-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
347 lines (260 loc) · 8.95 KB
/
index.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
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
<!DOCTYPE html>
<head>
<title>Yahoo! Social</title>
<link rel="stylesheet" href="css/default.css">
<link rel="stylesheet" href="scripts/jquery-ui.css" />
<script src="scripts/jquery-1.10.1.min.js"></script>
<script type="text/javascript" src="scripts/jstween-1.1.min.js"></script>
<script src="scripts/yui-min.js"></script>
<script src="scripts/jquery-ui.js"></script>
<script>
$(function() {
$( "#datepicker" ).datepicker();
});
</script>
</head>
<body>
<div id="add-event-component" class="view">
<div class="close">Close</div>
<h1>Add Event</h1>
<form id="form-add-event" >
<label>title</label>
<input type="text" name="title" id="title" size="70"/> <br />
<table>
<tr>
<td>
<label>Date</label>
<input type="text" name="date" id="date"/><br />
</td>
<td>
<label>Time</label>
<input type="text" name="time" id="time" size="10"/><br />
</td>
<td>
<label>Duration</label>
<input type="text" name="duration" id="duration"/><br />
</td>
</tr>
</table>
<table>
<tr>
<td>
<label>City</label>
<input type="text" name="city" id="city"/><br />
</td>
<td>
<label>State</label>
<input type="text" name="state" id="state" size="10"/><br />
</td>
<td>
<label>Country</label>
<input type="text" name="country" id="country"/><br />
</td>
</tr>
</table>
<label>Host</label>
<input type="text" name="host" id="host" value="Yahoo!" disabled/><br />
<label>Cost</label>
<input type="text" name="cost" id="cost"/><br />
<label>Details</label>
<input type="text" name="details" id="details" size="70"/><br />
<label>Hashtags</label>
<input type="text" name="tags" id="tags"/><br />
<div class="button-s" id="insert-event">Add event</div>
</form>
</div><!--end of add event -->
<div id="nav-wrapper">
<div id="nav">
<div id="logo">
</div><!--end of logo -->
<div id="menu">
<ul>
<li>My Events</li>
<li><span class="button" id="add-event">Add Event</span></li> |
<li>Welcome, Yahoo!</li>
<li>Log Out</li>
</ul>
</div><!--end of menu -->
</div> <!--end of nav -->
</div><!--end of nav-wrapper -->
<div id="fp-wrapper">
<div id="main-content">
<div id="today-date"><b>Sunday</b>, September 29, 2013</div><!--end of today's date -->
<div id="super-search">
<input type="text" value="Search city, zip or anything you want" name="search" id="search"
onfocus="if(this.value == 'Search city, zip or anything you want'){ this.value = ''; }"
onblur="if(this.value == ''){ this.value = 'Search city, zip or anything you want'; }"
autocomplete="off"
onkeypress="return loadEvents(event)"/>
</div><!--end of super search -->
<br />
<p style="color:#fff;">Your closest location is: <span style="color:#a8ff00; font-weight:bold">Sunnyvale, CA </span></p>
</div><!--end of main content -->
<div id="results-wrapper">
<div id="filters">
Events happening in:<br /> <span id="e-location" style="font-weight:bold; font-size:19px;"></span> <br /><br />
<b>Filters: <b/>
<input class="check-with-label" type="checkbox" value="bar" name="check-festivals" id="check-bar"></input>
<label class="label-for-check" for="check-bar">Bar</label>
<input class="check-with-label" type="checkbox" value="concerts" name="check-concerts" id="check-concerts"></input>
<label class="label-for-check" for="check-concerts">Concerts</label>
<input class="check-with-label" type="checkbox" value="tech" name="check-tech" id="check-tech"></input>
<label class="label-for-check" for="check-tech">Technology</label>
<input class="check-with-label" type="checkbox" value="public" name="check-public" id="check-public"></input>
<label class="label-for-check" for="check-public">Public Forums</label>
<input class="check-with-label" type="checkbox" value="sports" name="check-sports" id="check-sports"></input>
<label class="label-for-check" for="check-sports">Sports</label>
<input class="check-with-label" type="checkbox" value="Art" name="check-art" id="check-art"></input>
<label class="label-for-check" for="check-art">Art</label>
<input class="check-with-label" type="checkbox" value="family" name="check-family" id="check-family"></input>
<label class="label-for-check" for="check-family">Family</label>
<input class="check-with-label" type="checkbox" value="misc" name="check-misc" id="check-misc"></input>
<label class="label-for-check" for="check-art">Misc</label>
<br /><br />
<b>Price <b/>
<input class="check-with-label" type="checkbox" value="bar" name="check-free" id="check-free"></input>
<label class="label-for-check" for="check-free">Free</label>
<input class="check-with-label" type="checkbox" value="concerts" name="check-s" id="check-s"></input>
<label class="label-for-check" for="check-s">$</label>
<input class="check-with-label" type="checkbox" value="tech" name="check-ss" id="check-ss"></input>
<label class="label-for-check" for="check-ss">$$</label>
<input class="check-with-label" type="checkbox" value="public" name="check-sss" id="check-sss"></input>
<label class="label-for-check" for="check-sss">$$$</label>
<input class="check-with-label" type="checkbox" value="sports" name="check-ssss" id="check-ssss"></input>
<label class="label-for-check" for="check-ssss">$$$$</label>
<input class="check-with-label" type="checkbox" value="Art" name="check-sssss" id="check-sssss"></input>
<label class="label-for-check" for="check-sssss">$$$$$</label>
</div><!--end of filters -->
<div id="results_">
<div class="event">
<div><!--end of event -->
</div><!--end of results -->
</div><!--end of results wrapper -->
</div><!--end of fp-wrapper -->
<script type="text/javascript">
function loadEvents(e){
//console.log(e);
}
$('#add-event').on('click', function(){
var left = $(this).position().left;
console.log(left);
$('#add-event-component').show();
$('#add-event-component').css('left', left-300);
});
$('.close').on('click', function(){
$('.view').hide();
})
$("#search").keyup(function (e) {
if (e.keyCode == 13) {
var query = $('#search').val();
moveSearchUp(query);
return false;
}
});
</script>
<script>
function moveSearchUp(query){
$('#main-content').tween({
top:{
start: 0,
stop: -180,
time: 0,
duration: .3,
units: 'px',
effect: 'linear'
}
});
$.play();
//console.log(query.split(',')[0]);
$('#e-location').html(query);
$.ajax({
url: "scripts/get-events.php",
data: {query: query.split(',')[0]},
type: "post",
success: function(response){
var events = jQuery.parseJSON( response );
var len = events.length;
var events_;
var results = $('<div>', {
id: 'results'
});
if(len === 0){
var ewrap = $('<div>', {
class: 'event-wrapper',
html: "No events found for this query"
});
results.append(ewrap);
}else{
for(var i=0; i<len; i++){
//console.log(results);
var ewrap = $('<div>', {
class: 'event-wrapper'
});
var icon = $('<div>', {
class: 'event-icon icon-' + events[i].type.toLowerCase(),
});
var e = $('<div>', {
class: 'event',
id: 'event-'+events[i].id
});
var title = $('<div>', {
class: 'event-title',
html: events[i].title
});
var location = $('<div>', {
class: 'event-location',
html: '<span class="bold">Location: </span>' + events[i].city + ', ' + events[i].state + ' ' + events[i].country
});
var time = $('<div>', {
class: 'event-time',
html: '<span class="bold">Time: </span>' + events[i].event_time
});
var d = events[i].details;
if(events[i].details === null){
d = "No details provided";
}
var details = $('<div>', {
class: 'event-details',
html: '<br /><span class="bold">Details: </span> <br />' + d
});
if( events[i].cost.toLowerCase() === "free"){
var cost = $('<div>', {
class: 'event-cost',
html: '<span class="bold">Cost: </span>' + events[i].cost
});
}else{
var cost = $('<div>', {
class: 'event-cost',
html: '<span class="bold">Cost: </span>' + events[i].cost + ' | <a href="#">Buy tickets</a>'
});
}
e.append(title);
e.append(location);
e.append(time);
e.append(cost);
e.append(details);
ewrap.append(icon);
ewrap.append(e);
results.append(ewrap);
}//end for
}//end else
$('#results-wrapper').fadeIn();
$('#results_').html(results);
}
});
}
</script>
<script type="text/javascript">
YUI().use('autocomplete', 'autocomplete-highlighters', function(Y){
//autocomplete is available and ready to use
//add yui skin to class body so that the default
//auto complete widget skin will be applied:
Y.one('body').addClass('yui3-skin-sam');
Y.one('#search').plug(Y.Plugin.AutoComplete, {
resultHighlighter: "charMatch",
source: "scripts/query-server.php?q={query}"
});
});
</script>
</body>
</html>