]> git.wh0rd.org Git - tt-rss.git/commitdiff
update title of active feed in feedlist on the fly
authorAndrew Dolgov <fox@bah.spb.su>
Sat, 25 Aug 2007 07:38:18 +0000 (08:38 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Sat, 25 Aug 2007 07:38:18 +0000 (08:38 +0100)
backend.php
functions.js
functions.php

index 77323008fce5b9042d37120239a364413083f468..272daeb32d037f81cb89c6ffa8b1171f008483a4 100644 (file)
                if ($_GET["debug"]) $timing_info = print_checkpoint("20", $timing_info);
 
                print "<counters>";
-               getAllCounters($link, $omode);
+               getAllCounters($link, $omode, $feed);
                print "</counters>";
 
                if ($_GET["debug"]) $timing_info = print_checkpoint("30", $timing_info);
index 1c42df9ff1bd0805e532ffe8eba9a52bd0707255..5414e2bb878c0b551aa9bca9a97c77165eab8902 100644 (file)
@@ -596,7 +596,8 @@ function parse_counters(reply, scheduled_call) {
                        var error = elems[l].getAttribute("error");
                        var has_img = elems[l].getAttribute("hi");
                        var updated = elems[l].getAttribute("updated");
-       
+                       var title = elems[l].getAttribute("title");
+               
                        if (id == "global-unread") {
                                global_unread = ctr;
                                updateTitle();
@@ -650,6 +651,10 @@ function parse_counters(reply, scheduled_call) {
                                }
                        }
 
+                       if (feedlink && title) {
+                               feedlink.innerHTML = title;
+                       }
+
                        if (feedctr && feedu && feedr) {
 
                                if (feedu.innerHTML != ctr && id == getActiveFeedId() && scheduled_call) {
index d12120a637ebfd3e90b3e8c129ae3161889cd1f3..2aac7f3dbba414793bfa6ea5d537310ca4a6a819 100644 (file)
                        }
        }
 
-       function getAllCounters($link, $omode = "flc") {
+       function getAllCounters($link, $omode = "flc", $active_feed = false) {
 /*             getLabelCounters($link);
                getFeedCounters($link);
                getTagCounters($link);
                getGlobalCounters($link);
 
                if (strchr($omode, "l")) getLabelCounters($link);
-               if (strchr($omode, "f")) getFeedCounters($link);
+               if (strchr($omode, "f")) getFeedCounters($link, SMART_RPC_COUNTERS, $active_feed);
                if (strchr($omode, "t")) getTagCounters($link);
                if (strchr($omode, "c")) {                      
                        if (get_pref($link, 'ENABLE_FEED_CATS')) {
                        print "<counter type=\"feed\" id=\"$id\" counter=\"$count\" error=\"$last_error\"/>";           
        } */
 
-       function getFeedCounters($link, $smart_mode = SMART_RPC_COUNTERS) {
+       function getFeedCounters($link, $smart_mode = SMART_RPC_COUNTERS, $active_feed = false) {
 
                $age_qpart = getMaxAgeSubquery();
 
                                        $has_img_part = "";
                                }                               
 
-                               print "<counter type=\"feed\" id=\"$id\" counter=\"$count\" $has_img_part $error_part updated=\"$last_updated\"/>";
+                               if ($active_feed && $id == $active_feed) {
+                                       $has_title_part = "title=\"" . htmlspecialchars($line["title"]) . "\"";
+                               } else {
+                                       $has_title_part = "";
+                               }
+
+                               print "<counter type=\"feed\" id=\"$id\" counter=\"$count\" $has_img_part $error_part updated=\"$last_updated\" $has_title_part/>";
                        }
                }