1.7

Table Of Contents
c.setupExample();
var $allRules;
/** Load Search Rules */
(function () {
var $temp = $("<div>");
$temp.load("snippets/rules.html", function (response,
status, xhr) {
if (status === "success") {
$allRules = $temp;
$("input[type='submit']").removeAttr
("disabled");
$("input[type='button']").removeAttr
("disabled");
} else {
alert("Loading of Search Rules
Unsuccessful!\n\nUnable to load the search rules " +
"from the search rules template. Searching
is currently disabled.");
$("input[type='submit']").attr("disabled",
"disabled");
$("input[type='button']").attr("disabled",
"disabled");
}
});
}());
/** Common Load Rule Function */
function loadRule(ruleCategory, ruleName) {
var $rule = $allRules.find("#" + ruleCategory +
"-rules div.rule[id='" + ruleName + "']").clone();
/** Populate any Data Type References */
$rule.find("select[data-type]").each(function (index,
element) {
var $element = $(element),
dataType = $element.attr("data-type");
var options = $allRules
.find("#rule-data-types")
.find("#" + dataType + "-options")
.children();
Page 124