-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
121 lines (107 loc) · 3.66 KB
/
index.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
// function showfiles(str) {
// var xhttp;
// xhttp = new XMLHttpRequest();
// xhttp.onreadystatechange = function () {
// if (this.readyState == 4 && this.status == 200) {
// document.getElementById("coursematerial").innerHTML = this.responseText;
// }
// };
// xhttp.open("GET", "showoptions.php?q=" + str, true);
// xhttp.send();
// }
//buttons=document.getElementsByTagName("button");
// buttons.forEach(button => {
// button.addEventListener("click",loadDoc);
// });
// Array(buttons).forEach(button => {
// button.addEventListener("click",loadDoc);
// });
// for (var i = 0; i < buttons.length; i++) {
// buttons[i].addEventListener("click", function () {
// var xhttp = new XMLHttpRequest();
// xhttp.onreadystatechange = function () {
// if (this.readyState == 4 && this.status == 200) {
// buttons[i].getElementById("down").innerHTML = this.responseText;
// }
// };
// xhttp.open("GET", "increment.php?q="buttons[i].getElementById("notes").innerHTML + "&r=" + buttons[i].getElementById("course").innerHTML, true);
// xhttp.send();
// })
// }
function load(str) {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
str.children[3].innerHTML = this.responseText;
}
};
var r = str.children[1].innerHTML;
xhttp.open("GET", "increment.php?q=" + r + "&r=" + document.getElementById('select').value, true);
xhttp.send();
return true;
}
function redirect(str) {
location.replace("course.php?q=" + str);
}
function load2(str) {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
//str.children[3].innerHTML = this.responseText;
}
};
var r = str.substring(2);
xhttp.open("GET", "increment.php?q=" + r + "&r=" + document.getElementById('select').value, true);
xhttp.send();
return true;
}
// $('#menu').css("right", "-300px");
// $('.menu').on('click', function () {
// if ($('.menu').hasClass('open')) {
// $(this).removeClass('open');
// $(this).animate({
// "right": "20px",
// "background-position": "0px"
// });
// $('#menu').animate({ "right": "-300px" });
// $('body').css("position", "absolute");
// $('body').animate({
// "right": "0px",
// "z-index": "999"
// });
// }
// else {
// $(this).addClass('open');
// $(this).animate({
// "right": "310px",
// "background-position": "-40px"
// });
// $('#menu').animate({ "right": "0px" });
// $('body').css("position", "absolute");
// $('body').animate({
// "right": "300px",
// "z-index": "999"
// });
// }
// });
function openNav() {
var menu = document.getElementById("ham");
var cross = document.getElementById("cross");
if (document.getElementById("mySidebar").style.width == "0px") {
document.getElementById("mySidebar").style.width = "350px";
document.getElementById("main").style.marginLeft = "350px";
menu.style.zIndex = "-1";
cross.style.zIndex = "";
}
else {
document.getElementById("mySidebar").style.width = "0px";
document.getElementById("main").style.marginLeft = "0px";
cross.style.zIndex = "-1";
menu.style.zIndex = "";
}
}
/* Set the width of the sidebar to 0 and the left margin of the page content to 0 */
function closeNav() {
document.getElementById("mySidebar").style.width = "0";
document.getElementById("main").style.marginLeft = "0";
}