Permalink
Browse files

adding some binding when swiping

  • Loading branch information...
1 parent 88093ff commit f8c502759ab75656c2f94c3aa2d610d36642af2c @esromneb committed Jul 22, 2012
@@ -13,6 +13,8 @@ chatUserName= 0;
shortToken= 0;
eID= 0;
+globalEvent = new Array();
+
globalToken = "5c85d387e605833510da20dc71ad39821be2e35b";
function getRoToken() {
@@ -256,21 +258,9 @@ function parseRoTokenAndRequestServer() {
function loadTileDetails(sel, event) {
-//alert( sel );
var rel = new Date( event.startTimestamp*1000 ).toRelativeTime();
-
$(sel).html("<div class='tileText'><b>" + event.activityName + "</b><br>" + rel + "</div>");
- //alert( event.startTimestamp*1000 );
-
-
-
- //alert( relativeDate(new Date(event.startTimestamp*1000)) );
- //alert( relativeDate() );
-
-
- //var d = new Date(now).toRelativeTime();
- //alert( new Date(now.valueOf() - 500).toString().toRelativeTime() );
}
@@ -297,6 +287,8 @@ function loadEvents() {
loadTileDetails( '#t' + (i + offset), event );
+ globalEvent[i + offset] = event;
+
//$('#t' + (i + offset) ).html(event.activityName);
@@ -11,6 +11,35 @@ slideToPanel('r2', 1, 0);
});
+function isETile( num )
+{
+ if( num == 2 || num == 3 || num == 10 || num == 11 || num == 18 || num == 19 )
+ return true;
+
+ return false;
+}
+
+function bindEvent( sel, num )
+{
+ if( isETile( num ) )
+ {
+ var event = globalEvent[num];
+ //alert( num );
+ //alert( globalEvent[num].activityName );
+ var base = Math.floor(num/8)*8;
+ var rsvp = "#t" + base;
+ var details = "#t" + (base+4);
+ var other = "#t" + (base+6);
+
+ //alert( rsvp );
+ var rel = new Date( event.startTimestamp*1000 ).toRelativeTime();
+ $(rsvp).html("<div class='tileText'><b>Will you attend this event?</b><br><br><input type='button' value='Yes!'> or <input type='button' value='No :('>" + "</div>");
+ $(details).html("<div class='tileText'><b>" + event.start + "</b><br>" + event.numberAttending + " attending<br>" + event.numberInvited + " invited" + "</div>");
+
+ }
+}
+
+
$(function(){
@@ -26,6 +55,8 @@ $(function(){
var $li = $(this);
var tileId = e.target.id;
var tileNum = parseInt(tileId.replace('t',''));
+
+ bindEvent( tileId, tileNum );
var currentRow = "r"+Math.floor(tileNum/8);
@@ -71,6 +102,8 @@ $(function(){
var $li = $(this);
var tileId = e.target.id;
var tileNum = parseInt(tileId.replace('t',''));
+
+ bindEvent( tileId, tileNum );
var currentRow = "r"+Math.floor(tileNum/8);

0 comments on commit f8c5027

Please sign in to comment.