FilterEditor.js revision d051e6ec673461c44fca5836dd9333d639249d21
/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2015 ForgeRock AS. All rights reserved.
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*/
/*global define, window, $, _ , Handlebars*/
data: {
config: {
},
showSubmitButton: true
},
events: {
"change .expressionTree :input": "updateNodeValue",
"click .expressionTree .add-btn": "addNode",
"click .expressionTree .remove-btn": "removeNode"
},
getExpressionContext: function (e) {
e.preventDefault();
var objectPath = _.map(
function(li) {
}
).reverse(),
previousNode = null,
previousNode = node;
}
});
},
removeNode: function (e) {
var context = this.getExpressionContext(e);
context.parent.children = _.reject(context.parent.children, function (c) { return c === context.current; });
} else {
return this.removeNode(e);
}
} else {
}
this.renderExpressionTree();
},
addNode: function (e) {
var context = this.getExpressionContext(e),
this.renderExpressionTree();
},
updateNodeValue: function (e) {
var context = this.getExpressionContext(e),
redrawContainer = false;
redrawContainer = true;
}
} else {
}
node.extensible = {
rule: "1.2.840.113556.1.4.803",
};
node.extensible = {
rule: "1.2.840.113556.1.4.804",
};
} else {
delete node.extensible;
}
}
}
} else {
}
if (redrawContainer) {
this.renderExpressionTree();
} else {
}
},
renderExpressionTree: function () {
uiUtils.renderTemplate(this.template, this.$el, _.extend({}, conf.globalData, this.data), $.noop(), "replace");
}
}),
var returnVal = '',
}
rules.children = _.map(rules.children, function (c, index) { return _.extend(c, {index: index, lastChild: false, hasMultiple: (rules.children.length > 1)}); });
}
return {
"value": o,
"label": $.t("templates.util.filter.options." + o),
};
}),
if (o === "extensibleMatchAND") {
return {
"value": o,
"label": $.t("templates.util.filter.tags.extensible.rules.bitAnd"),
};
} else if (o === "extensibleMatchOR") {
return {
"value": o,
"label": $.t("templates.util.filter.tags.extensible.rules.bitOr"),
};
} else {
return {
"value": o,
"label": $.t("templates.util.filter.tags." + o),
};
}
}),
"delimiter": $.t($.t("templates.util.filter.delimiters." + rules.op)), // will only be valid for and and or
"config": config
}));
return returnVal;
});
return FilterEditor;
});