From: Andrew Dolgov Date: Mon, 20 Aug 2007 12:58:11 +0000 (+0100) Subject: rpc mark/pub return proper counters, rework all_counters_callback X-Git-Tag: 1.2.14~7 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=36e05046e05df61687627fb7f1241b51fb6b568d;p=tt-rss.git rpc mark/pub return proper counters, rework all_counters_callback --- diff --git a/functions.js b/functions.js index 041311df..a3330206 100644 --- a/functions.js +++ b/functions.js @@ -782,11 +782,11 @@ function parse_counters_reply(xmlhttp, scheduled_call) { return fatalError(error_code, error_msg); } - var counters = reply.firstChild; + var counters = reply.getElementsByTagName("counters")[0]; parse_counters(counters, scheduled_call); - var runtime_info = counters.nextSibling; + var runtime_info = reply.getElementsByTagName("runtime-info")[0]; parse_runtime_info(runtime_info); diff --git a/modules/backend-rpc.php b/modules/backend-rpc.php index 3303b25f..3a30543d 100644 --- a/modules/backend-rpc.php +++ b/modules/backend-rpc.php @@ -68,7 +68,13 @@ $result = db_query($link, "UPDATE ttrss_user_entries SET marked = $mark WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]); - print "$id"; + print ""; + getGlobalCounters($link); + getLabelCounters($link); + if (get_pref($link, 'ENABLE_FEED_CATS')) { + getCategoryCounters($link); + } + print ""; } @@ -87,7 +93,13 @@ $result = db_query($link, "UPDATE ttrss_user_entries SET published = $pub WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]); - print "$id"; + print ""; + getGlobalCounters($link); + getLabelCounters($link); + if (get_pref($link, 'ENABLE_FEED_CATS')) { + getCategoryCounters($link); + } + print ""; } diff --git a/viewfeed.js b/viewfeed.js index a9a413ac..b1fbdd80 100644 --- a/viewfeed.js +++ b/viewfeed.js @@ -440,6 +440,8 @@ function toggleMark(id) { //new Ajax.Request(query); */ + debug(query); + xmlhttp_rpc.open("GET", query, true); xmlhttp_rpc.onreadystatechange=all_counters_callback; xmlhttp_rpc.send(null);