1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-14 04:15:55 +00:00

allow adding/removing labels from frontend

This commit is contained in:
Andrew Dolgov
2009-01-18 15:36:50 +01:00
parent b2531a28a6
commit 1380f8eed4
5 changed files with 66 additions and 26 deletions

View File

@@ -562,11 +562,6 @@ function quickMenuGo(opid) {
return;
}
if (actid <= 0) {
alert(__("You can't unsubscribe from this kind of feed."));
return;
}
if (!actid) {
alert(__("Please select some feed first."));
return;
@@ -627,6 +622,10 @@ function quickMenuGo(opid) {
displayDlg("quickAddFilter", getActiveFeedId());
}
if (opid == "qmcAddLabel") {
addLabel();
}
if (opid == "qmcRescoreFeed") {
rescoreCurrentFeed();
}
@@ -1391,3 +1390,35 @@ function hotkey_handler(e) {
function feedsSortByUnread() {
return feeds_sort_by_unread;
}
function addLabel() {
try {
var caption = prompt(__("Please enter label caption:"), "");
if (caption != undefined) {
if (caption == "") {
alert(__("Can't create label: missing caption."));
return false;
}
var query = "backend.php?op=pref-labels&subop=add&caption=" +
param_escape(caption);
notify_progress("Loading, please wait...", true);
new Ajax.Request(query, {
onComplete: function(transport) {
updateFeedList();
} });
}
} catch (e) {
exception_error("addLabel", e);
}
}