lobby.notify={box:null,checkInterval:null,nfs:[],init:function(){lobby.notify.box=$("nav #notifyBox");this.update();this.events();this.checkInterval=setInterval(function(){lobby.notify.update();},30000);},push:function(){},onNewItems:function(){},update:function(){lobby.ar("notify",{},function(response){nfs=JSON.parse(response);if(nfs.length===0){lobby.notify.box.html("<center><h4>No Notifications</h4></center>");}else{$.each(nfs,function(id,notification){notification["id"]=id;lobby.notify.nfs.push(id);lobby.notify.push(notification);});if(lobby.notify.nfs.length!==nfs.length){$.each(lobby.notify.nfs,function(i,notifyID){if(typeof nfs[notifyID]==="undefined"){lobby.notify.push({"id":notifyID,"removed":true});}});}
lobby.notify.onNewItems();}});},events:function(){}};lobby.load(function(){lobby.notify.init();});
|