diff options
Diffstat (limited to 'lib/dojo/_base/_loader/hostenv_browser.js')
-rw-r--r-- | lib/dojo/_base/_loader/hostenv_browser.js | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/lib/dojo/_base/_loader/hostenv_browser.js b/lib/dojo/_base/_loader/hostenv_browser.js index 7d92d70e3..b31bd77dc 100644 --- a/lib/dojo/_base/_loader/hostenv_browser.js +++ b/lib/dojo/_base/_loader/hostenv_browser.js @@ -1,5 +1,5 @@ /* - 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 */ @@ -26,9 +26,9 @@ dojo.isIE = { 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. // | } }; @@ -71,7 +71,6 @@ dojo = { // True if the client runs on Mac } =====*/ - if(typeof window != 'undefined'){ dojo.isBrowser = true; dojo._name = "browser"; @@ -98,7 +97,7 @@ if(typeof window != 'undefined'){ 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){ @@ -172,7 +171,7 @@ if(typeof window != 'undefined'){ 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){ @@ -205,10 +204,11 @@ if(typeof window != 'undefined'){ 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. @@ -303,7 +303,7 @@ if(typeof window != 'undefined'){ 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 @@ -334,7 +334,7 @@ if(typeof window != 'undefined'){ // 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 @@ -347,7 +347,7 @@ if(typeof window != 'undefined'){ // // 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") @@ -384,7 +384,7 @@ if(typeof window != 'undefined'){ } } - 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 @@ -401,10 +401,10 @@ if(typeof window != 'undefined'){ 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){ @@ -467,8 +467,11 @@ if(dojo.config.isDebug){ } 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"); } + |