6 Star 10 Fork 0

Gitee 极速下载/dojo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/dojo/dojo
克隆/下载
uacss.js 2.13 KB
一键复制 编辑 原始数据 按行查看 历史
define(["./dom-geometry", "./_base/lang", "./domReady", "./sniff", "./_base/window"],
function(geometry, lang, domReady, has, baseWindow){
// module:
// dojo/uacss
/*=====
return {
// summary:
// Applies pre-set CSS classes to the top-level HTML node, based on:
//
// - browser (ex: dj_ie)
// - browser version (ex: dj_ie6)
// - box model (ex: dj_contentBox)
// - text direction (ex: dijitRtl)
//
// In addition, browser, browser version, and box model are
// combined with an RTL flag when browser text is RTL. ex: dj_ie-rtl.
//
// Returns the has() method.
};
=====*/
var
html = baseWindow.doc.documentElement,
ie = has("ie"),
trident = has("trident"),
opera = has("opera"),
maj = Math.floor,
ff = has("ff"),
boxModel = geometry.boxModel.replace(/-/,''),
classes = {
"dj_quirks": has("quirks"),
// NOTE: Opera not supported by dijit
"dj_opera": opera,
"dj_khtml": has("khtml"),
"dj_webkit": has("webkit"),
"dj_safari": has("safari"),
"dj_chrome": has("chrome"),
"dj_edge": has("edge"),
"dj_gecko": has("mozilla"),
"dj_ios": has("ios"),
"dj_android": has("android")
}; // no dojo unsupported browsers
if(ie){
classes["dj_ie"] = true;
classes["dj_ie" + maj(ie)] = true;
classes["dj_iequirks"] = has("quirks");
}
if(trident){
classes["dj_trident"] = true;
classes["dj_trident" + maj(trident)] = true;
}
if(ff){
classes["dj_ff" + maj(ff)] = true;
}
classes["dj_" + boxModel] = true;
// apply browser, browser version, and box model class names
var classStr = "";
for(var clz in classes){
if(classes[clz]){
classStr += clz + " ";
}
}
html.className = lang.trim(html.className + " " + classStr);
// If RTL mode, then add dj_rtl flag plus repeat existing classes with -rtl extension.
// We can't run the code below until the <body> tag has loaded (so we can check for dir=rtl).
domReady(function(){
if(!geometry.isBodyLtr()){
var rtlClassStr = "dj_rtl dijitRtl " + classStr.replace(/ /g, "-rtl ");
html.className = lang.trim(html.className + " " + rtlClassStr + "dj_rtl dijitRtl " + classStr.replace(/ /g, "-rtl "));
}
});
return has;
});
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/mirrors/dojo.git
git@gitee.com:mirrors/dojo.git
mirrors
dojo
dojo
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385