From 371685140a0cf4fd4286e0da32c045a466799348 Mon Sep 17 00:00:00 2001 From: czaks Date: Sun, 29 Dec 2013 01:10:35 +0100 Subject: watch.js: watch board + watch thread + tool for pinning boards; currently may not work the best at mobiles and without compact-boardlist --- js/auto-reload.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'js/auto-reload.js') 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 } }); -- cgit v1.3