-
Notifications
You must be signed in to change notification settings - Fork 3
/
index-new.html
250 lines (213 loc) · 8.76 KB
/
index-new.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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>PsetParty</title>
<link rel='stylesheet' type='text/css' href='libs/css/smoothness/jquery-ui-1.8.11.custom.css' />
<link rel='stylesheet' type='text/css' href='jquery.weekcalendar.css' />
<link rel="stylesheet" type="text/css" href="skins/default.css" />
<style type='text/css'>
body {
font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif;
margin: 0;
}
h1 {
margin:0 0 2em;
padding: 0.5em;
font-size: 1.3em;
}
p.description {
font-size: 0.8em;
padding: 1em;
position: absolute;
top: 3.2em;
margin-right: 400px;
}
.clearer {
clear: both;
}
#calendar_selection {
font-size: 0.7em;
position: absolute;
top: 43px;
right: 13px;
padding: 1em;
background: #ffc;
border: 1px solid #dda;
width: 270px;
}
#message {
font-size: 0.7em;
padding: 1em;
margin-right: 1em;
margin-bottom: 10px;
background: #ddf;
border: 1px solid #aad;
width: 270px;
float: right;
}
</style>
<link href="SpryAssets/SpryTabbedPanels.css" rel="stylesheet" type="text/css" />
<link href="SpryAssets/SpryAccordion.css" rel="stylesheet" type="text/css" />
<script type='text/javascript' src='libs/jquery-1.4.4.min.js'></script>
<script type='text/javascript' src='libs/jquery-ui-1.8.11.custom.min.js'></script>
<script type="text/javascript" src="libs/date.js"></script>
<script type='text/javascript' src='jquery.weekcalendar.js'></script>
<script src="SpryAssets/SpryTabbedPanels.js" type="text/javascript"></script>
<script src="SpryAssets/SpryAccordion.js" type="text/javascript"></script>
<script type='text/javascript'>
var year = new Date().getFullYear();
var month = new Date().getMonth();
var day = new Date().getDate();
var eventData1 = {
options: {
timeslotsPerHour: 4,
timeslotHeight: 20
},
events : [
{'id':1, 'start': new Date(year, month, day, 12), 'end': new Date(year, month, day, 13, 30),'title':'Lunch with Mike'},
{'id':2, 'start': new Date(year, month, day, 14), 'end': new Date(year, month, day, 14, 45),'title':'Dev Meeting'},
{'id':3, 'start': new Date(year, month, day + 1, 18), 'end': new Date(year, month, day + 1, 18, 45),'title':'Hair cut'},
{'id':4, 'start': new Date(year, month, day - 1, 8), 'end': new Date(year, month, day - 1, 9, 30),'title':'Team breakfast'},
{'id':5, 'start': new Date(year, month, day + 1, 14), 'end': new Date(year, month, day + 1, 15),'title':'Product showcase'}
]
};
var eventData2 = {
options: {
timeslotsPerHour: 3,
timeslotHeight: 30
},
events : [
{'id':1, 'start': new Date(year, month, day, 12), 'end': new Date(year, month, day, 13, 00),'title':'Lunch with Sarah'},
{'id':2, 'start': new Date(year, month, day, 14), 'end': new Date(year, month, day, 14, 40),'title':'Team Meeting'},
{'id':3, 'start': new Date(year, month, day + 1, 18), 'end': new Date(year, month, day + 1, 18, 40),'title':'Meet with Joe'},
{'id':4, 'start': new Date(year, month, day - 1, 8), 'end': new Date(year, month, day - 1, 9, 20),'title':'Coffee with Alison'},
{'id':5, 'start': new Date(year, month, day + 1, 14), 'end': new Date(year, month, day + 1, 15),'title':'Product showcase'}
]
};
// data set 3 : using event delete features
var eventData3 = {
options: {
allowEventDelete: true,
eventDelete: function(calEvent, element, dayFreeBusyManager, calendar, clickEvent) {
if (confirm('You want to delete this event?')) {
calendar.weekCalendar('removeEvent',calEvent.id);
}
},
deletable: function(calEvent, element) {
return calEvent.start > Date.today();
}
},
events : [
{'id':1, 'start': new Date(year, month, day, 12), 'end': new Date(year, month, day, 13, 00),'title':'Lunch with Ashley'},
{'id':2, 'start': new Date(year, month, day, 14), 'end': new Date(year, month, day, 14, 40),'title':'Team Picnic'},
{'id':3, 'start': new Date(year, month, day + 1, 18), 'end': new Date(year, month, day + 1, 18, 40),'title':'Meet with Cathy'},
{'id':4, 'start': new Date(year, month, day - 1, 8), 'end': new Date(year, month, day - 1, 9, 20),'title':'Coffee with Alyssa'},
{'id':5, 'start': new Date(year, month, day + 1, 14), 'end': new Date(year, month, day + 1, 15),'title':'Product kickoff'}
]
};
function getUrlParameters() {
var map = {};
var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
map[key] = value;
});
return map;
}
$(document).ready(function() {
var $calendar = $('#calendar').weekCalendar({
timeslotsPerHour: 4,
scrollToHourMillis : 0,
height: function($calendar){
return $(window).height() - $('h1').outerHeight(true);
},
eventRender : function(calEvent, $event) {
if(calEvent.end.getTime() < new Date().getTime()) {
$event.css('backgroundColor', '#aaa');
$event.find('.time').css({'backgroundColor': '#999', 'border':'1px solid #888'});
}
},
eventNew : function(calEvent, $event) {
alert('here is where the logic for creating a new event goes. the region of the calendar selected was:\n ' + JSON.stringify(calEvent))
//alert('You\'ve added a new event. You would capture this event, add the logic for creating a new event with your own fields, data and whatever backend persistence you require.');
},
eventClick: function(calEvent, $event) {
alert('<strong>Clicked Event</strong><br/>Start: ' + calEvent.start + '<br/>End: ' + calEvent.end);
},
data: function(start, end, callback) {
var dataSource = $('#data_source').val();
if (dataSource === '1') {
callback(eventData1);
} else if(dataSource === '2') {
callback(eventData2);
} else if(dataSource === '3') {
callback(eventData3);
} else {
callback([]);
}
}
});
$('#data_source').change(function() {
$calendar.weekCalendar('refresh');
updateMessage();
});
function updateMessage() {
var dataSource = $('#data_source').val();
$('#message').fadeOut(function(){
if(dataSource === '1') {
$('#message').text('Displaying event data set 1 with timeslots per hour of 4 and timeslot height of 20px');
} else if(dataSource === '2') {
$('#message').text('Displaying event data set 2 with timeslots per hour of 3 and timeslot height of 30px');
} else if(dataSource === '3') {
$('#message').text('Displaying event data set 3 with allowEventDelete enabled. Events before today will not be deletable. A confirmation dialog is opened when you delete an event.');
} else {
$('#message').text('Displaying no events.');
}
$(this).fadeIn();
});
}
updateMessage();
var params = getUrlParameters()
$('#usernamediv').text(params['name'].split('%20').join(' '))
$('#useremaildiv').text(params['email'])
});
</script>
<script>
</script>
</head>
<body>
<h1>PsetParty</h1>
<div id="usernamediv"></div>
<div id="useremaildiv"></div>
<div class="search">
<form action="" id ="search form" method="get"
<input type="text" value="search for classes" onblur="if(this.value=='')this.value='search for classes'" onfocus="if(this.value=='search for classes')this.value=''"/>
<input type="hidden" value="submit"/>
</form>
</div>
<div id="message" class="ui-corner-all"></div>
<div class="clearer"></div>
<div id="calendar_selection" class="ui-corner-all">
<strong>Classes: </strong>
<select id="data_source">
<option value="">Select your class</option>
<option value="1">6.857</option>
<option value="2">6.804</option>
<option value="3">6.831</option>
</select>
</div>
<div id="TabbedPanels4" class="TabbedPanels">
<ul class="TabbedPanelsTabGroup">
<li class="TabbedPanelsTab" tabindex="0">Calendar</li>
<li class="TabbedPanelsTab" tabindex="0">Map</li>
</ul>
<div class="TabbedPanelsContentGroup">
<div class="TabbedPanelsContent"><div id="calendar"></div>
<script type="text/javascript">
var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1");
var TabbedPanels2 = new Spry.Widget.TabbedPanels("TabbedPanels2");
</script></div>
<div class="TabbedPanelsContent"></div>
</div>
</div>
</body>
</html>