summaryrefslogtreecommitdiff
path: root/tt-rss.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2007-08-26 05:13:50 +0100
committerAndrew Dolgov <[email protected]>2007-08-26 05:13:50 +0100
commitd1f0c58498dbe91ebdaa59565abc1f2c1e076ad6 (patch)
treeeff3b65db994106741a87fab6cf76492f29317ec /tt-rss.js
parentbc0f07856012aa94eaea7c409e720d73f2fba0c3 (diff)
new feed action: clear articles
Diffstat (limited to 'tt-rss.js')
-rw-r--r--tt-rss.js39
1 files changed, 39 insertions, 0 deletions
diff --git a/tt-rss.js b/tt-rss.js
index 92fa161b1..54e069e78 100644
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -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;