if ($subop == "download") {
$stage = (int) $_REQUEST["stage"];
$cid = db_escape_string($_REQUEST["cid"]);
- $amount = (int) $_REQUEST["amount"];
- $unread_only = db_escape_string($_REQUEST["unread_only"]);
+ //$amount = (int) $_REQUEST["amount"];
+ //$unread_only = db_escape_string($_REQUEST["unread_only"]);
+ //if (!$amount) $amount = 50;
- if (!$amount) $amount = 50;
+ $amount = 100;
+ $unread_only = true;
print "<rpc-reply>";
resize_headlines();
}
- if (opid == "qmcDownload") {
+/* if (opid == "qmcDownload") {
displayDlg("offlineDownload");
return;
- }
+ } */
if (opid == "qmcResetCats") {
}
}
- if (keycode == 68 && shift_key) { // D
+/* if (keycode == 68 && shift_key) { // D
initiate_offline_download();
return false;
}
if (keycode == 68) { // d
displayDlg("offlineDownload");
return false;
- }
+ } */
if (keycode == 87) { // w
feeds_sort_by_unread = !feeds_sort_by_unread;
db.execute("CREATE TABLE if not exists articles (id integer, feed_id integer, title text, link text, guid text, updated text, content text, tags text, unread text, marked text, added text)");
- var qmcDownload = document.getElementById("qmcDownload");
- if (qmcDownload) Element.show(qmcDownload);
+ window.setTimeout("update_offline_data(0)", 100);
}
[id, title, has_icon]);
}
- window.setTimeout("initiate_offline_download("+(stage+1)+")", 50);
+ window.setTimeout("update_offline_data("+(stage+1)+")", 50);
} else {
var articles = transport.responseXML.getElementsByTagName("article");
}
if (articles_found > 0) {
- window.setTimeout("initiate_offline_download("+(stage+1)+")", 50);
+ window.setTimeout("update_offline_data("+(stage+1)+")", 50);
} else {
- notify_info("All done.");
- closeInfoBox();
+// notify_info("All done.");
+// closeInfoBox();
}
}
}
}
-function initiate_offline_download(stage, caller) {
+function update_offline_data(stage) {
try {
if (!stage) stage = 0;
- if (caller) caller.disabled = true;
- notify_progress("Loading, please wait... (" + stage +")", true);
+ debug("update_offline_data: stage " + stage);
+
+// notify_progress("Loading, please wait... (" + stage +")", true);
var query = "backend.php?op=rpc&subop=download&stage=" + stage;
query = query + "&cid=" + offline_dl_max_id;
}
- if (document.getElementById("download_ops_form")) {
- query = query + "&" + Form.serialize("download_ops_form");
- }
-
new Ajax.Request(query, {
onComplete: function(transport) {
offline_download_parse(stage, transport);