)","title",null,g,m,"-",function(e,t){var a=d.createElement("span"),i=d.createElement("strong"),r=this.textContent||this.innerText||n.i18n.get("NoPageTitle");return a.innerText=t+": ",a.textContent=t+": ",i.innerText=r,i.textContent=r,a.appendChild(i),a},function(){for(var e=this.textContent||this.innerText||"",t=["::","||","--","@@","##","$$","%%","&&","**","((","))","++","==","~~",";;","<<",">>","[[","]]","★★","☆☆","◎◎","●●","◆◆","◇◇","□□","■■","△△","▲▲","▽▽","▼▼","◁◁","◀◀","▷▷","▶▶","♠♠","♤♤","♡♡","♥♥","♧♧","♣♣","⊙⊙","◈◈","▣▣","◐◐","◑◑","▒▒","▤▤","▥▥","▨▨","▧▧","▦▦","▩▩","♨♨","☏☏","☎☎"],n=!!e,a=!1,i=0;t.length>i;i++)if(e.indexOf(t[i])>-1){a=!0;break}return n&&!a?"pass":"fail"}),frame:new r(t,d,"13. "+n.i18n.get("No13")+"(frame)","iframe",[{label:n.i18n.get("Hidden"),width:45},{label:n.i18n.get("Element"),width:45},{label:n.i18n.get("Title"),minWidth:50,className:"lt"},{label:n.i18n.get("Contents"),maxWidth:200}],g,m,n.i18n.get("NotApplicable"),function(){var e={hidden:"",el:"",title:"",url:""},t=this.getAttribute("src"),a=this.getAttribute("title");if(e.el="iframe",t){var i=d.createElement("a");i.setAttribute("href",t),i.setAttribute("target","_blank"),i.innerText=t,i.textContent=t,e.url=i}else e.url=n.i18n.get("NoSrc");return e.title=a||n.i18n.get("NoTitle"),[e.hidden,e.el,e.title,e.url]},function(){var e=this.getAttribute("title");return e?"pass":"fail"}),blockTitle:new r(t,d,"13. "+n.i18n.get("No13")+"(~)","h1,h2,h3,h4,h5,h6",[{label:n.i18n.get("Hidden"),width:45},{label:n.i18n.get("Element"),width:45},{label:n.i18n.get("Contents")}],g,m,n.i18n.get("RequireConfirmation"),function(){return["",this.tagName.toLowerCase(),h(this)]}),linkText:new r(t,d,"14. "+n.i18n.get("No14"),"a,area",[{label:n.i18n.get("Hidden"),width:45},{label:n.i18n.get("Element"),width:45},{label:n.i18n.get("Contents")}],g,m,n.i18n.get("NotApplicable"),function(){var e=h(this),t=this.getAttribute("title");return["",this.tagName.toLowerCase(),(e||"-")+(t?" (title: "+t+")":"")]},function(){var e=h(this);return e?"pass":"fail"}),pageLang:new i(t,d,"15. "+n.i18n.get("No15"),"html",null,g,m,"-",function(e,t){var a=this.getAttribute("xmlns"),i="",r=d.createElement("span");if("http"!==t.substr(0,4).toLowerCase()&&".html"!==t.substr(-5).toLowerCase())return!1;i=a&&this.getAttribute("xml:lang")&&this.getAttribute("lang")?"xml:lang="+this.getAttribute("xml:lang")+", lang="+this.getAttribute("lang"):a&&this.getAttribute("xml:lang")?"xml:lang="+this.getAttribute("xml:lang"):a&&this.getAttribute("lang")?"xml:lang="+n.i18n.get("None")+", lang="+this.getAttribute("lang"):!a&&this.getAttribute("lang")?"lang="+this.getAttribute("lang"):n.i18n.get("NoMainLang"),r.innerText=t+": ",r.textContent=t+": ";var l=d.createElement("strong");return l.innerText=i,l.textContent=i,r.appendChild(l),r},function(){var e=this.getAttribute("xmlns");return e&&this.getAttribute("xml:lang")?"pass":e&&this.getAttribute("lang")?"warning":!e&&this.getAttribute("lang")?"pass":"fail"}),unintendedFunction:new r(t,d,"16. "+n.i18n.get("No16"),"a,area,input,button",[{label:n.i18n.get("Hidden"),width:45},{label:n.i18n.get("Event"),width:80},{label:n.i18n.get("Contents"),className:"lt"},{label:n.i18n.get("TitleAttribute")}],g,m,n.i18n.get("RequireConfirmation"),function(){var e,t={hidden:"",event:"",content:"",title:""},n=this.wrappedJSObject||this;try{e=n.onclick?(""+n.onclick).indexOf("window.open")>-1:!1}catch(a){e=null}return t.content=h(this),t.title=this.getAttribute("title")?this.getAttribute("title"):"_blank"===this.getAttribute("target")?'target="_blank"':"-",e?(t.event="window.open",[t.hidden,t.event,t.content,t.title]):!1},function(){return this.getAttribute("title")?"warning":"_blank"===this.getAttribute("target")?"pass":"fail"}),tableTitle:new r(t,d,"18. "+n.i18n.get("No18")+"(caption, summary)","table",[{label:n.i18n.get("Hidden"),width:45},{label:n.i18n.get("CaptionContent"),className:"lt"},{label:n.i18n.get("SummaryContent")}],g,m,n.i18n.get("NotApplicable"),function(){var e,t=this.childNodes,a=null,i={hidden:"",caption:"",summary:""};for(e=0;t.length>e;e++)if(t[e].tagName&&"caption"===t[e].tagName.toLowerCase()){a=t[e];break}var r=!!a,l=!!this.getAttribute("summary");return i.caption=r?h(a):n.i18n.get("None"),i.summary=l?this.getAttribute("summary"):n.i18n.get("None"),[i.hidden,i.caption,i.summary]},function(){var e,t=this.childNodes,n=null;for(e=0;t.length>e;e++)if(t[e].tagName&&"caption"===t[e].tagName.toLowerCase()){n=t[e];break}var a=!!n,i=!!this.getAttribute("summary");return a?"pass":a||i?"fail":"warning"}),tableStructure:new r(t,d,"18. "+n.i18n.get("No18")+"(th)","table",[{label:n.i18n.get("Hidden"),width:45},{label:n.i18n.get("Structure"),className:"tb_str"}],g,m,n.i18n.get("NotApplicable"),function(){var e={hidden:"",structure:""},t=s(this,"thead"),n=s(this,"tfoot"),a=s(this,"tbody"),i=s(s(t,"tr"),"th"),r=s(s(n,"tr"),"th"),l=s(s(a,"tr"),"th").concat(s(s(this,"tr"),"th"));!!i.length||!!r.length||l.length;var o=d.createElement("table"),c=d.createElement("thead"),p=d.createElement("tbody"),g=d.createElement("tr"),m=d.createElement("th"),u=d.createElement("th"),f=d.createElement("th");m.innerText="요소",m.textContent="요소",u.innerText="유무",u.textContent="유무",f.innerText="제목셀 정보 (scope 속성값)",f.textContent="제목셀 정보 (scope 속성값)",g.appendChild(m),g.appendChild(u),g.appendChild(f),c.appendChild(g),o.appendChild(c),o.appendChild(p);var b,x,C,v,N,y,E=d.createElement("tr"),T=d.createElement("td"),w=d.createElement("td"),k=d.createElement("td");if(t.length){for(b=d.createElement("ul"),T.innerText="thead",T.textContent="thead",w.innerText="O",w.textContent="O",x=0,C=i.length;C>x;x++)v=i[x],N=v.getAttribute("scope"),y=d.createElement("li"),y.innerText=h(v)+(N?"("+N+")":"(X)"),y.textContent=h(v)+(N?"("+N+")":"(X)"),b.appendChild(y);k.appendChild(b)}else T.innerText="thead",T.textContent="thead",w.innerText="X",w.textContent="X",k.innerText="-",k.textContent="-";if(E.appendChild(T),E.appendChild(w),E.appendChild(k),p.appendChild(E),E=d.createElement("tr"),T=d.createElement("td"),w=d.createElement("td"),k=d.createElement("td"),n.length){for(b=d.createElement("ul"),T.innerText="tfoot",T.textContent="tfoot",w.innerText="O",w.textContent="O",x=0,C=r.length;C>x;x++)v=r[x],N=v.getAttribute("scope"),y=d.createElement("li"),y.innerText=h(v)+(N?"("+N+")":"(X)"),y.textContent=h(v)+(N?"("+N+")":"(X)"),b.appendChild(y);k.appendChild(b)}else T.innerText="tfoot",T.textContent="tfoot",w.innerText="X",w.textContent="X",k.innerText="-",k.textContent="-";if(E.appendChild(T),E.appendChild(w),E.appendChild(k),p.appendChild(E),E=d.createElement("tr"),T=d.createElement("td"),w=d.createElement("td"),k=d.createElement("td"),a.length){for(b=d.createElement("ul"),T.innerText="tbody",T.textContent="tbody",w.innerText="O",w.textContent="O",x=0,C=l.length;C>x;x++)v=l[x],N=v.getAttribute("scope"),y=d.createElement("li"),y.innerText=h(v)+(N?"("+N+")":"(X)"),y.textContent=h(v)+(N?"("+N+")":"(X)"),b.appendChild(y);k.appendChild(b)}else T.innerText="tbody",T.textContent="tbody",w.innerText="X",w.textContent="X",k.innerText="-",k.textContent="-";return E.appendChild(T),E.appendChild(w),E.appendChild(k),p.appendChild(E),e.structure=o,[e.hidden,e.structure]},function(){var e=s(s(s(this,"thead"),"tr"),"th"),t=s(s(s(this,"tfoot"),"tr"),"th"),n=s(s(s(this,"tbody"),"tr"),"th").concat(s(s(this,"tr"),"th")),a=e.length||t.length||n.length,i=function(e){var t,n;for(t=0,n=e.length;n>t;t++)if(!e[t].getAttribute("scope"))return!1;return!0};return a&&i(e)&&i(t)&&i(n)?"pass":a||e.length||t.length?"fail":"warning"}),label:new r(t,d,"19. "+n.i18n.get("No19"),"input,textarea,select",[{label:n.i18n.get("Hidden"),width:45},{label:n.i18n.get("Element"),width:45},{label:n.i18n.get("FormType"),width:66},{label:n.i18n.get("LabelConnection"),className:"lt"},{label:n.i18n.get("TitleAttribute")}],g,m,n.i18n.get("NotApplicable"),function(e){var t=this.getAttribute("type")?this.getAttribute("type").toLowerCase():null;if("INPUT"===this.tagName&&("submit"===t||"button"===t||"image"===t||"hidden"===t||"reset"===t))return!1;var n,a,i={hidden:"",el:"",type:"",label:"",title:""},r=this.getAttribute("id"),l=e.getElementsByTagName("label"),s=!1,o=null;if(r)for(n=0,a=l.length;a>n;n++)if(l[n].getAttribute("for")===r){s=!0,o=l[n];break}!!this.getAttribute("title");var c=!1,d=this.parentNode;do if(d=d.parentNode,"LABEL"===d.tagName){c=!0,o=d;break}while(d.parentNode);return i.el=this.tagName.toLowerCase(),i.type=t||"-",i.label=o?h(o):"",i.label||(i.label="X"),i.title=this.getAttribute("title"),i.title||(i.title="-"),[i.hidden,i.el,i.type,i.label,i.title]},function(e){var t,n,a=this.getAttribute("id"),i=e.getElementsByTagName("label"),r=!1;if(a)for(t=0,n=i.length;n>t;t++)if(i[t].getAttribute("for")===a){r=!0;break}var l=!!this.getAttribute("title"),s=!1,o=this.parentNode;do o=o.parentNode,"LABEL"===o.tagName&&(s=!0);while(o.parentNode);return r?"pass":s?"pass":l?"warning":"fail"}),validation:new l(t,d,"w3c_validation","21. "+n.i18n.get("No21"),function(t,i){var r="object"==typeof chrome&&chrome.extension,l="object"==typeof Components&&Components.classes;if(!r&&!l){var s=i.createElement("p");return s.className="comment",s.innerText="Not Supported.",s.textContent="Not Supported.",s}var o,c,d=function(e){var t,n,a=e.messages,i=[],r=[/^document type does not allow element .* here; missing one of .* start\-tag.*/,/^end tag for .* which is not finished.*/,/^end tag for element .* which is not open.*/,/^ID .* already defined.*/,/^unclosed start-tag requires SHORTTAG YES.*/,/^unclosed end-tag requires SHORTTAG YES.*/,/^empty start-tag.*/,/^empty end-tag.*/];for(t=0;a.length>t;t++)if("error"===a[t].type)for(n=0;r.length>n;n++)if(r[n].test(a[t].message)){i.push(a[t]);break}return e.messages=i,e},h=function(e,t){var n=i.createElement("div");n.className="validationResult";var r=i.createElement("h3");r.innerText="Error",r.textContent="Error",r.className="fail";var l=i.createElement("ul"),s=i.createElement("h3");s.innerText="Warning",s.textContent="Warning",s.className="warning";var o,c=i.createElement("ul"),d=function(e){e.preventDefault(),e.stopPropagation(),openDialog("chrome://global/content/viewSource.xul","achecker_sourceView","scrollbars,resizable,chrome,dialog=no",t,null,null,this.getAttribute("data-line"),!1)};for(o=0;e.length>o;o++){var h=e[o],p=i.createElement("li"),g=i.createElement("div"),m=i.createElement("a");m.innerText=h.message,m.textContent=h.message,m.setAttribute("href","#"),m.setAttribute("data-line",h.lastLine),a(m,"click",d),g.appendChild(m);
+var u=i.createElement("div");switch(u.className="subinfo",u.innerText=h.lastLine+" line, "+h.lastColumn+" column",u.textContent=h.lastLine+" line, "+h.lastColumn+" column",p.appendChild(g),p.appendChild(u),h.type){case"error":l.appendChild(p);break;case"info":c.appendChild(p)}}return n.appendChild(r),n.appendChild(l),n.appendChild(s),n.appendChild(c),n},p=function(e){var t,n=i.getElementById("w3c_validation"),a=n.querySelectorAll("li.validationItem");for(t=0;a.length>t;t++){var r=a[t].getElementsByClassName("url")[0];if(r.innerText===e||r.textContent===e)return a[t]}},u=function(t){var a=t,r=new XMLHttpRequest;r.onreadystatechange=function(){if(4===r.readyState)if(200===r.status){var a=r.responseText,l=new XMLHttpRequest;a.indexOf("euc-kr")>0?"euc-kr":"utf-8";var s=setTimeout(function(){var e=p(t),a=e.getElementsByClassName("errcnt")[0],r=i.createElement("a");r.target="_blank",r.href="http://validator.w3.org/check?uri="+encodeURIComponent(t),r.textContent="("+n.i18n.get("ValidateManually")+")",a.innerText=n.i18n.get("ValidationTimeout")+" ",a.textContent=n.i18n.get("ValidationTimeout")+" ",a.appendChild(r)},1e4);l.onreadystatechange=function(){try{var e,n=function(){var e=this.getElementsByTagName("div")[0];e.style.display="none"===e.style.display?"block":"none"};if(4===l.readyState&&200===l.status){var a=d(JSON.parse(l.responseText)),r=i.getElementById("w3c_validation"),o=r.querySelector("h2"),c=p(t),g=0;for(e=0;a.messages.length>e;e++)"error"===a.messages[e].type&&g++;clearTimeout(s);var m=c.getElementsByClassName("errcnt")[0];m.innerText=g+" Errors",m.textContent=g+" Errors",c.className=g>0?"fail":"pass",g>0&&(o.className+=" fail");var u=h(a.messages,t);u.style.display="none",c.appendChild(u),c.onclick=n}}catch(f){}};try{if(l.open("POST","http://validator.w3.org/check",!0),"object"!=typeof FormData)l.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),l.send("fragment="+e.escape(a)+"&doctype=Inline"+"&output=json");else{var o=new FormData;o.append("fragment",a),o.append("doctype","Inline"),o.append("output","json"),l.send(o)}}catch(c){}}else e.alert(n.i18n.get("ValidationFail"))},r.open("GET",a,!0),r.send(null)},f=[],b=[];if(("http://"===t.location.href.substr(0,7)||"https://"===t.location.href.substr(0,8))&&(f.push(t.location.href),b.push(t.document)),g)for(o=0,c=m.length;c>o;o++){var x=m[o].src;("http://"===x.substr(0,7)||"https://"===x.substr(0,8))&&(f.push(x),b.push(m[o]))}var C=i.createElement("ul");for(o=0,c=f.length;c>o;o++){u(f[o],b[o]);var v=i.createElement("li");v.className="validationItem";var N=i.createElement("span");N.className="url",N.innerText=f[o],N.textContent=f[o];var y=i.createElement("b");y.className="errcnt",y.innerText=n.i18n.get("Loading"),y.textContent=n.i18n.get("Loading"),v.appendChild(N),v.appendChild(i.createTextNode(": ")),v.appendChild(y),C.appendChild(v)}return C})}}}}(window,window.document),function(e){"use strict";var t={altText:30,kbdFocus:10,frame:10,linkText:10,pageLang:10,unintendedFunction:10,label:20},n=function(e){return e>=95?"perfect":e>80?"good":e>60?"bad":"fail"},a=function(e){var t,n=e.location.href,a=e.document.getElementsByTagName("link"),i=a.length;for(t=0;i>t;t++)"canonical"===a[t].getAttribute("rel")&&a[t].getAttribute("href")&&(n=a[t].getAttribute("href"));return n=n.replace(/\#.*$/,"")};e.achecker=e.achecker||{},e.achecker.Wax=e.achecker.Wax||{},e.achecker.Wax.score=function(e){var n,a=0;for(var i in t)t.hasOwnProperty(i)&&(n=e[i]?e[i].getScore():null,a+=n&&n.all>0?parseInt(10*n.pass/n.all*t[i],10)/10:parseInt(t[i],10));return parseInt(10*a,10)/10},e.achecker.Wax.scoreAsElement=function(t,i,r,l){var s=e.achecker.Wax.score(r),o=i.createElement("div");o.className="waxScore "+n(s);var c=i.createElement("h2"),d=i.createElement("a");d.setAttribute("href","http://openwax.miya.pe.kr/#guide_score"),d.setAttribute("target","_blank"),d.innerText="WAX Score: ",d.textContent="WAX Score: ";var h=i.createElement("strong");if(h.innerText=s,h.textContent=s,d.appendChild(h),c.appendChild(d),o.appendChild(c),l){var p=i.createElement("img");p.style.position="absolute",p.style.top="-9999px",p.style.left="-9999px",p.setAttribute("src","http://openwax.miya.pe.kr/log?url="+encodeURIComponent(a(t))+"&"+"title="+encodeURIComponent(t.document.title)+"&"+"score="+s+"&"),o.appendChild(p)}return o}}(window);var achecker_locale={};achecker_locale.messages={Target:{message:"대상",description:""},TargetPage:{message:"대상 페이지",description:""},NoneTargetPage:{message:"비대상 페이지",description:""},AltText:{message:"대체 텍스트",description:""},Undefined:{message:"미정의",description:""},ValidationFail:{message:"유효성 검사 오류 발생!",description:""},Loading:{message:"로딩중...",description:""},TableTitle:{message:"표 제목",description:""},None:{message:"없음",description:""},TableStructure:{message:"표 구조화",description:""},HasThead:{message:"thead있음",description:""},HasTfoot:{message:"tfoot있음",description:""},HasTbody:{message:"tbody있음",description:""},NoThead:{message:"thead없음",description:""},NoTfoot:{message:"tfoot없음",description:""},NoTbody:{message:"tbody없음",description:""},LevelAA:{message:"레벨AA",description:""},DocumentsForView:{message:"단순 열람 문서 형식",description:""},ShortCut:{message:"단축키",description:""},PageMainLang:{message:"주언어 명시",description:""},NoMainLang:{message:"주언어 없음",description:""},Contrast:{message:"명도 대비",description:""},Foreground:{message:"전경",description:""},SelectForegroundColor:{message:"전경색 선택",description:""},Background:{message:"배경",description:""},SelectBackgroundColor:{message:"배경색 선택",description:""},Result:{message:"결과",description:""},Test:{message:"테스트",description:""},KeyboardFocus:{message:"키보드 포커스",description:""},Error:{message:"오류",description:""},PageTitle:{message:"페이지 제목",description:""},NoPageTitle:{message:"페이지 제목 없음",description:""},UseFrame:{message:"프레임 사용",description:""},NoSrc:{message:"src 없음",description:""},NoTitle:{message:"title 없음",description:""},BlockTitle:{message:"콘텐츠 블록 제목",description:""},SkipNavigation:{message:"건너뛰기 링크",description:""},NthLink:{message:"번째 링크",description:""},Link:{message:"링크",description:""},Connected:{message:"연결",description:""},IsConnected:{message:"연결됨",description:""},IsNotConnected:{message:"연결되지 않음",description:""},LinkText:{message:"링크 텍스트",description:""},NoText:{message:"텍스트 없음",description:""},UnintendedFunction:{message:"의도하지 않은 기능",description:""},Label:{message:"레이블",description:""},No:{message:"번호",description:""},ThLink:{message:"번째 링크",description:""},NotApplicable:{message:"해당없음",description:""},RequireConfirmation:{message:"직접 확인 필요",description:""},FoldAll:{message:"전체 접기",description:""},UnfoldAll:{message:"전체 펼치기",description:""},Hidden:{message:"숨김",description:""},Preview:{message:"미리보기",description:""},Element:{message:"요소",description:""},Contents:{message:"내용",description:""},CaptionContent:{message:"Caption 내용",description:""},SummaryContent:{message:"Summary 내용",description:""},Structure:{message:"구조",description:""},ErrorType:{message:"오류 유형",description:""},Title:{message:"제목",description:""},Event:{message:"이벤트",description:""},TitleAttribute:{message:"title 속성값",description:""},FormType:{message:"폼 유형",description:""},LabelConnection:{message:"label 연결",description:""},CannotCheckFrameset:{message:"프레임셋 페이지는 검사할 수 없습니다. 프레임셋에 포함된 URL로 이동하여 재시도하실 수 있습니다.",description:""},ValidationTimeout:{message:"시간초과",description:""},ValidateManually:{message:"수동 검사",description:""},No1:{message:"적절한 대체 텍스트",description:""},No5:{message:"텍스트 콘텐츠의 명도 대비",description:""},No8:{message:"초점 이동",description:""},No12:{message:"건너뛰기 링크",description:""},No13:{message:"제목 제공",description:""},No14:{message:"적절한 링크 텍스트",description:""},No15:{message:"기본 언어 표시",description:""},No16:{message:"사용자 요구에 따른 실행",description:""},No18:{message:"표의 구성",description:""},No19:{message:"레이블 제공",description:""},No21:{message:"마크업 오류 방지",description:""}},function(e){"use strict";var t=e.achecker||{};t.i18n={get:function(e){return achecker_locale.messages[e].message||""}}}(window),function(e){"use strict";e.achecker=e.achecker||{},e.achecker.showOverlay=function(){if(document.getElementById("_acheckeroverlay"))return document.getElementById("_acheckeroverlay").style.display="block",void 0;var e=document.createElement("div");e.id="_acheckeroverlay",e.style.display="block",e.style.zIndex="99999999",e.style.position="fixed",e.style.top="0",e.style.right="0",e.style.bottom="0",e.style.left="400px",e.style.backgroundColor="#fff",e.style.opacity="0.01",document.body.appendChild(e)},e.achecker.hideOverlay=function(){document.getElementById("_acheckeroverlay")&&(document.getElementById("_acheckeroverlay").style.display="none")};var t=function(t){var n,a,i=[],r=[];if(t)for(n=0,a=document.getElementsByTagName("iframe").length;a>n;n++){var l=document.getElementsByTagName("iframe")[n];l.src&&l.contentDocument?i.push({src:l.src,doc:l.contentDocument}):l.src&&r.push(l.src)}var s=window,o=document;if(!i.length&&!s.document.documentElement)return{err:!0,message:"You cannot check this page.",text_message:"You cannot check this page."};if(s.document.getElementsByTagName("frameset").length>0){var c=s.document.getElementsByTagName("frame"),d="";for(n=0,a=c.length;a>n;n++)c[n].src.indexOf("http")>-1&&(d+='- '+c[n].src+"
");return d+="
",{err:!0,message:"
"+e.achecker.i18n.get("CannotCheckFrameset")+"
"+d,text_message:e.achecker.i18n.get("CannotCheckFrameset")}}var h=o.createElement("div");h.id="achecker-result",o.documentElement.className+=" achecker-included";var p=e.achecker.Wax.run(s,o,t,i,r),g=p.header,m=p.sections,u=e.achecker.Wax.scoreAsElement(s,o,m,!0);h.appendChild(u),h.appendChild(g);for(n in m)m.hasOwnProperty(n)&&h.appendChild(m[n].getAsElement());return o.body.appendChild(h),{err:!1}},n=function(e){if(!document.getElementById("achecker-css")){var n=document.createElement("link");n.rel="stylesheet",n.id="achecker-css",n.href="http://openwax.miya.pe.kr/c/bookmarklet.css?t="+(new Date).valueOf(),document.getElementsByTagName("head")[0].appendChild(n)}if(document.getElementById("achecker-result"))return document.body.removeChild(document.getElementById("achecker-result")),document.documentElement.className=document.documentElement.className.replace(/ achecker\-included/,""),{err:!1};var a=t(e);return a},a=n();a.err&&window.alert(a.text_message)}(window);
\ No newline at end of file
diff --git a/owax_bookmarklet/dist/locale_ko.js b/owax_bookmarklet/dist/locale_ko.js
index a960c18..a0ccfd8 100644
--- a/owax_bookmarklet/dist/locale_ko.js
+++ b/owax_bookmarklet/dist/locale_ko.js
@@ -267,6 +267,14 @@ achecker_locale["messages"] = {
"message": "프레임셋 페이지는 검사할 수 없습니다. 프레임셋에 포함된 URL로 이동하여 재시도하실 수 있습니다.",
"description": ""
},
+ "ValidationTimeout": {
+ "message": "시간초과",
+ "description": ""
+ },
+ "ValidateManually": {
+ "message": "수동 검사",
+ "description": ""
+ },
"No1": {
"message": "적절한 대체 텍스트",
diff --git a/owax_bookmarklet/lib/Score.js b/owax_bookmarklet/lib/Score.js
deleted file mode 100644
index 8510e93..0000000
--- a/owax_bookmarklet/lib/Score.js
+++ /dev/null
@@ -1,128 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is N-WAX(NHN Web Accessibility eXtension).
- *
- * The Initial Developer of the Original Code is
- * Goonoo Kim (http://miya.pe.kr).
- * Portions created by the Initial Developer are Copyright (C) 2011
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-(function (g) {
- "use strict";
-
- var sectionWeights = {
- "altText": 30,
- "kbdFocus": 10,
- "frame": 10,
- "linkText": 10,
- "pageLang": 10,
- "unintendedFunction": 10,
- "label": 20
- };
-
- var getLevel = function (score) {
- if (score >= 95) {
- return "perfect";
- } else if (score > 80) {
- return "good";
- } else if (score > 60) {
- return "bad";
- } else {
- return "fail";
- }
- };
-
- var canonicalUrl = function (win) {
- var url = win.location.href;
- var linkEls = win.document.getElementsByTagName("link");
- var i, l = linkEls.length;
- for (i = 0; i < l; i++) {
- if (linkEls[i].getAttribute("rel") === "canonical" &&
- linkEls[i].getAttribute("href")) {
- url = linkEls[i].getAttribute("href");
- }
- }
- // remove fragment identifier from URL
- url = url.replace(/\#.*$/, '');
- return url;
- };
-
- g.achecker = g.achecker || {};
- g.achecker.Wax = g.achecker.Wax || {};
- g.achecker.Wax.score = function (waxSections) {
- var score = 0, info;
-
- for (var key in sectionWeights) {
- if (sectionWeights.hasOwnProperty(key)) {
- info = waxSections[key] ? waxSections[key].getScore() : null;
- if (info && info.all > 0) {
- score += parseInt(info.pass / info.all * sectionWeights[key] * 10, 10) / 10;
- } else {
- score += parseInt(sectionWeights[key], 10);
- }
- }
- }
-
- return parseInt(score * 10, 10) / 10;
- };
- g.achecker.Wax.scoreAsElement = function (cwin, rdoc, waxSections, allowLogging) {
- var score = g.achecker.Wax.score(waxSections);
- var $div = rdoc.createElement('div');
- $div.className = 'waxScore ' + getLevel(score);
-
- var $title = rdoc.createElement('h2');
- var $label = rdoc.createElement('a');
- $label.setAttribute('href', 'http://openwax.miya.pe.kr/#guide_score');
- $label.setAttribute('target', '_blank');
- $label.innerText = "WAX Score: ";
- $label.textContent = "WAX Score: ";
- var $score = rdoc.createElement('strong');
- $score.innerText = score;
- $score.textContent = score;
-
- $label.appendChild($score);
- $title.appendChild($label);
- $div.appendChild($title);
-
- if (allowLogging) {
- var $logger = rdoc.createElement('img');
- $logger.style.position = 'absolute';
- $logger.style.top = '-9999px';
- $logger.style.left = '-9999px';
- $logger.setAttribute('src', 'http://openwax.miya.pe.kr/log?' +
- 'url=' + encodeURIComponent(canonicalUrl(cwin)) + '&' +
- 'title=' + encodeURIComponent(cwin.document.title) + '&' +
- 'score=' + score + '&');
- $div.appendChild($logger);
- }
-
- return $div;
- };
-}(window));
diff --git a/owax_bookmarklet/lib/Score.js b/owax_bookmarklet/lib/Score.js
new file mode 120000
index 0000000..3a3dbe3
--- /dev/null
+++ b/owax_bookmarklet/lib/Score.js
@@ -0,0 +1 @@
+../../lib/Score.js
\ No newline at end of file
diff --git a/owax_bookmarklet/lib/Section.js b/owax_bookmarklet/lib/Section.js
deleted file mode 100644
index b5a32c4..0000000
--- a/owax_bookmarklet/lib/Section.js
+++ /dev/null
@@ -1,613 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is N-WAX(NHN Web Accessibility eXtension).
- *
- * The Initial Developer of the Original Code is
- * Goonoo Kim (NHN).
- * Portions created by the Initial Developer are Copyright (C) 2011
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-(function (g) {
- "use strict";
-
- var addEvent = function (obj, type, fn) {
- if (obj.addEventListener) {
- obj.addEventListener(type, fn, false);
- } else if (obj.attachEvent) {
- obj["e" + type + fn] = fn;
- obj[type + fn] = function () {
- obj["e" + type + fn](g.event);
- };
- obj.attachEvent("on" + type, obj[type + fn]);
- }
- };
- var getStyle = function (el, style) {
- if (el.currentStyle) {
- return el.currentStyle.style;
- }
- return g.getComputedStyle(el, null)[style];
- };
- var toggleFoldedClass = function (el) {
- el.className = el.className.indexOf('folded') > -1 ? el.className.replace(/folded/g, '') : el.className + ' folded';
-
- // fix bug: IE8 won't reflow when set data-* attribute
- if (document && document.all) {
- document.body.className = document.body.getAttribute("className");
- }
- };
-
- var Xpath = {};
-
- // ********************************************************************************************* //
- // XPATH
-
- /**
- * Gets an XPath for an element which describes its hierarchical location.
- */
- Xpath.getElementXPath = function (element) {
- if (element && element.id) {
- return '//*[@id="' + element.id + '"]';
- }
- return Xpath.getElementTreeXPath(element);
- };
-
- Xpath.getElementTreeXPath = function (element) {
- var paths = [];
- var DOCUMENT_TYPE_NODE = 10;
- var sibling;
-
- // Use nodeName (instead of localName) so namespace prefix is included (if any).
- for (element; element && element.nodeType === 1; element = element.parentNode) {
- var index = 0;
- for (sibling = element.previousSibling; sibling; sibling = sibling.previousSibling) {
- // Ignore document type declaration.
- if (sibling.nodeType !== DOCUMENT_TYPE_NODE && sibling.nodeName === element.nodeName) {
- ++index;
- }
- }
-
- var tagName = element.nodeName.toLowerCase();
- var pathIndex = (index ? "[" + (index + 1) + "]" : "");
- paths.splice(0, 0, tagName + pathIndex);
- }
-
- return paths.length ? "/" + paths.join("/") : null;
- };
-
- g.achecker = g.achecker || {};
- g.achecker.Wax = g.achecker.Wax || {};
- g.achecker.Wax.Section = function () {
- throw 'not implemented';
- };
- g.achecker.Wax.Section.prototype = {
- getAsElement : function () {
- throw 'not implemented';
- }
- };
-
- g.achecker.Wax.isElHidden = function (el) {
- if (el && el.tagName && (el.tagName === 'TITLE' || el.tagName === 'BODY' || el.tagName === 'HTML')) {
- return false;
- }
- do {
- if (el.tagName && getStyle(el, 'display') === 'none') {
- return true;
- }
- el = el.parentNode;
- } while (el);
- return false;
- };
-
- g.achecker.Wax.ListSection = g.achecker.Wax.Section;
- g.achecker.Wax.ListSection = function (cwin, rdoc, title, targetSelector,
- limit, isIncludeFrame, frameDocs, emptyMessage,
- content, validStatus, eventHandlers) {
- var this_ = this;
- this.cwin = cwin;
- this.rdoc = rdoc;
- this.title = title;
- this.emptyMessage = emptyMessage;
- this.contents = this._getContents(cwin, isIncludeFrame, frameDocs,
- targetSelector, content, validStatus, eventHandlers, limit);
- };
- g.achecker.Wax.ListSection.prototype._getContentsFromDocument = function (doc, url,
- targetSelector, content, validStatus, eventHandlers, limit) {
- if (!limit) {
- limit = 99999;
- }
-
- var $target = doc.querySelectorAll(targetSelector);
- var contents = [], i;
-
- for (i = 0; i < $target.length; i++) {
- if (limit <= 0) {
- break;
- }
-
- var $el = $target[i];
- var _content = typeof content === 'function' ? content.apply($el, [doc, url]) : content;
- if (_content !== false) {
- contents.push({
- el: $el,
- doc: $el.ownerDocument,
- validStatus: typeof validStatus === 'function' ? validStatus.apply($el, [doc, url]) : (typeof validStatus === 'string' ? validStatus : ''),
- content: typeof content === 'function' ? content.apply($el, [doc, url]) : content,
- eventHandlers: eventHandlers
- });
- limit--;
- }
- }
- return contents;
- };
- g.achecker.Wax.ListSection.prototype._getContents = function (win, isIncludeFrame,
- frameDocs, targetSelector, content, validStatus,
- eventHandlers, limit) {
- if (!limit) {
- limit = 99999;
- }
- var contents = this._getContentsFromDocument(win.document, win.location.href,
- targetSelector, content, validStatus, eventHandlers, limit), i, l;
-
- limit -= contents.length;
- if (isIncludeFrame && limit > 0) {
- for (i = 0, l = frameDocs.length; i < l; i++) {
- if (limit <= 0) {
- break;
- }
-
- var _contents = this._getContentsFromDocument(
- frameDocs[i].doc,
- frameDocs[i].src,
- targetSelector,
- content,
- validStatus,
- eventHandlers,
- limit
- );
- contents = contents.concat(_contents);
- limit -= _contents.length;
- }
- }
- return contents;
- };
- g.achecker.Wax.ListSection.prototype.getAsElement = function () {
- var this_ = this;
- var doc = this.rdoc;
- var $contentList = doc.createElement("ul"), i;
- var hasWarning = false;
- var hasError = false;
- var onClickItem = function (e) {
- if (parent.Firebug) {
- parent.Firebug.Inspector.clearAllHighlights();
- }
-
- var $targetEl = this['data-el'];
- var isHidden = g.achecker.Wax.isElHidden($targetEl);
- if ($targetEl.tagName === 'TITLE') {
- while ($targetEl) {
- if ($targetEl.tagName === 'HTML') {
- break;
- }
- $targetEl = $targetEl.parentNode;
- }
- }
-
- if (!isHidden) {
- var oldTabindex = $targetEl.getAttribute('tabindex');
- $targetEl.setAttribute('tabindex', 0);
- $targetEl.focus();
- if (oldTabindex === null) {
- $targetEl.removeAttribute('tabindex');
- } else {
- $targetEl.setAttribute('tabindex', oldTabindex);
- }
- }
- if (parent.Firebug && $targetEl) {
- parent.Firebug.Inspector.inspectFromContextMenu($targetEl);
- // compatible with firebug 1.9.x
- parent.Firebug.Inspector.highlightObject($targetEl, parent.Firebug.currentContext);
- } else if (g.console && g.console.log && $targetEl) {
- g.console.log('OpenWAX Info: ', Xpath.getElementXPath($targetEl));
- }
- };
-
- for (i = 0; i < this.contents.length; i++) {
- var info = this.contents[i];
- var hiddenClass = g.achecker.Wax.isElHidden(info.el) ? ' hidden_el' : '';
- var $item = doc.createElement('li');
- var key;
-
- $item.className = info.validStatus + ' ' + hiddenClass;
- if (typeof info.content === 'string') {
- $item.innerText = info.content;
- $item.textContent = info.content;
- } else {
- $item.appendChild(info.content);
- }
- $item['data-el'] = info.el;
- if (info.eventHandlers) {
- for (key in info.eventHandlers) {
- if (info.eventHandlers.hasOwnProperty(key)) {
- addEvent($item, key, info.eventHandlers[key]);
- }
- }
- }
- if (info.validStatus === 'fail') {
- hasError = true;
- } else if (info.validStatus === 'warning') {
- hasWarning = true;
- }
- addEvent($item, 'click', onClickItem);
- $contentList.appendChild($item);
- }
-
- var $section = doc.createElement('div');
- $section.className = 'waxSection';
- var $title = doc.createElement('h2');
- var $count = doc.createElement('span');
- $title.innerText = this.title + " ";
- $title.textContent = this.title + " ";
- $title.className = 'folded';
- if (hasError) {
- $title.className += ' fail';
- } else if (hasWarning) {
- $title.className += ' warning';
- }
- $count.innerText = "(" + this.contents.length + ")";
- $count.textContent = "(" + this.contents.length + ")";
- $title.appendChild($count);
- /*
- var $titleLink = doc.createElement('a');
- $titleLink.setAttribute('target', '_blank');
- $titleLink.setAttribute('href',
- 'http://html.nhncorp.com/a11y/guide.php?no='+
- this.title.split(' ')[0] + '');
- $titleLink.innerText = 'Guide';
- $titleLink.textContent = 'Guide';
- $title.appendChild($titleLink);
- */
- $section.appendChild($title);
-
- if ($contentList.childNodes.length <= 0) {
- var $emptyItem = doc.createElement('p');
- $emptyItem.className = 'comment';
- $emptyItem.innerText = this.emptyMessage;
- $emptyItem.textContent = this.emptyMessage;
- $section.appendChild($emptyItem);
- } else {
- $section.appendChild($contentList);
- }
-
- addEvent($title, 'click', function (e) {
- toggleFoldedClass(this);
- });
- /*
- addEvent($titleLink, 'click', function (e) {
- e.stopPropagation();
- });
- */
- return $section;
- };
- g.achecker.Wax.ListSection.prototype.getScore = function () {
- var count = this.contents.length,
- pass = 0;
-
- for (var i = 0; i < count; i++) {
- if (this.contents[i].validStatus !== 'fail') {
- pass++;
- }
- }
-
- return {
- all: count,
- pass: pass
- };
- };
-
- g.achecker.Wax.TableSection = g.achecker.Wax.Section;
- g.achecker.Wax.TableSection = function (cwin, rdoc, title, targetSelector,
- colInfo, isIncludeFrame, frameDocs, emptyMessage,
- content, validStatus, eventHandlers) {
- var this_ = this;
- this.cwin = cwin;
- this.rdoc = rdoc;
- this.title = title;
- this.colInfo = colInfo;
- this.emptyMessage = emptyMessage;
- this.contents = this._getContents(cwin, isIncludeFrame, frameDocs,
- targetSelector, content, validStatus, eventHandlers);
- };
- g.achecker.Wax.TableSection.prototype._getContentsFromDocument = function (doc, url,
- targetSelector, content, validStatus, eventHandlers) {
- var $target = doc.querySelectorAll(targetSelector);
- var contents = [], i;
-
- for (i = 0; i < $target.length; i++) {
- var $el = $target[i];
- var _content = typeof content === 'function' ? content.apply($el, [doc, url]) : content;
- if (_content !== false) {
- contents.push({
- el: $el,
- doc: $el.ownerDocument,
- validStatus: typeof validStatus === 'function' ? validStatus.apply($el, [doc, url]) : (typeof validStatus === 'string' ? validStatus : ''),
- content: typeof content === 'function' ? content.apply($el, [doc, url]) : content,
- eventHandlers: eventHandlers
- });
- }
- }
- return contents;
- };
- g.achecker.Wax.TableSection.prototype._getContents = function (win, isIncludeFrame,
- frameDocs, targetSelector, content, validStatus,
- eventHandlers) {
- var contents = this._getContentsFromDocument(win.document, win.location.href,
- targetSelector, content, validStatus, eventHandlers), i, l;
-
- if (isIncludeFrame) {
- for (i = 0, l = frameDocs.length; i < l; i++) {
- var _contents = this._getContentsFromDocument(frameDocs[i].doc, frameDocs[i].src,
- targetSelector, content, validStatus, eventHandlers);
- contents = contents.concat(_contents);
- }
- }
- return contents;
- };
- g.achecker.Wax.TableSection.prototype.getAsElement = function () {
- var this_ = this;
- var doc = this.rdoc;
- var $table = doc.createElement('table');
- var $thead = doc.createElement('thead');
- var $theadTr = doc.createElement('tr');
- var hasWarning = false;
- var hasError = false;
- var i;
- var onClickTr = function (e) {
- if (parent.Firebug) {
- parent.Firebug.Inspector.clearAllHighlights();
- }
-
- var $targetEl = this['data-el'];
- var isHidden = g.achecker.Wax.isElHidden($targetEl);
- if ($targetEl.tagName === 'TITLE') {
- while ($targetEl) {
- if ($targetEl.tagName === 'HTML') {
- break;
- }
- $targetEl = $targetEl.parentNode;
- }
- }
-
- if (!isHidden) {
- var oldTabindex = $targetEl.getAttribute('tabindex');
- $targetEl.setAttribute('tabindex', 0);
- $targetEl.focus();
- if (oldTabindex === null) {
- $targetEl.removeAttribute('tabindex');
- } else {
- $targetEl.setAttribute('tabindex', oldTabindex);
- }
- }
- if (parent.Firebug && $targetEl) {
- parent.Firebug.Inspector.inspectFromContextMenu($targetEl);
- // compatible with firebug 1.9.x
- parent.Firebug.Inspector.highlightObject($targetEl, parent.Firebug.currentContext);
- } else if (g.console && g.console.log && $targetEl) {
- g.console.log('OpenWAX Info: ', Xpath.getElementXPath($targetEl));
- }
- };
-
- for (i = 0; i < this.colInfo.length; i++) {
- var $theadTh = doc.createElement('th');
- $theadTh.setAttribute('scope', 'col');
- $theadTh.innerText = this.colInfo[i].label;
- $theadTh.textContent = this.colInfo[i].label;
- if (this.colInfo[i].width) {
- $theadTh.style.width = this.colInfo[i].width + 'px';
- }
- if (this.colInfo[i].minWidth) {
- $theadTh.style.minWidth = this.colInfo[i].minWidth + 'px';
- }
- if (this.colInfo[i].maxWidth) {
- $theadTh.style.maxWidth = this.colInfo[i].maxWidth + 'px';
- }
- if (this.colInfo[i].className) {
- $theadTh.className = this.colInfo[i].className;
- }
- $theadTr.appendChild($theadTh);
- }
- $thead.appendChild($theadTr);
- $table.appendChild($thead);
-
- var $tbody = doc.createElement('tbody');
- for (i = 0; i < this.contents.length; i++) {
- var info = this.contents[i];
- var hiddenClass = g.achecker.Wax.isElHidden(info.el) ? ' hidden_el' : '';
- var $tr = doc.createElement('tr');
- var j, key;
-
- $tr.className = info.validStatus + ' ' + hiddenClass;
- for (j in info.content) {
- if (info.content.hasOwnProperty(j)) {
- var _content = info.content[j];
- var $td = doc.createElement('td');
- if (typeof _content === 'string') {
- $td.innerText = _content;
- $td.textContent = _content;
- $td.innerHTML = (_content
- .replace(//g, '>')
- )
- .replace(/\[__\[/g, '')
- .replace(/\]__\]/g, '');
- } else {
- $td.appendChild(_content);
- }
- if (this.colInfo[j].className) {
- $td.className = this.colInfo[j].className;
- }
- $tr.appendChild($td);
- }
- }
- $tr['data-el'] = info.el;
- if (info.eventHandlers) {
- for (key in info.eventHandlers) {
- if (info.eventHandlers.hasOwnProperty(key)) {
- addEvent($tr, key, info.eventHandlers[key]);
- }
- }
- }
- if (info.validStatus === 'fail') {
- hasError = true;
- } else if (info.validStatus === 'warning') {
- hasWarning = true;
- }
- addEvent($tr, 'click', onClickTr);
- $tbody.appendChild($tr);
- $table.appendChild($tbody);
- }
-
- var $section = doc.createElement('div');
- $section.className = 'waxSection';
- var $title = doc.createElement('h2');
- var $count = doc.createElement('span');
- $title.innerText = this.title + " ";
- $title.textContent = this.title + " ";
- $title.className = 'folded';
- if (hasError) {
- $title.className += ' fail';
- } else if (hasWarning) {
- $title.className += ' warning';
- }
- $count.innerText = "(" + this.contents.length + ")";
- $count.textContent = "(" + this.contents.length + ")";
- $title.appendChild($count);
- /*
- var $titleLink = doc.createElement('a');
- $titleLink.setAttribute('target', '_blank');
- $titleLink.setAttribute('href',
- 'http://html.nhncorp.com/a11y/guide.php?no='+
- this.title.split(' ')[0] + '');
- $titleLink.innerText = 'Guide';
- $titleLink.textContent = 'Guide';
- $title.appendChild($titleLink);
- */
- $section.appendChild($title);
-
- if ($tbody.childNodes.length <= 0) {
- var $emptyItem = doc.createElement('p');
- $emptyItem.className = 'comment';
- $emptyItem.innerText = this.emptyMessage;
- $emptyItem.textContent = this.emptyMessage;
- $section.appendChild($emptyItem);
- } else {
- $section.appendChild($table);
- }
-
- addEvent($title, 'click', function (e) {
- toggleFoldedClass(this);
- });
- /*
- addEvent($titleLink, 'click', function (e) {
- e.stopPropagation();
- });
- */
- return $section;
- };
- g.achecker.Wax.TableSection.prototype.getScore = function () {
- var count = this.contents.length,
- pass = 0;
-
- for (var i = 0; i < count; i++) {
- if (this.contents[i].validStatus !== 'fail') {
- pass++;
- }
- }
-
- return {
- all: count,
- pass: pass
- };
- };
-
- g.achecker.Wax.ToolSection = function (cwin, rdoc, id, title, content, eventHandlers) {
- var this_ = this;
- this.cwin = cwin;
- this.rdoc = rdoc;
- this.id = id;
- this.title = title;
- this.content = typeof content === 'function' ? content.apply(this, [this.cwin, this.rdoc]) : content;
- this.eventHandlers = eventHandlers;
- };
- g.achecker.Wax.ToolSection.prototype.getAsElement = function () {
- var doc = this.rdoc;
-
- var $section = doc.createElement('div');
- $section.id = this.id;
- $section.className = 'waxSection';
- var $title = doc.createElement('h2');
- $title.className = 'folded';
- $title.innerText = this.title;
- $title.textContent = this.title;
- /*
- var $titleLink = doc.createElement('a');
- $titleLink.setAttribute('target', '_blank');
- $titleLink.setAttribute('href',
- 'http://html.nhncorp.com/a11y/guide.php?no='+
- this.title.split(' ')[0] + '');
- $titleLink.innerText = 'Guide';
- $titleLink.textContent = 'Guide';
- $title.appendChild($titleLink);
- */
-
- var $content = doc.createElement('div');
- if (typeof this.content === 'string') {
- $content.innerText = this.content;
- $content.textContent = this.content;
- } else {
- $content.appendChild(this.content);
- }
- $section.appendChild($title);
- $section.appendChild($content);
-
- $title.setAttribute('tabindex', 0);
- addEvent($title, 'click', function (e) {
- toggleFoldedClass(this);
- });
- /*
- addEvent($titleLink, 'click', function (e) {
- e.stopPropagation();
- });
- */
- return $section;
- };
- g.achecker.Wax.ToolSection.prototype.getScore = function () {
- return null;
- };
-}(window));
diff --git a/owax_bookmarklet/lib/Section.js b/owax_bookmarklet/lib/Section.js
new file mode 120000
index 0000000..38191d3
--- /dev/null
+++ b/owax_bookmarklet/lib/Section.js
@@ -0,0 +1 @@
+../../lib/Section.js
\ No newline at end of file
diff --git a/owax_bookmarklet/lib/Sections.js b/owax_bookmarklet/lib/Sections.js
deleted file mode 100644
index 59f2bed..0000000
--- a/owax_bookmarklet/lib/Sections.js
+++ /dev/null
@@ -1,1750 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is N-WAX(NHN Web Accessibility eXtension).
- *
- * The Initial Developer of the Original Code is
- * Goonoo Kim (NHN).
- * Portions created by the Initial Developer are Copyright (C) 2011
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-/*jslint browser: true */
-/*global chrome, Components, openDialog, XMLHttpRequest, FormData */
-
-(function (global, document) {
- "use strict";
-
- var achecker = global.achecker || {};
- achecker.Wax = achecker.Wax || {};
- var addEvent = function (obj, type, fn) {
- if (obj.addEventListener) {
- obj.addEventListener(type, fn, false);
- } else if (obj.attachEvent) {
- obj["e" + type + fn] = fn;
- obj[type + fn] = function () {
- obj["e" + type + fn](global.event);
- };
- obj.attachEvent("on" + type, obj[type + fn]);
- }
- };
- var ListSection = achecker.Wax.ListSection;
- var TableSection = achecker.Wax.TableSection;
- var ToolSection = achecker.Wax.ToolSection;
- var getElsFromChildNodes = function (pEl, tagName) {
- var els = [], i = 0;
- if (pEl.length && pEl.push) {
- for (i = 0; i < pEl.length; i++) {
- els = els.concat(getElsFromChildNodes(pEl[i], tagName));
- }
- return els;
- }
- var n = pEl.childNodes;
- if (n && n.length) {
- for (i = 0; i < n.length; i++) {
- if (n[i].tagName && n[i].tagName.toLowerCase() === tagName.toLowerCase()) {
- els.push(n[i]);
- }
- }
- return els;
- }
- return [];
- };
- var toggleFoldedClass = function (el) {
- el.className = el.className === 'folded' ? '' : 'folded';
-
- // fix bug: IE8 won't reflow when set data-* attribute
- if (document && document.all) {
- document.body.className = document.body.getAttribute('className');
- }
- };
-
- var getContrastRatio = function (color1, color2) {
- var l1; // higher value
- var l2; // lower value
- var contrast;
- var l1R, l1G, l1B, l2R, l2G, l2B;
-
- // error check, check if pound sign was put in field value
- if (color2.indexOf('#') === 0) {
- color2 = color2.substr(1, color2.length - 1);
- }
- if (color1.indexOf('#') === 0) {
- color1 = color1.substr(1, color1.length - 1);
- }
-
- //Linearised R (for example) = (R/FS)^2.2 where FS is full scale value (255
- //for 8 bit color channels). L1 is the higher value (of text or background)
- //alert(parseInt("0x"+color1.substr(0, 2)));
- //Math.pow(n,x);
- l1R = parseInt(color1.substr(0, 2), 16) / 255;
- if (l1R <= 0.03928) {
- l1R = l1R / 12.92;
- } else {
- l1R = Math.pow(((l1R + 0.055) / 1.055), 2.4);
- }
- l1G = parseInt(color1.substr(2, 2), 16) / 255;
- if (l1G <= 0.03928) {
- l1G = l1G / 12.92;
- } else {
- l1G = Math.pow(((l1G + 0.055) / 1.055), 2.4);
- }
- l1B = parseInt(color1.substr(4, 2), 16) / 255;
- if (l1B <= 0.03928) {
- l1B = l1B / 12.92;
- } else {
- l1B = Math.pow(((l1B + 0.055) / 1.055), 2.4);
- }
- l2R = parseInt(color2.substr(0, 2), 16) / 255;
- if (l2R <= 0.03928) {
- l2R = l2R / 12.92;
- } else {
- l2R = Math.pow(((l2R + 0.055) / 1.055), 2.4);
- }
- l2G = parseInt(color2.substr(2, 2), 16) / 255;
- if (l2G <= 0.03928) {
- l2G = l2G / 12.92;
- } else {
- l2G = Math.pow(((l2G + 0.055) / 1.055), 2.4);
- }
- l2B = parseInt(color2.substr(4, 2), 16) / 255;
- if (l2B <= 0.03928) {
- l2B = l2B / 12.92;
- } else {
- l2B = Math.pow(((l2B + 0.055) / 1.055), 2.4);
- }
- //where L is luminosity and is defined as
- l1 = (0.2126 * l1R) + (0.7152 * l1G) + (0.0722 * l1B); //using linearised R, G, and B value
- l2 = (0.2126 * l2R) + (0.7152 * l2G) + (0.0722 * l2B); //using linearised R, G, and B value
- //and L2 is the lower value.
- l1 = l1 + 0.05;
- l2 = l2 + 0.05;
- if (l1 < l2) {
- var temp = l1;
- l1 = l2;
- l2 = temp;
- }
- l1 = l1 / l2;
- l1 = l1.toFixed(1);
- return l1;
- };
-
- var getLabel = function (element) {
- var currentLabel = "";
- var currentLabelElement;
- var doc = element.ownerDocument;
- var labelElement, labelChilds, i, l, _i, _l;
-
-labelLoop:
- for (i = 0, l = doc.getElementsByTagName("label").length; i < l; i++) {
- labelElement = doc.getElementsByTagName("label")[i];
- labelChilds = labelElement.childNodes;
-
- if (labelElement.htmlFor && labelElement.htmlFor === element.id) {
- currentLabelElement = labelElement;
- break labelLoop;
- }
- for (_i = 0, _l = labelChilds.length; _i < _l; _i++) {
- if (labelChilds[_i] === element) {
- currentLabelElement = labelElement;
- break labelLoop;
- }
- }
- }
-
- if (currentLabelElement) {
- labelChilds = currentLabelElement.childNodes;
- for (i = 0, l = labelChilds.length; i < l; i++) {
- if (!labelChilds[i].tagName) { // check is text node
- currentLabel += labelChilds[i].nodeValue.replace(/^\s+/, "").replace(/\s+$/, "");
- }
- }
- }
- if (!currentLabel) {
- if (element.title) {
- currentLabel = element.title;
- } else if (element.id) {
- currentLabel = element.id;
- } else if (element.name) {
- currentLabel = element.name;
- } else {
- currentLabel = "";
- }
- }
- return currentLabel;
- };
-
- var getTextContent = function (el) {
- var ELEMENT_NODE = 1;
- var txt = '';
- var nodeType = el.nodeType;
- var tagName = el.tagName ? el.tagName.toUpperCase() : '';
- var attrType = el.getAttribute ? el.getAttribute('type') : '';
- var styleDisplay;
-
- try {
- var computedStyle = el.currentStyle || el.ownerDocument.defaultView.getComputedStyle(el, null);
- styleDisplay = computedStyle.display;
- } catch (e) {
- styleDisplay = "";
- }
-
- if (nodeType === ELEMENT_NODE &&
- styleDisplay === 'none') {
- txt += '[__[';
- }
-
- if (nodeType === ELEMENT_NODE &&
- tagName === "IMG") {
- txt += el.getAttribute('alt');
- } else if (nodeType === ELEMENT_NODE &&
- tagName === "AREA") {
- txt += el.getAttribute('alt');
- } else if (nodeType === ELEMENT_NODE &&
- tagName === "INPUT" &&
- attrType === 'image') {
- txt += el.getAttribute('alt');
- } else if (nodeType === ELEMENT_NODE &&
- tagName === "INPUT" &&
- (attrType === 'submit' ||
- attrType === 'reset' ||
- attrType === 'button')) {
- txt += el.value;
- } else if (nodeType === ELEMENT_NODE &&
- tagName === "INPUT") {
- txt += getLabel(el);
- } else if (nodeType === ELEMENT_NODE &&
- (tagName === "TEXTAREA" || tagName === "SELECT")) {
- txt += getLabel(el);
- } else if (nodeType !== ELEMENT_NODE ||
- (tagName !== "SCRIPT" && tagName !== "STYLE")) {
- var cNodes = el.childNodes;
- var TEXT_NODE = 3;
- var i, l;
- for (i = 0, l = cNodes.length; i < l; i++) {
- if (cNodes[i].nodeType === TEXT_NODE) {
- txt += cNodes[i].nodeValue;
- } else {
- txt += getTextContent(cNodes[i]);
- }
- }
- }
-
- if (nodeType === ELEMENT_NODE &&
- styleDisplay === 'none') {
- txt += ']__]';
- }
- txt = txt ? txt.replace(/^\s+/, '').replace(/\s+$/, '') : '';
- return txt;
- };
-
- var getAbsolutePath = function (src, url) {
- var newpath, orgPath;
-
- // remove url querystring
- url = url.replace(/\?.*$/, '');
-
- if (src && src.indexOf('//') === -1) {
- if (src.substr(0, 3) === '../') {
- newpath = url.substr(0, url.lastIndexOf('/') > 10 ? url.lastIndexOf('/') : url.length);
- while (src.substr(0, 3) === '../') {
- newpath = newpath.substr(0, newpath.lastIndexOf('/') > 10 ? newpath.lastIndexOf('/') : newpath.length);
- src = src.substr(3);
- }
- src = newpath + '/' + src;
- } else if (src.substr(0, 1) === '/') {
- orgPath = url.replace(/^((?:https?\:\/\/|file\:\/\/\/)[^\/]+)\/.*$/, '$1');
- src = orgPath + '/' + src;
- } else {
- orgPath = url.substr(0, url.lastIndexOf('/'));
- src = orgPath + '/' + src;
- }
- }
- return src;
- };
-
- achecker.Wax.run = function (cwin, rdoc, isIncludeFrame, frameDocs, discardFrameUrls) {
- return {
- header: (function () {
- var $div = rdoc.createElement('div');
- $div.className = 'waxFrames';
-
- var $fold = rdoc.createElement('div');
- var $foldBtn = rdoc.createElement('button');
-
- $fold.className = 'toggleAll';
- $foldBtn.className = 'fold';
- $foldBtn.setAttribute('data-folded', 'folded');
- $foldBtn.title = achecker.i18n.get('UnfoldAll');
- $foldBtn.setAttribute('type', 'button');
- $foldBtn.innerText = 'Toggle All';
- $foldBtn.textContent = 'Toggle All';
- $foldBtn.onclick = function () {
- var $headings = rdoc.querySelectorAll('.waxSection h2,.waxFrames h2');
- var foldedClass = this.getAttribute('data-folded') === 'folded' ? '' : 'folded';
- var i, l;
-
- for (i = 0, l = $headings.length; i < l; i++) {
- $headings[i].className = $headings[i].className.replace('folded', '') + ' ' + foldedClass;
- }
-
- if (foldedClass) {
- this.className = 'unfold';
- this.title = achecker.i18n.get('UnfoldAll');
- } else {
- this.className = 'fold';
- this.title = achecker.i18n.get('FoldAll');
- }
- this.setAttribute('data-folded', foldedClass);
- // fix bug: IE8 won't reflow when set data-* attribute
- rdoc.body.className = rdoc.body.getAttribute("className");
- };
- $fold.appendChild($foldBtn);
- $div.appendChild($fold);
-
- var $title = rdoc.createElement('h2');
- $title.className = '';
- $title.innerText = achecker.i18n.get('TargetPage');
- $title.textContent = achecker.i18n.get('TargetPage');
- addEvent($title, 'click', function (e) {
- toggleFoldedClass(this);
- });
- var $pages = rdoc.createElement('ul'), $pageLink;
- var $topPage = rdoc.createElement('li');
- var $topPageLink = rdoc.createElement('a');
- var i, l, $page;
-
- $topPageLink.setAttribute('href', cwin.location.href);
- $topPageLink.setAttribute('target', '_blank');
- $topPageLink.innerText = cwin.location.href;
- $topPageLink.textContent = cwin.location.href;
- $topPage.appendChild($topPageLink);
- $pages.appendChild($topPage);
- if (isIncludeFrame) {
- for (i = 0, l = frameDocs.length; i < l; i++) {
- $page = rdoc.createElement('li');
- $pageLink = rdoc.createElement('a');
- $pageLink.setAttribute('href', frameDocs[i].src);
- $pageLink.setAttribute('target', '_blank');
- $pageLink.innerText = frameDocs[i].src;
- $pageLink.textContent = frameDocs[i].src;
- $page.appendChild($pageLink);
- $pages.appendChild($page);
- }
- }
- $div.appendChild($title);
- $div.appendChild($pages);
-
- if (discardFrameUrls && discardFrameUrls.length) {
- $title = rdoc.createElement('h2');
- $title.innerText = achecker.i18n.get('NoneTargetPage');
- $title.textContent = achecker.i18n.get('NoneTargetPage');
- $title.className = 'folded';
- addEvent($title, 'click', function (e) {
- toggleFoldedClass(this);
- });
- $pages = rdoc.createElement('ul');
- for (i = 0, l = discardFrameUrls.length; i < l; i++) {
- $page = rdoc.createElement('li');
- $pageLink = rdoc.createElement('a');
- $pageLink.setAttribute('href', discardFrameUrls[i]);
- $pageLink.setAttribute('target', '_blank');
- $pageLink.innerText = discardFrameUrls[i];
- $pageLink.textContent = discardFrameUrls[i];
- $page.appendChild($pageLink);
- $pages.appendChild($page);
- }
- }
- $div.appendChild($title);
- $div.appendChild($pages);
- return $div;
- }()),
- sections: {
- altText: new TableSection(
- cwin,
- rdoc,
- '1. ' + achecker.i18n.get('No1') + ' (img)',
- 'input[type=image],img,area',
- [ {label: achecker.i18n.get('Hidden'), width: 45},
- {label: achecker.i18n.get('Preview'), width: 106},
- {label: achecker.i18n.get('Element'), width: 45},
- {label: achecker.i18n.get('Contents')}
- ],
- isIncludeFrame,
- frameDocs,
- achecker.i18n.get('NotApplicable'),
- function (doc, url) {
- var tagName = this.tagName.toLowerCase();
- var data = {
- hidden: '',
- preview: '',
- el: '',
- alt: ''
- };
- var self = this;
-
- var handleImg = function () {
- var hasAlt = self.getAttribute('alt') !== null;
- data.alt = rdoc.createElement('span');
- if (!hasAlt) {
- data.alt.innerText = 'alt ' + achecker.i18n.get('Undefined');
- data.alt.textContent = 'alt ' + achecker.i18n.get('Undefined');
- } else if (!self.getAttribute('alt')) {
- data.alt.innerText = 'alt=""';
- data.alt.textContent = 'alt=""';
- } else {
- data.alt.innerText = self.getAttribute('alt');
- data.alt.textContent = self.getAttribute('alt');
- }
- data.el = tagName;
-
- if (self.getAttribute('longdesc')) {
- var $longdesc = rdoc.createElement('a');
- $longdesc.setAttribute('href',
- getAbsolutePath(self.getAttribute('longdesc'), url));
- $longdesc.setAttribute('target', '_blank');
- $longdesc.innerText = 'longdesc link';
- $longdesc.textContent = 'longdesc link';
- data.alt.innerText += ' ';
- data.alt.textContent += ' ';
- data.alt.appendChild($longdesc);
- }
-
- var src = self.getAttribute('src');
-
- var $container = rdoc.createElement('div');
- $container.style.width = "100px";
- $container.style.margin = "0 auto";
- $container.style.overflow = "hidden";
- var $img = rdoc.createElement('img');
- $img.setAttribute('alt', '');
- $img.setAttribute('src', getAbsolutePath(src, url));
- $container.appendChild($img);
- data.preview = $container;
-
- return [
- data.hidden,
- data.preview,
- data.el,
- data.alt
- ];
- };
-
- switch (tagName) {
- case "input":
- if (this.type.toLowerCase() !== 'image') {
- break;
- }
- return handleImg();
-
- case "img":
- return handleImg();
-
- case "area":
- var hasAlt = this.getAttribute('alt') !== null;
- data.alt = rdoc.createElement('span');
- if (!hasAlt) {
- data.alt.innerText = 'alt ' + achecker.i18n.get('Undefined');
- data.alt.textContent = 'alt ' + achecker.i18n.get('Undefined');
- } else if (!this.getAttribute('alt')) {
- data.alt.innerText = 'alt=""';
- data.alt.textContent = 'alt=""';
- } else {
- data.alt.innerText = this.getAttribute('alt');
- data.alt.textContent = this.getAttribute('alt');
- }
- data.el = tagName;
-
- return [
- data.hidden,
- data.preview,
- data.el,
- data.alt
- ];
- }
-
- return false;
- },
- function () {
- var tagName = this.tagName;
- switch (tagName) {
- case "IMG":
- case "INPUT":
- case "AREA":
- var hasAlt = this.getAttribute('alt') !== null;
-
- if (!hasAlt) {
- return 'fail';
- }
- if (!this.getAttribute('alt')) {
- return 'warning';
- }
- return 'pass';
- }
- }
- ),
-
- altTextBG: new TableSection(
- cwin,
- rdoc,
- '1. ' + achecker.i18n.get('No1') + ' (bg)',
- 'body *',
- [ {label: achecker.i18n.get('Hidden'), width: 45},
- {label: achecker.i18n.get('Preview'), width: 106},
- {label: achecker.i18n.get('Contents')}
- ],
- isIncludeFrame,
- frameDocs,
- achecker.i18n.get('NotApplicable'),
- function (doc, url) {
- var data = {
- hidden: '',
- preview: '',
- content: ''
- };
- var computedStyle = this.currentStyle || cwin.getComputedStyle(this, null);
- var bgImage = computedStyle.backgroundImage;
- if (bgImage !== 'none' &&
- this.getElementsByTagName('*').length < 10) {
- var $bg = rdoc.createElement('span');
- url = bgImage.replace(/^url\("?/, '').replace(/"?\)$/, '');
-
- try {
- $bg.style.backgroundImage = bgImage;
- $bg.style.backgroundPosition = computedStyle.backgroundPosition;
- $bg.style.backgroundRepeat = computedStyle.backgroundRepeat;
- $bg.style.width = computedStyle.width;
- $bg.style.height = computedStyle.height;
- } catch (e) {
- }
- $bg.style.maxWidth = '100px';
- $bg.style.maxHeight = '200px';
- $bg.style.display = 'inline-block';
- $bg.style.overflow = 'hidden';
-
- data.preview = $bg;
- data.content = getTextContent(this);
-
- return [
- data.hidden,
- data.preview,
- data.content
- ];
- }
-
- return false;
- }
- ),
-
- altTextEmbed: new TableSection(
- cwin,
- rdoc,
- '1. ' + achecker.i18n.get('No1') + ' (object)',
- 'object,embed,video,audio,canvas,svg',
- [ {label: achecker.i18n.get('Hidden'), width: 45},
- {label: achecker.i18n.get('Element')}
- ],
- isIncludeFrame,
- frameDocs,
- achecker.i18n.get('NotApplicable'),
- function (doc, url) {
- var tagName = this.tagName;
- switch (tagName) {
- case "OBJECT":
- if (this.parentNode && this.parentNode.tagName &&
- (this.parentNode.tagName === 'OBJECT' ||
- this.parentNode.tagName === 'EMBED')) {
- return false;
- }
- return [
- '',
- '