|
|
@ -24,6 +24,7 @@ var store = false;
|
|
|
|
var localServer = false;
|
|
|
|
var localServer = false;
|
|
|
|
var db = false;
|
|
|
|
var db = false;
|
|
|
|
var download_progress_last = 0;
|
|
|
|
var download_progress_last = 0;
|
|
|
|
|
|
|
|
var offline_dl_max_id = 0;
|
|
|
|
|
|
|
|
|
|
|
|
function activeFeedIsCat() {
|
|
|
|
function activeFeedIsCat() {
|
|
|
|
return _active_feed_is_cat;
|
|
|
|
return _active_feed_is_cat;
|
|
|
@ -1570,39 +1571,48 @@ function offline_download_parse(stage, transport) {
|
|
|
|
if (a) {
|
|
|
|
if (a) {
|
|
|
|
db.execute("DELETE FROM articles WHERE id = ?", [a.id]);
|
|
|
|
db.execute("DELETE FROM articles WHERE id = ?", [a.id]);
|
|
|
|
db.execute("INSERT INTO articles "+
|
|
|
|
db.execute("INSERT INTO articles "+
|
|
|
|
"(id, feed_id, title, link, guid, updated, content, unread, marked) "+
|
|
|
|
"(id, feed_id, title, link, guid, updated, content, "+
|
|
|
|
"VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)",
|
|
|
|
"unread, marked, tags) "+
|
|
|
|
|
|
|
|
"VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
|
|
|
|
[a.id, a.feed_id, a.title, a.link, a.guid, a.updated,
|
|
|
|
[a.id, a.feed_id, a.title, a.link, a.guid, a.updated,
|
|
|
|
a.content, a.unread, a.marked]);
|
|
|
|
a.content, a.unread, a.marked, a.tags]);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (articles_found > 0) {
|
|
|
|
if (articles_found > 0) {
|
|
|
|
window.setTimeout("initiate_offline_download("+(stage+1)+")", 50);
|
|
|
|
window.setTimeout("initiate_offline_download("+(stage+1)+")", 50);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
notify_info("All done.");
|
|
|
|
|
|
|
|
closeInfoBox();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
notify_info("All done.");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (e) {
|
|
|
|
} catch (e) {
|
|
|
|
exception_error("offline_download_parse", e);
|
|
|
|
exception_error("offline_download_parse", e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function initiate_offline_download(stage) {
|
|
|
|
function initiate_offline_download(stage, caller) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
|
|
if (!stage) stage = 0;
|
|
|
|
if (!stage) stage = 0;
|
|
|
|
|
|
|
|
if (caller) caller.disabled = true;
|
|
|
|
|
|
|
|
|
|
|
|
notify_progress("Loading, please wait... (" + stage +")", true);
|
|
|
|
notify_progress("Loading, please wait... (" + stage +")", true);
|
|
|
|
|
|
|
|
|
|
|
|
var query = "backend.php?op=rpc&subop=download&stage=" + stage;
|
|
|
|
var query = "backend.php?op=rpc&subop=download&stage=" + stage;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (stage == 0) {
|
|
|
|
var rs = db.execute("SELECT MAX(id) FROM articles");
|
|
|
|
var rs = db.execute("SELECT MAX(id) FROM articles");
|
|
|
|
if (rs.isValidRow()) {
|
|
|
|
if (rs.isValidRow() && rs.field(0)) {
|
|
|
|
query = query + "&cid=" + rs.field(0);
|
|
|
|
offline_dl_max_id = rs.field(0);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (offline_dl_max_id) {
|
|
|
|
|
|
|
|
query = query + "&cid=" + offline_dl_max_id;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (document.getElementById("download_ops_form")) {
|
|
|
|
if (document.getElementById("download_ops_form")) {
|
|
|
|