From: Andrew Dolgov Date: Sun, 4 May 2008 05:47:07 +0000 (+0100) Subject: main ui: add action to rescore current feed X-Git-Tag: 1.2.23-final~153 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=9a85081ae0dbe006b464e5985fdccd90962b5346;p=tt-rss.git main ui: add action to rescore current feed --- diff --git a/tt-rss.js b/tt-rss.js index d127e03d..63233031 100644 --- 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(); + } }); + } +} + diff --git a/tt-rss.php b/tt-rss.php index e491cc71..37728aa7 100644 --- a/tt-rss.php +++ b/tt-rss.php @@ -145,6 +145,7 @@ window.onload = init; +