make faction chat display almost work

This commit is contained in:
Stefan Breunig
2013-02-03 13:19:56 +01:00
parent 4da97f48e3
commit b7f1270ff6
10 changed files with 599 additions and 217 deletions

View File

@ -7,7 +7,9 @@ var idleReset = function (e) {
// update immediately when the user comes back
if(isIdle()) {
window.idleTime = 0;
window.requestData();
$.each(window._onResumeFunctions, function(ind, f) {
f();
});
}
window.idleTime = 0;
};
@ -16,3 +18,11 @@ $('body').mousemove(idleReset).keypress(idleReset);
window.isIdle = function() {
return window.idleTime >= MAX_IDLE_TIME;
}
window._onResumeFunctions = [];
// add your function here if you want to be notified when the user
// resumes from being idle
window.addResumeFunction = function(f) {
window._onResumeFunctions.push(f);
}