diff options
Diffstat (limited to 'itjs')
-rw-r--r-- | itjs/boot.js | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/itjs/boot.js b/itjs/boot.js index 5261405..dd5169d 100644 --- a/itjs/boot.js +++ b/itjs/boot.js @@ -235,16 +235,40 @@ function it_boot(file, isretry) { var doc = document; var dom = doc && (dom = doc.getElementById('it_boot_dom')); // HTML has been rendered + var files = []; it_boot.sequence += "n"; bootparam += "&script=1"; + if (jsdebug) { + var path = file.match(/^(.*\/)[^\/]*$/)[1]; + var params = file.match(/\?.*$/)[0]; + var imports = file.split(','); + for (var i=0; i<imports.length; i++) { + var script = imports[i]; + if (script.substr(0, path.length) != path) + script = path + script; + if (script.substr(script.length - params.length, params.length) != params) + script = script + params; + if (i == imports.length-1) + script = it_boot_addparam(script, bootparam); + else + script = it_boot_addparam(script, 'script=1'); + files.push(script); + } + } + else + files = [it_boot_addparam(file, bootparam)]; - if (window.opera || (document.all && navigator.platform.indexOf("Mac") >= 0)) - document.write('<sc'+'ript type="text/javascript" src="'+it_boot_addparam(file, bootparam)+'"><\/sc'+'ript>'); + if (window.opera || (document.all && navigator.platform.indexOf("Mac") >= 0)) { + for (var i=0; i < files.length; i++) + document.write('<sc'+'ript type="text/javascript" src="' + files[i] + '"><\/sc'+'ript>'); + } else if (dom) { - var tag = doc.createElement("script"); - tag.src = it_boot_addparam(file, bootparam); - dom.appendChild(tag); + for (var i=0; i < files.length; i++) { + var tag = doc.createElement("script"); + tag.src = files[i]; + dom.appendChild(tag); + } } else window.it_domtimer = window.setTimeout("it_boot('" + file + "')" , 42); |