diff options
author | Andrew Dolgov <[email protected]> | 2007-08-26 05:13:50 +0100 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2007-08-26 05:13:50 +0100 |
commit | d1f0c58498dbe91ebdaa59565abc1f2c1e076ad6 (patch) | |
tree | eff3b65db994106741a87fab6cf76492f29317ec /tt-rss.js | |
parent | bc0f07856012aa94eaea7c409e720d73f2fba0c3 (diff) |
new feed action: clear articles
Diffstat (limited to 'tt-rss.js')
-rw-r--r-- | tt-rss.js | 39 |
1 files changed, 39 insertions, 0 deletions
@@ -460,7 +460,32 @@ function quickMenuGo(opid) { return; } + + if (opid == "qmcClearFeed") { + var actid = getActiveFeedId(); + + if (!actid) { + alert(__("Please select some feed first.")); + return; + } + + if (activeFeedIsCat() || actid < 0) { + alert(__("You can't clear this type of feed.")); + return; + } + + var fn = getFeedName(actid); + + var pr = __("Remove all (except starred) stored articles for %s?").replace("%s", fn); + + if (confirm(pr)) { + clearFeedArticles(actid); + } + + return; + } + if (opid == "qmcUpdateFeeds") { scheduleFeedUpdate(true); return; @@ -500,6 +525,20 @@ function qfdDelete(feed_id) { return false; } +function clearFeedArticles(feed_id) { + + notify_progress("Clearing feed..."); + + var query = "backend.php?op=pref-feeds&quiet=1&subop=clear&id=" + feed_id; + + new Ajax.Request(query, { + onComplete: function(transport) { + dlg_frefresh_callback(transport, feed_id); + } }); + + return false; +} + function updateFeedTitle(t) { active_title_text = t; |