You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.4 KiB
52 lines
1.4 KiB
/* |
|
Copyright (c) 2004-2006, The Dojo Foundation |
|
All Rights Reserved. |
|
|
|
Licensed under the Academic Free License version 2.1 or above OR the |
|
modified BSD license. For more information on Dojo licensing, see: |
|
|
|
http://dojotoolkit.org/community/licensing.shtml |
|
*/ |
|
|
|
|
|
dojo.provide("dojo.a11y"); |
|
dojo.require("dojo.uri.*"); |
|
dojo.require("dojo.html.common"); |
|
dojo.a11y={imgPath:dojo.uri.moduleUri("dojo.widget","templates/images"),doAccessibleCheck:true,accessible:null,checkAccessible:function(){ |
|
if(this.accessible===null){ |
|
this.accessible=false; |
|
if(this.doAccessibleCheck==true){ |
|
this.accessible=this.testAccessible(); |
|
} |
|
} |
|
return this.accessible; |
|
},testAccessible:function(){ |
|
this.accessible=false; |
|
if(dojo.render.html.ie||dojo.render.html.mozilla){ |
|
var _1=document.createElement("div"); |
|
_1.style.backgroundImage="url(\""+this.imgPath+"/tab_close.gif\")"; |
|
dojo.body().appendChild(_1); |
|
var _2=null; |
|
if(window.getComputedStyle){ |
|
var _3=getComputedStyle(_1,""); |
|
_2=_3.getPropertyValue("background-image"); |
|
}else{ |
|
_2=_1.currentStyle.backgroundImage; |
|
} |
|
var _4=false; |
|
if(_2!=null&&(_2=="none"||_2=="url(invalid-url:)")){ |
|
this.accessible=true; |
|
} |
|
dojo.body().removeChild(_1); |
|
} |
|
return this.accessible; |
|
},setCheckAccessible:function(_5){ |
|
this.doAccessibleCheck=_5; |
|
},setAccessibleMode:function(){ |
|
if(this.accessible===null){ |
|
if(this.checkAccessible()){ |
|
dojo.render.html.prefixes.unshift("a11y"); |
|
} |
|
} |
|
return this.accessible; |
|
}};
|
|
|