aboutsummaryrefslogtreecommitdiff
path: root/exampleData/ruleSets
diff options
context:
space:
mode:
authorGravatar Rogan Creswick <creswick@gmail.com>2013-06-03 14:37:58 -0700
committerGravatar Rogan Creswick <creswick@gmail.com>2013-06-03 14:37:58 -0700
commitc555ff24d184947ab8e0df07b1e57f8b0d7dc2fd (patch)
tree921786dfd902c85209d3631b9886d3f46e07877b /exampleData/ruleSets
parent1e0c5e1b790b18645225fcc2b06fdc59e1a099a9 (diff)
minor bug fixes, started changing color rules to the new manifest format
Diffstat (limited to 'exampleData/ruleSets')
-rw-r--r--exampleData/ruleSets/backgroundCheck.js10
-rw-r--r--exampleData/ruleSets/colorRules.json107
-rw-r--r--exampleData/ruleSets/foregroundCheck.js9
3 files changed, 64 insertions, 62 deletions
diff --git a/exampleData/ruleSets/backgroundCheck.js b/exampleData/ruleSets/backgroundCheck.js
new file mode 100644
index 0000000..7da59aa
--- /dev/null
+++ b/exampleData/ruleSets/backgroundCheck.js
@@ -0,0 +1,10 @@
+function() {
+ var allow = '#00 #FF #3D #F7 #C2 #B4 #4E'.split(' ');
+ report("broken");
+ $5(':visible')
+ .cssIsNot('background-color', allow, fiveui.color.colorToHex)
+ .each(function(i, elt) {
+ var color = fiveui.color.colorToHex($(elt).css('background-color'));
+ report('non-standard background color: ' + color, $(elt));
+ });
+}
diff --git a/exampleData/ruleSets/colorRules.json b/exampleData/ruleSets/colorRules.json
index 8f10ee8..54fb549 100644
--- a/exampleData/ruleSets/colorRules.json
+++ b/exampleData/ruleSets/colorRules.json
@@ -4,89 +4,72 @@
* Test using exampleData/basic/testColorRules.html
*/
-{ 'name': 'Color Guidelines'
-, 'description': 'Foreground/background color guidelines'
-, 'rules': [
+{ "name": "Color Guidelines"
+, "description": "Foreground/background color guidelines"
+, "rules": [
//----------------------------------------------------------------
- { 'id': 2141101
- , 'name': 'Foreground check'
- , 'description': 'Foreground colors should be in the set:'+
- '#00 #FF #3D #F7 #C2 #B4 #4E #FFCB05 #7B8738'
- , 'rule':
- function() {
- 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'));
- report('foreground color: ' + color, elt);
- });
- }
+ { "name": "Foreground check"
+ , "description": ["Foreground colors should be in the set: \n",
+ "#00 #FF #3D #F7 #C2 #B4 #4E #FFCB05 #7B8738"]
+ , "file": "foregroundCheck.js"
},
//----------------------------------------------------------------
- { 'id': 2141102
- , 'name': 'Background check'
- , 'description': 'Backgrounds colors should be in the set:' +
- '#00 #FF #3D #F7 #C2 #B4 #4E'
- , 'rule':
- function() {
- var allow = '#00 #FF #3D #F7 #C2 #B4 #4E'.split(' ');
- $5(':visible')
- .cssIsNot('background-color', allow, fiveui.color.colorToHex)
- .each(function(i, elt) {
- var color = fiveui.color.colorToHex($(elt).css('background-color'));
- report('non-standard background color: ' + color, $(elt));
- });
+ { "name": "Background check"
+ , "description": ["Backgrounds colors should be in the set:",
+ "#00 #FF #3D #F7 #C2 #B4 #4E"]
+ , "file": "backgroundCheck.js"
}
- },
- //----------------------------------------------------------------
- { 'id': 2141103
- , 'name': 'Content area color'
- , 'description': 'Background color should be: ' +
- '#F7'
- , 'rule':
+]
+}
+//----------------------------------------------------------------
+/* { "id": 2141103
+ , "name": "Content area color"
+ , "description": "Background color should be: " +
+ "#F7"
+ , "rule":
function() {
- var allow = '#F7';
- $5('#content')
- .cssIsNot('background-color', allow, fiveui.color.colorToHex)
+ var allow = "#F7";
+ $5("#content")
+ .cssIsNot("background-color", allow, fiveui.color.colorToHex)
.each(function(i, elt) {
- var color = fiveui.color.colorToHex($(elt).css('background-color'));
- report('non-standard content background color: ' + color, elt);
+ var color = fiveui.color.colorToHex($(elt).css("background-color"));
+ report("non-standard content background color: " + color, elt);
});
}
},
//----------------------------------------------------------------
- { 'id': 2141104
- , 'name': 'Left navigation color'
- , 'description': 'Left navigation color should be: ' +
- '#C2'
- , 'rule':
+ { "id": 2141104
+ , "name": "Left navigation color"
+ , "description": "Left navigation color should be: " +
+ "#C2"
+ , "rule":
function() {
- var allow = '#C2';
- $5('#leftNav')
- .cssIsNot('color', allow, fiveui.color.colorToHex)
+ var allow = "#C2";
+ $5("#leftNav")
+ .cssIsNot("color", allow, fiveui.color.colorToHex)
.each(function(i, elt) {
- var color = fiveui.color.colorToHex($(elt).css('color'));
- report('non-standard left navigation color: ' + color, elt);
+ var color = fiveui.color.colorToHex($(elt).css("color"));
+ report("non-standard left navigation color: " + color, elt);
});
}
},
//----------------------------------------------------------------
- { 'id': 2141105
- , 'name': 'Header color check'
- , 'description': 'Header color should be: ' +
- '#3D'
- , 'rule':
+ { "id": 2141105
+ , "name": "Header color check"
+ , "description": "Header color should be: " +
+ "#3D"
+ , "rule":
function() {
- var allow = '#3D';
- $5(':header')
- .cssIsNot('color', allow, fiveui.color.colorToHex)
+ var allow = "#3D";
+ $5(":header")
+ .cssIsNot("color", allow, fiveui.color.colorToHex)
.each(function(i, elt) {
- var color = fiveui.color.colorToHex($(elt).css('color'));
- report('non-standard header color: ' + color, elt);
+ var color = fiveui.color.colorToHex($(elt).css("color"));
+ report("non-standard header color: " + color, elt);
});
}
}//,
//----------------------------------------------------------------
]
}
+ */ \ No newline at end of file
diff --git a/exampleData/ruleSets/foregroundCheck.js b/exampleData/ruleSets/foregroundCheck.js
new file mode 100644
index 0000000..32a8ee5
--- /dev/null
+++ b/exampleData/ruleSets/foregroundCheck.js
@@ -0,0 +1,9 @@
+function() {
+ 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'));
+ report('foreground color: ' + color, elt);
+ });
+}