Subversion Repositories Applications.papyrus

Rev

Rev 1372 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1372 Rev 1422
1
/*
1
/*
2
	Copyright (c) 2004-2006, The Dojo Foundation
2
	Copyright (c) 2004-2006, The Dojo Foundation
3
	All Rights Reserved.
3
	All Rights Reserved.
4
 
4
 
5
	Licensed under the Academic Free License version 2.1 or above OR the
5
	Licensed under the Academic Free License version 2.1 or above OR the
6
	modified BSD license. For more information on Dojo licensing, see:
6
	modified BSD license. For more information on Dojo licensing, see:
7
 
7
 
8
		http://dojotoolkit.org/community/licensing.shtml
8
		http://dojotoolkit.org/community/licensing.shtml
9
*/
9
*/
-
 
10
 
-
 
11
 
10
 
12
 
11
dojo.provide("dojo.a11y");
13
dojo.provide("dojo.a11y");
12
dojo.require("dojo.uri.*");
14
dojo.require("dojo.uri.*");
13
dojo.require("dojo.html.common");
15
dojo.require("dojo.html.common");
14
dojo.a11y = {imgPath:dojo.uri.moduleUri("dojo.widget", "templates/images"), doAccessibleCheck:true, accessible:null, checkAccessible:function () {
16
dojo.a11y = {imgPath:dojo.uri.moduleUri("dojo.widget", "templates/images"), doAccessibleCheck:true, accessible:null, checkAccessible:function () {
15
	if (this.accessible === null) {
17
	if (this.accessible === null) {
16
		this.accessible = false;
18
		this.accessible = false;
17
		if (this.doAccessibleCheck == true) {
19
		if (this.doAccessibleCheck == true) {
18
			this.accessible = this.testAccessible();
20
			this.accessible = this.testAccessible();
19
		}
21
		}
20
	}
22
	}
21
	return this.accessible;
23
	return this.accessible;
22
}, testAccessible:function () {
24
}, testAccessible:function () {
23
	this.accessible = false;
25
	this.accessible = false;
24
	if (dojo.render.html.ie || dojo.render.html.mozilla) {
26
	if (dojo.render.html.ie || dojo.render.html.mozilla) {
25
		var div = document.createElement("div");
27
		var div = document.createElement("div");
26
		div.style.backgroundImage = "url(\"" + this.imgPath + "/tab_close.gif\")";
28
		div.style.backgroundImage = "url(\"" + this.imgPath + "/tab_close.gif\")";
27
		dojo.body().appendChild(div);
29
		dojo.body().appendChild(div);
28
		var bkImg = null;
30
		var bkImg = null;
29
		if (window.getComputedStyle) {
31
		if (window.getComputedStyle) {
30
			var cStyle = getComputedStyle(div, "");
32
			var cStyle = getComputedStyle(div, "");
31
			bkImg = cStyle.getPropertyValue("background-image");
33
			bkImg = cStyle.getPropertyValue("background-image");
32
		} else {
34
		} else {
33
			bkImg = div.currentStyle.backgroundImage;
35
			bkImg = div.currentStyle.backgroundImage;
34
		}
36
		}
35
		var bUseImgElem = false;
37
		var bUseImgElem = false;
36
		if (bkImg != null && (bkImg == "none" || bkImg == "url(invalid-url:)")) {
38
		if (bkImg != null && (bkImg == "none" || bkImg == "url(invalid-url:)")) {
37
			this.accessible = true;
39
			this.accessible = true;
38
		}
40
		}
39
		dojo.body().removeChild(div);
41
		dojo.body().removeChild(div);
40
	}
42
	}
41
	return this.accessible;
43
	return this.accessible;
42
}, setCheckAccessible:function (bTest) {
44
}, setCheckAccessible:function (bTest) {
43
	this.doAccessibleCheck = bTest;
45
	this.doAccessibleCheck = bTest;
44
}, setAccessibleMode:function () {
46
}, setAccessibleMode:function () {
45
	if (this.accessible === null) {
47
	if (this.accessible === null) {
46
		if (this.checkAccessible()) {
48
		if (this.checkAccessible()) {
47
			dojo.render.html.prefixes.unshift("a11y");
49
			dojo.render.html.prefixes.unshift("a11y");
48
		}
50
		}
49
	}
51
	}
50
	return this.accessible;
52
	return this.accessible;
51
}};
53
}};
52
 
54