-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschedule.js
executable file
·166 lines (146 loc) · 4.34 KB
/
schedule.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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
// schedule.js
// General Date Information
var year = 2017, month = 4, thursday = 6, friday = 7;
// Admited Student Preview schedule
// event = [startTime, endTime, Title, locationName, desc]
var parentThursday = [
[Thurs(14),Thurs(15,30),"Parent Check-in","loopMap","Tiffany Loop and Martin Square"],
[Thurs(14),Thurs(15),"Campus Tour","loopMap","Tiffany Loop"],
[Thurs(14),Thurs(15,15),"Meet Your Counselor!","fineCenterMap","First Free Methodist Church, Fine Center"],
[Thurs(15,30),Thurs(16),"Parent Welcome Session","gwinnMap","Gwinn Commons, Queen Anne Room"],
[Thurs(16,30),Thurs(17,15),"Parent Panel","gwinnMap","Gwinn Commons, Queen Anne Room"],
[Thurs(17,15),Thurs(18,15),"Parent Dinner","gwinnMap","Gwinn Commons, Queen Anne Room"]
]
var parentFriday = [
[Fri(8,30),Fri(9,20),"Next Steps","gwinnMap","Gwinn Commons, Queen Anne Room"]
]
var studentThursday = [
[Thurs(14),Thurs(15,30),"Check-in","gwinnMap","Gwinn Commons, Third Floor"],
[Thurs(14),Thurs(15),"Campus Tour","loopMap","Tiffany Loop"],
[Thurs(14),Thurs(15,15),"Meet Your Counselor!","fineCenterMap","First Free Methodist Church, Fine Center"],
[Thurs(15,30),Thurs(16),"Welcome Session","ffmMap","First Free Methodist Church, Sanctuary"],
[Thurs(16,30),Thurs(20),"Eat Dinner & Explore Seattle!","fineCenterMap","First Free Methodist Church, Fine Center"],
[Thurs(16,30),Thurs(20),"Residence Hall Meet and Greet","gwinnMap","Depart from Gwinn Commons, Third Floor"]
]
var studentFriday = [
[Fri(7,30),Fri(8,30),"Breakfast","gwinnMap","Gwinn Commons, Second Floor"],
[Fri(8,30),Fri(9,20),"Next Steps","gwinnMap","Gwinn Commons, Queen Anne Room"]
]
function Thurs(hour,minutes){
if(!minutes){
minutes = 0;
}
return new Date(year,month,thursday,hour,minutes);
}
function Fri(hour,minutes){
if(!minutes){
minutes = 0;
}
return new Date(year,month,friday,hour,minutes);
}
function LoadEvent(e){
toggleNav();
SetNewTarget(e);
var jqStr = "#buildings option[value='" + e + "']";
$(jqStr).prop('selected', true);
}
function NewEvent(title,range,location){
var range = TimeRange(event[0],event[1]);
var resp = "<div class=\"option-box event\" onclick=\"LoadEvent('" + event[3] + "')\"><a href=\"#\"><span class=\"title\">";
resp += event[2];
resp +="</span><br /><small>";
resp += range;
resp += "</small> | <span class=\"loc\">";
resp += event[4];
resp +="</span>"
resp += "</a></div>";
return $.parseHTML(resp);
}
function InitSchedule(){
for(event of studentThursday){
$("#findDiv").before(NewEvent(event))
}
}
function LoadParentSchedule(){
$(".resetbtn").toggle();
$("#studentTitle").hide();
$("#thursdayTitle").show();
for(event of parentThursday){
$("#fridayTitle").before(NewEvent(event[2],TimeRange(event[0],event[1]),event[3]))
}
$("#parentTitle").hide();
$("#fridayTitle").show();
for(event of parentFriday){
$("#endDiv").before(NewEvent(event[2],TimeRange(event[0],event[1]),event[3]))
}
}
function LoadStudentSchedule(){
$(".resetbtn").toggle();
$("#studentTitle").hide();
$("#thursdayTitle").show();
for(event of studentThursday){
$("#fridayTitle").before(NewEvent(event[2],TimeRange(event[0],event[1]),event[3]))
}
$("#parentTitle").hide();
$("#fridayTitle").show();
for(event of studentFriday){
$("#endDiv").before(NewEvent(event[2],TimeRange(event[0],event[1]),event[3]))
}
}
function GetStartTime(date) {
var d = date;
var hh = d.getHours();
var m = d.getMinutes();
var h = hh;
if (h >= 12) {
h = hh - 12;
}
if (h == 0) {
h = 12;
}
m = m < 10 ? "0" + m : m;
var resp = "";
if(m != "00"){
resp = h + ":" + m;
}else{
resp = h;
}
return resp;
}
function GetEndTime(date) {
var d = date;
var hh = d.getHours();
var m = d.getMinutes();
var dd = "am";
var h = hh;
if (h >= 12) {
h = hh - 12;
dd = "pm";
}
if (h == 0) {
h = 12;
}
m = m < 10 ? "0" + m : m;
var resp = "";
if(m != "00"){
resp = h + ":" + m + dd;
}else{
resp = h + dd;
}
return resp;
}
function TimeRange(start,end){
if(!end || end == ""){
return GetEndTime(start);
}
var resp = GetStartTime(start) + "-" + GetEndTime(end);
return resp;
}
function ResetSchedule(){
$(".event").remove();
$(".resetbtn").toggle();
$("#studentTitle").show();
$("#thursdayTitle").hide();
$("#parentTitle").show();
$("#fridayTitle").hide();
}