Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 604 lines (488 sloc) 20.134 kb
bda2a3b index.jsp is new landing page, logout functionality added
Jake Levine authored
1 <%@ page contentType="text/html;charset=UTF-8" language="java" %>
2
d161527 @aquillano updated index.jsp
aquillano authored
3 <%@ page import="meetupnow.NewsItem" %>
2001892 replaced signed URLs with RegDev signed URLs in index.jsp
Jake Levine authored
4 <%@ page import="meetupnow.RegDev" %>
5ddf3d3 fixed map bug on index
Michael Shapiro authored
5 <%@ page import="meetupnow.UserInfo" %>
c93bb34 remember topic list selection
Jake Levine authored
6 <%@ page import="meetupnow.Topic" %>
bda2a3b index.jsp is new landing page, logout functionality added
Jake Levine authored
7 <%@ page import="javax.jdo.PersistenceManager" %>
8 <%@ page import="javax.jdo.Query" %>
9 <%@ page import="java.util.List" %>
d161527 @aquillano updated index.jsp
aquillano authored
10 <%@ page import="java.util.Date" %>
9af4d91 map on index queries all topics in database
Michael Shapiro authored
11
45ad31b @aquillano commit
aquillano authored
12 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
13 "http://www.w3.org/TR/html4/strict.dtd">
c66706c @aquillano add index.jsp
aquillano authored
14 <html>
15 <head>
75fbb2f @aquillano create about page
aquillano authored
16 <title>EventBent</title>
c66706c @aquillano add index.jsp
aquillano authored
17 <link rel="stylesheet" href="css/reset.css" type="text/css" />
1c588db @aquillano styling EventPage
aquillano authored
18 <link rel="stylesheet" href="css/meetupnow.css" type="text/css" />
9f5f7a1 @aquillano index.jsp improvements
aquillano authored
19 <link rel="stylesheet" type="text/css" media="all" href="css/grids.css">
07b7233 @aquillano added topic selection and list sorting
aquillano authored
20 <link rel="stylesheet" href="/css/ui-lightness/jquery-ui-1.8.2.css" type="text/css" />
21 <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
22 <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/jquery-ui.min.js"></script>
c66706c @aquillano add index.jsp
aquillano authored
23 <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
4fa6f95 seperated javascript from index into new file index.js
Michael Shapiro authored
24 <script type="text/javascript" src="/js/index.js"></script>
c66706c @aquillano add index.jsp
aquillano authored
25 <script type="text/javascript">
b904930 added map functionallity to index.jsp
Michael Shapiro authored
26
bb08f3d @aquillano working header/footer
aquillano authored
27 <%@ include file="jsp/cookie.jsp" %>
28 <%@ include file="jsp/declares.jsp" %>
29 <%@ page import="meetupnow.Topic" %>
b904930 added map functionallity to index.jsp
Michael Shapiro authored
30
9b16224 sync database with meetup in index
Michael Shapiro authored
31
76ac6e6 search integrated into index# Please enter the commit message for your c...
Michael Shapiro authored
32
2917307 better search result handling
Jake Levine authored
33 var data;
34
35 function setData(d) {
4bc27a9 logout bug fix
Jake Levine authored
36 if (d != null) {
37 if (d.results.length > 0) {
38 data = d;
39 }
2917307 better search result handling
Jake Levine authored
40 } else {
41 data = null;
42 }
43 }
44
45
76ac6e6 search integrated into index# Please enter the commit message for your c...
Michael Shapiro authored
46 function loadEvents(){
07b7233 @aquillano added topic selection and list sorting
aquillano authored
47
48 // Sort Buttons | jQuery UI
49 $(function() {
50 $("#sortMain").buttonset();
3b9c60f small changes
Jake Levine authored
51
07b7233 @aquillano added topic selection and list sorting
aquillano authored
52 });
53
54 // Select Topic Widget | jQuery UI
55
76ac6e6 search integrated into index# Please enter the commit message for your c...
Michael Shapiro authored
56
8d3af89 @aquillano added feed to index.jsp
aquillano authored
57 <%!
58 public static String timeBetween(Date d1, Date d2){
59 long now = d1.getTime();
60 long then = d2.getTime();
61
62 long seconds = (now - then)/1000;
63 long minutes = seconds/60;
64 long hours = minutes/60;
65 long days = hours/24;
66
67 if (seconds < 60) {
68 if (seconds == 1) {return seconds+" second ago";}
69 else {return seconds+" seconds ago";}
70 }
71 if (minutes < 60) {
72 if (minutes == 1) {return minutes+" minute ago";}
73 else {return minutes+" minutes ago";}
74 }
75 if (hours < 24) {
76 if (hours == 1) {return hours+" hour ago";}
77 else {return hours+" hours ago";}
78 }
79 if (days == 1) {return days+" day ago";}
80 else {return days+" days ago";}
81
82 }
2917307 better search result handling
Jake Levine authored
83 %>
76ac6e6 search integrated into index# Please enter the commit message for your c...
Michael Shapiro authored
84 <%
85
8d3af89 @aquillano added feed to index.jsp
aquillano authored
86 int numBoxes = 3;
87
f781a7a search feature on front page working#
Michael Shapiro authored
88
76ac6e6 search integrated into index# Please enter the commit message for your c...
Michael Shapiro authored
89 RegDev sg = new RegDev();
f781a7a search feature on front page working#
Michael Shapiro authored
90 String querystring = request.getParameter("topic");
76ac6e6 search integrated into index# Please enter the commit message for your c...
Michael Shapiro authored
91 String locationquery = request.getParameter("location");
4584b35 minor bug fix# Please enter the commit message for your changes. Lines s...
Michael Shapiro authored
92 if (querystring == null) querystring = "";
93 if (locationquery == null) locationquery = "";
852ce94 fixed search mechanisms
Jake Levine authored
94 String topicList = "&container_id=";
4159202 bug fix#
Michael Shapiro authored
95
852ce94 fixed search mechanisms
Jake Levine authored
96 Query topicQuery = pm.newQuery(Topic.class);
97 topicQuery.setFilter("id != 0");
98 topicQuery.declareParameters("String reqTokenParam"); //Setup Query
99
100 List<Topic> Topics = new ArrayList<Topic>();
101 try {
102 Topics = (List<Topic>) pm.detachCopyAll((List<Topic>) topicQuery.execute(key));
103 for (int i = 0; i < Topics.size(); i++){
104 topicList = topicList + Integer.toString(Topics.get(i).getId()) + ",";
105 }
106 if (topicList.charAt(topicList.length() - 1) == ',')
107 topicList = topicList.substring(0, topicList.length() - 1);
108 } finally {
109 topicQuery.closeAll();
f781a7a search feature on front page working#
Michael Shapiro authored
110 }
2917307 better search result handling
Jake Levine authored
111 String allTopicList = topicList;
852ce94 fixed search mechanisms
Jake Levine authored
112 if (!querystring.equals("0") && !querystring.equals("")){
113 topicList = "&container_id=" + querystring;
f781a7a search feature on front page working#
Michael Shapiro authored
114 }
76ac6e6 search integrated into index# Please enter the commit message for your c...
Michael Shapiro authored
115 JSONObject json;
116 Boolean searchresults = false;
117 String Lat = "";
118 String Lon = "";
119
852ce94 fixed search mechanisms
Jake Levine authored
120
76ac6e6 search integrated into index# Please enter the commit message for your c...
Michael Shapiro authored
121 if (querystring != null && locationquery != null){
122
f781a7a search feature on front page working#
Michael Shapiro authored
123 if (!querystring.equals("")) {
9c2b2ad bug fix#
Michael Shapiro authored
124
125 //display search results
126 searchresults = true;
f781a7a search feature on front page working#
Michael Shapiro authored
127 if (!locationquery.equals("")){
128
76ac6e6 search integrated into index# Please enter the commit message for your c...
Michael Shapiro authored
129
d41387d minor bug fix# with '#' will be ignored, and an empty message aborts the...
Michael Shapiro authored
130 locationquery = locationquery.replace(' ', '+');
38f8dc5 added option to search without zip code#
Michael Shapiro authored
131
a67dd59 no more google geocoding on front page
Jake Levine authored
132 //String GEOCODE_API_URL = "http://maps.google.com/maps/api/geocode/json?address=" + locationquery +"&sensor=true";
852ce94 fixed search mechanisms
Jake Levine authored
133 String gisgraphy_url = "http://services.gisgraphy.com/fulltext/fulltextsearch?q="+ locationquery +"&placetype=city&country=us&format=json&from=1&to=1";
a67dd59 no more google geocoding on front page
Jake Levine authored
134 APIresponse = sg.submitUnsignedURL(gisgraphy_url);
76ac6e6 search integrated into index# Please enter the commit message for your c...
Michael Shapiro authored
135 json = new JSONObject(APIresponse.getBody());
852ce94 fixed search mechanisms
Jake Levine authored
136 JSONObject g_response = json.getJSONObject("response");
137 if (Integer.parseInt(g_response.getString("numFound")) > 0) {
138 Lat = g_response.getJSONArray("docs").getJSONObject(0).getString("lat");
139 Lon = g_response.getJSONArray("docs").getJSONObject(0).getString("lng");
140
141 API_URL = "http://api.meetup.com/ew/events/?link=http://jake-meetup-test.appspot.com/&status=upcoming&fields=rsvp_count&radius=10&lat=" + Lat + "&lon=" + Lon + topicList;
142 APIresponse = sg.submitURL(API_URL);
143 json = new JSONObject(APIresponse.getBody());
2917307 better search result handling
Jake Levine authored
144 %> setData(<%=json.toString()%>); <%
852ce94 fixed search mechanisms
Jake Levine authored
145 }
146 else {
147 Lat = null;
148 Lon = null;
2917307 better search result handling
Jake Levine authored
149 %> setData(null);<%
852ce94 fixed search mechanisms
Jake Levine authored
150 }
76ac6e6 search integrated into index# Please enter the commit message for your c...
Michael Shapiro authored
151
34a6d67 added timeline to containerpage#
Michael Shapiro authored
152
f781a7a search feature on front page working#
Michael Shapiro authored
153
76ac6e6 search integrated into index# Please enter the commit message for your c...
Michael Shapiro authored
154
155 } else {
38f8dc5 added option to search without zip code#
Michael Shapiro authored
156 if (!key.equals("empty")) {
157
158 try {
159 users = (List<MeetupUser>) query.execute(key);
160
161 if (users.iterator().hasNext()) {
162 query = pm.newQuery(UserInfo.class);
163 query.setFilter("user_id == u_id");
164 query.declareParameters("String u_id");
165
166
167 List <UserInfo> userInfoList = (List<UserInfo>) query.execute(users.get(0).getID());
168 if (userInfoList.iterator().hasNext()){
169 Token accessToken = new Token(users.get(0).getAccToken(),users.get(0).getAccTokenSecret());
170
171 Lat = userInfoList.get(0).getLat();
172 Lon = userInfoList.get(0).getLon();
173 distance = userInfoList.get(0).getDistance();
174 if ((Lat != null) && (Lon != null)){
175 if (distance != null){
852ce94 fixed search mechanisms
Jake Levine authored
176 API_URL = "http://api.meetup.com/ew/events/?link=http://jake-meetup-test.appspot.com/&fields=rsvp_count&status=upcoming&radius=" + distance + "&lat=" + Lat + "&lon=" + Lon + topicList;
38f8dc5 added option to search without zip code#
Michael Shapiro authored
177 } else {
852ce94 fixed search mechanisms
Jake Levine authored
178 API_URL = "http://api.meetup.com/ew/events/?link=http://jake-meetup-test.appspot.com/&fields=rsvp_count&status=upcoming&radius=10&lat=" + Lat + "&lon=" + Lon + topicList;
38f8dc5 added option to search without zip code#
Michael Shapiro authored
179 }
180 }
181 else {
182 API_URL = "http://api.meetup.com/ew/events.json?lat=40.7142691&lon=-74.0059729&&status=upcoming&radius=5&fields=geo_ip";
183 APIresponse = sg.submitURL(API_URL);
184 json = new JSONObject(APIresponse.getBody());
185 Lat = json.getJSONObject("meta").getJSONObject("geo_ip").getString("lat");
186 Lon = json.getJSONObject("meta").getJSONObject("geo_ip").getString("lon");
852ce94 fixed search mechanisms
Jake Levine authored
187 API_URL = "http://api.meetup.com/ew/events/?link=http://jake-meetup-test.appspot.com/&fields=rsvp_count&radius=10&status=upcoming&lat=" + Lat + "&lon=" + Lon + topicList;
38f8dc5 added option to search without zip code#
Michael Shapiro authored
188 }
189
190 APIrequest = new Request(Request.Verb.GET, API_URL);
191 scribe.signRequest(APIrequest,accessToken);
192 APIresponse = APIrequest.send();
2917307 better search result handling
Jake Levine authored
193 %>setData(<%=APIresponse.getBody().toString()%>);<%
38f8dc5 added option to search without zip code#
Michael Shapiro authored
194 }
195 }
196 }
197 finally {
198
199 }
200 }
201 else {
202 API_URL = "http://api.meetup.com/ew/events.json?lat=40.7142691&lon=-74.0059729&radius=5&fields=geo_ip";
203 APIresponse = sg.submitURL(API_URL);
204 json = new JSONObject(APIresponse.getBody());
205 Lat = json.getJSONObject("meta").getJSONObject("geo_ip").getString("lat");
206 Lon = json.getJSONObject("meta").getJSONObject("geo_ip").getString("lon");
852ce94 fixed search mechanisms
Jake Levine authored
207 API_URL = "http://api.meetup.com/ew/events?status=upcoming"+ topicList + "&lat=" + Lat + "&lon=" + Lon + "&radius=25.0&fields=rsvp_count&order=time";
38f8dc5 added option to search without zip code#
Michael Shapiro authored
208 APIresponse = sg.submitURL(API_URL);
2917307 better search result handling
Jake Levine authored
209 %>setData(<%=APIresponse.getBody().toString()%>);<%
38f8dc5 added option to search without zip code#
Michael Shapiro authored
210
211 }
212
76ac6e6 search integrated into index# Please enter the commit message for your c...
Michael Shapiro authored
213
214 }
215
216 } else {
217
218 }
219 } else {
220
221 }
cd35ba0 minor bug fix#
Michael Shapiro authored
222 %>var search = <%=searchresults + ";\n"%>
223 <%
76ac6e6 search integrated into index# Please enter the commit message for your c...
Michael Shapiro authored
224 if (!searchresults){
225
4159202 bug fix#
Michael Shapiro authored
226
227
76ac6e6 search integrated into index# Please enter the commit message for your c...
Michael Shapiro authored
228
bb08f3d @aquillano working header/footer
aquillano authored
229 JSONArray top_list;
9b16224 sync database with meetup in index
Michael Shapiro authored
230
c7399d2 created a syncdatabase servlet and deleted the sync feature from the
Michael Shapiro authored
231
bb08f3d @aquillano working header/footer
aquillano authored
232 if (!key.equals("empty")) {
fa34262 jkljklj
Michael Shapiro authored
233
bb08f3d @aquillano working header/footer
aquillano authored
234 try {
235 users = (List<MeetupUser>) query.execute(key);
5ddf3d3 fixed map bug on index
Michael Shapiro authored
236
bb08f3d @aquillano working header/footer
aquillano authored
237 if (users.iterator().hasNext()) {
5ddf3d3 fixed map bug on index
Michael Shapiro authored
238 query = pm.newQuery(UserInfo.class);
239 query.setFilter("user_id == u_id");
240 query.declareParameters("String u_id");
241
242
243 List <UserInfo> userInfoList = (List<UserInfo>) query.execute(users.get(0).getID());
244 if (userInfoList.iterator().hasNext()){
245 Token accessToken = new Token(users.get(0).getAccToken(),users.get(0).getAccTokenSecret());
246
247 Lat = userInfoList.get(0).getLat();
248 Lon = userInfoList.get(0).getLon();
2383383 jk
Michael Shapiro authored
249 distance = userInfoList.get(0).getDistance();
83f3203 Fixed bug with meta object on first login
Jake Levine authored
250 if ((Lat != null) && (Lon != null)){
f617de1 minor bug fix
Michael Shapiro authored
251 if (distance != null){
852ce94 fixed search mechanisms
Jake Levine authored
252 API_URL = "http://api.meetup.com/ew/events/?link=http://jake-meetup-test.appspot.com/&fields=rsvp_count&status=upcoming&radius=" + distance + "&lat=" + Lat + "&lon=" + Lon + topicList;
f617de1 minor bug fix
Michael Shapiro authored
253 } else {
852ce94 fixed search mechanisms
Jake Levine authored
254 API_URL = "http://api.meetup.com/ew/events/?link=http://jake-meetup-test.appspot.com/&fields=rsvp_count&status=upcoming&radius=10&lat=" + Lat + "&lon=" + Lon + topicList;
f617de1 minor bug fix
Michael Shapiro authored
255 }
b241ec0 fixed geo ip
Michael Shapiro authored
256 APIrequest = new Request(Request.Verb.GET, API_URL);
257 scribe.signRequest(APIrequest,accessToken);
258 APIresponse = APIrequest.send();
2917307 better search result handling
Jake Levine authored
259 %>setData(<%=APIresponse.getBody().toString()%>);<%
f617de1 minor bug fix
Michael Shapiro authored
260 }
261 else {
b241ec0 fixed geo ip
Michael Shapiro authored
262 Lat = null;
263 Lon = null;
2917307 better search result handling
Jake Levine authored
264 %>setData(null);<%
b241ec0 fixed geo ip
Michael Shapiro authored
265
f617de1 minor bug fix
Michael Shapiro authored
266 }
4159202 bug fix#
Michael Shapiro authored
267
b241ec0 fixed geo ip
Michael Shapiro authored
268
5ddf3d3 fixed map bug on index
Michael Shapiro authored
269 }
bb08f3d @aquillano working header/footer
aquillano authored
270 }
b904930 added map functionallity to index.jsp
Michael Shapiro authored
271 }
bb08f3d @aquillano working header/footer
aquillano authored
272 finally {
19f68b7 minor changes to index.jsp
Michael Shapiro authored
273
bb08f3d @aquillano working header/footer
aquillano authored
274 }
1fea70c fixed index.jsp to work when user is not logged in
Jake Levine authored
275 }
bb08f3d @aquillano working header/footer
aquillano authored
276 else {
b241ec0 fixed geo ip
Michael Shapiro authored
277
278 Lat = null;
279 Lon = null;
2917307 better search result handling
Jake Levine authored
280 %>setData(null);<%
3b9c60f small changes
Jake Levine authored
281
92d7c95 modified index.jsp to recognize whether a user is logged in and if so
Michael Shapiro authored
282
bb08f3d @aquillano working header/footer
aquillano authored
283 }
76ac6e6 search integrated into index# Please enter the commit message for your c...
Michael Shapiro authored
284 }
b241ec0 fixed geo ip
Michael Shapiro authored
285 //String GEOCODE_API_URL = "http://maps.google.com/maps/api/geocode/json?latlng=" + Lat + "," + Lon +"&sensor=true";
286 //APIresponse = sg.submitURL(GEOCODE_API_URL);
2917307 better search result handling
Jake Levine authored
287 %>
288 Topic_List = "<%=topicList %>";
3b9c60f small changes
Jake Levine authored
289 User_Lat = <%=Lat + ";\n"%>
55e0a79 done with sorting# with '#' will be ignored, and an empty message aborts...
Michael Shapiro authored
290 User_Lon = <%=Lon + ";\n"%>
b241ec0 fixed geo ip
Michael Shapiro authored
291 if (data == null){
2917307 better search result handling
Jake Levine authored
292 if (search) {
293 Topic_List = "<%=allTopicList%>";
294 }
b241ec0 fixed geo ip
Michael Shapiro authored
295 $.ajax({
296 dataType: "jsonp",
297 url: 'http://api.meetup.com/members?relation=self&order=name&offset=0&format=json&page=200&fields=geo_ip&sig_id=12219649&sig=c36e74db72bca240652d609ae875821df5ea9418',
298 success: function(data) {
299 User_Lat = data.meta.geo_ip.lat;
300 User_Lon = data.meta.geo_ip.lon;
301 $.ajax({
302 dataType: "jsonp",
4bc27a9 logout bug fix
Jake Levine authored
303 url: "http://api.meetup.com/ew/events?status=upcoming&lat=" + data.meta.geo_ip.lat + "&lon=" + data.meta.geo_ip.lon + Topic_List + "&radius=25.0&fields=rsvp_count&key=<%=sg.getKey()%>",
b241ec0 fixed geo ip
Michael Shapiro authored
304 success: function(data2) {
305
306 use_everywhere(data2);
307 eventArray.sort(SortByDistance);
cd35ba0 minor bug fix#
Michael Shapiro authored
308 var location = '';
309 if (search){
2917307 better search result handling
Jake Levine authored
310 location = 'Results or location not found... Showing all ';
cd35ba0 minor bug fix#
Michael Shapiro authored
311 }
312 location = location + 'Events near ' + eventArray[0].ev.city;
b241ec0 fixed geo ip
Michael Shapiro authored
313 if (eventArray[0].ev.state){
314 location = location + ", " + eventArray[0].ev.state;
315 }
316 else{
317 location = location + ", " + eventArray[0].ev.country.toUpperCase();
318 }
cd35ba0 minor bug fix#
Michael Shapiro authored
319
b241ec0 fixed geo ip
Michael Shapiro authored
320 $('#searchResultsHeading').append(location);
321 eventArray.sort(SortByTime);
322 }
323 });
324 }
325 });
326
327
328
329 } else {
330 use_everywhere(data);
331 eventArray.sort(SortByDistance);
332 var location = 'Events near ' + eventArray[0].ev.city;
333 if (eventArray[0].ev.state){
334 location = location + ", " + eventArray[0].ev.state;
335 }
336 else{
337 location = location + ", " + eventArray[0].ev.country.toUpperCase();
338 }
cd35ba0 minor bug fix#
Michael Shapiro authored
339
b241ec0 fixed geo ip
Michael Shapiro authored
340 $('#searchResultsHeading').append(location);
341 eventArray.sort(SortByTime);
48fb549 added users location to [location]
Michael Shapiro authored
342
92d7c95 modified index.jsp to recognize whether a user is logged in and if so
Michael Shapiro authored
343
b241ec0 fixed geo ip
Michael Shapiro authored
344 }
345 }
c66706c @aquillano add index.jsp
aquillano authored
346 </script>
8d3af89 @aquillano added feed to index.jsp
aquillano authored
347
348 <script type="text/javascript">
349
350 var alerts = new Array();
351
352 $(function() {
353 var count = 0;
354
355 <%
356 List<NewsItem> newsFeed = new ArrayList<NewsItem>();
357 Query newsQuery = pm.newQuery(NewsItem.class);
358 newsQuery.declareParameters("long startdate");
359 newsQuery.setFilter("timeCreated > startdate");
360 newsQuery.setOrdering("timeCreated descending");
361 try {
362 newsFeed = (List<NewsItem>) newsQuery.execute(0);
363 for (int i = 0; i < newsFeed.size(); i++) {
364 NewsItem n = newsFeed.get(i);
365 Date now = new Date();
366 Date then = new Date(n.getTimeCreated());
367
368 %>
369
370 alerts[<%=i%>] = new item("<%=n.getType()%>","<%=n.getName()%>","<%=n.getMessage()%>","<%=n.getEvConName()%>","<%=n.getContainerName()%>","<%=timeBetween(now,then)%>","<%=n.getLink()%>");
371
372 <%
373
374 }
375 for (int i=0; i<numBoxes; i++) {
376 %>
377 addBox(<%=i%>);
378 <%
379 }
380 } finally {
381 newsQuery.closeAll();
382 }
383 %>
384 var interval = window.setInterval(loop, 7500);
385 function loop() {
386 var n = count + <%=numBoxes%>;
387 var one = count + 1;
388 var two = count + 2;
389 $("div:."+count+",."+one+",."+two).fadeTo('slow', 0.0, function () {
390 addBox(n);
391 n++;
392 $("div:."+count+",."+one+",."+two).slideUp(function () {
393
394
395 });
396 count++;
397 });
398
399
400 }
401 });
402
403 function item(ty,n,m,e,c,ti,l) {
404 this.type = ty;
405 this.name = n;
406 this.message = m;
407 this.eventName = e;
408 this.container = c;
409 this.time = ti;
410 this.link = l;
411 }
412 function formatAlert(alert) {
413 var evName;
414 var contain;
415 if (alert.type == "comment") {
416 if (alert.eventName == "null") { evName = "on an event"; }
7c5d269 @aquillano styled ticker
aquillano authored
417 else {evName = "on " + alert.eventName;}
418 return "<span class='tickerMember'>"+alert.name+"</span> commented <a href=\""+alert.link+"\">"+evName+"</a>: "+ alert.message+" <span class='tickerTime'> ~ "+alert.time+"</span>";
8d3af89 @aquillano added feed to index.jsp
aquillano authored
419 }
420 if (alert.type == "event_create") {
421 if (alert.container == "null") {contain = "";}
422 else { contain = "in topic "+alert.container;}
7c5d269 @aquillano styled ticker
aquillano authored
423 return "<span class='tickerMember'>"+alert.name+"</span> created a new event "+contain+": <a href=\""+alert.link+"\">"+alert.eventName+"</a><span class='tickerTime'> ~ "+alert.time+"</span>";
8d3af89 @aquillano added feed to index.jsp
aquillano authored
424 }
425 if (alert.type == "event_rsvp") {
426 if (alert.eventName == "null") {evName = "an event";}
427 else {evName = alert.eventName;}
428 if (alert.container == "null") {contain = "";}
429 else {contain = " in topic "+alert.container;}
7c5d269 @aquillano styled ticker
aquillano authored
430 return "<span class='tickerMember'>"+alert.name+"</span> will be attending <a href=\""+alert.link+"\">"+evName+"</a>"+contain+" <span class='tickerTime'> ~ "+alert.time +"</span>";
8d3af89 @aquillano added feed to index.jsp
aquillano authored
431 }
432
433 }
434
435 function addBox(i) {
bb054b6 news feed loops when it reaches the end of it's notifications
Jake Levine authored
436 var index = i;
437 if ( i >= alerts.length) {
438 index = index % alerts.length;
439 }
440 $('#out').append("<div class=\""+i+"\"><div class=\"tickerContentBox\">"+formatAlert(alerts[index])+"</div></div>");
8d3af89 @aquillano added feed to index.jsp
aquillano authored
441 }
442
443
444 </script>
c66706c @aquillano add index.jsp
aquillano authored
445 </head>
d161527 @aquillano updated index.jsp
aquillano authored
446 <body onload="loadEvents()">
bb08f3d @aquillano working header/footer
aquillano authored
447 <div id="wrap">
a2d224c @aquillano still slight gap at bottom
aquillano authored
448
4a67df7 added jsp header file
Michael Shapiro authored
449 <%@ include file="jsp/header.jsp" %>
a2d224c @aquillano still slight gap at bottom
aquillano authored
450
451 <%//@ include file="jsp/ticker.jsp" %>
bb08f3d @aquillano working header/footer
aquillano authored
452 <div id="main">
9f5f7a1 @aquillano index.jsp improvements
aquillano authored
453 <div id="contentBottom">
454 <div id="contentBottomBody">
8d3af89 @aquillano added feed to index.jsp
aquillano authored
455 <div id="ticker">
456 <div class="tickerContext" id="out">
457
458 </div>
459 </div>
9f5f7a1 @aquillano index.jsp improvements
aquillano authored
460 <div id="action">
461
462 <% if(k.equals("empty")) { %>
463
5bb1ea5 @aquillano homepage redesign to 750px fixed-width
aquillano authored
464 <span class="title">Get Started.</span>
465 <div id="actionDesc">
2d15777 @aquillano added eventbent logo
aquillano authored
466 <span class="heading">EventBent helps you discover events happening locally, and happening soon. Nothing going on near you? No problem, just start something yourself, and people nearby will hear about it. Now go out and do something!</span>
5bb1ea5 @aquillano homepage redesign to 750px fixed-width
aquillano authored
467 </div> <!-- end #actionDesc -->
9f5f7a1 @aquillano index.jsp improvements
aquillano authored
468
469 <% } %>
470
471 <div id="actionBtns">
9bb69bb when not logged in, clicking create an event brings you to login
Jake Levine authored
472 <%
473 if (!k.equals("empty")) {
474 %>
cc66373 @aquillano buttons now blue
aquillano authored
475 <a href="CreateEvent.jsp" class="actionBtn" style="float:right; margin-left: 12px">Create An Event</a>
9bb69bb when not logged in, clicking create an event brings you to login
Jake Levine authored
476 <%
477 } else {
478 %>
479 <a href="#modal_login" name="modal" class="actionBtn" style="float:right; margin-left: 12px">Create An Event</a>
480 <%
481 }
482 %>
cc66373 @aquillano buttons now blue
aquillano authored
483 <a href="lucky" class="actionBtn" style="float:right; margin-left: 12px">Can't Decide?</a>
484 <a href="AllTopics.jsp" class="actionBtn" style="float:right; margin-left: 12px">Browse Events</a>
9f5f7a1 @aquillano index.jsp improvements
aquillano authored
485 </div><!-- end #actionBtns -->
486
487 <!-- <div class="line">
488 <div class="unit size1of3">
9bb69bb when not logged in, clicking create an event brings you to login
Jake Levine authored
489
490
491
492
493
9f5f7a1 @aquillano index.jsp improvements
aquillano authored
494 </div>
495 <div class="unit size1of3">
496 <a href="lucky" class="btn_main" style="margin: 0 auto;">Roll the Dice!</a>
497 </div>
498 <div class="unit size1of3 lastUnit">
499 <a href="AllTopics.jsp" class="btn_main fltrt">Browse Events</a>
500 </div>
501 </div> -->
502 </div><!-- end #action -->
503
504
5bb1ea5 @aquillano homepage redesign to 750px fixed-width
aquillano authored
505 <div class="map_contextLeft">
bb08f3d @aquillano working header/footer
aquillano authored
506 <span class="map_title title">Happening NOW near you...</span>
9f5f7a1 @aquillano index.jsp improvements
aquillano authored
507 <div id="map_canvasContainerMain">
bb08f3d @aquillano working header/footer
aquillano authored
508 <div id="map_canvas">
be87e92 @aquillano fixed merge conflict
aquillano authored
509
d161527 @aquillano updated index.jsp
aquillano authored
510 </div><!-- end #map_canvas -->
511 </div><!-- end #map_canvasContainer -->
5bb1ea5 @aquillano homepage redesign to 750px fixed-width
aquillano authored
512 </div><!-- end .map_context -->
c93bb34 remember topic list selection
Jake Levine authored
513
07b7233 @aquillano added topic selection and list sorting
aquillano authored
514 <div class="line">
4ceb758 @aquillano added zip back to index.jsp
aquillano authored
515 <div class="unit size2of3">
07b7233 @aquillano added topic selection and list sorting
aquillano authored
516 <div class="mainListActions">
517 <form action="index.jsp" method="post" accept-charset="utf-8">
4ceb758 @aquillano added zip back to index.jsp
aquillano authored
518 <div class="element">
519 <div class="label">
2917307 better search result handling
Jake Levine authored
520 <label for="location">Topic</label>
4ceb758 @aquillano added zip back to index.jsp
aquillano authored
521 </div> <!-- end .label -->
522 <select class="fltlft" id="topicSelect" name="topic">
f781a7a search feature on front page working#
Michael Shapiro authored
523 <option value="0">All Topics</option>
c93bb34 remember topic list selection
Jake Levine authored
524 <%
525 Query TopicQuery = pm.newQuery(Topic.class);
526 TopicQuery.setFilter("id != 0");
527 TopicQuery.declareParameters("String reqTokenParam"); //Setup Query
528
529 List<Topic> topics = new ArrayList<Topic>();
530 try {
531 topics = (List<Topic>) pm.detachCopyAll((List<Topic>) TopicQuery.execute(key));
532 } finally {
533
534 }
535 String tString;
536 for (int i = 0; i < topics.size(); i++) {
537 tString = ""+topics.get(i).getId();
538 if (tString.equals(querystring)) {
539 %>
540 <option value="<%=topics.get(i).getId()%>" selected><%=topics.get(i).getName()%></option>
541 <%
542 } else {
543 %>
544 <option value="<%=topics.get(i).getId()%>"><%=topics.get(i).getName()%></option>
545 <%
546 }
547 }
548 %>
4ceb758 @aquillano added zip back to index.jsp
aquillano authored
549 </select>
550 </div><!-- end .element -->
551 <div class="element">
552 <div class="label">
553 <label for="location">City or Zip Code</label>
554 </div> <!-- end .label -->
555 <div class="mainSearchInput">
556 <input type="text" name="location" value="<%=locationquery.replace('+',' ')%>" id="mainSearchLocation" maxlength="100">
557 </div> <!-- end .input -->
558 </div> <!-- end .element -->
559 <div class="submit">
cc66373 @aquillano buttons now blue
aquillano authored
560 <input type="submit" value="Search" class="actionBtn submitBtn">
4ceb758 @aquillano added zip back to index.jsp
aquillano authored
561 </div> <!-- end .submit -->
07b7233 @aquillano added topic selection and list sorting
aquillano authored
562 </form>
563 </div>
564 </div>
4ceb758 @aquillano added zip back to index.jsp
aquillano authored
565 <div class="unit size1of3 lastUnit">
566 <div id="sortMain">
07b7233 @aquillano added topic selection and list sorting
aquillano authored
567 <div class="mainListActions fltrt">
4ceb758 @aquillano added zip back to index.jsp
aquillano authored
568 <div class="label">
569 <label for="sortBy">Sort By</label>
570 </div>
571 <input type="radio" id="sortTime" name="sortBy" checked="checked" onclick="eventArray.sort(SortByTime); update_events(current_page);"><label for="sortTime">Time</label>
07b7233 @aquillano added topic selection and list sorting
aquillano authored
572 <input type="radio" id="sortDistance" name="sortBy" onclick="eventArray.sort(SortByDistance); update_events(current_page);"><label for="sortDistance">Distance</label>
573 <input type="radio" id="sortPop" name="sortBy" onclick="eventArray.sort(SortByRSVP); update_events(current_page);"><label for="sortPop">Popularity</label>
574 </div><!-- end #sortMainBtnWrap -->
4ceb758 @aquillano added zip back to index.jsp
aquillano authored
575 </div><!-- end .sortMain -->
07b7233 @aquillano added topic selection and list sorting
aquillano authored
576 </div>
577 </div>
578
579
580
5bb1ea5 @aquillano homepage redesign to 750px fixed-width
aquillano authored
581 <div id="mn_geoListContext">
d161527 @aquillano updated index.jsp
aquillano authored
582 <div id="mn_geoListHeader">
fa95cf4 @aquillano css fixes index.jsp
aquillano authored
583 <span id="searchResultsHeading" class="listTitle"></span>
d161527 @aquillano updated index.jsp
aquillano authored
584 </div><!-- mn_geoListHeader -->
585 <div id="mn_geoListBody">
bb08f3d @aquillano working header/footer
aquillano authored
586
be87e92 @aquillano fixed merge conflict
aquillano authored
587 </div> <!-- end #mn_geoListBody -->
588 <div id="mn_geoListFooter">
589 <div id="searchResultsNav">
590 <span class="showAll"></span>
591 <span class="paginationNav"></span>
592 </div> <!-- end searchResultsNav -->
593 </div><!-- mn_geoListFooter -->
5bb1ea5 @aquillano homepage redesign to 750px fixed-width
aquillano authored
594 </div><!-- mn_geoListContext -->
595 </div> <!-- end #contentLeftBody -->
d161527 @aquillano updated index.jsp
aquillano authored
596 </div> <!-- end #contentLeft -->
bb08f3d @aquillano working header/footer
aquillano authored
597 </div> <!-- end #main -->
598 </div> <!-- end #wrap -->
1c588db @aquillano styling EventPage
aquillano authored
599
9af4d91 map on index queries all topics in database
Michael Shapiro authored
600 <%@ include file="jsp/footer.jsp" %>
bb08f3d @aquillano working header/footer
aquillano authored
601
a2d224c @aquillano still slight gap at bottom
aquillano authored
602 </body>
0c9a906 @aquillano Merge branch 'master' of github.com:meetup/meetupnow
aquillano authored
603 </html>
Something went wrong with that request. Please try again.