2150 |
mathias |
1 |
if(!dojo._hasResource["dojo._base._loader.loader_debug"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
|
|
|
2 |
dojo._hasResource["dojo._base._loader.loader_debug"] = true;
|
|
|
3 |
dojo.provide("dojo._base._loader.loader_debug");
|
|
|
4 |
|
|
|
5 |
//Override dojo.provide, so we can trigger the next
|
|
|
6 |
//script tag for the next local module. We can only add one
|
|
|
7 |
//at a time because there are browsers that execute script tags
|
|
|
8 |
//in the order that the code is received, and not in the DOM order.
|
|
|
9 |
dojo.nonDebugProvide = dojo.provide;
|
|
|
10 |
|
|
|
11 |
dojo.provide = function(resourceName){
|
|
|
12 |
var dbgQueue = dojo["_xdDebugQueue"];
|
|
|
13 |
if(dbgQueue && dbgQueue.length > 0 && resourceName == dbgQueue["currentResourceName"]){
|
|
|
14 |
//Set a timeout so the module can be executed into existence. Normally the
|
|
|
15 |
//dojo.provide call in a module is the first line. Don't want to risk attaching
|
|
|
16 |
//another script tag until the current one finishes executing.
|
|
|
17 |
window.setTimeout("dojo._xdDebugFileLoaded('" + resourceName + "')", 1);
|
|
|
18 |
}
|
|
|
19 |
|
|
|
20 |
return dojo.nonDebugProvide.apply(dojo, arguments);
|
|
|
21 |
}
|
|
|
22 |
|
|
|
23 |
dojo._xdDebugFileLoaded = function(resourceName){
|
|
|
24 |
var dbgQueue = this._xdDebugQueue;
|
|
|
25 |
|
|
|
26 |
if(resourceName && resourceName == dbgQueue.currentResourceName){
|
|
|
27 |
dbgQueue.shift();
|
|
|
28 |
}
|
|
|
29 |
|
|
|
30 |
if(dbgQueue.length == 0){
|
|
|
31 |
dbgQueue.currentResourceName = null;
|
|
|
32 |
this._xdNotifyLoaded();
|
|
|
33 |
}else{
|
|
|
34 |
dbgQueue.currentResourceName = dbgQueue[0].resourceName;
|
|
|
35 |
var element = document.createElement("script");
|
|
|
36 |
element.type = "text/javascript";
|
|
|
37 |
element.src = dbgQueue[0].resourcePath;
|
|
|
38 |
document.getElementsByTagName("head")[0].appendChild(element);
|
|
|
39 |
}
|
|
|
40 |
}
|
|
|
41 |
|
|
|
42 |
}
|