/*
- Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details
*/
dojo.isSafari = {
// example:
// | if(dojo.isSafari){ ... }
- // example:
+ // example:
// Detect iPhone:
- // | if(dojo.isSafari && navigator.userAgent.indexOf("iPhone") != -1){
+ // | if(dojo.isSafari && navigator.userAgent.indexOf("iPhone") != -1){
// | // we are iPhone. Note, iPod touch reports "iPod" above and fails this test.
// | }
};
// True if the client runs on Mac
}
=====*/
-
if(typeof window != 'undefined'){
dojo.isBrowser = true;
dojo._name = "browser";
d.config.baseUrl = src.substring(0, m.index);
}
// and find out if we need to modify our behavior
- var cfg = scripts[i].getAttribute("djConfig");
+ var cfg = (scripts[i].getAttribute("djConfig") || scripts[i].getAttribute("data-dojo-config"));
if(cfg){
var cfgo = eval("({ "+cfg+" })");
for(var x in cfgo){
d._XMLHTTP_PROGIDS = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.4.0'];
d._xhrObj = function(){
- // summary:
+ // summary:
// does the work of portably generating a new XMLHTTPRequest object.
var http, last_e;
if(!dojo.isIE || !dojo.config.ieForceActiveXXhr){
var stat = http.status || 0,
lp = location.protocol;
return (stat >= 200 && stat < 300) || // Boolean
- stat == 304 || // allow any 2XX response code
- stat == 1223 || // get it out of the cache
+ stat == 304 || // allow any 2XX response code
+ stat == 1223 || // get it out of the cache
+ // Internet Explorer mangled the status code
// Internet Explorer mangled the status code OR we're Titanium/browser chrome/chrome extension requesting a local file
- (!stat && (lp == "file:" || lp == "chrome:" || lp == "chrome-extension:" || lp == "app:") );
+ (!stat && (lp == "file:" || lp == "chrome:" || lp == "chrome-extension:" || lp == "app:"));
}
//See if base tag is in use.
d.addOnWindowUnload = function(/*Object?|Function?*/obj, /*String|Function?*/functionName){
// summary:
// registers a function to be triggered when window.onunload
- // fires.
+ // fires.
// description:
// The first time that addOnWindowUnload is called Dojo
// will register a page listener to trigger your unload
// description:
// The first time that addOnUnload is called Dojo will
// register a page listener to trigger your unload handler
- // with.
+ // with.
//
// In a browser enviroment, the functions will be triggered
// during the window.onbeforeunload event. Be careful of doing
//
// Further note that calling dojo.addOnUnload will prevent
// browsers from using a "fast back" cache to make page
- // loading via back button instantaneous.
+ // loading via back button instantaneous.
// example:
// | dojo.addOnUnload(functionPointer)
// | dojo.addOnUnload(object, "functionName")
}
}
- if(!dojo.config.afterOnLoad){
+ if(!dojo.config.afterOnLoad){
if(document.addEventListener){
//Standards. Hooray! Assumption here that if standards based,
//it knows about DOMContentLoaded. It is OK if it does not, the fall through
if(!dojo.config.skipIeDomLoaded && self === self.top){
dojo._scrollIntervalId = setInterval(function (){
try{
- //When dojo is loaded into an iframe in an IE HTML Application
+ //When dojo is loaded into an iframe in an IE HTML Application
//(HTA), such as in a selenium test, javascript in the iframe
//can't see anything outside of it, so self===self.top is true,
- //but the iframe is not the top window and doScroll will be
+ //but the iframe is not the top window and doScroll will be
//available before document.body is set. Test document.body
//before trying the doScroll trick
if(document.body){
}
if(dojo.config.debugAtAllCosts){
- dojo.config.useXDomain = true;
- dojo.require("dojo._base._loader.loader_xd");
+ // this breaks the new AMD based module loader. The XDomain won't be necessary
+ // anyway if you switch to the asynchronous loader
+ //dojo.config.useXDomain = true;
+ //dojo.require("dojo._base._loader.loader_xd");
dojo.require("dojo._base._loader.loader_debug");
dojo.require("dojo.i18n");
}
+