summaryrefslogtreecommitdiff
path: root/js/PrefFeedTree.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2012-08-15 09:38:57 +0400
committerAndrew Dolgov <[email protected]>2012-08-15 09:38:57 +0400
commit5ef071e00ba62c5b66a594b55185ef87012dc40a (patch)
tree9aacfb6d676cc80b2830ec353537281e18cb6052 /js/PrefFeedTree.js
parente07f89815b88139a5b0945bd89277eb6b36e8f5a (diff)
remove old category editor
allow creating/removing categories in main feed editor
Diffstat (limited to 'js/PrefFeedTree.js')
-rw-r--r--js/PrefFeedTree.js45
1 files changed, 45 insertions, 0 deletions
diff --git a/js/PrefFeedTree.js b/js/PrefFeedTree.js
index 12c02c447..942793c76 100644
--- a/js/PrefFeedTree.js
+++ b/js/PrefFeedTree.js
@@ -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() {