-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcal_11am.html
300 lines (279 loc) · 9.31 KB
/
cal_11am.html
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
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
<link href="../Downloads/fullcalendar-2.2.7/fullcalendar.css" rel="stylesheet">
<link href="../Downloads/fullcalendar-2.2.7/fullcalendar.print.css" rel="stylesheet" media="print">
<script src="http://code.jquery.com/jquery-1.11.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
<script src="../Downloads/fullcalendar-2.2.7/lib/moment.min.js"></script>
<script src="../Downloads/fullcalendar-2.2.7/lib/jquery.min.js"></script>
<script src="../Downloads/fullcalendar-2.2.7/fullcalendar.min.js"></script>
<script>
$(document).ready(function() {
console.log("happenin captain");
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
defaultDate: '2015-03-01',
editable: true,
eventLimit: true, // allow "more" link when too many events
events: [
]
});
});
courseInfo = {
"collection1": [
{
"courseNumber": {
"text": "CSS220-01",
"href": "https://iasext.wesleyan.edu/regprod/!wesmaps_page.html?crse=003389&term=1149"
},
"Title": "Sophomore Economics Tutorial: Topics in the History of Economic Thought",
"Time": ".....F. 14:00:00-16:00:00",
"Location": "PAC413"
},
{
"courseNumber": {
"text": "CSS230-01",
"href": "https://iasext.wesleyan.edu/regprod/!wesmaps_page.html?crse=003395&term=1149"
},
"Title": "Sophomore Government Tutorial: State and Society in the Modern Age",
"Time": ".....F. 14:00:00-16:00:00",
"Location": "PAC402"
},
{
"courseNumber": {
"text": "CSS240-01",
"href": "https://iasext.wesleyan.edu/regprod/!wesmaps_page.html?crse=003396&term=1149"
},
"Title": "Sophomore History Tutorial: The Emergence of Modern Europe",
"Time": ".....F. 14:00:00-16:00:00",
"Location": "PAC104"
},
{
"courseNumber": {
"text": "CSS271-01",
"href": "https://iasext.wesleyan.edu/regprod/!wesmaps_page.html?crse=003370&term=1149"
},
"Title": "Sophomore Colloquium: Modern Social Theory",
"Time": ".M.W... 13:10:00-14:30:00",
"Location": "PAC422"
},
{
"courseNumber": {
"text": "CSS391-01",
"href": "https://iasext.wesleyan.edu/regprod/!wesmaps_page.html?crse=003376&term=1149"
},
"Title": "Senior Colloquium: Political Economy (aka Public and Private: The Logic of Social Order)",
"Time": "...W.F. 02:40PM-04:00PM",
"Location": "PAC422"
},
{
"courseNumber": {
"text": "CSS220-01",
"href": "https://iasext.wesleyan.edu/regprod/!wesmaps_page.html?crse=003389&term=1151"
},
"Title": "Sophomore Economics Tutorial: Topics in the History of Economic Thought",
"Time": ".....F. 14:00:00-16:00:00",
"Location": "PAC413"
},
{
"courseNumber": {
"text": "CSS220-02",
"href": "https://iasext.wesleyan.edu/regprod/!wesmaps_page.html?crse=003389&term=1151"
},
"Title": "Sophomore Economics Tutorial: Topics in the History of Economic Thought",
"Time": ".....F. 14:00:00-16:00:00",
"Location": "PAC413"
},
{
"courseNumber": {
"text": "CSS230-01",
"href": "https://iasext.wesleyan.edu/regprod/!wesmaps_page.html?crse=003395&term=1151"
},
"Title": "Sophomore Government Tutorial: State and Society in the Modern Age",
"Time": ".....F. 14:00:00-16:00:00",
"Location": "PAC402"
},
{
"courseNumber": {
"text": "CSS230-02",
"href": "https://iasext.wesleyan.edu/regprod/!wesmaps_page.html?crse=003395&term=1151"
},
"Title": "Sophomore Government Tutorial: State and Society in the Modern Age",
"Time": ".....F. 14:00:00-16:00:00",
"Location": "PAC402"
},
{
"courseNumber": {
"text": "CSS240-01",
"href": "https://iasext.wesleyan.edu/regprod/!wesmaps_page.html?crse=003396&term=1151"
},
"Title": "Sophomore History Tutorial: The Emergence of Modern Europe",
"Time": ".....F. 14:00:00-16:00:00",
"Location": "PAC104"
},
{
"courseNumber": {
"text": "CSS240-02",
"href": "https://iasext.wesleyan.edu/regprod/!wesmaps_page.html?crse=003396&term=1151"
},
"Title": "Sophomore History Tutorial: The Emergence of Modern Europe",
"Time": ".....F. 14:00:00-16:00:00",
"Location": "PAC104"
},
{
"courseNumber": {
"text": "CSS320-01",
"href": "https://iasext.wesleyan.edu/regprod/!wesmaps_page.html?crse=003390&term=1151"
},
"Title": "Junior Economics Tutorial: Economics of the Welfare State",
"Time": ".....F. 14:00:00-16:00:00",
"Location": "PAC421"
},
{
"courseNumber": {
"text": "CSS320-02",
"href": "https://iasext.wesleyan.edu/regprod/!wesmaps_page.html?crse=003390&term=1151"
},
"Title": "Junior Economics Tutorial: Economics of the Welfare State",
"Time": ".....F. 14:00:00-16:00:00",
"Location": "PAC421"
},
{
"courseNumber": {
"text": "CSS330-01",
"href": "https://iasext.wesleyan.edu/regprod/!wesmaps_page.html?crse=003407&term=1151"
},
"Title": "Junior Government Tutorial: The Great Powers and Grand Strategy",
"Time": ".....F. 14:00:00-16:00:00",
"Location": "PAC136"
},
{
"courseNumber": {
"text": "CSS330-02",
"href": "https://iasext.wesleyan.edu/regprod/!wesmaps_page.html?crse=003407&term=1151"
},
"Title": "Junior Government Tutorial: The Great Powers and Grand Strategy",
"Time": ".....F. 14:00:00-16:00:00",
"Location": "PAC136"
},
{
"courseNumber": {
"text": "CSS340-01",
"href": "https://iasext.wesleyan.edu/regprod/!wesmaps_page.html?crse=003427&term=1151"
},
"Title": "Junior History Tutorial: Postimperial History, 1945-1990",
"Time": ".....F. 14:00:00-16:00:00",
"Location": "PAC422"
},
{
"courseNumber": {
"text": "CSS340-02",
"href": "https://iasext.wesleyan.edu/regprod/!wesmaps_page.html?crse=003427&term=1151"
},
"Title": "Junior History Tutorial: Postimperial History, 1945-1990",
"Time": ".....F. 14:00:00-16:00:00",
"Location": "PAC422"
},
{
"courseNumber": {
"text": "CSS371-01",
"href": "https://iasext.wesleyan.edu/regprod/!wesmaps_page.html?crse=003371&term=1151"
},
"Title": "Junior Colloquium: Contemporary Social and Political Theory",
"Time": ".M.W... 13:10:00-14:30:00",
"Location": "PAC422"
}
]
}
function printAnElement(){
for(var i = 0; i < courseInfo.collection1.length; i++){
$("#courseList").append("<li><input type='checkbox' id='myCheck"+i+"' onchange='isClicked("+i+")'></input><div id ='TESTER"+i+"'>"+courseInfo.collection1[i].courseNumber.text+" "+courseInfo.collection1[i].Title+"</div></li>");
//console.log(courseInfo.collection1[i].courseNumber.text);
}
$( "#courseList" ).listview( "refresh" );
}
function isClicked(myCheck){
if($("#myCheck"+myCheck).is(':checked'))
calendarInfo(myCheck);
}
var dayTimeStart;
var dayTimeEnd;
function calendarInfo(theNum){
console.log("called")
var newString = "";
var dataDayTime = courseInfo.collection1[theNum].Time;
for(var i = 0; i < dataDayTime.length; i++){
var days = dataDayTime.substring(0,6);
var timeStart = dataDayTime.substring(8,16);
var timeEnd = dataDayTime.substring(17,25);
if(days[i] != "."){
newString = days[i];
break;
}
}
console.log(newString)
if(newString == "M"){
newString = "2015-03-02";
}
else if(newString == "T"){
newString = "2015-03-03";
}
else if(newString == "W"){
newString = "2015-03-04";
}
else if(newString == "R"){
newString = "2015-03-05";
}
else if(newString == "F"){
newString = "2015-03-06";
}
dayTimeStart = newString+"T"+timeStart;
dayTimeEnd = newString+"T"+timeEnd;
console.log(dayTimeStart);
console.log(dayTimeEnd);
var t=courseInfo.collection1[theNum].courseNumber.text
var newEvent = {
title: t,
start: dayTimeStart,
end: dayTimeEnd
};
$('#calendar').fullCalendar( 'renderEvent', newEvent , 'stick');
}
</script>
<style>
body {
margin: 40px 10px;
padding: 0;
font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif;
font-size: 14px;
}
#calendar {
max-width: 900px;
margin: 0 auto;
}
</style>
</head>
<body>
<div id = 'calendar'></div>
<div id = "homeScreen">
<div data-role="header">
<h1>Plan Your Semester!</h1>
</div>
<div data-role="main" class="ui-content" id = "text">
<ul data-role="listview" id="courseList">
</ul>
<P>
<a data-role="button" onclick="printAnElement()">CSS Classes</a>
</div>
<div data-role="footer">
<h1>Footer Text</h1>
</div>
</div>
</body>
</html>