]> git.wh0rd.org Git - tt-rss.git/commitdiff
main ui: add action to rescore current feed
authorAndrew Dolgov <fox@madoka.spb.ru>
Sun, 4 May 2008 05:47:07 +0000 (06:47 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Sun, 4 May 2008 05:47:07 +0000 (06:47 +0100)
tt-rss.js
tt-rss.php

index d127e03d29a3c0cd99a3ea965c2c3cb3997a5af2..632330311466d1784a08cfc30e5e948f92e6f68b 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -520,6 +520,10 @@ function quickMenuGo(opid) {
                        displayDlg("quickAddFilter", getActiveFeedId());
                }
 
+               if (opid == "qmcRescoreFeed") {
+                       rescoreCurrentFeed();
+               }
+
        } catch (e) {
                exception_error("quickMenuGo", e);
        }
@@ -857,3 +861,33 @@ function adjustArticleScore(id, score) {
                exception_error(e, "adjustArticleScore");
        }
 }      
+
+function rescoreCurrentFeed() {
+
+       var actid = getActiveFeedId();
+
+       if (activeFeedIsCat() || actid < 0 || tagsAreDisplayed()) {
+               alert(__("You can't rescore this kind of feed."));
+               return;
+       }       
+
+       if (!actid) {
+               alert(__("Please select some feed first."));
+               return;
+       }
+
+       var fn = getFeedName(actid);
+       var pr = __("Rescore articls in %s?").replace("%s", fn);
+
+       if (confirm(pr)) {
+               notify_progress("Rescoring articles...");
+
+               var query = "backend.php?op=pref-feeds&subop=rescore&quiet=1&ids=" + actid;
+
+               new Ajax.Request(query, {
+               onComplete: function(transport) {
+                       viewCurrentFeed();
+               } });
+       }
+}
+
index e491cc717131975c1151c70e0ecfd703be41ef67..37728aa739286e8811e229cc98ebe945d0c09e9b 100644 (file)
@@ -145,6 +145,7 @@ window.onload = init;
                                        <option value="qmcAddFeed"><?php echo __('&nbsp;&nbsp;Subscribe to feed') ?></option>
                                        <option value="qmcEditFeed"><?php echo __('&nbsp;&nbsp;Edit this feed') ?></option>
                                        <!-- <option value="qmcClearFeed"><?php echo __('&nbsp;&nbsp;Clear articles') ?></option> -->
+                                       <option value="qmcRescoreFeed"><?php echo __('&nbsp;&nbsp;Rescore feed') ?></option>
                                        <option value="qmcRemoveFeed"><?php echo __('&nbsp;&nbsp;Unsubscribe') ?></option>
                                        <option disabled>--------</option>
                                        <option style="color : #5050aa" disabled><?php echo __('All feeds:') ?></option>