rpc mark/pub return proper counters, rework all_counters_callback

master
Andrew Dolgov 18 years ago
parent 2fe69e2292
commit 36e05046e0

@ -782,11 +782,11 @@ function parse_counters_reply(xmlhttp, scheduled_call) {
return fatalError(error_code, error_msg); return fatalError(error_code, error_msg);
} }
var counters = reply.firstChild; var counters = reply.getElementsByTagName("counters")[0];
parse_counters(counters, scheduled_call); parse_counters(counters, scheduled_call);
var runtime_info = counters.nextSibling; var runtime_info = reply.getElementsByTagName("runtime-info")[0];
parse_runtime_info(runtime_info); parse_runtime_info(runtime_info);

@ -68,7 +68,13 @@
$result = db_query($link, "UPDATE ttrss_user_entries SET marked = $mark $result = db_query($link, "UPDATE ttrss_user_entries SET marked = $mark
WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]); WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]);
print "<rpc-reply><mark>$id</mark></rpc-reply>"; print "<rpc-reply><counters>";
getGlobalCounters($link);
getLabelCounters($link);
if (get_pref($link, 'ENABLE_FEED_CATS')) {
getCategoryCounters($link);
}
print "</counters></rpc-reply>";
} }
@ -87,7 +93,13 @@
$result = db_query($link, "UPDATE ttrss_user_entries SET published = $pub $result = db_query($link, "UPDATE ttrss_user_entries SET published = $pub
WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]); WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]);
print "<rpc-reply><pub>$id</pub></rpc-reply>"; print "<rpc-reply><counters>";
getGlobalCounters($link);
getLabelCounters($link);
if (get_pref($link, 'ENABLE_FEED_CATS')) {
getCategoryCounters($link);
}
print "</counters></rpc-reply>";
} }

@ -440,6 +440,8 @@ function toggleMark(id) {
//new Ajax.Request(query); */ //new Ajax.Request(query); */
debug(query);
xmlhttp_rpc.open("GET", query, true); xmlhttp_rpc.open("GET", query, true);
xmlhttp_rpc.onreadystatechange=all_counters_callback; xmlhttp_rpc.onreadystatechange=all_counters_callback;
xmlhttp_rpc.send(null); xmlhttp_rpc.send(null);

Loading…
Cancel
Save