-
Notifications
You must be signed in to change notification settings - Fork 1
/
indexpage.js
147 lines (126 loc) · 4.28 KB
/
indexpage.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
//initial
window.onload = function()
{
for (var i = 1; i <=8; i++)
document.getElementById('sub'+i).style.display = 'none';
}
//to display continuous improvement dropdown
function contImp() {
document.getElementById("cont-imp").classList.toggle('show');
}
/*window.onclick=function (e) {
var temp=document.getElementsByClassName('dropdown');
var block=document.getElementById('cont-imp');
if (e.target == temp) {
block.style.display = "none";
}
}*/
//to display login dropdown
function LogIn() {
document.getElementById("login").classList.toggle('show');
}
// Close the dropdown if the user clicks outside of it
/*window.onclick = function(e) {
if (!e.target.matches('.dropbutton')) {
var myDropdown = document.getElementById("cont-imp");
if (myDropdown.classList.contains('show')) {
myDropdown.classList.remove('show');
}
}
}
/* if (!e.target.matches('.dropdown-content')) {
var myDropdown = document.getElementById("cont-imp");
if (myDropdown.classList.contains('show')) {
myDropdown.classList.remove('show');
}
}
}*/
//show password
function showPassword() {
var temp = document.getElementById("password-box");
if (temp.type === "password") {
temp.type = "text";
} else {
temp.type = "password";
}
}
//to hide subject dropdowns
function hideall()
{
for (var i = 1; i <=8; i++)
document.getElementById('sub'+i).style.display = 'none';
}
//to hide radio buttons
function selectSem()
{
if(document.getElementById('sem-dropdown').value=="yearly")
{
document.getElementById('hidethis').style.display='none';
}
else
{
document.getElementById('hidethis').style.display='block';
}
}
//to display subject choice
function subjectSem()
{
for (var i = 1; i <=8; i++)
document.getElementById('sub'+i).style.display = 'none';
if(document.getElementById('year-dropdown').value=="fe")
{
if( document.getElementById('sem-dropdown').value=="odd")
document.getElementById('sub1').style.display='block';
else if(document.getElementById('sem-dropdown').value=="even")
document.getElementById('sub2').style.display = 'block';
}
if(document.getElementById('year-dropdown').value=="se")
{
if( document.getElementById('sem-dropdown').value=="odd")
document.getElementById('sub3').style.display='block';
else if(document.getElementById('sem-dropdown').value=="even")
document.getElementById('sub4').style.display = 'block';
}
if(document.getElementById('year-dropdown').value=="te")
{
if( document.getElementById('sem-dropdown').value=="odd")
document.getElementById('sub5').style.display='block';
else if(document.getElementById('sem-dropdown').value=="even")
document.getElementById('sub6').style.display = 'block';
}
if(document.getElementById('year-dropdown').value=="be")
{
if( document.getElementById('sem-dropdown').value=="odd")
document.getElementById('sub7').style.display='block';
else if(document.getElementById('sem-dropdown').value=="even")
document.getElementById('sub8').style.display = 'block';
}
}
//hide save name option
document.getElementById('saveName').style.display="none";
//to change username
function change_username() {
document.getElementById('change-name-box').disabled=false;
document.getElementById('changeName').style.display="none";
document.getElementById('saveName').style.display="inline";
}
//to open or close change password modal
{
var modal = document.getElementById('change-password-modal');
var btn = document.getElementById("change-password");
var span = document.getElementsByClassName("close")[0];
// When the user clicks on the button, open the modal
btn.onclick = function() {
modal.style.display = "block";
}
// When the user clicks on <span> (x), close the modal
span.onclick = function() {
modal.style.display = "none";
}
// When the user clicks anywhere outside of the modal, close it
window.onclick = function(event) {
if (event.target == modal) {
modal.style.display = "none";
}
}
}