diff options
Diffstat (limited to 'js/titlebar-notifications.js')
| -rw-r--r-- | js/titlebar-notifications.js | 18 |
1 files changed, 18 insertions, 0 deletions
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); +}; |
