-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
30 lines (29 loc) · 822 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
(function() {
$(function() {
var loadpage, page;
loadpage = function(name) {
$("#spinner").fadeIn("55");
return $("#content").load(name, function(response, status, xhr) {
if (status === "error") {
return loadpage("404.html");
} else {
return $("#spinner").fadeOut("55", function() {
$(".pageportal").unbind("click");
return $(".pageportal").click(function(event) {
var page;
page = $(this).attr("href").substr(1);
return loadpage(page + ".html");
});
});
}
});
};
page = window.location.hash;
if (page) {
page = page.substr(1) + ".html";
return loadpage(page);
} else {
return loadpage("home.html");
}
});
}).call(this);