Skip to content
This repository was archived by the owner on Sep 24, 2019. It is now read-only.

Commit 4fc83b9

Browse files
author
Kevin Miller
committed
Merge pull request #108 from kevee/hotfix
Hotfix - add test results per issue #99
2 parents 37b8d80 + e0c5fba commit 4fc83b9

40 files changed

+61
-58
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ Credits
4545
Legal
4646
-----
4747

48-
QUAIL is covered under the MIT License, and is copyright (c) 2013 by Kevin Miller. Current license is at http://quailjs.org/license.
48+
QUAIL is covered under the MIT License, and is copyright (c) 2013 by Kevin Miller. Current license is at http://quailjs.org/license.

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "quail",
33
"version": "2.1.0",
4-
"main": "dist/quail.jquery.js",
4+
"main": "dist/*",
55
"ignore": [
66
".jshintrc",
77
"**/*.txt"

dist/quail.jquery.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ var quail = {
9999
var results = {totals : {severe : 0, moderate : 0, suggestion : 0 },
100100
results : quail.accessibilityResults };
101101
$.each(results.results, function(testName, result) {
102-
results.totals[quail.testabilityTranslation[quail.accessibilityTests[testName].testability]] += result.length;
103-
});
102+
results.totals[quail.testabilityTranslation[quail.accessibilityTests[testName].testability]] += result.elements.length; });
104103
quail.options.complete(results);
105104
}
106105
},
@@ -129,14 +128,15 @@ var quail = {
129128
}
130129
}
131130

132-
quail.accessibilityResults[testName].push($element);
131+
quail.accessibilityResults[testName].elements.push($element);
133132
if(typeof quail.options.testFailed !== 'undefined') {
134133
var testability = (typeof quail.accessibilityTests[testName].testability !== 'undefined') ?
135134
quail.accessibilityTests[testName].testability :
136135
'unknown';
137136
var severity =
138137
quail.options.testFailed({element : $element,
139138
testName : testName,
139+
test : quail.accessibilityTests[testName],
140140
testability : testability,
141141
severity : quail.testabilityTranslation[testability],
142142
options : options
@@ -157,7 +157,7 @@ var quail = {
157157
}
158158
var testType = quail.accessibilityTests[testName].type;
159159
if(typeof quail.accessibilityResults[testName] === 'undefined') {
160-
quail.accessibilityResults[testName] = [ ];
160+
quail.accessibilityResults[testName] = { test : quail.accessibilityTests[testName], elements : [ ] };
161161
}
162162
if(testType === 'selector') {
163163
quail.html.find(quail.accessibilityTests[testName].selector).each(function() {

dist/quail.jquery.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/tests/imgAltNotPlaceHolder.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@ Images should not have a simple placeholder text as an "alt" attribute
99
1010
Any image that is not used decorativey or which is purely for layout purposes cannot have an "alt" attribute that consists solely of placeholders. Placeholders include:
1111

12+
* nbsp
13+
*  
14+
* spacer
15+
* image
16+
* img
17+
* photo
1218

13-
14-
<ul><li>nbsp</li><li>&amp;nbsp;</li><li>spacer</li><li>image</li><li>img</li><li>photo</li></ul>Example
15-
-------
1619
Wrong
1720
-----
1821

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "quail",
33
"description": "A javascript content accessibility checker.",
44
"homepage": "http://quailjs.org",
5-
"version": "2.1.0",
5+
"version": "2.1.1",
66
"engines": {
77
"node": ">= 0.10.20"
88
},

quail.jquery.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"homepage": "http://quailjs.org",
77
"docs": "http://quail.readthedocs.org/en/latest/",
88
"demo": "http://quailjs.org/examples/",
9-
"version": "2.1.0",
9+
"version": "2.1.1",
1010
"author": {
1111
"name": "Kevin Miller",
1212
"email": "[email protected]",

quail.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "quail",
33
"title": "Quail",
44
"description": "QUAIL Accessibility Information Library.",
5-
"version": "2.1.0",
5+
"version": "2.1.1",
66
"homepage": "https://github.com/kevee/quail",
77
"author": {
88
"name": "Kevin Miller",

src/js/core.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ var quail = {
9797
var results = {totals : {severe : 0, moderate : 0, suggestion : 0 },
9898
results : quail.accessibilityResults };
9999
$.each(results.results, function(testName, result) {
100-
results.totals[quail.testabilityTranslation[quail.accessibilityTests[testName].testability]] += result.length;
101-
});
100+
results.totals[quail.testabilityTranslation[quail.accessibilityTests[testName].testability]] += result.elements.length; });
102101
quail.options.complete(results);
103102
}
104103
},
@@ -127,14 +126,15 @@ var quail = {
127126
}
128127
}
129128

130-
quail.accessibilityResults[testName].push($element);
129+
quail.accessibilityResults[testName].elements.push($element);
131130
if(typeof quail.options.testFailed !== 'undefined') {
132131
var testability = (typeof quail.accessibilityTests[testName].testability !== 'undefined') ?
133132
quail.accessibilityTests[testName].testability :
134133
'unknown';
135134
var severity =
136135
quail.options.testFailed({element : $element,
137136
testName : testName,
137+
test : quail.accessibilityTests[testName],
138138
testability : testability,
139139
severity : quail.testabilityTranslation[testability],
140140
options : options
@@ -155,7 +155,7 @@ var quail = {
155155
}
156156
var testType = quail.accessibilityTests[testName].type;
157157
if(typeof quail.accessibilityResults[testName] === 'undefined') {
158-
quail.accessibilityResults[testName] = [ ];
158+
quail.accessibilityResults[testName] = { test : quail.accessibilityTests[testName], elements : [ ] };
159159
}
160160
if(testType === 'selector') {
161161
quail.html.find(quail.accessibilityTests[testName].selector).each(function() {

test/composite.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,36 +27,36 @@ var quailTest = {
2727
reset : true,
2828
accessibilityTests : accessibilityTests,
2929
complete : function(results) {
30-
$.each(results.results[testName], function(index, item) {
30+
$.each(results.results[testName].elements, function(index, item) {
3131
if(typeof item === 'undefined' ||
3232
(item && item.attr('id') && item.attr('id').indexOf('qunit-') !== -1) ||
3333
item.parents('#qunit-wrapper').length) {
34-
results.results[testName].splice(index, 1);
34+
results.results[testName].elements.splice(index, 1);
3535
}
3636
});
3737
quailTest.results = results.results;
3838
}});
3939
},
4040

4141
confirmIsEmpty : function() {
42-
$.each(quailTest.results[quailTest.testName], function(index, item) {
42+
$.each(quailTest.results[quailTest.testName].elements, function(index, item) {
4343
if(typeof item === 'undefined' ||
4444
(item && item.attr('id') && item.attr('id').indexOf('qunit-') !== -1) ||
4545
item.parents('#qunit-wrapper').length) {
46-
quailTest.results[quailTest.testName].splice(index, 1);
46+
quailTest.results[quailTest.testName].elements.splice(index, 1);
4747
}
4848
});
49-
if(quailTest.results[quailTest.testName].length) {
49+
if(quailTest.results[quailTest.testName].elements.length) {
5050
return false;
5151
}
5252
return true;
5353
},
5454

5555
confirmIsTag : function(tag) {
56-
if(typeof quailTest.results[quailTest.testName][0] === 'undefined') {
56+
if(typeof quailTest.results[quailTest.testName].elements[0] === 'undefined') {
5757
return false;
5858
}
59-
return quailTest.results[quailTest.testName][0].is(tag);
59+
return quailTest.results[quailTest.testName].elements[0].is(tag);
6060
},
6161

6262
insertElements : function(callback) {

0 commit comments

Comments
 (0)