summaryrefslogtreecommitdiff
path: root/includes/js/dijit/_base/sniff.js
diff options
context:
space:
mode:
authormensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-11-13 09:49:11 +0000
committermensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-11-13 09:49:11 +0000
commite44a7e37b6c7b5961adaffc62b9042b8d442938e (patch)
tree95b67c356e93163467db2451f2b8cce84ed5d582 /includes/js/dijit/_base/sniff.js
parenta62b9742ee5e28bcec6872d88f50f25b820914f6 (diff)
downloadsemanticscuttle-e44a7e37b6c7b5961adaffc62b9042b8d442938e.tar.gz
semanticscuttle-e44a7e37b6c7b5961adaffc62b9042b8d442938e.tar.bz2
New feature: basic Ajax suggestion for tags and implementation of Dojo toolkit
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@151 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'includes/js/dijit/_base/sniff.js')
-rw-r--r--includes/js/dijit/_base/sniff.js45
1 files changed, 45 insertions, 0 deletions
diff --git a/includes/js/dijit/_base/sniff.js b/includes/js/dijit/_base/sniff.js
new file mode 100644
index 0000000..30835cc
--- /dev/null
+++ b/includes/js/dijit/_base/sniff.js
@@ -0,0 +1,45 @@
+if(!dojo._hasResource["dijit._base.sniff"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._base.sniff"] = true;
+dojo.provide("dijit._base.sniff");
+
+// ported from dojo.html.applyBrowserClass (style.js)
+
+// summary:
+// Applies pre-set class names based on browser & version to the
+// top-level HTML node. Simply doing a require on this module will
+// establish this CSS. Modified version of Morris' CSS hack.
+(function(){
+ var d = dojo;
+ var ie = d.isIE;
+ var opera = d.isOpera;
+ var maj = Math.floor;
+ var ff = d.isFF;
+ var classes = {
+ dj_ie: ie,
+// dj_ie55: ie == 5.5,
+ dj_ie6: maj(ie) == 6,
+ dj_ie7: maj(ie) == 7,
+ dj_iequirks: ie && d.isQuirks,
+// NOTE: Opera not supported by dijit
+ dj_opera: opera,
+ dj_opera8: maj(opera) == 8,
+ dj_opera9: maj(opera) == 9,
+ dj_khtml: d.isKhtml,
+ dj_safari: d.isSafari,
+ dj_gecko: d.isMozilla,
+ dj_ff2: maj(ff) == 2
+ }; // no dojo unsupported browsers
+
+ for(var p in classes){
+ if(classes[p]){
+ var html = dojo.doc.documentElement; //TODO browser-specific DOM magic needed?
+ if(html.className){
+ html.className += " " + p;
+ }else{
+ html.className = p;
+ }
+ }
+ }
+})();
+
+}