diff --git a/bower.json b/bower.json index 7dd664074..764840e36 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "quail", "version": "2.1.0", - "main": "dist/quail.jquery.js", + "main": "dist/*", "ignore": [ ".jshintrc", "**/*.txt" diff --git a/dist/quail.jquery.js b/dist/quail.jquery.js index 898bb65ba..7e4e5a5f1 100644 --- a/dist/quail.jquery.js +++ b/dist/quail.jquery.js @@ -99,8 +99,7 @@ var quail = { var results = {totals : {severe : 0, moderate : 0, suggestion : 0 }, results : quail.accessibilityResults }; $.each(results.results, function(testName, result) { - results.totals[quail.testabilityTranslation[quail.accessibilityTests[testName].testability]] += result.length; - }); + results.totals[quail.testabilityTranslation[quail.accessibilityTests[testName].testability]] += result.elements.length; }); quail.options.complete(results); } }, @@ -129,7 +128,7 @@ var quail = { } } - quail.accessibilityResults[testName].push($element); + quail.accessibilityResults[testName].elements.push($element); if(typeof quail.options.testFailed !== 'undefined') { var testability = (typeof quail.accessibilityTests[testName].testability !== 'undefined') ? quail.accessibilityTests[testName].testability : @@ -137,6 +136,7 @@ var quail = { var severity = quail.options.testFailed({element : $element, testName : testName, + test : quail.accessibilityTests[testName], testability : testability, severity : quail.testabilityTranslation[testability], options : options @@ -157,7 +157,7 @@ var quail = { } var testType = quail.accessibilityTests[testName].type; if(typeof quail.accessibilityResults[testName] === 'undefined') { - quail.accessibilityResults[testName] = [ ]; + quail.accessibilityResults[testName] = { test : quail.accessibilityTests[testName], elements : [ ] }; } if(testType === 'selector') { quail.html.find(quail.accessibilityTests[testName].selector).each(function() { diff --git a/dist/quail.jquery.min.js b/dist/quail.jquery.min.js index f9e5dd05b..e58a8c327 100644 --- a/dist/quail.jquery.min.js +++ b/dist/quail.jquery.min.js @@ -1 +1 @@ -/*! QUAIL quailjs.org | quailjs.org/license */!function(a){a.fn.quail=function(a){return this.length?(b.options=a,b.html=this,b.run(),this):this},a.expr[":"].quailCss=function(b,c,d){var e=d[3].split(/\s*=\s*/);return a(b).css(e[0]).search(e[1])>-1};var b={options:{},components:{},testabilityTranslation:{0:"suggestion",.5:"moderate",1:"severe"},html:{},strings:{},accessibilityResults:{},accessibilityTests:{},textSelector:"p, h1, h2, h3, h4, h5, h6, div, pre, blockquote, aside, article, details, summary, figcaption, footer, header, hgroup, nav, section, strong, em, del, i, b",suspectPHeaderTags:["strong","b","em","i","u","font"],suspectPCSSStyles:["color","font-weight","font-size","font-family"],run:function(){if(b.options.reset&&(b.accessibilityResults={}),"undefined"!=typeof b.options.accessibilityTests?b.accessibilityTests=b.options.accessibilityTests:a.ajax({url:b.options.jsonPath+"/tests.json",async:!1,dataType:"json",success:function(a){"object"==typeof a&&(b.accessibilityTests=a)}}),"undefined"!=typeof b.options.customTests)for(var c in b.options.customTests)b.accessibilityTests[c]=b.options.customTests[c];if("string"==typeof b.options.guideline&&a.ajax({url:b.options.jsonPath+"/guidelines/"+b.options.guideline+".tests.json",async:!1,dataType:"json",success:function(a){b.options.guideline=a}}),"undefined"==typeof b.options.guideline){b.options.guideline=[];for(var d in b.accessibilityTests)b.options.guideline.push(d)}if(b.runTests(),"undefined"!=typeof b.options.complete){var e={totals:{severe:0,moderate:0,suggestion:0},results:b.accessibilityResults};a.each(e.results,function(a,c){e.totals[b.testabilityTranslation[b.accessibilityTests[a].testability]]+=c.length}),b.options.complete(e)}},getConfiguration:function(a){return"undefined"==typeof this.options.guidelineName||"undefined"==typeof this.accessibilityTests[a].guidelines||"undefined"==typeof this.accessibilityTests[a].guidelines[this.options.guidelineName]||"undefined"==typeof this.accessibilityTests[a].guidelines[this.options.guidelineName].configuration?!1:this.accessibilityTests[a].guidelines[this.options.guidelineName].configuration},testFails:function(a,c,d){if(d=d||{},("undefined"==typeof b.options.preFilter||b.options.preFilter(a,c,d)!==!1)&&(b.accessibilityResults[a].push(c),"undefined"!=typeof b.options.testFailed)){var e="undefined"!=typeof b.accessibilityTests[a].testability?b.accessibilityTests[a].testability:"unknown";b.options.testFailed({element:c,testName:a,testability:e,severity:b.testabilityTranslation[e],options:d})}},runTests:function(){a.each(b.options.guideline,function(c,d){if("undefined"!=typeof b.accessibilityTests[d]){var e=b.accessibilityTests[d].type;"undefined"==typeof b.accessibilityResults[d]&&(b.accessibilityResults[d]=[]),"selector"===e&&b.html.find(b.accessibilityTests[d].selector).each(function(){b.testFails(d,a(this))}),"custom"===e&&("object"==typeof b.accessibilityTests[d].callback||"function"==typeof b.accessibilityTests[d].callback?b.accessibilityTests[d].callback(b):"undefined"!=typeof b[b.accessibilityTests[d].callback]&&b[b.accessibilityTests[d].callback]()),"undefined"!=typeof b.components[e]&&b.components[e](d,b.accessibilityTests[d])}})},isUnreadable:function(a){return"string"!=typeof a?!0:a.trim().length?!1:!0},isDataTable:function(b){if(b.find("tr").length<3)return!1;if(b.find("th[scope]").length)return!0;var c=b.find("tr:has(td)").length,d=b.find("td[rowspan], td[colspan]"),e=!0;if(d.length){var f={};d.each(function(){"undefined"==typeof f[a(this).index()]&&(f[a(this).index()]=0),f[a(this).index()]++}),a.each(f,function(a,b){c>b&&(e=!1)})}var g=b.find("table");if(g.length){var h={};g.each(function(){var b=a(this).parent("td").index();b!==!1&&"undefined"==typeof h[b]&&(h[b]=0),h[b]++}),a.each(h,function(a,b){c>b&&(e=!1)})}return e},validURL:function(a){return-1===a.search(" ")?!0:!1},cleanString:function(a){return a.toLowerCase().replace(/^\s\s*/,"")},containsReadableText:function(c,d){if(c=c.clone(),c.find("option").remove(),!b.isUnreadable(c.text()))return!0;if(!b.isUnreadable(c.attr("alt")))return!0;if(d){var e=!1;if(c.find("*").each(function(){b.containsReadableText(a(this),!0)&&(e=!0)}),e)return!0}return!1}};b.components.acronym=function(c){var d={},e={};b.html.find("acronym[title], abbr[title]").each(function(){d[a(this).text().toUpperCase()]=a(this).attr("title")}),b.html.find("p, div, h1, h2, h3, h4, h5").each(function(){var f=a(this),g=a(this).text().split(" ");g.length>1&&a(this).text().toUpperCase()!==a(this).text()&&a.each(g,function(a,g){g=g.replace(/[^a-zA-Zs]/,""),g.toUpperCase()===g&&g.length>1&&"undefined"==typeof d[g.toUpperCase()]&&("undefined"==typeof e[g.toUpperCase()]&&b.testFails(c,f,{acronym:g.toUpperCase()}),e[g.toUpperCase()]=g)})})},b.components.color=function(c,d){if(d.bodyForegroundAttribute&&d.bodyBackgroundAttribute){var e=b.html.find("body").clone(!1,!1),f=e.attr(d.bodyForegroundAttribute),g=e.attr(d.bodyBackgroundAttribute);"undefined"==typeof f&&(f="rgb(0,0,0)"),"undefined"==typeof g&&(f="rgb(255,255,255)"),e.css("color",f),e.css("background-color",g),("wcag"===d.algorithm&&!b.colors.passesWCAG(e)||"wai"===d.algorithm&&!b.colors.passesWAI(e))&&b.testFails(c,e)}b.html.find(d.selector).filter(b.textSelector).each(function(){(!b.isUnreadable(a(this).text())&&"wcag"===d.algorithm&&!b.colors.passesWCAG(a(this))||"wai"===d.algorithm&&!b.colors.passesWAI(a(this)))&&b.testFails(c,a(this))})},b.colors={getLuminosity:function(a,b){a=this.cleanup(a),b=this.cleanup(b);var c,d,e=a.r/255,f=a.g/255,g=a.b/255,h=.03928>=e?e/12.92:Math.pow((e+.055)/1.055,2.4),i=.03928>=f?f/12.92:Math.pow((f+.055)/1.055,2.4),j=.03928>=g?g/12.92:Math.pow((g+.055)/1.055,2.4),k=b.r/255,l=b.g/255,m=b.b/255,n=.03928>=k?k/12.92:Math.pow((k+.055)/1.055,2.4),o=.03928>=l?l/12.92:Math.pow((l+.055)/1.055,2.4),p=.03928>=m?m/12.92:Math.pow((m+.055)/1.055,2.4);return c=.2126*h+.7152*i+.0722*j,d=.2126*n+.7152*o+.0722*p,Math.round((Math.max(c,d)+.05)/(Math.min(c,d)+.05)*10)/10},fetchImageColor:function(){var b=new Image,c=a(this).css("background-image").replace("url(","").replace(/'/,"").replace(")","");b.src=c;var d=document.createElement("canvas"),e=d.getContext("2d");e.drawImage(b,0,0);var f=e.getImageData(0,0,1,1).data;return"rgb("+f[0]+","+f[1]+","+f[2]+")"},passesWCAG:function(a){return b.colors.getLuminosity(b.colors.getColor(a,"foreground"),b.colors.getColor(a,"background"))>5},passesWAI:function(a){var c=b.colors.cleanup(b.colors.getColor(a,"foreground")),d=b.colors.cleanup(b.colors.getColor(a,"background"));return b.colors.getWAIErtContrast(c,d)>500&&b.colors.getWAIErtBrightness(c,d)>125},getWAIErtContrast:function(a,c){var d=b.colors.getWAIDiffs(a,c);return d.red+d.green+d.blue},getWAIErtBrightness:function(a,c){var d=b.colors.getWAIDiffs(a,c);return(299*d.red+587*d.green+114*d.blue)/1e3},getWAIDiffs:function(a,b){var c={};return c.red=Math.abs(a.r-b.r),c.green=Math.abs(a.g-b.g),c.blue=Math.abs(a.b-b.b),c},getColor:function(b,c){if("foreground"===c)return b.css("color")?b.css("color"):"rgb(255,255,255)";if("rgba(0, 0, 0, 0)"!==b.css("background-color")&&"transparent"!==b.css("background-color")||"body"===b.get(0).tagName)return b.css("background-color")?b.css("background-color"):"rgb(0,0,0)";var d="rgb(0,0,0)";return b.parents().each(function(){return"rgba(0, 0, 0, 0)"!==a(this).css("background-color")&&"transparent"!==a(this).css("background-color")?(d=a(this).css("background-color"),!1):void 0}),d},cleanup:function(a){return a=a.replace("rgb(","").replace("rgba(","").replace(")","").split(","),{r:a[0],g:a[1],b:a[2],a:"undefined"==typeof a[3]?!1:a[3]}}},b.components.convertToPx=function(c){var d=a('
 
').appendTo(b.html),e=d.height();return d.remove(),e},b.components.event=function(c,d){var e="undefined"==typeof d.selector?b.html.find("*"):b.html.find(d.selector);e.each(function(){!b.components.hasEventListener(a(this),d.searchEvent.replace("on",""))||"undefined"!=typeof d.correspondingEvent&&b.components.hasEventListener(a(this),d.correspondingEvent.replace("on",""))||b.testFails(c,a(this))})},b.components.hasEventListener=function(b,c){return"undefined"!=typeof a(b).attr("on"+c)?!0:"undefined"!=typeof a(b).get(0)[c]},b.components.header=function(c,d){var e=parseInt(d.selector.substr(-1,1),10),f=!1;b.html.find("h1, h2, h3, h4, h5, h6").each(function(){var d=parseInt(a(this).get(0).tagName.substr(-1,1),10);f&&(d-1>e||e>d+1)&&b.testFails(c,a(this)),d===e&&(f=a(this)),f&&d!==e&&(f=!1)})},b.components.label=function(c,d){b.html.find(d.selector).each(function(){a(this).parent("label").length&&b.containsReadableText(a(this).parent("label"))||b.html.find("label[for="+a(this).attr("id")+"]").length&&b.containsReadableText(b.html.find("label[for="+a(this).attr("id")+"]"))||b.testFails(c,a(this))})},b.components.labelProximity=function(c,d){b.html.find(d.selector).each(function(){var d=b.html.find("label[for="+a(this).attr("id")+"]").first();d.length||b.testFails(c,a(this)),a(this).parent().is(d.parent())||b.testFails(c,a(this))})},b.components.placeholder=function(c,d){b.html.find(d.selector).each(function(){var e;if("undefined"!=typeof d.attribute){if("undefined"==typeof a(this).attr(d.attribute)||"tabindex"===d.attribute&&a(this).attr(d.attribute)<=0)return b.testFails(c,a(this)),void 0;e=a(this).attr(d.attribute)}else e=a(this).text(),a(this).find("img[alt]").each(function(){e+=a(this).attr("alt")});if("string"==typeof e){e=b.cleanString(e);var f=/^([0-9]*)(k|kb|mb|k bytes|k byte)$/g,g=f.exec(e.toLowerCase());g&&g[0].length?b.testFails(c,a(this)):d.empty&&b.isUnreadable(e)?b.testFails(c,a(this)):b.strings.placeholders.indexOf(e)>-1&&b.testFails(c,a(this))}else d.empty&&"number"!=typeof e&&b.testFails(c,a(this))})},b.statistics={setDecimal:function(a,b){var c=Math.pow(10,b||0);return b?Math.round(c*a)/c:a},average:function(a,c){for(var d=a.length,e=0;d--;)e+=a[d];return b.statistics.setDecimal(e/a.length,c)},variance:function(a,c){for(var d=b.statistics.average(a,c),e=a.length,f=0;e--;)f+=Math.pow(a[e]-d,2);return f/=a.length,b.statistics.setDecimal(f,c)},standardDeviation:function(a,c){var d=Math.sqrt(b.statistics.variance(a,c));return b.statistics.setDecimal(d,c)}},b.components.textStatistics={cleanText:function(a){return a.replace(/[,:;()\-]/," ").replace(/[\.!?]/,".").replace(/[ ]*(\n|\r\n|\r)[ ]*/," ").replace(/([\.])[\. ]+/,"$1").replace(/[ ]*([\.])/,"$1").replace(/[ ]+/," ").toLowerCase()},sentenceCount:function(a){var b=a;return b.split(".").length+1},wordCount:function(a){var b=a;return b.split(" ").length+1},averageWordsPerSentence:function(a){return this.wordCount(a)/this.sentenceCount(a)},averageSyllablesPerWord:function(b){var c=this,d=0,e=c.wordCount(b);return e?(a.each(b.split(" "),function(a,b){d+=c.syllableCount(b)}),d/e):0},syllableCount:function(a){var b=a.replace(/(?:[^laeiouy]es|ed|[^laeiouy]e)$/,"").match(/[aeiouy]{1,2}/g);return b&&0!==b.length?b.length:1}},b.components.video={youTube:{videoID:"",apiUrl:"http://gdata.youtube.com/feeds/api/videos/?q=%video&caption&v=2&alt=json",isVideo:function(a){var b=/^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/,c=a.match(b);return c&&11===c[7].length?(this.videoID=c[7],!0):!1},hasCaptions:function(b){a.ajax({url:this.apiUrl.replace("%video",this.videoID),async:!1,dataType:"json",success:function(a){b(a.feed.openSearch$totalResults.$t>0?!0:!1)}})}}},b.strings.colors={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"},b.strings.emoticons=[":)",";)",":-)",":^)","=)","B)","8)","c8","cB","=]",":]","x]",":-)",":)",":o)","=]",":-D",":D","=D",":-(",":(","=(",":/",":P",":o"],b.strings.languageCodes=["bh","bi","nb","bs","br","bg","my","es","ca","km","ch","ce","ny","ny","zh","za","cu","cu","cv","kw","co","cr","hr","cs","da","dv","dv","nl","dz","en","eo","et","ee","fo","fj","fi","nl","fr","ff","gd","gl","lg","ka","de","ki","el","kl","gn","gu","ht","ht","ha","he","hz","hi","ho","hu","is","io","ig","id","ia","ie","iu","ik","ga","it","ja","jv","kl","kn","kr","ks","kk","ki","rw","ky","kv","kg","ko","kj","ku","kj","ky","lo","la","lv","lb","li","li","li","ln","lt","lu","lb","mk","mg","ms","ml","dv","mt","gv","mi","mr","mh","ro","ro","mn","na","nv","nv","nd","nr","ng","ne","nd","se","no","nb","nn","ii","ny","nn","ie","oc","oj","cu","cu","cu","or","om","os","os","pi","pa","ps","fa","pl","pt","pa","ps","qu","ro","rm","rn","ru","sm","sg","sa","sc","gd","sr","sn","ii","sd","si","si","sk","sl","so","st","nr","es","su","sw","ss","sv","tl","ty","tg","ta","tt","te","th","bo","ti","to","ts","tn","tr","tk","tw","ug","uk","ur","ug","uz","ca","ve","vi","vo","wa","cy","fy","wo","xh","yi","yo","za","zu"],b.strings.placeholders=["title","untitled","untitled document","this is the title","the title","content"," ","new page","new","nbsp"," ","spacer","image","img","photo","frame","frame title","iframe","iframe title","legend"],b.strings.redundant={inputImage:["submit","button"],link:["link to","link","go to","click here","link","click","more"],required:["*"]},b.strings.siteMap=["site map","map","sitemap"],b.strings.suspiciousLinks=["click here","click","more","here","read more","download","add","delete","clone","order","view","read","clic aquí","clic","haga clic","más","aquí","image"],b.strings.symbols=["|","*",/\*/g,"
*","•","•"],b.aAdjacentWithSameResourceShouldBeCombined=function(){b.html.find("a").each(function(){a(this).next("a").attr("href")===a(this).attr("href")&&b.testFails("aAdjacentWithSameResourceShouldBeCombined",a(this))})},b.aImgAltNotRepetative=function(){b.html.find("a img[alt]").each(function(){b.cleanString(a(this).attr("alt"))===b.cleanString(a(this).parent("a").text())&&b.testFails("aImgAltNotRepetative",a(this).parent("a"))})},b.aLinkTextDoesNotBeginWithRedundantWord=function(){b.html.find("a").each(function(){var c=a(this),d="";a(this).find("img[alt]").length&&(d+=a(this).find("img[alt]:first").attr("alt")),d+=a(this).text(),d=d.toLowerCase(),a.each(b.strings.redundant.link,function(a,e){d.search(e)>-1&&b.testFails("aLinkTextDoesNotBeginWithRedundantWord",c)})})},b.aLinksAreSeperatedByPrintableCharacters=function(){b.html.find("a").each(function(){a(this).next("a").length&&b.isUnreadable(a(this).get(0).nextSibling.wholeText)&&b.testFails("aLinksAreSeperatedByPrintableCharacters",a(this))})},b.aLinksNotSeparatedBySymbols=function(){b.html.find("a").each(function(){a(this).next("a").length&&-1!==b.strings.symbols.indexOf(a(this).get(0).nextSibling.wholeText.toLowerCase().trim())&&b.testFails("aLinksNotSeparatedBySymbols",a(this))})},b.aMustContainText=function(){b.html.find("a").each(function(){b.containsReadableText(a(this),!0)||(a(this).attr("name")||a(this).attr("id"))&&!a(this).attr("href")||b.testFails("aMustContainText",a(this))})},b.aSuspiciousLinkText=function(){b.html.find("a").each(function(){var c=a(this).text();a(this).find("img[alt]").each(function(){c+=a(this).attr("alt")}),b.strings.suspiciousLinks.indexOf(b.cleanString(c))>-1&&b.testFails("aSuspiciousLinkText",a(this))})},b.appletContainsTextEquivalent=function(){b.html.find("applet[alt=], applet:not(applet[alt])").each(function(){b.isUnreadable(a(this).text())&&b.testFails("appletContainsTextEquivalent",a(this))})},b.blockquoteUseForQuotations=function(){b.html.find("p").each(function(){a(this).text().substr(0,1).search(/[\'\"]/)>-1&&a(this).text().substr(-1,1).search(/[\'\"]/)>-1&&b.testFails("blockquoteUseForQuotations",a(this))})},b.doctypeProvided=function(){0===a(b.html.get(0).doctype).length&&b.testFails("doctypeProvided",b.html.find("html"))},b.documentAbbrIsUsed=function(){b.components.acronym("documentAbbrIsUsed","abbr")},b.documentAcronymsHaveElement=function(){b.components.acronym("documentAcronymsHaveElement","acronym")},b.documentIDsMustBeUnique=function(){var c=[];b.html.find("*[id]").each(function(){c.indexOf(a(this).attr("id"))>=0&&b.testFails("documentIDsMustBeUnique",a(this)),c.push(a(this).attr("id"))})},b.documentIsWrittenClearly=function(){b.html.find(b.textSelector).each(function(){var c=b.components.textStatistics.cleanText(a(this).text());Math.round(206.835-1.015*b.components.textStatistics.averageWordsPerSentence(c)-84.6*b.components.textStatistics.averageSyllablesPerWord(c))<60&&b.testFails("documentIsWrittenClearly",a(this))})},b.documentLangIsISO639Standard=function(){var a=b.html.find("html").attr("lang");a&&-1===b.strings.languageCodes.indexOf(a)&&b.testFails("documentLangIsISO639Standard",b.html.find("html"))},b.documentStrictDocType=function(){a(b.html.get(0).doctype).length&&-1!==b.html.get(0).doctype.systemId.indexOf("strict")||b.testFails("documentStrictDocType",b.html.find("html"))},b.documentTitleIsShort=function(){b.html.find("head title:first").text().length>150&&b.testFails("documentTitleIsShort",b.html.find("head title:first"))},b.documentValidatesToDocType=function(){"undefined"==typeof document.doctype},b.documentVisualListsAreMarkedUp=function(){b.html.find("p, div, h1, h2, h3, h4, h5, h6").each(function(){var c=a(this);a.each(b.strings.symbols,function(a,d){c.text().split(d).length>2&&b.testFails("documentVisualListsAreMarkedUp",c)})})},b.embedHasAssociatedNoEmbed=function(){b.html.find("noembed").length||b.html.find("embed").each(function(){b.testFails("embedHasAssociatedNoEmbed",a(this))})},b.emoticonsExcessiveUse=function(){var c=0;b.html.find("p, div, h1, h2, h3, h4, h5, h6").each(function(){var d=a(this);a.each(d.text().split(" "),function(a,d){b.strings.emoticons.indexOf(d)>-1&&c++,c>4}),c>4&&b.testFails("emoticonsExcessiveUse",d)})},b.emoticonsMissingAbbr=function(){b.html.find("p, div, h1, h2, h3, h4, h5, h6").each(function(){var c=a(this),d=c.clone();d.find("abbr, acronym").each(function(){a(this).remove()}),a.each(d.text().split(" "),function(a,d){b.strings.emoticons.indexOf(d)>-1&&b.testFails("emoticonsMissingAbbr",c)})})},b.formWithRequiredLabel=function(){var c,d=b.strings.redundant,e=!1;d.required[d.required.indexOf("*")]=/\*/g,b.html.find("label").each(function(){var f=a(this).text().toLowerCase(),g=a(this);a.each(d.required,function(a,c){f.search(c)>=0&&!b.html.find("#"+g.attr("for")).attr("aria-required")&&b.testFails("formWithRequiredLabel",g)}),e=g.css("color")+g.css("font-weight")+g.css("background-color"),c&&e!==c&&b.testFails("formWithRequiredLabel",g),c=e})},b.headersUseToMarkSections=function(){b.html.find("p").each(function(){var c=a(this);c.find("strong:first, em:first, i:first, b:first").each(function(){c.text()===a(this).text()&&b.testFails("headersUseToMarkSections",c)})})},b.imgAltIsDifferent=function(){b.html.find("img[alt][src]").each(function(){(a(this).attr("src")===a(this).attr("alt")||a(this).attr("src").split("/").pop()===a(this).attr("alt"))&&b.testFails("imgAltIsDifferent",a(this))})},b.imgAltIsTooLong=function(){b.html.find("img[alt]").each(function(){a(this).attr("alt").length>100&&b.testFails("imgAltIsTooLong",a(this))})},b.imgAltNotEmptyInAnchor=function(){b.html.find("a img").each(function(){b.isUnreadable(a(this).attr("alt"))&&b.isUnreadable(a(this).parent("a:first").text())&&b.testFails("imgAltNotEmptyInAnchor",a(this))})},b.imgAltTextNotRedundant=function(){var c={};b.html.find("img[alt]").each(function(){"undefined"==typeof c[a(this).attr("alt")]?c[a(this).attr("alt")]=a(this).attr("src"):c[a(this).attr("alt")]!==a(this).attr("src")&&b.testFails("imgAltTextNotRedundant",a(this))})},b.imgGifNoFlicker=function(){b.html.find('img[src$=".gif"]').each(function(){var c=a(this);a.ajax({url:c.attr("src"),async:!1,dataType:"text",success:function(a){-1!==a.search("NETSCAPE2.0")&&b.testFails("imgGifNoFlicker",c)}})})},b.imgHasLongDesc=function(){b.html.find("img[longdesc]").each(function(){a(this).attr("longdesc")!==a(this).attr("alt")&&b.validURL(a(this).attr("longdesc"))||b.testFails("imgHasLongDesc",a(this))})},b.imgImportantNoSpacerAlt=function(){b.html.find("img[alt]").each(function(){var c=a(this).width()?a(this).width():parseInt(a(this).attr("width"),10),d=a(this).height()?a(this).height():parseInt(a(this).attr("height"),10);b.isUnreadable(a(this).attr("alt").trim())&&a(this).attr("alt").length>0&&c>50&&d>50&&b.testFails("imgImportantNoSpacerAlt",a(this))})},b.imgMapAreasHaveDuplicateLink=function(){var c={};b.html.find("a").each(function(){c[a(this).attr("href")]=a(this).attr("href")}),b.html.find("img[usemap]").each(function(){var d=a(this),e=b.html.find(d.attr("usemap"));e.length||(e=b.html.find('map[name="'+d.attr("usemap").replace("#","")+'"]')),e.length&&e.find("area").each(function(){"undefined"==typeof c[a(this).attr("href")]&&b.testFails("imgMapAreasHaveDuplicateLink",d)})})},b.imgNonDecorativeHasAlt=function(){b.html.find("img[alt]").each(function(){b.isUnreadable(a(this).attr("alt"))&&(a(this).width()>100||a(this).height()>100)&&b.testFails("imgNonDecorativeHasAlt",a(this))})},b.imgWithMathShouldHaveMathEquivalent=function(){b.html.find("img:not(img:has(math), img:has(tagName))").each(function(){a(this).parent().find("math").length||b.testFails("imgWithMathShouldHaveMathEquivalent",a(this))})},b.inputCheckboxRequiresFieldset=function(){b.html.find(":checkbox").each(function(){a(this).parents("fieldset").length||b.testFails("inputCheckboxRequiresFieldset",a(this))})},b.inputImageAltIsNotFileName=function(){b.html.find("input[type=image][alt]").each(function(){a(this).attr("src")===a(this).attr("alt")&&b.testFails("inputImageAltIsNotFileName",a(this))})},b.inputImageAltIsShort=function(){b.html.find("input[type=image]").each(function(){a(this).attr("alt").length>100&&b.testFails("inputImageAltIsShort",a(this))})},b.inputImageAltNotRedundant=function(){b.html.find("input[type=image][alt]").each(function(){b.strings.redundant.inputImage.indexOf(b.cleanString(a(this).attr("alt")))>-1&&b.testFails("inputImageAltNotRedundant",a(this))})},b.labelMustBeUnique=function(){var c={};b.html.find("label[for]").each(function(){"undefined"!=typeof c[a(this).attr("for")]&&b.testFails("labelMustBeUnique",a(this)),c[a(this).attr("for")]=a(this).attr("for")})},b.labelsAreAssignedToAnInput=function(){b.html.find("label").each(function(){a(this).attr("for")?b.html.find("#"+a(this).attr("for")).length&&b.html.find("#"+a(this).attr("for")).is("input, select, textarea")||b.testFails("labelsAreAssignedToAnInput",a(this)):b.testFails("labelsAreAssignedToAnInput",a(this))})},b.listNotUsedForFormatting=function(){b.html.find("ol, ul").each(function(){a(this).find("li").length<2&&b.testFails("listNotUsedForFormatting",a(this))})},b.pNotUsedAsHeader=function(){var c={};b.html.find("p").each(function(){if(a(this).text().search(".")<1){var d=a(this);a.each(b.suspectPHeaderTags,function(c,e){d.find(e).length&&d.find(e).each(function(){a(this).text().trim()===d.text().trim()&&b.testFails("pNotUsedAsHeader",d)})}),a.each(b.suspectPCSSStyles,function(a,e){"undefined"!=typeof c[e]&&c[e]!==d.css(e)&&b.testFails("pNotUsedAsHeader",d),c[e]=d.css(e)}),"bold"===d.css("font-weight")&&b.testFails("pNotUsedAsHeader",d)}})},b.paragarphIsWrittenClearly=function(){b.html.find("p").each(function(){var c=b.components.textStatistics.cleanText(a(this).text());Math.round(206.835-1.015*b.components.textStatistics.averageWordsPerSentence(c)-84.6*b.components.textStatistics.averageSyllablesPerWord(c))<60&&b.testFails("paragarphIsWrittenClearly",a(this))})},b.preShouldNotBeUsedForTabularLayout=function(){b.html.find("pre").each(function(){var c=a(this).text().split(/[\n\r]+/);c.length>1&&a(this).text().search(/\t/)>-1&&b.testFails("preShouldNotBeUsedForTabularLayout",a(this))})},b.selectJumpMenu=function(){0!==b.html.find("select").length&&b.html.find("select").each(function(){0===a(this).parent("form").find(":submit").length&&b.components.hasEventListener(a(this),"change")&&b.testFails("selectJumpMenu",a(this))})},b.siteMap=function(){var c=!0;b.html.find("a").each(function(){var d=a(this).text().toLowerCase();a.each(b.strings.siteMap,function(a,b){return d.search(b)>-1?(c=!1,void 0):void 0}),c===!1}),c&&b.testFails("siteMap",b.html.find("body"))},b.tabIndexFollowsLogicalOrder=function(){var c=0;b.html.find("[tabindex]").each(function(){parseInt(a(this).attr("tabindex"),10)>=0&&parseInt(a(this).attr("tabindex"),10)!==c+1&&b.testFails("tabIndexFollowsLogicalOrder",a(this)),c++})},b.tableHeaderLabelMustBeTerse=function(){b.html.find("th, table tr:first td").each(function(){a(this).text().length>20&&(!a(this).attr("abbr")||a(this).attr("abbr").length>20)&&b.testFails("tableHeaderLabelMustBeTerse",a(this))})},b.tableLayoutDataShouldNotHaveTh=function(){b.html.find("table:has(th)").each(function(){b.isDataTable(a(this))||b.testFails("tableLayoutDataShouldNotHaveTh",a(this))})},b.tableLayoutHasNoCaption=function(){b.html.find("table:has(caption)").each(function(){b.isDataTable(a(this))||b.testFails("tableLayoutHasNoCaption",a(this))})},b.tableLayoutHasNoSummary=function(){b.html.find("table[summary]").each(function(){b.isDataTable(a(this))||b.isUnreadable(a(this).attr("summary"))||b.testFails("tableLayoutHasNoSummary",a(this))})},b.tableLayoutMakesSenseLinearized=function(){b.html.find("table").each(function(){b.isDataTable(a(this))||b.testFails("tableLayoutMakesSenseLinearized",a(this))})},b.tableNotUsedForLayout=function(){b.html.find("table").each(function(){b.isDataTable(a(this))||b.testFails("tableNotUsedForLayout",a(this))})},b.tableSummaryDoesNotDuplicateCaption=function(){b.html.find("table[summary]:has(caption)").each(function(){b.cleanString(a(this).attr("summary"))===b.cleanString(a(this).find("caption:first").text())&&b.testFails("tableSummaryDoesNotDuplicateCaption",a(this))})},b.tableSummaryIsNotTooLong=function(){b.html.find("table[summary]").each(function(){a(this).attr("summary").trim().length>100&&b.testFails("tableSummaryIsNotTooLong",a(this))})},b.tableUseColGroup=function(){b.html.find("table").each(function(){b.isDataTable(a(this))&&!a(this).find("colgroup").length&&b.testFails("tableUseColGroup",a(this))})},b.tableUsesAbbreviationForHeader=function(){b.html.find("th:not(th[abbr])").each(function(){a(this).text().length>20&&b.testFails("tableUsesAbbreviationForHeader",a(this))})},b.tableUsesScopeForRow=function(){b.html.find("table").each(function(){a(this).find("td:first-child").each(function(){var c=a(this).next("td");("bold"===a(this).css("font-weight")&&"bold"!==c.css("font-weight")||a(this).find("strong").length&&!c.find("strong").length)&&b.testFails("tableUsesScopeForRow",a(this))}),a(this).find("td:last-child").each(function(){var c=a(this).prev("td");("bold"===a(this).css("font-weight")&&"bold"!==c.css("font-weight")||a(this).find("strong").length&&!c.find("strong").length)&&b.testFails("tableUsesScopeForRow",a(this))})})},b.tableWithMoreHeadersUseID=function(){b.html.find("table:has(th)").each(function(){var c=a(this),d=0;c.find("tr").each(function(){a(this).find("th").length&&d++,d>1&&!a(this).find("th[id]").length&&b.testFails("tableWithMoreHeadersUseID",c)})})},b.tabularDataIsInTable=function(){b.html.find("pre").each(function(){a(this).html().search(" ")>=0&&b.testFails("tabularDataIsInTable",a(this))})},b.textIsNotSmall=function(){b.html.find(b.textSelector).each(function(){var c=a(this).css("font-size");c.search("em")>0&&(c=b.components.convertToPx(c)),c=parseInt(c.replace("px",""),10),10>c&&b.testFails("textIsNotSmall",a(this))})},b.videosEmbeddedOrLinkedNeedCaptions=function(){b.html.find("a").each(function(){var c=a(this);a.each(b.components.video,function(a,d){d.isVideo(c.attr("href"))&&d.hasCaptions(function(a){a||b.testFails("videosEmbeddedOrLinkedNeedCaptions",c)})})})}}(jQuery); \ No newline at end of file +/*! QUAIL quailjs.org | quailjs.org/license */!function(a){a.fn.quail=function(a){return this.length?(b.options=a,b.html=this,b.run(),this):this},a.expr[":"].quailCss=function(b,c,d){var e=d[3].split(/\s*=\s*/);return a(b).css(e[0]).search(e[1])>-1};var b={options:{},components:{},testabilityTranslation:{0:"suggestion",.5:"moderate",1:"severe"},html:{},strings:{},accessibilityResults:{},accessibilityTests:{},textSelector:"p, h1, h2, h3, h4, h5, h6, div, pre, blockquote, aside, article, details, summary, figcaption, footer, header, hgroup, nav, section, strong, em, del, i, b",suspectPHeaderTags:["strong","b","em","i","u","font"],suspectPCSSStyles:["color","font-weight","font-size","font-family"],run:function(){if(b.options.reset&&(b.accessibilityResults={}),"undefined"!=typeof b.options.accessibilityTests?b.accessibilityTests=b.options.accessibilityTests:a.ajax({url:b.options.jsonPath+"/tests.json",async:!1,dataType:"json",success:function(a){"object"==typeof a&&(b.accessibilityTests=a)}}),"undefined"!=typeof b.options.customTests)for(var c in b.options.customTests)b.accessibilityTests[c]=b.options.customTests[c];if("string"==typeof b.options.guideline&&a.ajax({url:b.options.jsonPath+"/guidelines/"+b.options.guideline+".tests.json",async:!1,dataType:"json",success:function(a){b.options.guideline=a}}),"undefined"==typeof b.options.guideline){b.options.guideline=[];for(var d in b.accessibilityTests)b.options.guideline.push(d)}if(b.runTests(),"undefined"!=typeof b.options.complete){var e={totals:{severe:0,moderate:0,suggestion:0},results:b.accessibilityResults};a.each(e.results,function(a,c){e.totals[b.testabilityTranslation[b.accessibilityTests[a].testability]]+=c.elements.length}),b.options.complete(e)}},getConfiguration:function(a){return"undefined"==typeof this.options.guidelineName||"undefined"==typeof this.accessibilityTests[a].guidelines||"undefined"==typeof this.accessibilityTests[a].guidelines[this.options.guidelineName]||"undefined"==typeof this.accessibilityTests[a].guidelines[this.options.guidelineName].configuration?!1:this.accessibilityTests[a].guidelines[this.options.guidelineName].configuration},testFails:function(a,c,d){if(d=d||{},("undefined"==typeof b.options.preFilter||b.options.preFilter(a,c,d)!==!1)&&(b.accessibilityResults[a].elements.push(c),"undefined"!=typeof b.options.testFailed)){var e="undefined"!=typeof b.accessibilityTests[a].testability?b.accessibilityTests[a].testability:"unknown";b.options.testFailed({element:c,testName:a,test:b.accessibilityTests[a],testability:e,severity:b.testabilityTranslation[e],options:d})}},runTests:function(){a.each(b.options.guideline,function(c,d){if("undefined"!=typeof b.accessibilityTests[d]){var e=b.accessibilityTests[d].type;"undefined"==typeof b.accessibilityResults[d]&&(b.accessibilityResults[d]={test:b.accessibilityTests[d],elements:[]}),"selector"===e&&b.html.find(b.accessibilityTests[d].selector).each(function(){b.testFails(d,a(this))}),"custom"===e&&("object"==typeof b.accessibilityTests[d].callback||"function"==typeof b.accessibilityTests[d].callback?b.accessibilityTests[d].callback(b):"undefined"!=typeof b[b.accessibilityTests[d].callback]&&b[b.accessibilityTests[d].callback]()),"undefined"!=typeof b.components[e]&&b.components[e](d,b.accessibilityTests[d])}})},isUnreadable:function(a){return"string"!=typeof a?!0:a.trim().length?!1:!0},isDataTable:function(b){if(b.find("tr").length<3)return!1;if(b.find("th[scope]").length)return!0;var c=b.find("tr:has(td)").length,d=b.find("td[rowspan], td[colspan]"),e=!0;if(d.length){var f={};d.each(function(){"undefined"==typeof f[a(this).index()]&&(f[a(this).index()]=0),f[a(this).index()]++}),a.each(f,function(a,b){c>b&&(e=!1)})}var g=b.find("table");if(g.length){var h={};g.each(function(){var b=a(this).parent("td").index();b!==!1&&"undefined"==typeof h[b]&&(h[b]=0),h[b]++}),a.each(h,function(a,b){c>b&&(e=!1)})}return e},validURL:function(a){return-1===a.search(" ")?!0:!1},cleanString:function(a){return a.toLowerCase().replace(/^\s\s*/,"")},containsReadableText:function(c,d){if(c=c.clone(),c.find("option").remove(),!b.isUnreadable(c.text()))return!0;if(!b.isUnreadable(c.attr("alt")))return!0;if(d){var e=!1;if(c.find("*").each(function(){b.containsReadableText(a(this),!0)&&(e=!0)}),e)return!0}return!1}};b.components.acronym=function(c){var d={},e={};b.html.find("acronym[title], abbr[title]").each(function(){d[a(this).text().toUpperCase()]=a(this).attr("title")}),b.html.find("p, div, h1, h2, h3, h4, h5").each(function(){var f=a(this),g=a(this).text().split(" ");g.length>1&&a(this).text().toUpperCase()!==a(this).text()&&a.each(g,function(a,g){g=g.replace(/[^a-zA-Zs]/,""),g.toUpperCase()===g&&g.length>1&&"undefined"==typeof d[g.toUpperCase()]&&("undefined"==typeof e[g.toUpperCase()]&&b.testFails(c,f,{acronym:g.toUpperCase()}),e[g.toUpperCase()]=g)})})},b.components.color=function(c,d){if(d.bodyForegroundAttribute&&d.bodyBackgroundAttribute){var e=b.html.find("body").clone(!1,!1),f=e.attr(d.bodyForegroundAttribute),g=e.attr(d.bodyBackgroundAttribute);"undefined"==typeof f&&(f="rgb(0,0,0)"),"undefined"==typeof g&&(f="rgb(255,255,255)"),e.css("color",f),e.css("background-color",g),("wcag"===d.algorithm&&!b.colors.passesWCAG(e)||"wai"===d.algorithm&&!b.colors.passesWAI(e))&&b.testFails(c,e)}b.html.find(d.selector).filter(b.textSelector).each(function(){(!b.isUnreadable(a(this).text())&&"wcag"===d.algorithm&&!b.colors.passesWCAG(a(this))||"wai"===d.algorithm&&!b.colors.passesWAI(a(this)))&&b.testFails(c,a(this))})},b.colors={getLuminosity:function(a,b){a=this.cleanup(a),b=this.cleanup(b);var c,d,e=a.r/255,f=a.g/255,g=a.b/255,h=.03928>=e?e/12.92:Math.pow((e+.055)/1.055,2.4),i=.03928>=f?f/12.92:Math.pow((f+.055)/1.055,2.4),j=.03928>=g?g/12.92:Math.pow((g+.055)/1.055,2.4),k=b.r/255,l=b.g/255,m=b.b/255,n=.03928>=k?k/12.92:Math.pow((k+.055)/1.055,2.4),o=.03928>=l?l/12.92:Math.pow((l+.055)/1.055,2.4),p=.03928>=m?m/12.92:Math.pow((m+.055)/1.055,2.4);return c=.2126*h+.7152*i+.0722*j,d=.2126*n+.7152*o+.0722*p,Math.round((Math.max(c,d)+.05)/(Math.min(c,d)+.05)*10)/10},fetchImageColor:function(){var b=new Image,c=a(this).css("background-image").replace("url(","").replace(/'/,"").replace(")","");b.src=c;var d=document.createElement("canvas"),e=d.getContext("2d");e.drawImage(b,0,0);var f=e.getImageData(0,0,1,1).data;return"rgb("+f[0]+","+f[1]+","+f[2]+")"},passesWCAG:function(a){return b.colors.getLuminosity(b.colors.getColor(a,"foreground"),b.colors.getColor(a,"background"))>5},passesWAI:function(a){var c=b.colors.cleanup(b.colors.getColor(a,"foreground")),d=b.colors.cleanup(b.colors.getColor(a,"background"));return b.colors.getWAIErtContrast(c,d)>500&&b.colors.getWAIErtBrightness(c,d)>125},getWAIErtContrast:function(a,c){var d=b.colors.getWAIDiffs(a,c);return d.red+d.green+d.blue},getWAIErtBrightness:function(a,c){var d=b.colors.getWAIDiffs(a,c);return(299*d.red+587*d.green+114*d.blue)/1e3},getWAIDiffs:function(a,b){var c={};return c.red=Math.abs(a.r-b.r),c.green=Math.abs(a.g-b.g),c.blue=Math.abs(a.b-b.b),c},getColor:function(b,c){if("foreground"===c)return b.css("color")?b.css("color"):"rgb(255,255,255)";if("rgba(0, 0, 0, 0)"!==b.css("background-color")&&"transparent"!==b.css("background-color")||"body"===b.get(0).tagName)return b.css("background-color")?b.css("background-color"):"rgb(0,0,0)";var d="rgb(0,0,0)";return b.parents().each(function(){return"rgba(0, 0, 0, 0)"!==a(this).css("background-color")&&"transparent"!==a(this).css("background-color")?(d=a(this).css("background-color"),!1):void 0}),d},cleanup:function(a){return a=a.replace("rgb(","").replace("rgba(","").replace(")","").split(","),{r:a[0],g:a[1],b:a[2],a:"undefined"==typeof a[3]?!1:a[3]}}},b.components.convertToPx=function(c){var d=a('
 
').appendTo(b.html),e=d.height();return d.remove(),e},b.components.event=function(c,d){var e="undefined"==typeof d.selector?b.html.find("*"):b.html.find(d.selector);e.each(function(){!b.components.hasEventListener(a(this),d.searchEvent.replace("on",""))||"undefined"!=typeof d.correspondingEvent&&b.components.hasEventListener(a(this),d.correspondingEvent.replace("on",""))||b.testFails(c,a(this))})},b.components.hasEventListener=function(b,c){return"undefined"!=typeof a(b).attr("on"+c)?!0:"undefined"!=typeof a(b).get(0)[c]},b.components.header=function(c,d){var e=parseInt(d.selector.substr(-1,1),10),f=!1;b.html.find("h1, h2, h3, h4, h5, h6").each(function(){var d=parseInt(a(this).get(0).tagName.substr(-1,1),10);f&&(d-1>e||e>d+1)&&b.testFails(c,a(this)),d===e&&(f=a(this)),f&&d!==e&&(f=!1)})},b.components.label=function(c,d){b.html.find(d.selector).each(function(){a(this).parent("label").length&&b.containsReadableText(a(this).parent("label"))||b.html.find("label[for="+a(this).attr("id")+"]").length&&b.containsReadableText(b.html.find("label[for="+a(this).attr("id")+"]"))||b.testFails(c,a(this))})},b.components.labelProximity=function(c,d){b.html.find(d.selector).each(function(){var d=b.html.find("label[for="+a(this).attr("id")+"]").first();d.length||b.testFails(c,a(this)),a(this).parent().is(d.parent())||b.testFails(c,a(this))})},b.components.placeholder=function(c,d){b.html.find(d.selector).each(function(){var e;if("undefined"!=typeof d.attribute){if("undefined"==typeof a(this).attr(d.attribute)||"tabindex"===d.attribute&&a(this).attr(d.attribute)<=0)return b.testFails(c,a(this)),void 0;e=a(this).attr(d.attribute)}else e=a(this).text(),a(this).find("img[alt]").each(function(){e+=a(this).attr("alt")});if("string"==typeof e){e=b.cleanString(e);var f=/^([0-9]*)(k|kb|mb|k bytes|k byte)$/g,g=f.exec(e.toLowerCase());g&&g[0].length?b.testFails(c,a(this)):d.empty&&b.isUnreadable(e)?b.testFails(c,a(this)):b.strings.placeholders.indexOf(e)>-1&&b.testFails(c,a(this))}else d.empty&&"number"!=typeof e&&b.testFails(c,a(this))})},b.statistics={setDecimal:function(a,b){var c=Math.pow(10,b||0);return b?Math.round(c*a)/c:a},average:function(a,c){for(var d=a.length,e=0;d--;)e+=a[d];return b.statistics.setDecimal(e/a.length,c)},variance:function(a,c){for(var d=b.statistics.average(a,c),e=a.length,f=0;e--;)f+=Math.pow(a[e]-d,2);return f/=a.length,b.statistics.setDecimal(f,c)},standardDeviation:function(a,c){var d=Math.sqrt(b.statistics.variance(a,c));return b.statistics.setDecimal(d,c)}},b.components.textStatistics={cleanText:function(a){return a.replace(/[,:;()\-]/," ").replace(/[\.!?]/,".").replace(/[ ]*(\n|\r\n|\r)[ ]*/," ").replace(/([\.])[\. ]+/,"$1").replace(/[ ]*([\.])/,"$1").replace(/[ ]+/," ").toLowerCase()},sentenceCount:function(a){var b=a;return b.split(".").length+1},wordCount:function(a){var b=a;return b.split(" ").length+1},averageWordsPerSentence:function(a){return this.wordCount(a)/this.sentenceCount(a)},averageSyllablesPerWord:function(b){var c=this,d=0,e=c.wordCount(b);return e?(a.each(b.split(" "),function(a,b){d+=c.syllableCount(b)}),d/e):0},syllableCount:function(a){var b=a.replace(/(?:[^laeiouy]es|ed|[^laeiouy]e)$/,"").match(/[aeiouy]{1,2}/g);return b&&0!==b.length?b.length:1}},b.components.video={youTube:{videoID:"",apiUrl:"http://gdata.youtube.com/feeds/api/videos/?q=%video&caption&v=2&alt=json",isVideo:function(a){var b=/^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/,c=a.match(b);return c&&11===c[7].length?(this.videoID=c[7],!0):!1},hasCaptions:function(b){a.ajax({url:this.apiUrl.replace("%video",this.videoID),async:!1,dataType:"json",success:function(a){b(a.feed.openSearch$totalResults.$t>0?!0:!1)}})}}},b.strings.colors={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"},b.strings.emoticons=[":)",";)",":-)",":^)","=)","B)","8)","c8","cB","=]",":]","x]",":-)",":)",":o)","=]",":-D",":D","=D",":-(",":(","=(",":/",":P",":o"],b.strings.languageCodes=["bh","bi","nb","bs","br","bg","my","es","ca","km","ch","ce","ny","ny","zh","za","cu","cu","cv","kw","co","cr","hr","cs","da","dv","dv","nl","dz","en","eo","et","ee","fo","fj","fi","nl","fr","ff","gd","gl","lg","ka","de","ki","el","kl","gn","gu","ht","ht","ha","he","hz","hi","ho","hu","is","io","ig","id","ia","ie","iu","ik","ga","it","ja","jv","kl","kn","kr","ks","kk","ki","rw","ky","kv","kg","ko","kj","ku","kj","ky","lo","la","lv","lb","li","li","li","ln","lt","lu","lb","mk","mg","ms","ml","dv","mt","gv","mi","mr","mh","ro","ro","mn","na","nv","nv","nd","nr","ng","ne","nd","se","no","nb","nn","ii","ny","nn","ie","oc","oj","cu","cu","cu","or","om","os","os","pi","pa","ps","fa","pl","pt","pa","ps","qu","ro","rm","rn","ru","sm","sg","sa","sc","gd","sr","sn","ii","sd","si","si","sk","sl","so","st","nr","es","su","sw","ss","sv","tl","ty","tg","ta","tt","te","th","bo","ti","to","ts","tn","tr","tk","tw","ug","uk","ur","ug","uz","ca","ve","vi","vo","wa","cy","fy","wo","xh","yi","yo","za","zu"],b.strings.placeholders=["title","untitled","untitled document","this is the title","the title","content"," ","new page","new","nbsp"," ","spacer","image","img","photo","frame","frame title","iframe","iframe title","legend"],b.strings.redundant={inputImage:["submit","button"],link:["link to","link","go to","click here","link","click","more"],required:["*"]},b.strings.siteMap=["site map","map","sitemap"],b.strings.suspiciousLinks=["click here","click","more","here","read more","download","add","delete","clone","order","view","read","clic aquí","clic","haga clic","más","aquí","image"],b.strings.symbols=["|","*",/\*/g,"
*","•","•"],b.aAdjacentWithSameResourceShouldBeCombined=function(){b.html.find("a").each(function(){a(this).next("a").attr("href")===a(this).attr("href")&&b.testFails("aAdjacentWithSameResourceShouldBeCombined",a(this))})},b.aImgAltNotRepetative=function(){b.html.find("a img[alt]").each(function(){b.cleanString(a(this).attr("alt"))===b.cleanString(a(this).parent("a").text())&&b.testFails("aImgAltNotRepetative",a(this).parent("a"))})},b.aLinkTextDoesNotBeginWithRedundantWord=function(){b.html.find("a").each(function(){var c=a(this),d="";a(this).find("img[alt]").length&&(d+=a(this).find("img[alt]:first").attr("alt")),d+=a(this).text(),d=d.toLowerCase(),a.each(b.strings.redundant.link,function(a,e){d.search(e)>-1&&b.testFails("aLinkTextDoesNotBeginWithRedundantWord",c)})})},b.aLinksAreSeperatedByPrintableCharacters=function(){b.html.find("a").each(function(){a(this).next("a").length&&b.isUnreadable(a(this).get(0).nextSibling.wholeText)&&b.testFails("aLinksAreSeperatedByPrintableCharacters",a(this))})},b.aLinksNotSeparatedBySymbols=function(){b.html.find("a").each(function(){a(this).next("a").length&&-1!==b.strings.symbols.indexOf(a(this).get(0).nextSibling.wholeText.toLowerCase().trim())&&b.testFails("aLinksNotSeparatedBySymbols",a(this))})},b.aMustContainText=function(){b.html.find("a").each(function(){b.containsReadableText(a(this),!0)||(a(this).attr("name")||a(this).attr("id"))&&!a(this).attr("href")||b.testFails("aMustContainText",a(this))})},b.aSuspiciousLinkText=function(){b.html.find("a").each(function(){var c=a(this).text();a(this).find("img[alt]").each(function(){c+=a(this).attr("alt")}),b.strings.suspiciousLinks.indexOf(b.cleanString(c))>-1&&b.testFails("aSuspiciousLinkText",a(this))})},b.appletContainsTextEquivalent=function(){b.html.find("applet[alt=], applet:not(applet[alt])").each(function(){b.isUnreadable(a(this).text())&&b.testFails("appletContainsTextEquivalent",a(this))})},b.blockquoteUseForQuotations=function(){b.html.find("p").each(function(){a(this).text().substr(0,1).search(/[\'\"]/)>-1&&a(this).text().substr(-1,1).search(/[\'\"]/)>-1&&b.testFails("blockquoteUseForQuotations",a(this))})},b.doctypeProvided=function(){0===a(b.html.get(0).doctype).length&&b.testFails("doctypeProvided",b.html.find("html"))},b.documentAbbrIsUsed=function(){b.components.acronym("documentAbbrIsUsed","abbr")},b.documentAcronymsHaveElement=function(){b.components.acronym("documentAcronymsHaveElement","acronym")},b.documentIDsMustBeUnique=function(){var c=[];b.html.find("*[id]").each(function(){c.indexOf(a(this).attr("id"))>=0&&b.testFails("documentIDsMustBeUnique",a(this)),c.push(a(this).attr("id"))})},b.documentIsWrittenClearly=function(){b.html.find(b.textSelector).each(function(){var c=b.components.textStatistics.cleanText(a(this).text());Math.round(206.835-1.015*b.components.textStatistics.averageWordsPerSentence(c)-84.6*b.components.textStatistics.averageSyllablesPerWord(c))<60&&b.testFails("documentIsWrittenClearly",a(this))})},b.documentLangIsISO639Standard=function(){var a=b.html.find("html").attr("lang");a&&-1===b.strings.languageCodes.indexOf(a)&&b.testFails("documentLangIsISO639Standard",b.html.find("html"))},b.documentStrictDocType=function(){a(b.html.get(0).doctype).length&&-1!==b.html.get(0).doctype.systemId.indexOf("strict")||b.testFails("documentStrictDocType",b.html.find("html"))},b.documentTitleIsShort=function(){b.html.find("head title:first").text().length>150&&b.testFails("documentTitleIsShort",b.html.find("head title:first"))},b.documentValidatesToDocType=function(){"undefined"==typeof document.doctype},b.documentVisualListsAreMarkedUp=function(){b.html.find("p, div, h1, h2, h3, h4, h5, h6").each(function(){var c=a(this);a.each(b.strings.symbols,function(a,d){c.text().split(d).length>2&&b.testFails("documentVisualListsAreMarkedUp",c)})})},b.embedHasAssociatedNoEmbed=function(){b.html.find("noembed").length||b.html.find("embed").each(function(){b.testFails("embedHasAssociatedNoEmbed",a(this))})},b.emoticonsExcessiveUse=function(){var c=0;b.html.find("p, div, h1, h2, h3, h4, h5, h6").each(function(){var d=a(this);a.each(d.text().split(" "),function(a,d){b.strings.emoticons.indexOf(d)>-1&&c++,c>4}),c>4&&b.testFails("emoticonsExcessiveUse",d)})},b.emoticonsMissingAbbr=function(){b.html.find("p, div, h1, h2, h3, h4, h5, h6").each(function(){var c=a(this),d=c.clone();d.find("abbr, acronym").each(function(){a(this).remove()}),a.each(d.text().split(" "),function(a,d){b.strings.emoticons.indexOf(d)>-1&&b.testFails("emoticonsMissingAbbr",c)})})},b.formWithRequiredLabel=function(){var c,d=b.strings.redundant,e=!1;d.required[d.required.indexOf("*")]=/\*/g,b.html.find("label").each(function(){var f=a(this).text().toLowerCase(),g=a(this);a.each(d.required,function(a,c){f.search(c)>=0&&!b.html.find("#"+g.attr("for")).attr("aria-required")&&b.testFails("formWithRequiredLabel",g)}),e=g.css("color")+g.css("font-weight")+g.css("background-color"),c&&e!==c&&b.testFails("formWithRequiredLabel",g),c=e})},b.headersUseToMarkSections=function(){b.html.find("p").each(function(){var c=a(this);c.find("strong:first, em:first, i:first, b:first").each(function(){c.text()===a(this).text()&&b.testFails("headersUseToMarkSections",c)})})},b.imgAltIsDifferent=function(){b.html.find("img[alt][src]").each(function(){(a(this).attr("src")===a(this).attr("alt")||a(this).attr("src").split("/").pop()===a(this).attr("alt"))&&b.testFails("imgAltIsDifferent",a(this))})},b.imgAltIsTooLong=function(){b.html.find("img[alt]").each(function(){a(this).attr("alt").length>100&&b.testFails("imgAltIsTooLong",a(this))})},b.imgAltNotEmptyInAnchor=function(){b.html.find("a img").each(function(){b.isUnreadable(a(this).attr("alt"))&&b.isUnreadable(a(this).parent("a:first").text())&&b.testFails("imgAltNotEmptyInAnchor",a(this))})},b.imgAltTextNotRedundant=function(){var c={};b.html.find("img[alt]").each(function(){"undefined"==typeof c[a(this).attr("alt")]?c[a(this).attr("alt")]=a(this).attr("src"):c[a(this).attr("alt")]!==a(this).attr("src")&&b.testFails("imgAltTextNotRedundant",a(this))})},b.imgGifNoFlicker=function(){b.html.find('img[src$=".gif"]').each(function(){var c=a(this);a.ajax({url:c.attr("src"),async:!1,dataType:"text",success:function(a){-1!==a.search("NETSCAPE2.0")&&b.testFails("imgGifNoFlicker",c)}})})},b.imgHasLongDesc=function(){b.html.find("img[longdesc]").each(function(){a(this).attr("longdesc")!==a(this).attr("alt")&&b.validURL(a(this).attr("longdesc"))||b.testFails("imgHasLongDesc",a(this))})},b.imgImportantNoSpacerAlt=function(){b.html.find("img[alt]").each(function(){var c=a(this).width()?a(this).width():parseInt(a(this).attr("width"),10),d=a(this).height()?a(this).height():parseInt(a(this).attr("height"),10);b.isUnreadable(a(this).attr("alt").trim())&&a(this).attr("alt").length>0&&c>50&&d>50&&b.testFails("imgImportantNoSpacerAlt",a(this))})},b.imgMapAreasHaveDuplicateLink=function(){var c={};b.html.find("a").each(function(){c[a(this).attr("href")]=a(this).attr("href")}),b.html.find("img[usemap]").each(function(){var d=a(this),e=b.html.find(d.attr("usemap"));e.length||(e=b.html.find('map[name="'+d.attr("usemap").replace("#","")+'"]')),e.length&&e.find("area").each(function(){"undefined"==typeof c[a(this).attr("href")]&&b.testFails("imgMapAreasHaveDuplicateLink",d)})})},b.imgNonDecorativeHasAlt=function(){b.html.find("img[alt]").each(function(){b.isUnreadable(a(this).attr("alt"))&&(a(this).width()>100||a(this).height()>100)&&b.testFails("imgNonDecorativeHasAlt",a(this))})},b.imgWithMathShouldHaveMathEquivalent=function(){b.html.find("img:not(img:has(math), img:has(tagName))").each(function(){a(this).parent().find("math").length||b.testFails("imgWithMathShouldHaveMathEquivalent",a(this))})},b.inputCheckboxRequiresFieldset=function(){b.html.find(":checkbox").each(function(){a(this).parents("fieldset").length||b.testFails("inputCheckboxRequiresFieldset",a(this))})},b.inputImageAltIsNotFileName=function(){b.html.find("input[type=image][alt]").each(function(){a(this).attr("src")===a(this).attr("alt")&&b.testFails("inputImageAltIsNotFileName",a(this))})},b.inputImageAltIsShort=function(){b.html.find("input[type=image]").each(function(){a(this).attr("alt").length>100&&b.testFails("inputImageAltIsShort",a(this))})},b.inputImageAltNotRedundant=function(){b.html.find("input[type=image][alt]").each(function(){b.strings.redundant.inputImage.indexOf(b.cleanString(a(this).attr("alt")))>-1&&b.testFails("inputImageAltNotRedundant",a(this))})},b.labelMustBeUnique=function(){var c={};b.html.find("label[for]").each(function(){"undefined"!=typeof c[a(this).attr("for")]&&b.testFails("labelMustBeUnique",a(this)),c[a(this).attr("for")]=a(this).attr("for")})},b.labelsAreAssignedToAnInput=function(){b.html.find("label").each(function(){a(this).attr("for")?b.html.find("#"+a(this).attr("for")).length&&b.html.find("#"+a(this).attr("for")).is("input, select, textarea")||b.testFails("labelsAreAssignedToAnInput",a(this)):b.testFails("labelsAreAssignedToAnInput",a(this))})},b.listNotUsedForFormatting=function(){b.html.find("ol, ul").each(function(){a(this).find("li").length<2&&b.testFails("listNotUsedForFormatting",a(this))})},b.pNotUsedAsHeader=function(){var c={};b.html.find("p").each(function(){if(a(this).text().search(".")<1){var d=a(this);a.each(b.suspectPHeaderTags,function(c,e){d.find(e).length&&d.find(e).each(function(){a(this).text().trim()===d.text().trim()&&b.testFails("pNotUsedAsHeader",d)})}),a.each(b.suspectPCSSStyles,function(a,e){"undefined"!=typeof c[e]&&c[e]!==d.css(e)&&b.testFails("pNotUsedAsHeader",d),c[e]=d.css(e)}),"bold"===d.css("font-weight")&&b.testFails("pNotUsedAsHeader",d)}})},b.paragarphIsWrittenClearly=function(){b.html.find("p").each(function(){var c=b.components.textStatistics.cleanText(a(this).text());Math.round(206.835-1.015*b.components.textStatistics.averageWordsPerSentence(c)-84.6*b.components.textStatistics.averageSyllablesPerWord(c))<60&&b.testFails("paragarphIsWrittenClearly",a(this))})},b.preShouldNotBeUsedForTabularLayout=function(){b.html.find("pre").each(function(){var c=a(this).text().split(/[\n\r]+/);c.length>1&&a(this).text().search(/\t/)>-1&&b.testFails("preShouldNotBeUsedForTabularLayout",a(this))})},b.selectJumpMenu=function(){0!==b.html.find("select").length&&b.html.find("select").each(function(){0===a(this).parent("form").find(":submit").length&&b.components.hasEventListener(a(this),"change")&&b.testFails("selectJumpMenu",a(this))})},b.siteMap=function(){var c=!0;b.html.find("a").each(function(){var d=a(this).text().toLowerCase();a.each(b.strings.siteMap,function(a,b){return d.search(b)>-1?(c=!1,void 0):void 0}),c===!1}),c&&b.testFails("siteMap",b.html.find("body"))},b.tabIndexFollowsLogicalOrder=function(){var c=0;b.html.find("[tabindex]").each(function(){parseInt(a(this).attr("tabindex"),10)>=0&&parseInt(a(this).attr("tabindex"),10)!==c+1&&b.testFails("tabIndexFollowsLogicalOrder",a(this)),c++})},b.tableHeaderLabelMustBeTerse=function(){b.html.find("th, table tr:first td").each(function(){a(this).text().length>20&&(!a(this).attr("abbr")||a(this).attr("abbr").length>20)&&b.testFails("tableHeaderLabelMustBeTerse",a(this))})},b.tableLayoutDataShouldNotHaveTh=function(){b.html.find("table:has(th)").each(function(){b.isDataTable(a(this))||b.testFails("tableLayoutDataShouldNotHaveTh",a(this))})},b.tableLayoutHasNoCaption=function(){b.html.find("table:has(caption)").each(function(){b.isDataTable(a(this))||b.testFails("tableLayoutHasNoCaption",a(this))})},b.tableLayoutHasNoSummary=function(){b.html.find("table[summary]").each(function(){b.isDataTable(a(this))||b.isUnreadable(a(this).attr("summary"))||b.testFails("tableLayoutHasNoSummary",a(this))})},b.tableLayoutMakesSenseLinearized=function(){b.html.find("table").each(function(){b.isDataTable(a(this))||b.testFails("tableLayoutMakesSenseLinearized",a(this))})},b.tableNotUsedForLayout=function(){b.html.find("table").each(function(){b.isDataTable(a(this))||b.testFails("tableNotUsedForLayout",a(this))})},b.tableSummaryDoesNotDuplicateCaption=function(){b.html.find("table[summary]:has(caption)").each(function(){b.cleanString(a(this).attr("summary"))===b.cleanString(a(this).find("caption:first").text())&&b.testFails("tableSummaryDoesNotDuplicateCaption",a(this))})},b.tableSummaryIsNotTooLong=function(){b.html.find("table[summary]").each(function(){a(this).attr("summary").trim().length>100&&b.testFails("tableSummaryIsNotTooLong",a(this))})},b.tableUseColGroup=function(){b.html.find("table").each(function(){b.isDataTable(a(this))&&!a(this).find("colgroup").length&&b.testFails("tableUseColGroup",a(this))})},b.tableUsesAbbreviationForHeader=function(){b.html.find("th:not(th[abbr])").each(function(){a(this).text().length>20&&b.testFails("tableUsesAbbreviationForHeader",a(this))})},b.tableUsesScopeForRow=function(){b.html.find("table").each(function(){a(this).find("td:first-child").each(function(){var c=a(this).next("td");("bold"===a(this).css("font-weight")&&"bold"!==c.css("font-weight")||a(this).find("strong").length&&!c.find("strong").length)&&b.testFails("tableUsesScopeForRow",a(this))}),a(this).find("td:last-child").each(function(){var c=a(this).prev("td");("bold"===a(this).css("font-weight")&&"bold"!==c.css("font-weight")||a(this).find("strong").length&&!c.find("strong").length)&&b.testFails("tableUsesScopeForRow",a(this))})})},b.tableWithMoreHeadersUseID=function(){b.html.find("table:has(th)").each(function(){var c=a(this),d=0;c.find("tr").each(function(){a(this).find("th").length&&d++,d>1&&!a(this).find("th[id]").length&&b.testFails("tableWithMoreHeadersUseID",c)})})},b.tabularDataIsInTable=function(){b.html.find("pre").each(function(){a(this).html().search(" ")>=0&&b.testFails("tabularDataIsInTable",a(this))})},b.textIsNotSmall=function(){b.html.find(b.textSelector).each(function(){var c=a(this).css("font-size");c.search("em")>0&&(c=b.components.convertToPx(c)),c=parseInt(c.replace("px",""),10),10>c&&b.testFails("textIsNotSmall",a(this))})},b.videosEmbeddedOrLinkedNeedCaptions=function(){b.html.find("a").each(function(){var c=a(this);a.each(b.components.video,function(a,d){d.isVideo(c.attr("href"))&&d.hasCaptions(function(a){a||b.testFails("videosEmbeddedOrLinkedNeedCaptions",c)})})})}}(jQuery); \ No newline at end of file diff --git a/package.json b/package.json index 572a1218c..da1656d41 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "quail", "description": "A javascript content accessibility checker.", "homepage": "http://quailjs.org", - "version": "2.1.0", + "version": "2.1.1", "engines": { "node": ">= 0.10.20" }, diff --git a/quail.jquery.json b/quail.jquery.json index 88f8824d9..68ae7ce17 100644 --- a/quail.jquery.json +++ b/quail.jquery.json @@ -6,7 +6,7 @@ "homepage": "http://quailjs.org", "docs": "http://quail.readthedocs.org/en/latest/", "demo": "http://quailjs.org/examples/", - "version": "2.1.0", + "version": "2.1.1", "author": { "name": "Kevin Miller", "email": "kevin@csumb.edu", diff --git a/quail.json b/quail.json index f797c8e87..8ff4fa0fa 100644 --- a/quail.json +++ b/quail.json @@ -2,7 +2,7 @@ "name": "quail", "title": "Quail", "description": "QUAIL Accessibility Information Library.", - "version": "2.1.0", + "version": "2.1.1", "homepage": "https://github.com/kevee/quail", "author": { "name": "Kevin Miller", diff --git a/src/js/core.js b/src/js/core.js index 1c8aede6f..8c10330a5 100644 --- a/src/js/core.js +++ b/src/js/core.js @@ -97,8 +97,7 @@ var quail = { var results = {totals : {severe : 0, moderate : 0, suggestion : 0 }, results : quail.accessibilityResults }; $.each(results.results, function(testName, result) { - results.totals[quail.testabilityTranslation[quail.accessibilityTests[testName].testability]] += result.length; - }); + results.totals[quail.testabilityTranslation[quail.accessibilityTests[testName].testability]] += result.elements.length; }); quail.options.complete(results); } }, @@ -127,7 +126,7 @@ var quail = { } } - quail.accessibilityResults[testName].push($element); + quail.accessibilityResults[testName].elements.push($element); if(typeof quail.options.testFailed !== 'undefined') { var testability = (typeof quail.accessibilityTests[testName].testability !== 'undefined') ? quail.accessibilityTests[testName].testability : @@ -135,6 +134,7 @@ var quail = { var severity = quail.options.testFailed({element : $element, testName : testName, + test : quail.accessibilityTests[testName], testability : testability, severity : quail.testabilityTranslation[testability], options : options @@ -155,7 +155,7 @@ var quail = { } var testType = quail.accessibilityTests[testName].type; if(typeof quail.accessibilityResults[testName] === 'undefined') { - quail.accessibilityResults[testName] = [ ]; + quail.accessibilityResults[testName] = { test : quail.accessibilityTests[testName], elements : [ ] }; } if(testType === 'selector') { quail.html.find(quail.accessibilityTests[testName].selector).each(function() { diff --git a/test/composite.js b/test/composite.js index ca614e035..67e08bbcf 100644 --- a/test/composite.js +++ b/test/composite.js @@ -27,11 +27,11 @@ var quailTest = { reset : true, accessibilityTests : accessibilityTests, complete : function(results) { - $.each(results.results[testName], function(index, item) { + $.each(results.results[testName].elements, function(index, item) { if(typeof item === 'undefined' || (item && item.attr('id') && item.attr('id').indexOf('qunit-') !== -1) || item.parents('#qunit-wrapper').length) { - results.results[testName].splice(index, 1); + results.results[testName].elements.splice(index, 1); } }); quailTest.results = results.results; @@ -39,24 +39,24 @@ var quailTest = { }, confirmIsEmpty : function() { - $.each(quailTest.results[quailTest.testName], function(index, item) { + $.each(quailTest.results[quailTest.testName].elements, function(index, item) { if(typeof item === 'undefined' || (item && item.attr('id') && item.attr('id').indexOf('qunit-') !== -1) || item.parents('#qunit-wrapper').length) { - quailTest.results[quailTest.testName].splice(index, 1); + quailTest.results[quailTest.testName].elements.splice(index, 1); } }); - if(quailTest.results[quailTest.testName].length) { + if(quailTest.results[quailTest.testName].elements.length) { return false; } return true; }, confirmIsTag : function(tag) { - if(typeof quailTest.results[quailTest.testName][0] === 'undefined') { + if(typeof quailTest.results[quailTest.testName].elements[0] === 'undefined') { return false; } - return quailTest.results[quailTest.testName][0].is(tag); + return quailTest.results[quailTest.testName].elements[0].is(tag); }, insertElements : function(callback) { diff --git a/test/testfiles/common/aLinksToMultiMediaRequireTranscript-fail-2.html b/test/testfiles/common/aLinksToMultiMediaRequireTranscript-fail-2.html index 32d5687e9..9756808e9 100644 --- a/test/testfiles/common/aLinksToMultiMediaRequireTranscript-fail-2.html +++ b/test/testfiles/common/aLinksToMultiMediaRequireTranscript-fail-2.html @@ -16,7 +16,7 @@ diff --git a/test/testfiles/common/aLinksToMultiMediaRequireTranscript-fail-3.html b/test/testfiles/common/aLinksToMultiMediaRequireTranscript-fail-3.html index def924864..dcedda39b 100644 --- a/test/testfiles/common/aLinksToMultiMediaRequireTranscript-fail-3.html +++ b/test/testfiles/common/aLinksToMultiMediaRequireTranscript-fail-3.html @@ -16,7 +16,7 @@ diff --git a/test/testfiles/common/aLinksToMultiMediaRequireTranscript-fail-4.html b/test/testfiles/common/aLinksToMultiMediaRequireTranscript-fail-4.html index 38d330493..d15b37fe4 100644 --- a/test/testfiles/common/aLinksToMultiMediaRequireTranscript-fail-4.html +++ b/test/testfiles/common/aLinksToMultiMediaRequireTranscript-fail-4.html @@ -16,7 +16,7 @@ diff --git a/test/testfiles/common/aLinksToMultiMediaRequireTranscript-fail-5.html b/test/testfiles/common/aLinksToMultiMediaRequireTranscript-fail-5.html index 14ee0a655..933e279d2 100644 --- a/test/testfiles/common/aLinksToMultiMediaRequireTranscript-fail-5.html +++ b/test/testfiles/common/aLinksToMultiMediaRequireTranscript-fail-5.html @@ -16,7 +16,7 @@ diff --git a/test/testfiles/common/aLinksToMultiMediaRequireTranscript-fail.html b/test/testfiles/common/aLinksToMultiMediaRequireTranscript-fail.html index 0247b1ba2..eb6c1d2a4 100644 --- a/test/testfiles/common/aLinksToMultiMediaRequireTranscript-fail.html +++ b/test/testfiles/common/aLinksToMultiMediaRequireTranscript-fail.html @@ -16,7 +16,7 @@ diff --git a/test/testfiles/common/aLinksToSoundFilesNeedTranscripts-fail.html b/test/testfiles/common/aLinksToSoundFilesNeedTranscripts-fail.html index f36bf6a2c..b2f79f381 100644 --- a/test/testfiles/common/aLinksToSoundFilesNeedTranscripts-fail.html +++ b/test/testfiles/common/aLinksToSoundFilesNeedTranscripts-fail.html @@ -17,7 +17,7 @@ diff --git a/test/testfiles/common/cssDocumentMakesSenseStyleTurnedOff-pass.html b/test/testfiles/common/cssDocumentMakesSenseStyleTurnedOff-pass.html index 7b7af259b..e37a834c3 100644 --- a/test/testfiles/common/cssDocumentMakesSenseStyleTurnedOff-pass.html +++ b/test/testfiles/common/cssDocumentMakesSenseStyleTurnedOff-pass.html @@ -16,9 +16,9 @@ diff --git a/test/testfiles/common/imgAltEmptyForDecorativeImages-fail-3.html b/test/testfiles/common/imgAltEmptyForDecorativeImages-fail-3.html index 62a93d320..e632703e4 100644 --- a/test/testfiles/common/imgAltEmptyForDecorativeImages-fail-3.html +++ b/test/testfiles/common/imgAltEmptyForDecorativeImages-fail-3.html @@ -17,7 +17,7 @@ diff --git a/test/testfiles/common/imgAltEmptyForDecorativeImages-fail-4.html b/test/testfiles/common/imgAltEmptyForDecorativeImages-fail-4.html index d0e309411..d0f1caf9d 100644 --- a/test/testfiles/common/imgAltEmptyForDecorativeImages-fail-4.html +++ b/test/testfiles/common/imgAltEmptyForDecorativeImages-fail-4.html @@ -17,7 +17,7 @@ diff --git a/test/testfiles/common/imgAltEmptyForDecorativeImages-fail.html b/test/testfiles/common/imgAltEmptyForDecorativeImages-fail.html index 32311ac26..8f1e84cf2 100644 --- a/test/testfiles/common/imgAltEmptyForDecorativeImages-fail.html +++ b/test/testfiles/common/imgAltEmptyForDecorativeImages-fail.html @@ -18,7 +18,7 @@ diff --git a/test/testfiles/common/imgAltIdentifiesLinkDestination-fail.html b/test/testfiles/common/imgAltIdentifiesLinkDestination-fail.html index ea96a61d8..451839b44 100644 --- a/test/testfiles/common/imgAltIdentifiesLinkDestination-fail.html +++ b/test/testfiles/common/imgAltIdentifiesLinkDestination-fail.html @@ -17,7 +17,7 @@ diff --git a/test/testfiles/common/imgAltIsSameInText-fail.html b/test/testfiles/common/imgAltIsSameInText-fail.html index 71a43f2c2..52d90d034 100644 --- a/test/testfiles/common/imgAltIsSameInText-fail.html +++ b/test/testfiles/common/imgAltIsSameInText-fail.html @@ -18,7 +18,7 @@ diff --git a/test/testfiles/common/imgAltIsSameInText-pass.html b/test/testfiles/common/imgAltIsSameInText-pass.html index 65b369fce..b796f6e5d 100644 --- a/test/testfiles/common/imgAltIsSameInText-pass.html +++ b/test/testfiles/common/imgAltIsSameInText-pass.html @@ -19,7 +19,7 @@ diff --git a/test/testfiles/common/imgHasLongDesc-fail-2.html b/test/testfiles/common/imgHasLongDesc-fail-2.html index 537456937..cd891094b 100644 --- a/test/testfiles/common/imgHasLongDesc-fail-2.html +++ b/test/testfiles/common/imgHasLongDesc-fail-2.html @@ -20,7 +20,7 @@ diff --git a/test/testfiles/common/imgHasLongDesc-fail.html b/test/testfiles/common/imgHasLongDesc-fail.html index 95e0143fd..84a0d3d0e 100644 --- a/test/testfiles/common/imgHasLongDesc-fail.html +++ b/test/testfiles/common/imgHasLongDesc-fail.html @@ -20,7 +20,7 @@ diff --git a/test/testfiles/common/imgMapAreasHaveDuplicateLink-fail-2.html b/test/testfiles/common/imgMapAreasHaveDuplicateLink-fail-2.html index 7d3f1c532..d65c948d9 100644 --- a/test/testfiles/common/imgMapAreasHaveDuplicateLink-fail-2.html +++ b/test/testfiles/common/imgMapAreasHaveDuplicateLink-fail-2.html @@ -31,7 +31,7 @@ diff --git a/test/testfiles/common/imgMapAreasHaveDuplicateLink-fail.html b/test/testfiles/common/imgMapAreasHaveDuplicateLink-fail.html index 4a3f14ffe..027d31534 100644 --- a/test/testfiles/common/imgMapAreasHaveDuplicateLink-fail.html +++ b/test/testfiles/common/imgMapAreasHaveDuplicateLink-fail.html @@ -29,7 +29,7 @@ diff --git a/test/testfiles/common/imgNotReferredToByColorAlone-fail-2.html b/test/testfiles/common/imgNotReferredToByColorAlone-fail-2.html index c69edf6ed..9b209ea57 100644 --- a/test/testfiles/common/imgNotReferredToByColorAlone-fail-2.html +++ b/test/testfiles/common/imgNotReferredToByColorAlone-fail-2.html @@ -23,7 +23,7 @@

Clayton's Class

diff --git a/test/testfiles/common/imgNotReferredToByColorAlone-fail-3.html b/test/testfiles/common/imgNotReferredToByColorAlone-fail-3.html index d4d842134..84f194cb6 100644 --- a/test/testfiles/common/imgNotReferredToByColorAlone-fail-3.html +++ b/test/testfiles/common/imgNotReferredToByColorAlone-fail-3.html @@ -23,7 +23,7 @@

Clayton's Class

diff --git a/test/testfiles/common/imgNotReferredToByColorAlone-fail.html b/test/testfiles/common/imgNotReferredToByColorAlone-fail.html index ab9cfd7e7..535557e54 100644 --- a/test/testfiles/common/imgNotReferredToByColorAlone-fail.html +++ b/test/testfiles/common/imgNotReferredToByColorAlone-fail.html @@ -23,7 +23,7 @@

Clayton's Class

diff --git a/test/testfiles/common/imgWithMapHasUseMap-fail.html b/test/testfiles/common/imgWithMapHasUseMap-fail.html index e503eb79b..c716844ca 100644 --- a/test/testfiles/common/imgWithMapHasUseMap-fail.html +++ b/test/testfiles/common/imgWithMapHasUseMap-fail.html @@ -19,7 +19,7 @@ diff --git a/test/testfiles/common/inputTextHasLabel-fail-2.html b/test/testfiles/common/inputTextHasLabel-fail-2.html index 2599370fd..a6dc1dc5c 100644 --- a/test/testfiles/common/inputTextHasLabel-fail-2.html +++ b/test/testfiles/common/inputTextHasLabel-fail-2.html @@ -20,7 +20,7 @@ diff --git a/test/testfiles/common/inputTextHasLabel-fail.html b/test/testfiles/common/inputTextHasLabel-fail.html index 4e8366431..2b920eb2b 100644 --- a/test/testfiles/common/inputTextHasLabel-fail.html +++ b/test/testfiles/common/inputTextHasLabel-fail.html @@ -21,7 +21,7 @@ diff --git a/test/testfiles/quail/customTest.html b/test/testfiles/quail/customTest.html index 1e6e1a932..98217747a 100644 --- a/test/testfiles/quail/customTest.html +++ b/test/testfiles/quail/customTest.html @@ -43,8 +43,8 @@

Heading!

complete : function(results) { testResults = results.results; }}); - equal('P', testResults.customTestSelector[0].get(0).tagName, 'Found paragraph with selector'); - equal('H2', testResults.customTestCallback[0].get(0).tagName, 'Found header with custom callback'); + equal('P', testResults.customTestSelector.elements[0].get(0).tagName, 'Found paragraph with selector'); + equal('H2', testResults.customTestCallback.elements[0].get(0).tagName, 'Found header with custom callback'); }); diff --git a/test/testfiles/quail/guidelineFallback.html b/test/testfiles/quail/guidelineFallback.html index 7699a00d6..e46d21fa3 100644 --- a/test/testfiles/quail/guidelineFallback.html +++ b/test/testfiles/quail/guidelineFallback.html @@ -27,7 +27,7 @@

Heading!

complete : function(results) { testResults = results.results; }}); - equal('IMG', testResults.imgHasAlt[0].get(0).tagName, 'Default guideline has run'); + equal('IMG', testResults.imgHasAlt.elements[0].get(0).tagName, 'Default guideline has run'); }); diff --git a/test/testfiles/quail/preFilter.html b/test/testfiles/quail/preFilter.html index be0c5f9ac..5326821f9 100644 --- a/test/testfiles/quail/preFilter.html +++ b/test/testfiles/quail/preFilter.html @@ -27,7 +27,7 @@ complete : function(results) { testResults = results.results; }}); - equal(1, testResults.imgHasAlt.length, 'Image was found.'); + equal(1, testResults.imgHasAlt.elements.length, 'Image was found.'); $('.test-area').quail({ jsonPath : '../../../dist', guideline : [ 'imgHasAlt' ], @@ -40,7 +40,7 @@ complete : function(results) { testResults = results.results; }}); - equal(0, testResults.imgHasAlt.length, 'Image was filtered out.'); + equal(0, testResults.imgHasAlt.elements.length, 'Image was filtered out.'); }); diff --git a/test/testfiles/quail/testConfiguration.html b/test/testfiles/quail/testConfiguration.html index e8094e4fd..a73295838 100644 --- a/test/testfiles/quail/testConfiguration.html +++ b/test/testfiles/quail/testConfiguration.html @@ -49,7 +49,7 @@ reset : true, customTests : custom, complete : function(results) { - equal('STRONG', results.results.customConfigurationTest[0].get(0).tagName, 'Found strong tag'); + equal('STRONG', results.results.customConfigurationTest.elements[0].get(0).tagName, 'Found strong tag'); }}); $('.test-area').quail({ jsonPath : '../../../dist', @@ -58,7 +58,7 @@ reset : true, customTests : custom, complete : function(results) { - equal('EM', results.results.customConfigurationTest[0].get(0).tagName, 'Found em tag'); + equal('EM', results.results.customConfigurationTest.elements[0].get(0).tagName, 'Found em tag'); }}); });