diff options
author | Andrew Dolgov <[email protected]> | 2008-05-04 06:47:07 +0100 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2008-05-04 06:47:07 +0100 |
commit | 9a85081ae0dbe006b464e5985fdccd90962b5346 (patch) | |
tree | 61c9ef5c526b445df7b866b9cc7531b58bae195f /tt-rss.js | |
parent | ba7f81d8d5f8405413657b24d0c1689fd5b4c053 (diff) |
main ui: add action to rescore current feed
Diffstat (limited to 'tt-rss.js')
-rw-r--r-- | tt-rss.js | 34 |
1 files changed, 34 insertions, 0 deletions
@@ -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(); + } }); + } +} + |