Show More
Commit Description:
update heartbeat...
Commit Description:
update heartbeat
add try-to-login-from-other-ip loggin (by printing to stdout)
References:
File last commit:
Show/Diff file:
Action:
app/assets/javascripts/announcement_refresh.js
| 41 lines
| 1.0 KiB
| application/javascript
| JavascriptLexer
|
|
r322 | |||
var Announcement = { | ||||
mostRecentId: 0, | ||||
refreshUrl: '/main/announcements', | ||||
setMostRecentId: function(id) { | ||||
Announcement.mostRecentId = id; | ||||
}, | ||||
updateRecentId: function(id) { | ||||
if(Announcement.mostRecentId < id) | ||||
Announcement.mostRecentId = id; | ||||
}, | ||||
refreshAnnouncement: function() { | ||||
var url = Announcement.refreshUrl; | ||||
new Ajax.Request(url, { | ||||
method: 'get', | ||||
parameters: { recent: Announcement.mostRecentId }, | ||||
onSuccess: function(transport) { | ||||
if((transport.status == 200) && | ||||
(transport.responseText.match(/\S/)!=null)) { | ||||
var announcementBody = $("announcementbox-body"); | ||||
announcementBody.insert({ top: transport.responseText }); | ||||
var announcementBoxes = $$(".announcementbox"); | ||||
if(announcementBoxes.length!=0) | ||||
announcementBoxes[0].show(); | ||||
Announcement.registerRefreshEventTimer(); | ||||
} | ||||
} | ||||
}); | ||||
}, | ||||
registerRefreshEventTimer: function() { | ||||
setTimeout(function () { | ||||
Announcement.refreshAnnouncement(); | ||||
}, 30000); | ||||
} | ||||
}; | ||||