var active_post_id = false;
-var _catchup_callback_func = false;
var last_article_view = false;
var active_real_feed_id = false;
}
}
+function catchup_callback2(transport, callback) {
+ try {
+ debug("catchup_callback2 " + transport + ", " + callback);
+ notify("");
+ all_counters_callback2(transport);
+ if (callback) {
+ setTimeout(callback, 10);
+ }
+ } catch (e) {
+ exception_error("catchup_callback2", e);
+ }
+}
+
function headlines_callback() {
if (xmlhttp.readyState == 4) {
debug("headlines_callback");
try {
- if (!xmlhttp_ready(xmlhttp_rpc)) {
- printLockingError();
- return;
- }
-
var query = "backend.php?op=rpc&id=" + id + "&subop=mark";
query = query + "&afid=" + getActiveFeedId();
if (!client_only) {
debug(query);
- xmlhttp_rpc.open("GET", query, true);
- xmlhttp_rpc.onreadystatechange=all_counters_callback;
- xmlhttp_rpc.send(null);
+// xmlhttp_rpc.open("GET", query, true);
+// xmlhttp_rpc.onreadystatechange=all_counters_callback;
+// xmlhttp_rpc.send(null);
+
+ new Ajax.Request(query, {
+ onComplete: function(transport) {
+ all_counters_callback2(transport);
+ } });
+
}
} catch (e) {
try {
- if (!xmlhttp_ready(xmlhttp_rpc)) {
- printLockingError();
- return;
- }
-
var query = "backend.php?op=rpc&id=" + id + "&subop=publ";
query = query + "&afid=" + getActiveFeedId();
new Ajax.Request(query); */
if (!client_only) {
- xmlhttp_rpc.open("GET", query, true);
- xmlhttp_rpc.onreadystatechange=all_counters_callback;
- xmlhttp_rpc.send(null);
+ new Ajax.Request(query, {
+ onComplete: function(transport) {
+ all_counters_callback2(transport);
+ } });
}
} catch (e) {
function toggleUnread(id, cmode) {
try {
- if (!xmlhttp_ready(xmlhttp_rpc)) {
- printLockingError();
- return;
- }
var row = document.getElementById("RROW-" + id);
if (row) {
var query = "backend.php?op=rpc&subop=catchupSelected&ids=" +
param_escape(id) + "&cmode=" + param_escape(cmode);
- notify_progress("Loading, please wait...");
+// notify_progress("Loading, please wait...");
- xmlhttp_rpc.open("GET", query, true);
- xmlhttp_rpc.onreadystatechange=all_counters_callback;
- xmlhttp_rpc.send(null);
+ new Ajax.Request(query, {
+ onComplete: function(transport) {
+ all_counters_callback2(transport);
+ } });
}
function selectionToggleUnread(cdm_mode, set_state, callback_func, no_error) {
try {
- if (!xmlhttp_ready(xmlhttp_rpc)) {
+/* if (!xmlhttp_ready(xmlhttp_rpc)) {
printLockingError();
return;
- }
+ } */
var rows;
var query = "backend.php?op=rpc&subop=catchupSelected&ids=" +
param_escape(rows.toString()) + "&cmode=" + cmode;
- _catchup_callback_func = callback_func;
+// _catchup_callback_func = callback_func;
+
+ debug(callback_func);
notify_progress("Loading, please wait...");
- xmlhttp_rpc.open("GET", query, true);
+/* xmlhttp_rpc.open("GET", query, true);
xmlhttp_rpc.onreadystatechange=catchup_callback;
- xmlhttp_rpc.send(null);
+ xmlhttp_rpc.send(null); */
+
+ new Ajax.Request(query, {
+ onComplete: function(transport) {
+ catchup_callback2(transport, callback_func);
+ } });
}
function selectionToggleMarked(cdm_mode) {
try {
- if (!xmlhttp_ready(xmlhttp_rpc)) {
- printLockingError();
- return;
- }
var rows;
query = query + "&afid=" + getActiveFeedId();
- if (tagsAreDisplayed()) {
+/* if (tagsAreDisplayed()) {
query = query + "&omode=tl";
} else {
query = query + "&omode=flc";
- }
+ } */
+
+ query = query + "&omode=lc";
- xmlhttp_rpc.open("GET", query, true);
- xmlhttp_rpc.onreadystatechange=all_counters_callback;
- xmlhttp_rpc.send(null);
+ new Ajax.Request(query, {
+ onComplete: function(transport) {
+ all_counters_callback2(transport);
+ } });
}
function selectionTogglePublished(cdm_mode) {
try {
- if (!xmlhttp_ready(xmlhttp_rpc)) {
- printLockingError();
- return;
- }
var rows;
query = query + "&afid=" + getActiveFeedId();
- if (tagsAreDisplayed()) {
+/* if (tagsAreDisplayed()) {
query = query + "&omode=tl";
} else {
query = query + "&omode=flc";
- }
+ } */
+
+ query = query + "&omode=lc";
- xmlhttp_rpc.open("GET", query, true);
- xmlhttp_rpc.onreadystatechange=all_counters_callback;
- xmlhttp_rpc.send(null);
+ new Ajax.Request(query, {
+ onComplete: function(transport) {
+ all_counters_callback2(transport);
+ } });
}
debug("cdmWatchdog, ids= " + ids.toString());
- if (ids.length > 0 && xmlhttp_ready(xmlhttp_rpc)) {
+ if (ids.length > 0) {
for (var i = 0; i < ids.length; i++) {
var e = document.getElementById("RROW-" + ids[i]);
var query = "backend.php?op=rpc&subop=catchupSelected&ids=" +
param_escape(ids.toString()) + "&cmode=0";
- xmlhttp_rpc.open("GET", query, true);
- xmlhttp_rpc.onreadystatechange=all_counters_callback;
- xmlhttp_rpc.send(null);
+ new Ajax.Request(query, {
+ onComplete: function(transport) {
+ all_counters_callback2(transport);
+ } });
}