aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Benjamin Jones <bjones@galois.com>2013-11-04 15:21:32 -0800
committerGravatar Benjamin Jones <bjones@galois.com>2013-11-04 15:21:32 -0800
commitf241200b5f19c9b389bfc4152751b0e509b991e7 (patch)
treec04c80bff28621e32ba5322d6e99ef6bbf215f38
parentf1d3202e54fac77246d56977c3ae12bf454c4da2 (diff)
parent51f5a2477adb718a1868483cf00e04816bf7423a (diff)
Merge branch 'new-ui'
-rw-r--r--src/js/fiveui/css/ui.css12
-rw-r--r--src/js/fiveui/injected/compute.js16
2 files changed, 22 insertions, 6 deletions
diff --git a/src/js/fiveui/css/ui.css b/src/js/fiveui/css/ui.css
index 0b723c9..2a08a69 100644
--- a/src/js/fiveui/css/ui.css
+++ b/src/js/fiveui/css/ui.css
@@ -108,9 +108,17 @@ div.fiveui-problem-body {
}
div.fiveui-severity-0 {
- background-color: #F2FC7E;
+ background-color: #F5B3B3;
}
div.fiveui-severity-1 {
- background-color: #F5B3B3;
+ background-color: #F2FC7E;
+}
+
+div.fiveui-severity-2 {
+ background-color: rgba(0, 255, 0, 0.5);
+}
+
+div.fiveui-severity-3 {
+ background-color: rgba(0, 0, 255, 0.5);
}
diff --git a/src/js/fiveui/injected/compute.js b/src/js/fiveui/injected/compute.js
index 9fc16a8..d8ae9e8 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();