]>
git.wh0rd.org - tt-rss.git/blob - lib/dojo/uacss.js.uncompressed.js
1 define("dojo/uacss", ["./dom-geometry", "./_base/lang", "./ready", "./sniff", "./_base/window"],
2 function(geometry
, lang
, ready
, has
, baseWindow
){
10 // Applies pre-set CSS classes to the top-level HTML node, based on:
12 // - browser (ex: dj_ie)
13 // - browser version (ex: dj_ie6)
14 // - box model (ex: dj_contentBox)
15 // - text direction (ex: dijitRtl)
17 // In addition, browser, browser version, and box model are
18 // combined with an RTL flag when browser text is RTL. ex: dj_ie-rtl.
20 // Returns the has() method.
25 html
= baseWindow
.doc
.documentElement
,
30 boxModel
= geometry
.boxModel
.replace(/-/,''),
33 "dj_quirks": has("quirks"),
35 // NOTE: Opera not supported by dijit
38 "dj_khtml": has("khtml"),
40 "dj_webkit": has("webkit"),
41 "dj_safari": has("safari"),
42 "dj_chrome": has("chrome"),
44 "dj_gecko": has("mozilla")
45 }; // no dojo unsupported browsers
48 classes
["dj_ie"] = true;
49 classes
["dj_ie" + maj(ie
)] = true;
50 classes
["dj_iequirks"] = has("quirks");
53 classes
["dj_ff" + maj(ff
)] = true;
56 classes
["dj_" + boxModel
] = true;
58 // apply browser, browser version, and box model class names
60 for(var clz
in classes
){
62 classStr
+= clz
+ " ";
65 html
.className
= lang
.trim(html
.className
+ " " + classStr
);
67 // If RTL mode, then add dj_rtl flag plus repeat existing classes with -rtl extension.
68 // We can't run the code below until the <body> tag has loaded (so we can check for dir=rtl).
69 // priority is 90 to run ahead of parser priority of 100
71 if(!geometry
.isBodyLtr()){
72 var rtlClassStr
= "dj_rtl dijitRtl " + classStr
.replace(/ /g
, "-rtl ");
73 html
.className
= lang
.trim(html
.className
+ " " + rtlClassStr
+ "dj_rtl dijitRtl " + classStr
.replace(/ /g
, "-rtl "));