Show More
Commit Description:
added time out check for code jom submissions
Commit Description:
added time out check for code jom submissions
References:
File last commit:
Show/Diff file:
Action:
public/javascripts/announcement_refresh.js
| 38 lines
| 942 B
| application/javascript
| JavascriptLexer
|
|
r192 | |||
var Announcement = { | ||||
mostRecentId: 0, | ||||
setMostRecentId: function(id) { | ||||
Announcement.mostRecentId = id; | ||||
}, | ||||
updateRecentId: function(id) { | ||||
if(Announcement.mostRecentId < id) | ||||
Announcement.mostRecentId = id; | ||||
}, | ||||
refreshAnnouncement: function() { | ||||
var url = '/main/announcements'; | ||||
new Ajax.Request(url, { | ||||
method: 'get', | ||||
parameters: { recent: Announcement.mostRecentId }, | ||||
onSuccess: function(transport) { | ||||
|
r226 | if(transport.responseText.match(/\S/)!=null) { | ||
var announcementBody = $("announcementbox-body"); | ||||
announcementBody.insert({ top: transport.responseText }); | ||||
var announcementBoxes = $$(".announcementbox"); | ||||
if(announcementBoxes.length!=0) | ||||
announcementBoxes[0].show(); | ||||
} | ||||
|
r192 | } | ||
}); | ||||
Announcement.registerRefreshEventTimer(); | ||||
}, | ||||
registerRefreshEventTimer: function() { | ||||
setTimeout(function () { | ||||
Announcement.refreshAnnouncement(); | ||||
}, 30000); | ||||
} | ||||
|
r226 | }; | ||