]> git.wh0rd.org Git - tt-rss.git/commitdiff
show number of unread articles in title
authorAndrew Dolgov <fox@bah.spb.su>
Tue, 29 Nov 2005 13:09:47 +0000 (14:09 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Tue, 29 Nov 2005 13:09:47 +0000 (14:09 +0100)
NEWS
functions.js
tt-rss.js

diff --git a/NEWS b/NEWS
index 56f28d3a6e23783734b48fc020305d16a457161a..1a527c336b507d234a6ea1c8aa9dc564bb890a37 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,7 @@ v1.1          (Dec xy, 2005)
        * Feed categories
        * "Mark as read" for tags
        * Test button in label editor
+       * Show number of unread articles in title
        
 v1.0.7 (Nov 14, 2005)
 
index 694ade06a8eefc0f18c64b0d34b93388e863ff65..17cab9d7617a554f375570c6f40c2c2d497e4868 100644 (file)
@@ -359,6 +359,12 @@ function all_counters_callback() {
                        for (var l = 0; l < reply.childNodes.length; l++) {
                                var id = reply.childNodes[l].getAttribute("id");
                                var ctr = reply.childNodes[l].getAttribute("counter");
+
+                               if (id == "global-unread") {
+                                       parent.global_unread = ctr;
+                                       parent.updateTitle();
+                                       continue;
+                               }
        
                                var feedctr = f_document.getElementById("FEEDCTR-" + id);
                                var feedu = f_document.getElementById("FEEDU-" + id);
index a2910451eee79fb16052688c8066f813ba124594..bb0f13c7900fd9af0890a7f78046ddc34da825a2 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -5,7 +5,7 @@ var first_run = true;
 
 var display_tags = false;
 
-var global_unread = 0;
+var global_unread = -1;
 
 var active_title_text = "";
 
@@ -93,12 +93,10 @@ function refetch_callback() {
                                var feedu = f_document.getElementById("FEEDU-" + id);
                                var feedr = f_document.getElementById("FEEDR-" + id);
        
-       /*                      TODO figure out how to update this from viewfeed.js->view()
-                               disabled for now...
-       
                                if (id == "global-unread") {
                                        global_unread = ctr;
-                               } */
+                                       continue;
+                               }
        
                                if (feedctr && feedu && feedr) {
        
@@ -318,6 +316,8 @@ function localHotkeyHandler(keycode) {
 
 }
 
+// if argument is undefined, current subtitle is not updated
+// use blank string to clear subtitle
 function updateTitle(s) {
        var tmp = "Tiny Tiny RSS";