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 + "" + "
" + - "" + + "" + "" + feed.unread + "" + "
" + ""; @@ -267,7 +295,7 @@ function add_headline_entry(article, feed) { "
" + "" + "" + - "" + + "" + "
" + "" + @@ -390,8 +418,12 @@ function parse_headlines(transport, replace) { $('headlines-content').appendChild(pr); } else { $('headlines-content').innerHTML += "
  • " + - "
    " + - __("More articles...") + "
  • "; + "
    " + + "" + + __("Mark as read") + " | " + + "" + + __("Load more...") + "" + + "
    "; } new Effect.Appear('headlines-content');