]> git.wh0rd.org - tt-rss.git/commitdiff
digest: show number of unread articles in the title
authorAndrew Dolgov <fox@bah.org.ru>
Sun, 12 Sep 2010 08:16:50 +0000 (12:16 +0400)
committerAndrew Dolgov <fox@bah.org.ru>
Sun, 12 Sep 2010 08:16:50 +0000 (12:16 +0400)
digest.js
digest.php

index a3cbb4879a92b20c3ba5eb9748369a904b4e1d32..777473c61f68cd5b068f46df1012946f8ea86792 100644 (file)
--- a/digest.js
+++ b/digest.js
@@ -346,6 +346,10 @@ function parse_feeds(transport) {
                                                        return 0;                                       
                                });
 
+                       var all_articles = find_feed(feeds, -4);
+
+                       update_title(all_articles.unread);
+
                        last_feeds = feeds;
 
                        redraw_feedlist(feeds);
@@ -602,3 +606,16 @@ function feed_mo(elem) {
                exception_error("feed_mo", e);
        }
 }
+
+function update_title(unread) {
+       try {
+               document.title = "Tiny Tiny RSS";
+
+               if (unread > 0)
+                       document.title += " (" + unread + ")";
+
+       } catch (e) {
+               exception_error("update_title", e);
+       }
+}
+
index 467f6c28688b2a96da03157cbfaafc18d7d23187..c217d2abfe9d1311a7d880e71546431479d6aa51 100644 (file)
@@ -24,7 +24,7 @@
 
 <html>
 <head>
-       <title>Tiny Tiny Digest</title>
+       <title>Tiny Tiny RSS</title>
        <link rel="stylesheet" type="text/css" href="digest.css?<?php echo $dt_add ?>"/>
 
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>