]>
git.wh0rd.org - tt-rss.git/blob - lib/dojo/uacss.js
2 Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
3 Available via Academic Free License >= 2.1 OR the modified BSD license.
4 see: http://dojotoolkit.org/license for details
8 if(!dojo
._hasResource
["dojo.uacss"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
9 dojo
._hasResource
["dojo.uacss"] = true;
10 dojo
.provide("dojo.uacss");
15 // Applies pre-set CSS classes to the top-level HTML node, based on:
16 // - browser (ex: dj_ie)
17 // - browser version (ex: dj_ie6)
18 // - box model (ex: dj_contentBox)
19 // - text direction (ex: dijitRtl)
21 // In addition, browser, browser version, and box model are
22 // combined with an RTL flag when browser text is RTL. ex: dj_ie-rtl.
25 html
= d
.doc
.documentElement
,
30 boxModel
= d
.boxModel
.replace(/-/,''),
38 dj_quirks
: d
.isQuirks
,
39 dj_iequirks
: ie
&& d
.isQuirks
,
41 // NOTE: Opera not supported by dijit
46 dj_webkit
: d
.isWebKit
,
47 dj_safari
: d
.isSafari
,
48 dj_chrome
: d
.isChrome
,
50 dj_gecko
: d
.isMozilla
,
52 }; // no dojo unsupported browsers
54 classes
["dj_" + boxModel
] = true;
56 // apply browser, browser version, and box model class names
58 for(var clz
in classes
){
60 classStr
+= clz
+ " ";
63 html
.className
= d
.trim(html
.className
+ " " + classStr
);
65 // If RTL mode, then add dj_rtl flag plus repeat existing classes with -rtl extension.
66 // We can't run the code below until the <body> tag has loaded (so we can check for dir=rtl).
67 // Unshift() is to run sniff code before the parser.
68 dojo
._loaders
.unshift(function(){
69 if(!dojo
._isBodyLtr()){
70 var rtlClassStr
= "dj_rtl dijitRtl " + classStr
.replace(/ /g
, "-rtl ")
71 html
.className
= d
.trim(html
.className
+ " " + rtlClassStr
);