]> git.wh0rd.org Git - tt-rss.git/commitdiff
add manual purge prototype
authorAndrew Dolgov <fox@madoka.spb.ru>
Thu, 18 Oct 2007 05:06:20 +0000 (06:06 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Thu, 18 Oct 2007 05:06:20 +0000 (06:06 +0100)
modules/pref-feeds.php
prefs.js

index b8671c4ee22b018b2c57375a2249e16b83547264..6abf5d43f24b08fc00942360d2e046a66edd6c98 100644 (file)
        
                        print "</table>";
 
-                       print "<p><span id=\"feedOpToolbar\">";
+                       print "<p>";
 
                        print "<select id=\"feedActionChooser\" onchange=\"feedActionChange()\">
                                <option value=\"facDefault\" selected>".__('Actions...')."</option>
                                <option disabled>--------</option>
                                <option style=\"color : #5050aa\" disabled>".__('Selection:')."</option>
                                <option value=\"facEdit\">&nbsp;&nbsp;".__('Edit')."</option>
-                               <option value=\"facPurge\">&nbsp;&nbsp;".__('Purge')."</option>
+                               <option value=\"facPurge\">&nbsp;&nbsp;".__('Manual purge')."</option>
                                <option value=\"facClear\">&nbsp;&nbsp;".__('Clear feed data')."</option>
                                <option value=\"facUnsubscribe\">&nbsp;&nbsp;".__('Unsubscribe')."</option>";
 
 
                                print "</select>";
 
+                               print "<span id=\"feedOpToolbar\">";
+
                        /* print "<input type=\"submit\" class=\"button\" disabled=\"true\"
                                onclick=\"javascript:editSelectedFeed()\" value=\"".__('Edit')."\">
                        <input type=\"submit\" class=\"button\" disabled=\"true\"
 
                        if (get_pref($link, 'ENABLE_FEED_CATS')) {
 
-                               print "&nbsp;|&nbsp;" . __('Selection:');                               
+                               print "&nbsp;|&nbsp;" . __('Selection:') . " ";
 
                                print_feed_cat_select($link, "sfeed_set_fcat", "", "disabled");
 
                                
                        print "</span>";
 
-                       if (get_pref($link, 'ENABLE_FEED_CATS')) {
+//                     if (get_pref($link, 'ENABLE_FEED_CATS')) {
 
 /*                             print " <input type=\"submit\" class=\"button\"
                                        onclick=\"javascript:editFeedCats()\" value=\"".
 
 #                              print "&nbsp;|&nbsp;";                          
 
-                               }
+//                             }
                } else {
 
 //                     print "<p>No feeds defined.</p>";
index 3d95f01c3f840bf1884d2e3618e3e61cb8712729..ab85bcad6400c8ae25c07ad1a679dc9561b89e66 100644 (file)
--- a/prefs.js
+++ b/prefs.js
@@ -700,6 +700,42 @@ function clearSelectedFeeds() {
        return false;
 }
 
+function purgeSelectedFeeds() {
+
+       if (!xmlhttp_ready(xmlhttp)) {
+               printLockingError();
+               return
+       }
+
+       var sel_rows = getSelectedFeeds();
+
+       if (sel_rows.length > 0) {
+
+               var pr = prompt(__("How many days of articles to keep (0 - use default)?"), "0");
+
+               if (pr != undefined) {
+                       notify_progress("Purging selected feed...");
+
+                       var query = "backend.php?op=rpc&subop=purge&ids="+
+                               param_escape(sel_rows.toString()) + "&days=" + pr;
+
+                       debug(query);
+
+                       new Ajax.Request(query, {
+                               onComplete: function(transport) {
+                                       notify('');
+                               } });
+               }
+
+       } else {
+
+               alert(__("No feeds are selected."));
+
+       }
+       
+       return false;
+}
+
 function removeSelectedFeedCats() {
 
        if (!xmlhttp_ready(xmlhttp)) {
@@ -1840,6 +1876,10 @@ function feedActionGo(op) {
                        purgeSelectedFeeds();
                }
 
+               if (op == "facEditCats") {
+                       editFeedCats();
+               }
+
                if (op == "facUnsubscribe") {
                        removeSelectedFeeds();
                }