summaryrefslogtreecommitdiff
path: root/tt-rss.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2009-01-18 15:36:50 +0100
committerAndrew Dolgov <[email protected]>2009-01-18 15:36:50 +0100
commit1380f8eed4015a2759f9f49e9c90145c464ecd0c (patch)
tree9d06a0c84920ea6491cb04953ecd904d23dae48d /tt-rss.js
parentb2531a28a63fe23ddb0d0c518f8405d4d5e4eb25 (diff)
allow adding/removing labels from frontend
Diffstat (limited to 'tt-rss.js')
-rw-r--r--tt-rss.js41
1 files changed, 36 insertions, 5 deletions
diff --git a/tt-rss.js b/tt-rss.js
index fba1158f0..9757639b3 100644
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -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);
+ }
+}
+
+