diff options
author | Trevor Elliott <trevor@galois.com> | 2013-06-12 16:41:00 -0700 |
---|---|---|
committer | Trevor Elliott <trevor@galois.com> | 2013-06-12 16:41:00 -0700 |
commit | c7b493dcc46ac800ace472a580d5430a1b0c2e41 (patch) | |
tree | 1ae2ea9ad7b84b07387d41c2b6ca6c4eccc4366a /exampleData/ruleSets | |
parent | 0decef2093c676d91b0b590a9b94f201c4995716 (diff) |
Group url patterns with rule set definitions
Diffstat (limited to 'exampleData/ruleSets')
-rw-r--r-- | exampleData/ruleSets/colorRules/backgroundCheck.js | 8 | ||||
-rw-r--r-- | exampleData/ruleSets/colorRules/foregroundCheck.js | 3 |
2 files changed, 8 insertions, 3 deletions
diff --git a/exampleData/ruleSets/colorRules/backgroundCheck.js b/exampleData/ruleSets/colorRules/backgroundCheck.js index 98df08c..d860410 100644 --- a/exampleData/ruleSets/colorRules/backgroundCheck.js +++ b/exampleData/ruleSets/colorRules/backgroundCheck.js @@ -7,12 +7,16 @@ exports.description = ].join('\n'); exports.rule = function() { + var rule = this; + + var allow = '#00 #FF #3D #F7 #C2 #B4 #4E'.split(' '); - this.report("broken"); + rule.report("broken"); $5(':visible') .cssIsNot('background-color', allow, fiveui.color.colorToHex) .each(function(i, elt) { var color = fiveui.color.colorToHex($(elt).css('background-color')); - this.report('non-standard background color: ' + color, $(elt)); + eonsole.log(rule); + rule.report('non-standard background color: ' + color, $(elt)); }); }; diff --git a/exampleData/ruleSets/colorRules/foregroundCheck.js b/exampleData/ruleSets/colorRules/foregroundCheck.js index 2cf2b5f..9102bbe 100644 --- a/exampleData/ruleSets/colorRules/foregroundCheck.js +++ b/exampleData/ruleSets/colorRules/foregroundCheck.js @@ -6,11 +6,12 @@ exports.description = ].join('\n'); exports.rule = function() { + var rule = this; var allow = '#00 #FF #3D #F7 #C2 #B4 #4E #FFCB05 #7B8738'.split(' '); $5(':visible') .cssIsNot('color', allow, fiveui.color.colorToHex) .each(function(i, elt) { var color = fiveui.color.colorToHex($(elt).css('color')); - this.report('foreground color: ' + color, elt); + rule.report('foreground color: ' + color, elt); }); }; |