2010-11-18 13:49:26 +01:00
|
|
|
dojo.provide("fox.PrefFilterTree");
|
|
|
|
|
|
|
|
dojo.require("lib.CheckBoxTree");
|
|
|
|
|
|
|
|
dojo.declare("fox.PrefFilterTree", lib.CheckBoxTree, {
|
|
|
|
_createTreeNode: function(args) {
|
|
|
|
var tnode = this.inherited(arguments);
|
|
|
|
|
|
|
|
var enabled = this.model.store.getValue(args.item, 'enabled');
|
|
|
|
var param = this.model.store.getValue(args.item, 'param');
|
|
|
|
|
|
|
|
if (param) {
|
|
|
|
param = dojo.doc.createElement('span');
|
|
|
|
param.className = (enabled != false) ? 'labelParam' : 'labelParam Disabled';
|
|
|
|
param.innerHTML = args.item.param[0];
|
|
|
|
dojo.place(param, tnode.labelNode, 'after');
|
|
|
|
}
|
|
|
|
|
|
|
|
return tnode;
|
|
|
|
},
|
|
|
|
|
|
|
|
getLabel: function(item) {
|
|
|
|
var label = item.name;
|
|
|
|
|
|
|
|
var feed = this.model.store.getValue(item, 'feed');
|
|
|
|
var inverse = this.model.store.getValue(item, 'inverse');
|
|
|
|
|
|
|
|
if (feed)
|
|
|
|
label += " (" + __("Feed:") + " " + feed + ")";
|
|
|
|
|
|
|
|
if (inverse)
|
|
|
|
label += " (" + __("Inverse") + ")";
|
|
|
|
|
|
|
|
/* if (item.param)
|
|
|
|
label = "<span class=\"labelFixedLength\">" + label +
|
|
|
|
"</span>" + item.param[0]; */
|
|
|
|
|
|
|
|
return label;
|
|
|
|
},
|
2010-11-19 16:38:25 +01:00
|
|
|
getIconClass: function (item, opened) {
|
|
|
|
return (!item || this.model.mayHaveChildren(item)) ? (opened ? "dijitFolderOpened" : "dijitFolderClosed") : "invisible";
|
|
|
|
},
|
2010-11-18 13:49:26 +01:00
|
|
|
getLabelClass: function (item, opened) {
|
|
|
|
var enabled = this.model.store.getValue(item, 'enabled');
|
|
|
|
return (enabled != false) ? "dijitTreeLabel labelFixedLength" : "dijitTreeLabel labelFixedLength Disabled";
|
|
|
|
},
|
|
|
|
getRowClass: function (item, opened) {
|
|
|
|
return (!item.error || item.error == '') ? "dijitTreeRow" :
|
|
|
|
"dijitTreeRow Error";
|
|
|
|
},
|
|
|
|
onClick: function (item) {
|
|
|
|
var id = String(item.id);
|
|
|
|
var bare_id = id.substr(id.indexOf(':')+1);
|
|
|
|
|
|
|
|
if (id.match('FILTER:')) {
|
|
|
|
editFilter(bare_id, event);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|