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/titlebar-notifications.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 js/titlebar-notifications.js (limited to 'js/titlebar-notifications.js') diff --git a/js/titlebar-notifications.js b/js/titlebar-notifications.js new file mode 100644 index 00000000..329c8812 --- /dev/null +++ b/js/titlebar-notifications.js @@ -0,0 +1,18 @@ +var orig_title = document.title; + +$(function(){ + orig_title = document.title; +}); + +update_title = function() { + var updates = 0; + for(var i in title_collectors) { + updates += title_collectors[i](); + } + document.title = (updates ? "("+updates+") " : "") + orig_title; +}; + +var title_collectors = []; +add_title_collector = function(f) { + title_collectors.push(f); +}; -- cgit v1.3