<commit_before>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;
	},
	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);<commit_msg>preffiltertree: hide generic document icon<commit_after>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;
	},
	getIconClass: function (item, opened) {
		return (!item || this.model.mayHaveChildren(item)) ? (opened ? "dijitFolderOpened" : "dijitFolderClosed") : "invisible";
	},
	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);
{'fraction_non_alphanumeric': 0.18336886993603413, 'fraction_numerical': 0.0018275967103259215, 'mean_word_length': 4.220985691573927, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4777414', 'n_tokens_mistral': 1246, 'n_tokens_neox': 1132, 'n_words': 224}