diff options
author | Benjamin Jones <bjones@galois.com> | 2013-07-16 15:58:09 -0700 |
---|---|---|
committer | Benjamin Jones <bjones@galois.com> | 2013-07-16 15:58:09 -0700 |
commit | 54d73a015a05ded583723a3b204580ea66d79acf (patch) | |
tree | 56d3d017f31c23884024a8b2449b0cf56e72d959 | |
parent | e089832e50c87a79a9872009fd47231473d81b7a (diff) |
added warning, advisory, info reporters to the report object
-rw-r--r-- | src/js/fiveui/injected/compute.js | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/js/fiveui/injected/compute.js b/src/js/fiveui/injected/compute.js index 921229e..2cfab53 100644 --- a/src/js/fiveui/injected/compute.js +++ b/src/js/fiveui/injected/compute.js @@ -101,7 +101,7 @@ msg: message, descr: rule.description, url: window.location.href, - severity: 1, + severity: 0, // default is error xpath: core.getElementXPath(node), phash: null, hash: null, @@ -238,15 +238,23 @@ }; fiveui.stats.numElts = 0; // reset stats element counter - var report = { - error:function(message, node) { + var genericReporter = function (severity) { + return function (message, node) { var prob = core.hash(theRule, message, node); var query = $(node); // let the backend sort out if this problem has been reported already query.addClass(prob.hash); + prob.severity = severity; core.reportProblem(prob); - } + }; + }; + + var report = { + error: genericReporter(0), + warning: genericReporter(1), + advisory: genericReporter(2), + info: genericReporter(3) }; core.beforeRules(); |