-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathSched.html
More file actions
378 lines (348 loc) · 10.5 KB
/
Sched.html
File metadata and controls
378 lines (348 loc) · 10.5 KB
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
[Offset=-1]
<html>
<head>
<style>
body
{
background-color:black;
color:white;
font-family:"Arial";
}
table.schedule, table.schedule td, table.schedule tr
{
border-color:red;
border-style:solid;
border-width:3px;
border-collapse:collapse;
}
table.schedule td
{
text-align:center;
padding:5px;
}
td.name
{
color:#C08000;
}
tr.title
{
color:green;
}
h1
{
text-align:center;
}
h5
{
text-align:center;
color:red;
}
h2
{
text-align:center;
color:#40FF00;
}
.numbers {
padding: 0px;
width: 45px;
text-align: center;
font-family: Arial;
font-size: 28px;
font-weight: bold; /* options are normal, bold, bolder, lighter */
font-style: normal; /* options are normal or italic */
color: #FFFFFF; /* change color using the hexadecimal color codes for HTML */
}
.ctitle { /* the styles below will affect the title under the numbers, i.e., “Days”, “Hours”, etc. */
border-style: none;
padding: 0px 0px 3px 0px;
width: 45px;
text-align: center;
font-family: Arial;
font-size: 10px;
font-weight: bold; /* options are normal, bold, bolder, lighter */
color: #FFFFFF; /* change color using the hexadecimal color codes for HTML */
}
#table {
width: 400px;
height: 70px;
border-style: ridge;
border-width: 3px;
border-color: #666666; /* change color using the hexadecimal color codes for HTML */
background-color: #222222; /* change color using the hexadecimal color codes for HTML */
}
</style>
</head>
<body onload="updateClock(); setInterval('updateClock()', 1000 )">
<br>
<center>Random Event
<table id="table" border="0">
<tr>
<td align="center" colspan="6"><div class="numbers" id="count2" style="padding: 5px 0 0 0; "></div></td>
</tr>
<tr id="spacer1">
<td align="center" ><div class="numbers" ></div></td>
<td align="center" ><div class="numbers" id="dhour"></div></td>
<td align="center" ><div class="numbers" id="dmin"></div></td>
<td align="center" ><div class="numbers" id="dsec"></div></td>
<td align="center" ><div class="numbers" ></div></td>
</tr>
<tr id="spacer2">
<td align="center" ><div class="ctitle" ></div></td>
<td align="center" ><div class="ctitle" id="hours">Hours</div></td>
<td align="center" ><div class="ctitle" id="minutes">Minutes</div></td>
<td align="center" ><div class="ctitle" id="seconds">Seconds</div></td>
<td align="center" ><div class="ctitle" ></div></td>
</tr>
</table>
</center>
<h1><u>Class Schedule</u></h1>
<center><span id="clock" style="font-size:x-large;"> </span><!--<iframe src="http://free.timeanddate.com/clock/i3l19d6l/n142/fn7/fs15/fc90f/tct/pct/ftb/bat7/bac909/tt0/tw1/tm1/th2/ta1" frameborder="0" width="320" height="25" allowTransparency="true"></iframe>--></center>
<br>
<h5>Classes will be announced when they are going to start, and the times each class are going to start can be viewed below:.
<br>*<u>Note</u>: Teachers will start their class within the times stated. Weekend classes don't follow any schedule.</h5>
<h2>**<u>Note</u>: The schedule now follows your local time zone, you no longer need to convert the times below to your time.</h2>
<h3>***<u>Note</u>: Yellow class times are automatic classes, due to daylight savings kicking in/out around the world, the times might be off by an hour or two.</h3>
<br>
<center>
<table class="schedule" border=0>
<tr class="title">
<td>Teacher</td>
<td>Class</td>
<td id="sunday">Sunday</td>
<td>Monday</td>
<td>Tuesday</td>
<td>Wednesday</td>
<td>Thursday</td>
<td>Friday</td>
<td id="saturday">Saturday</td>
</tr>
[GMSchedule]
[Auto Class]
[Clan Wars]
</table>
</center>
<script type="text/javascript">
var days = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]
var saturday = 0;
var sunday = 0
var offset = new Date().getTimezoneOffset()/60 - 5;
var elems = document.getElementsByTagName('*');
var arr = toArray(elems);
for (var i = arr.length - 1; i >= 0; i--)
{
if((elems[i].className).indexOf("time") > -1)
{
var str = elems[i].innerHTML;
if(str.indexOf(" - ") > -1)
{
var n = str.split(" - ");
var minutes1 = 0;
var minutes2 = 0;
if(n[0].indexOf(":") > -1)
{
var tm1 = n[0].split(":");
var ampm1 = tm1[1].split(" ")
n[0] = tm1[0] + " " + ampm1[1];
minutes1 = parseInt(ampm1[0]);
}
if(n[1].indexOf(":") > -1)
{
var tm2 = n[1].split(":");
var ampm2 = tm2[1].split(" ")
n[1] = tm2[0] + " " + ampm2[1];
minutes2 = parseInt(ampm2[0]);
}
n[0] = militarytime(n[0]);
n[1] = militarytime(n[1]);
var offsetHour = Math.floor(offset);
var offsetMin = offset - offsetHour;
n[0] -= offsetHour;
n[1] -= offsetHour;
if(offsetMin > 0)
{
n[0]--;
n[1]--;
minutes1 += 60 - offsetMin * 60;
minutes2 += 60 - offsetMin * 60;
if(minutes1 >= 60)
{
minutes1 -= 60;
n[0]++;
}
if(minutes2 >= 60)
{
minutes2 -= 60;
n[1]++;
}
}
var new_time = standardtime(n[0], minutes1) + " - " + standardtime(n[1], minutes2);
if(parseInt(n[0]) >= 24 )
{
elems[i].innerHTML = " ";
if(elems[i].style.color == "yellow")
{
new_time = "<font color=yellow>" + new_time + "</font>";
elems[i].style.color = "white"
}
if(elems[i+1].innerHTML != " ")
{
if(elems[i+1].style.color == "yellow")
{
elems[i+1].innerHTML = "<font color=yellow>" + elems[i+1].innerHTML + "</font>";
elems[i+1].style.color = "white"
}
elems[i+1].innerHTML = new_time + "|BREAKLINE|" + elems[i+1].innerHTML;
}
else
{
elems[i+1].innerHTML = new_time;
}
if(elems[i+1].className == "time:saturday") saturday = 1;
}
else if(parseInt(n[0]) < 0)
{
elems[i].innerHTML = new_time + "|backwards";
if(elems[i-1].className == "time:sunday") sunday = 1;
}
else
{
elems[i].innerHTML = new_time;
}
}
}
}
if(saturday == 0) document.getElementById("saturday").style.display = "none";
if(sunday == 0) document.getElementById("sunday").style.display = "none";
for (var i = 0; i < arr.length; i++)
{
if((elems[i].className).indexOf("time") > -1)
{
if(elems[i].innerHTML.indexOf("|backwards") > -1)
{
var str_ = elems[i].innerHTML;
var n_ = str_.split("|");
if(elems[i].style.color == "yellow")
{
n_[0] = "<font color=yellow>" + n_[0] + "</font>";
elems[i].style.color = "white"
}
if(elems[i-1].innerHTML != " ")
{
if(elems[i-1].style.color == "yellow")
{
elems[i-1].innerHTML = "<font color=yellow>" + elems[i-1].innerHTML + "</font>";
elems[i-1].style.color = "white"
}
elems[i-1].innerHTML = elems[i-1].innerHTML + "|BREAKLINE|" + n_[0];
}
else
{
elems[i-1].innerHTML = n_[0];
}
elems[i].innerHTML = " ";
}
else if(elems[i].className == "time:saturday" && saturday == 0) elems[i].style.display = "none"
else if(elems[i].className == "time:sunday" && sunday == 0) elems[i].style.display = "none"
}
}
document.body.innerHTML = replaceAll('|BREAKLINE|', '<br>', document.body.innerHTML);
function militarytime(time)
{
var militaryHours;
var n = time.split(" ");
var hours = n[0];
var ampm = n[1];
if( ampm.toLowerCase() == "am" )
{
militaryHours = hours;
if( militaryHours == "12" ) { militaryHours = "00"; }
}
else
{
if( ampm.toLowerCase() == "pm")
{
tempHours = parseInt( hours ) + 2;
if( tempHours < 10 ) tempHours = "1" + tempHours;
else tempHours = "2" + ( tempHours - 10 );
if( tempHours == "24" ) { tempHours = "12"; }
militaryHours = tempHours;
}
}
return militaryHours;
}
function standardtime(time, minutes)
{
var hours24 = parseInt(time);
if(hours24 > 24) hours24 -= 24;
if(hours24 < 0) hours24 += 24;
var hours = ((hours24 + 11) % 12) + 1;
var amPm = hours24 > 11 ? 'PM' : 'AM';
if(hours24 == 24) amPm = 'AM';
return hours + (minutes == 0 ? "" : ":" + ("00" + minutes).slice(-2)) + " " + amPm;
}
function escapeRegExp(str)
{
return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
}
function replaceAll(find, replace, str)
{
return str.replace(new RegExp(escapeRegExp(find), 'g'), replace);
}
function updateClock ( )
{
var currentTime = new Date ( );
var currentHours = currentTime.getHours ( );
var currentMinutes = currentTime.getMinutes ( );
var currentSeconds = currentTime.getSeconds ( );
currentMinutes = ( currentMinutes < 10 ? "0" : "" ) + currentMinutes;
currentSeconds = ( currentSeconds < 10 ? "0" : "" ) + currentSeconds;
var timeOfDay = ( currentHours < 12 ) ? "AM" : "PM";
currentHours = ( currentHours > 12 ) ? currentHours - 12 : currentHours;
currentHours = ( currentHours == 0 ) ? 12 : currentHours;
var currentTimeString = currentHours + ":" + currentMinutes + ":" + currentSeconds + " " + timeOfDay;
document.getElementById("clock").firstChild.nodeValue = days[new Date().getDay()] + " " + currentTimeString;
}
function toArray(obj)
{
var array = [];
for (var i = obj.length >>> 0; i--;) {
array[i] = obj[i];
}
return array;
}
var timeuntil=[Random Event];
function countdown()
{
if(timeuntil >= 10)
{
timeuntil -= 10;
var dd=Math.floor(timeuntil/10);
var dhour=Math.floor(dd/3600);
dd -= dhour*3600;
var dmin=Math.floor(dd / 60);
dd -= dmin * 60;
document.getElementById('count2').style.display="none";
document.getElementById('dhour').innerHTML=dhour;
document.getElementById('dmin').innerHTML=dmin;
document.getElementById('dsec').innerHTML=dd;
setTimeout("countdown()",1000);
}
else
{
document.getElementById('count2').innerHTML="Random event is about to begin!";
document.getElementById('count2').style.display="inline";
document.getElementById('count2').style.width="390px";
document.getElementById('dhour').style.display="none";
document.getElementById('dmin').style.display="none";
document.getElementById('dsec').style.display="none";
document.getElementById('hours').style.display="none";
document.getElementById('minutes').style.display="none";
document.getElementById('seconds').style.display="none";
document.getElementById('spacer1').style.display="none";
document.getElementById('spacer2').style.display="none";
}
}
countdown();
</script>
</body>
</html>