X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/573b9004c7bc2a6a2b29335155b4ff55d142c6b6..309ec8b919d57858254b78cd7ba3b4d84d90da9a:/src/redakcja/static/js/wiki/loader.js?ds=inline diff --git a/src/redakcja/static/js/wiki/loader.js b/src/redakcja/static/js/wiki/loader.js index 7ea9b407..e9cf2b1a 100644 --- a/src/redakcja/static/js/wiki/loader.js +++ b/src/redakcja/static/js/wiki/loader.js @@ -113,10 +113,10 @@ $(function() { }; $('body').mousemove(function(e) { - CurrentDocument.active = true; + CurrentDocument.active = new Date(); }); $('body').keydown(function(e) { - CurrentDocument.active = true; + CurrentDocument.active = new Date(); }); console.log("Fetching document's text"); @@ -141,13 +141,15 @@ $(function() { console.log("Initial tab is:", active_tab) $.wiki.switchToTab(active_tab); - /* every minute check for a newer version */ + /* check for a newer version */ + CurrentDocument.checkRevision({outdated: function(){ + $('#header').addClass('out-of-date'); + }}); var revTimer = setInterval(function() { CurrentDocument.checkRevision({outdated: function(){ $('#header').addClass('out-of-date'); - clearInterval(revTimer); }}); - }, 60 * 1000); + }, 5 * 1000); }, failure: function() { $('#loading-overlay').fadeOut();