summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2008-05-20 13:52:38 +0100
committerAndrew Dolgov <[email protected]>2008-05-20 13:52:38 +0100
commit5aaf9b34e43c90dfc3b95731d71f4d598251a321 (patch)
tree08bb2c992336585f09bbdaa4f74692412323b6e4
parentd6586c1d9840f9e1c5c1c9b914b2fccd64f8fca0 (diff)
request counters asynchronously after viewfeed has succeeded but w/o counters block
-rw-r--r--backend.php4
-rw-r--r--feedlist.js42
-rw-r--r--viewfeed.js3
3 files changed, 30 insertions, 19 deletions
diff --git a/backend.php b/backend.php
index 20411cc0a..ba7cbdb0b 100644
--- a/backend.php
+++ b/backend.php
@@ -288,11 +288,11 @@
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);
diff --git a/feedlist.js b/feedlist.js
index 562b2ad9b..df30a6107 100644
--- a/feedlist.js
+++ b/feedlist.js
@@ -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);
+ }
+}
diff --git a/viewfeed.js b/viewfeed.js
index 6f6a530a5..16f96216a 100644
--- a/viewfeed.js
+++ b/viewfeed.js
@@ -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) {