-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevelop.js
More file actions
44 lines (37 loc) · 1.01 KB
/
develop.js
File metadata and controls
44 lines (37 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
var doc = document;
var config = window.amdizeConfig || {};
var basePath = config.basePath || '.';
for(i = 0; i < externalDepends.length; ++i){
var dep = externalDepends[i];
if(dep){
window[dep.name] = dojo.require(dep.path);
}
}
var scripts = doc.getElementsByTagName("script"),
i = 0,
script, dojoDir, src, match;
var insertPointSibling;
while(i < scripts.length){
script = scripts[i++];
if((src = script.getAttribute("src")) && (match = src.match(/(((.*)\/)|^)dojo\.js(\W|$)/i))){
// remember an insertPointSibling
insertPointSibling = script;
}
}
var sourceLoaded = new Deferred();
function loadSource(idx){
var sourceFile = sourceFiles[idx];
if(sourceFile){
var url = basePath + '/' + sourceFile.path + '.js';
var node = doc.createElement('script');
node.type = 'text/javascript';
node.src = url;
on(node, 'load', function(){
loadSource(idx + 1);
});
insertPointSibling.parentNode.insertBefore(node, insertPointSibling);
}else{
sourceLoaded.resolve();
}
}
loadSource(0);