]> git.wh0rd.org Git - tt-rss.git/commitdiff
request counters asynchronously after viewfeed has succeeded but w/o counters block
authorAndrew Dolgov <fox@bah.spb.su>
Tue, 20 May 2008 12:52:38 +0000 (13:52 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Tue, 20 May 2008 12:52:38 +0000 (13:52 +0100)
backend.php
feedlist.js
viewfeed.js

index 20411cc0ae17d3aa8bb731c57985a81b8e4d2338..ba7cbdb0b33326f4063d915196fdb1d550a94d23 100644 (file)
 
                        if ($_GET["debug"]) $timing_info = print_checkpoint("20", $timing_info);
 
-                       if (time() - $_SESSION["get_all_counters_stamp"] > 300) {
+/*                     if (time() - $_SESSION["get_all_counters_stamp"] > 300) {
                                print "<counters>";
                                getAllCounters($link, $omode, $feed);
                                print "</counters>";
-                       }
+                       } */
 
                        if ($_GET["debug"]) $timing_info = print_checkpoint("30", $timing_info);
 
index 562b2ad9b55aa443839513a5740f3e1e287dcb57..df30a6107b213ffbb85e74aa5e93506039b8f5bc 100644 (file)
@@ -210,22 +210,7 @@ function viewfeed(feed, subop, is_cat, subop_param, skip_history, offset) {
 
                        f.innerHTML = cache_find_param(cache_prefix + feed, unread_ctr);
 
-                       var query = "backend.php?op=rpc&subop=getAllCounters";
-
-                       if (tagsAreDisplayed()) {
-                               query = query + "&omode=tl";
-                       } else {
-                               query = query + "&omode=flc";
-                       }
-
-                       new Ajax.Request(query, {
-                               onComplete: function(transport) { 
-                                       try {
-                                               all_counters_callback2(transport);
-                                       } catch (e) {
-                                               exception_error("viewfeed/getcounters", e);
-                                       }
-                               } });
+                       request_counters();
 
                } else {
 
@@ -510,3 +495,28 @@ function mouse_up_handler(e) {
                exception_error("mouse_move_handler", e);
        }
 }
+
+function request_counters() {
+
+       try {
+               var query = "backend.php?op=rpc&subop=getAllCounters";
+
+               if (tagsAreDisplayed()) {
+                       query = query + "&omode=tl";
+               } else {
+                       query = query + "&omode=flc";
+               }
+
+               new Ajax.Request(query, {
+                       onComplete: function(transport) { 
+                               try {
+                                       all_counters_callback2(transport);
+                               } catch (e) {
+                                       exception_error("viewfeed/getcounters", e);
+                               }
+                       } });
+
+       } catch (e) {
+               exception_error("request_counters", e);
+       }
+}
index 6f6a530a55d7e2604e341b9085607eb988522a44..16f96216a4fefded7f1fcd1b4661b5623507d14b 100644 (file)
@@ -187,7 +187,8 @@ function headlines_callback2(transport, active_feed_id, is_cat, feed_cur_page) {
                                debug("parsing piggybacked counters: " + counters);
                                parse_counters(counters, false);
                        } else {
-                               debug("counters container not found in reply");
+                               debug("counters container not found in reply, requesting...");
+                               request_counters();
                        }
        
                        if (runtime_info) {