diff --git a/digest.js b/digest.js index 7a1e7d2ec..ce9c325b5 100644 --- a/digest.js +++ b/digest.js @@ -33,6 +33,32 @@ function catchup_feed(feed_id, callback) { } } +function catchup_visible_articles(callback) { + try { + var elems = $("headlines-content").getElementsByTagName("LI"); + var ids = []; + + for (var i = 0; i < elems.length; i++) { + if (elems[i].id && elems[i].id.match("A-")) { + ids.push(elems[i].id.replace("A-", "")); + } + } + + var query = "?op=rpc&subop=catchupSelected" + + "&cmode=0&ids=" + param_escape(ids); + + new Ajax.Request("backend.php", { + parameters: query, + onComplete: function(transport) { + if (callback) callback(transport); + + viewfeed(_active_feed_id, 0); + } }); + + } catch (e) { + exception_error("catchup_visible_articles", e); + } +} function catchup_article(article_id, callback) { try { @@ -243,7 +269,9 @@ function add_feed_entry(feed) { icon_part + "" + feed.title + "" + "