main ui: add action to rescore current feed

master
Andrew Dolgov 17 years ago
parent ba7f81d8d5
commit 9a85081ae0

@ -520,6 +520,10 @@ function quickMenuGo(opid) {
displayDlg("quickAddFilter", getActiveFeedId()); displayDlg("quickAddFilter", getActiveFeedId());
} }
if (opid == "qmcRescoreFeed") {
rescoreCurrentFeed();
}
} catch (e) { } catch (e) {
exception_error("quickMenuGo", e); exception_error("quickMenuGo", e);
} }
@ -857,3 +861,33 @@ function adjustArticleScore(id, score) {
exception_error(e, "adjustArticleScore"); 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();
} });
}
}

@ -145,6 +145,7 @@ window.onload = init;
<option value="qmcAddFeed"><?php echo __('&nbsp;&nbsp;Subscribe to feed') ?></option> <option value="qmcAddFeed"><?php echo __('&nbsp;&nbsp;Subscribe to feed') ?></option>
<option value="qmcEditFeed"><?php echo __('&nbsp;&nbsp;Edit this 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="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 value="qmcRemoveFeed"><?php echo __('&nbsp;&nbsp;Unsubscribe') ?></option>
<option disabled>--------</option> <option disabled>--------</option>
<option style="color : #5050aa" disabled><?php echo __('All feeds:') ?></option> <option style="color : #5050aa" disabled><?php echo __('All feeds:') ?></option>

Loading…
Cancel
Save