Ticket #4573: dojo.2.patch
| File dojo.2.patch, 8.7 kB (added by jburke, 15 months ago) |
|---|
-
io/script.js
56 56 var dfd = dojo._ioSetArgs(args, this._deferredCancel, this._deferredOk, this._deferredError); 57 57 58 58 var ioArgs = dfd.ioArgs; 59 ioArgs.id = "dojoIoScript" + (this._counter++);59 ioArgs.id = dojo._scopeName + "IoScript" + (this._counter++); 60 60 ioArgs.canDelete = false; 61 61 62 62 //Special setup for jsonp case -
io/iframe.js
128 128 // using dojo.objectToQuery(). 129 129 130 130 if(!this["_frame"]){ 131 this._frame = this.create(this._iframeName, "dojo.io.iframe._iframeOnload();");131 this._frame = this.create(this._iframeName, dojo._scopeName + ".io.iframe._iframeOnload();"); 132 132 } 133 133 134 134 //Set up the deferred. … … 212 212 213 213 _currentDfd: null, 214 214 _dfdQueue: [], 215 _iframeName: "dojoIoIframe",215 _iframeName: dojo._scopeName + "IoIframe", 216 216 217 217 _fireNextRequest: function(){ 218 218 //summary: Internal method used to fire the next request in the bind queue. -
parser.js
122 122 // potentially calls a layout method to allow them to connect with 123 123 // any children 124 124 var thelist = []; 125 var daName = dojo._scopeName + "Type"; 125 126 d.forEach(nodes, function(node){ 126 127 if(!node){ return; } 127 var type = node.getAttribute( "dojoType");128 var type = node.getAttribute(daName); 128 129 if((!type)||(!type.length)){ return; } 129 130 var clsInfo = getClassInfo(type); 130 131 var clazz = clsInfo.cls; … … 219 220 // Search specified node (or root node) recursively for class instances, 220 221 // and instantiate them Searches for 221 222 // dojoType="qualified.class.name" 222 var list = d.query('[ dojoType]', rootNode);223 var list = d.query('[' + dojo._scopeName + 'Type]', rootNode); 223 224 // go build the object instances 224 225 var instances = this.instantiate(list); 225 226 return instances; -
_base/_loader/loader.js
112 112 if(!contents){ return false; } // Boolean 113 113 this._loadedUrls[uri] = true; 114 114 this._loadedUrls.push(uri); 115 if(cb){ contents = '('+contents+')'; } 115 if(cb){ 116 contents = '('+contents+')'; 117 }else{ 118 //Only do the scoping if no callback. If a callback is specified, 119 //it is most likely the i18n bundle stuff. 120 contents = this._scopePrefix + contents + this._scopeSuffix; 121 } 116 122 var value = dojo["eval"](contents+"\r\n//@ sourceURL="+uri); 117 123 if(cb){ cb(value); } 118 124 return true; // Boolean … … 223 229 //FF 2.0 and freezing issues where we try to do sync xhr while background css images 224 230 //are being loaded (trac #2572)? Consider for 0.9. 225 231 if(typeof setTimeout == "object" || (djConfig["useXDomain"] && dojo.isOpera)){ 226 setTimeout( "dojo.loaded();", 0);232 setTimeout(dojo._scopeName + ".loaded();", 0); 227 233 }else{ 228 234 dojo.loaded(); 229 235 } -
_base/_loader/hostenv_browser.js
238 238 // strips all comments -- including conditional ones. 239 239 240 240 document.write('<scr'+'ipt defer src="//:" ' 241 + 'onreadystatechange="if(this.readyState==\'complete\'){ dojo._loadInit();}">'241 + 'onreadystatechange="if(this.readyState==\'complete\'){' + dojo._scopeName + '._loadInit();}">' 242 242 + '</scr'+'ipt>' 243 243 ); 244 244 -
_base/_loader/loader_debug.js
12 12 //Set a timeout so the module can be executed into existence. Normally the 13 13 //dojo.provide call in a module is the first line. Don't want to risk attaching 14 14 //another script tag until the current one finishes executing. 15 window.setTimeout( "dojo._xdDebugFileLoaded('" + resourceName + "')", 1);15 window.setTimeout(dojo._scopeName + "._xdDebugFileLoaded('" + resourceName + "')", 1); 16 16 } 17 17 18 18 return dojo.nonDebugProvide.apply(dojo, arguments); -
_base/_loader/bootstrap.js
41 41 42 42 //TODOC: HOW TO DOC THIS? 43 43 // dojo is the root variable of (almost all) our public symbols -- make sure it is defined. 44 if(typeof this["dojo"] == "undefined"){ 45 this.dojo = {}; 44 if(typeof(dojo) == "undefined"){ 45 this.dojo = { 46 _scopeName: "dojo", 47 _scopePrefix: "", 48 _scopePrefixArgs: "", 49 _scopeSuffix: "", 50 _scopeMap: {} 51 }; 46 52 } 47 53 54 //Need placeholders for dijit and dojox for scoping code. 55 if(typeof(dijit) == "undefined"){ 56 this.dijit = {_scopeName: "dijit"}; 57 } 58 if(typeof(dojox) == "undefined"){ 59 this.dojox = {_scopeName: "dojox"}; 60 } 61 62 if(!dojo._scopeArgs){ 63 dojo._scopeArgs = [dojo, dijit, dojox]; 64 } 65 48 66 // summary: 49 67 // return the current global context object 50 68 // (e.g., the window object in a browser). … … 91 109 92 110 // Register with the OpenAjax hub 93 111 if(typeof OpenAjax != "undefined"){ 94 OpenAjax.hub.registerLibrary( "dojo", "http://dojotoolkit.org", dojo.version.toString());112 OpenAjax.hub.registerLibrary(dojo._scopeName, "http://dojotoolkit.org", dojo.version.toString()); 95 113 } 96 114 97 115 dojo._getProp = function(/*Array*/parts, /*Boolean*/create, /*Object*/context){ 98 116 var obj=context||dojo.global; 99 117 for(var i=0, p; obj&&(p=parts[i]); i++){ 118 if(i == 0 && this._scopeMap[p]){ 119 p = this._scopeMap[p]; 120 } 100 121 obj = (p in obj ? obj[p] : (create ? obj[p]={} : undefined)); 101 122 } 102 123 return obj; // Any -
_base/_loader/loader_xd.js
45 45 46 46 //Create resource object and the call to _xdResourceLoaded. 47 47 var output = []; 48 output.push( "dojo._xdResourceLoaded({\n");48 output.push(dojo._scopeName + "._xdResourceLoaded({\n"); 49 49 50 50 //Add dependencies 51 51 if(deps.length > 0){ … … 60 60 } 61 61 62 62 //Add the contents of the file inside a function. 63 //Pass in dojo as an argument to the function to help with64 // allowing multiple versions of dojo in a page.65 output.push("\ndefineResource: function( dojo){");63 //Pass in scope arguments so we can support multiple versions of the 64 //same module on a page. 65 output.push("\ndefineResource: function(" + dojo._scopePrefixArgs + "){"); 66 66 67 67 //Don't put in the contents in the debugAtAllCosts case 68 68 //since the contents may have syntax errors. Let those … … 168 168 169 169 //Start timer 170 170 if(!this._xdTimer){ 171 this._xdTimer = setInterval( "dojo._xdWatchInFlight();", 100);171 this._xdTimer = setInterval(dojo._scopeName + "._xdWatchInFlight();", 100); 172 172 } 173 173 this._xdStartTime = (new Date()).getTime(); 174 174 } … … 213 213 var res = this._xdCreateResource(contents, module, uri); 214 214 dojo.eval(res); 215 215 }else{ 216 if(cb){ contents = '('+contents+')'; }217 var value = dojo.eval(contents);218 216 if(cb){ 217 contents = '('+contents+')'; 218 }else{ 219 //Only do the scoping if no callback. If a callback is specified, 220 //it is most likely the i18n bundle stuff. 221 contents = this._scopePrefix + contents + this._scopeSuffix; 222 } 223 var value = dojo["eval"](contents+"\r\n//@ sourceURL="+uri); 224 if(cb){ 219 225 cb(value); 220 226 } 221 227 } … … 593 599 this._xdDebugQueue.push({resourceName: content.resourceName, resourcePath: content.resourcePath}); 594 600 }else{ 595 601 //Evaluate the resource to bring it into being. 596 //Pass dojo in so that later, to support multiple versions of dojo 597 //in a page, we can pass which version of dojo to use. 598 content(dojo); 602 //Pass in scope args to allow multiple versions of modules in a page. 603 content.apply(dojo.global, dojo._scopeArgs); 599 604 } 600 605 } 601 606 … … 603 608 //This normally shouldn't happen with proper dojo.provide and dojo.require 604 609 //usage, but providing it just in case. Note that these may not be executed 605 610 //in the original order that the developer intended. 606 //Pass dojo in so that later, to support multiple versions of dojo607 //in a page, we can pass which version of dojo to use.608 611 for(var i = 0; i < this._xdContents.length; i++){ 609 612 var current = this._xdContents[i]; 610 613 if(current.content && !current.isDefined){ 611 current.content(dojo); 614 //Pass in scope args to allow multiple versions of modules in a page. 615 current.content.apply(dojo.global, dojo._scopeArgs); 612 616 } 613 617 } 614 618