diff options
author | Thomas BrĂ¼derli | 2007-08-08 14:54:51 +0000 |
---|---|---|
committer | Thomas BrĂ¼derli | 2007-08-08 14:54:51 +0000 |
commit | 1a413655f0b1b717d568b165c5b72e14575b75f9 (patch) | |
tree | 1c8c143b618c359d421cd3e38ec5f9d65e281254 /itjs/boot.js | |
parent | 983823c499ab3aea81298a8284dbb8d28b4a1b1b (diff) | |
download | itools-1a413655f0b1b717d568b165c5b72e14575b75f9.tar.gz itools-1a413655f0b1b717d568b165c5b72e14575b75f9.tar.bz2 itools-1a413655f0b1b717d568b165c5b72e14575b75f9.zip |
Updated it_boot
Diffstat (limited to 'itjs/boot.js')
-rw-r--r-- | itjs/boot.js | 35 |
1 files changed, 11 insertions, 24 deletions
diff --git a/itjs/boot.js b/itjs/boot.js index 46c9dc5..cf28518 100644 --- a/itjs/boot.js +++ b/itjs/boot.js @@ -40,7 +40,6 @@ function it_panic(msg) return it_catcherr('panic ' + msg, '-', -1); } - function it_boot_report(msg, file, line, error) { window.clearTimeout(window.it_domtimer); @@ -95,7 +94,7 @@ function it_boot(file, isretry) if (loader) { - loader.open("GET", it_boot_addparam(file, "boot=1" + (isretry ? "&retry=1&t="+new Date().getTime() : ""))); + loader.open("GET", it_boot_addparam(file, "boot=1" + (isretry ? "&retry=1" : ""))); loader.onreadystatechange = function() { var error = ""; @@ -104,28 +103,16 @@ function it_boot(file, isretry) { if (loader.status < 400) // Opera gives back 304 if from cache { - try + if (loader.responseText.length && loader.responseText.lastIndexOf('it_boot_init()') > 0) { - var data = eval("(" + loader.responseText + ")"); - - if (data.code.length == data.len) - { - var code = "try {" + data.code + "} catch (e) { it_boot_report('Load error', '-', -1, e); };window.it_boot_init()"; // Wrapped in try/catch as Konqueror does not support window.onerror - isretry = true; // No further retry after this point - - if (window.execScript) - window.execScript(code, "javascript"); // IE work-around to get script executed in global scope - else - window.setTimeout(code, 0); // Standard compliant version - } + var code = "try {" + loader.responseText + "} catch (e) { it_boot_report('Script exec error', '-', -1, e); }"; // Wrapped in try/catch as Konqueror does not support window.onerror + if (window.execScript) + window.execScript(code, "javascript"); // IE work-around to get script executed in global scope else - error = "Length mismatch " + data.code.length + " != " + data.len; - } - catch (e) - { - for (i in e) - error += i + "=" + e[i] + ";"; + window.setTimeout(code, 0); // Standard compliant version } + else + error = "Incomplete script load @ status " + loader.status; } else error = loader.statusText; @@ -146,12 +133,12 @@ function it_boot(file, isretry) var doc = document; var dom = doc && (dom = doc.getElementById('it_boot_dom')); // HTML has been rendered - if (window.opera) - document.write('<sc'+'ript type="text/javascript" src="'+it_boot_addparam(file, 'init=1')+'"><\/sc'+'ript>'); + if (window.opera || (document.all && navigator.platform.indexOf("Mac") >= 0)) + document.write('<sc'+'ript type="text/javascript" src="'+it_boot_addparam(file, 'boot=1')+'"><\/sc'+'ript>'); else if (dom) { var tag = doc.createElement("script"); - tag.src = it_boot_addparam(file, 'init=1'); + tag.src = it_boot_addparam(file, 'boot=1'); dom.appendChild(tag); } else |