]> git.wh0rd.org - tt-rss.git/blobdiff - js/PrefFeedTree.js
remove old category editor
[tt-rss.git] / js / PrefFeedTree.js
index 12c02c4479d037cf9daa7e22497cf2159f353d7a..942793c768b4d0f798d8186819365a6c8aaa973d 100644 (file)
@@ -35,6 +35,51 @@ dojo.declare("fox.PrefFeedTree", lib.CheckBoxTree, {
                        dojo.place(param, tnode.labelNode, 'after');
                }
 
+               var id = args.item.id[0];
+               var bare_id = parseInt(id.substr(id.indexOf(':')+1));
+
+               if (id.match("CAT:") && bare_id > 0) {
+                       var menu = new dijit.Menu();
+                       menu.row_id = bare_id;
+                       menu.item = args.item;
+
+                       menu.addChild(new dijit.MenuItem({
+                               label: __("Edit category"),
+                               onClick: function() {
+                                       editCat(this.getParent().row_id, this.getParent().item, null);
+                               }}));
+
+
+                       menu.addChild(new dijit.MenuItem({
+                               label: __("Remove category"),
+                               onClick: function() {
+                                       removeCategory(this.getParent().row_id, this.getParent().item);
+                               }}));
+
+                       menu.bindDomNode(tnode.domNode);
+                       tnode._menu = menu;
+               } else if (id.match("FEED:")) {
+                       var menu = new dijit.Menu();
+                       menu.row_id = bare_id;
+                       menu.item = args.item;
+
+                       menu.addChild(new dijit.MenuItem({
+                               label: __("Edit feed"),
+                               onClick: function() {
+                                       editFeed(this.getParent().row_id);
+                               }}));
+
+                       menu.addChild(new dijit.MenuItem({
+                               label: __("Unsubscribe"),
+                               onClick: function() {
+                                       unsubscribeFeed(this.getParent().row_id, this.getParent().item.name);
+                               }}));
+
+                       menu.bindDomNode(tnode.domNode);
+                       tnode._menu = menu;
+
+               }
+
                return tnode;
        },
        onDndDrop: function() {