summaryrefslogtreecommitdiff
path: root/js/auto-reload.js
diff options
context:
space:
mode:
authorczaks <marcin@6irc.net>2013-12-29 01:10:35 +0100
committerczaks <marcin@6irc.net>2013-12-29 01:10:35 +0100
commit371685140a0cf4fd4286e0da32c045a466799348 (patch)
treeb86fdcc3f9d184fab6bb3ad8508b1711d9afcd08 /js/auto-reload.js
parent2664a849748d8d1f44c9ccd23ab6429e5e8a8940 (diff)
watch.js: watch board + watch thread + tool for pinning boards; currently may not work the best at mobiles and without compact-boardlist
Diffstat (limited to 'js/auto-reload.js')
-rw-r--r--js/auto-reload.js17
1 files changed, 13 insertions, 4 deletions
diff --git a/js/auto-reload.js b/js/auto-reload.js
index 725b4b51..9f5fe052 100644
--- a/js/auto-reload.js
+++ b/js/auto-reload.js
@@ -9,10 +9,13 @@
*
* Usage:
* $config['additional_javascript'][] = 'js/jquery.min.js';
+ * //$config['additional_javascript'][] = 'js/titlebar-notifications.js';
* $config['additional_javascript'][] = 'js/auto-reload.js';
*
*/
+auto_reload_enabled = true; // for watch.js to interop
+
$(document).ready(function(){
if($('div.banner').length == 0)
return; // not index
@@ -24,12 +27,17 @@ $(document).ready(function(){
var end_of_page = false;
- var orig_title = document.title;
var new_posts = 0;
var first_new_post = null;
- var update_title = function() {
- document.title = (new_posts ? "("+new_posts+") " : "") + orig_title;
- };
+
+ if (typeof update_title == "undefined") {
+ var update_title = function() { };
+ }
+
+ if (typeof add_title_collector != "undefined")
+ add_title_collector(function(){
+ return new_posts;
+ });
var window_active = true;
$(window).focus(function() {
@@ -66,6 +74,7 @@ $(document).ready(function(){
recheck_activated();
}
});
+ time_loaded = Date.now(); // interop with watch.js
}
});