forked from ajiaoboard/ajiaoboard.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage.js
44 lines (34 loc) · 1.33 KB
/
page.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
(function () {
document.getElementById('noscript').remove();
document.getElementById('show-control').style.display = "";
try {
document.getElementById('homepage').href = switchToHttps(createHiddenElement("/").href);
} catch (e) {}
document.getElementById('page-number-control').onkeypress = function (e) {
if (e.keyCode == 13) {
jumpToPage();
}
}
if (needHttps(location.href)) {
document.getElementById('https').href = forceHttps(location.href);
document.getElementById('insecure').style.display = "";
}
})();
function showControl() {
document.getElementById('show-control').style.display = "none";
document.getElementById('page-number-control').style.display = "";
document.getElementById('go-to-page').style.display = "";
return false;
}
function jumpToPage() {
var whichPage = document.getElementById('page-number-control').value;
document.getElementById('show-control').style.display = "";
document.getElementById('page-number-control').style.display = "none";
document.getElementById('go-to-page').style.display = "none";
location.href = whichPage + ".html";
return false;
}
function ignoreHttps() {
document.getElementById('insecure').style.display = "none";
return false;
}