diff options
author | Christian Schneider | 2006-12-12 13:38:57 +0000 |
---|---|---|
committer | Christian Schneider | 2006-12-12 13:38:57 +0000 |
commit | fd9171e0df775da9c4a3ea22e8f95ec75d3b3897 (patch) | |
tree | 53e93e18851d1c780f73e5464b89b1aad87f598c /itjs/boot.js | |
parent | ee2fcb5bbc9b9db282a4668c50d87447b2114886 (diff) | |
download | itools-fd9171e0df775da9c4a3ea22e8f95ec75d3b3897.tar.gz itools-fd9171e0df775da9c4a3ea22e8f95ec75d3b3897.tar.bz2 itools-fd9171e0df775da9c4a3ea22e8f95ec75d3b3897.zip |
Merged revisions 13944-15067 via svnmerge from
svn+ssh://rdc.rim.ch/rdc/svn/itools/devel-redesign
........
r13945 | weber | 2006-10-26 16:13:44 +0200 (Thu, 26 Oct 2006) | 2 lines
omit null attributes, true means add name only. select() supports optgroups
........
r13946 | weber | 2006-10-26 16:22:42 +0200 (Thu, 26 Oct 2006) | 2 lines
Removed cruft
........
r13989 | cschneid | 2006-10-27 18:32:11 +0200 (Fri, 27 Oct 2006) | 1 line
Removed more cruft
........
r13991 | cschneid | 2006-10-28 19:36:35 +0200 (Sat, 28 Oct 2006) | 1 line
Make adserver output xhtml compliant tags
........
r14093 | weber | 2006-11-06 17:13:23 +0100 (Mon, 06 Nov 2006) | 2 lines
title tag can be omitted completely
........
r14096 | weber | 2006-11-06 18:00:43 +0100 (Mon, 06 Nov 2006) | 2 lines
Q() doesn't encode newlines, tag() encodes newlines within attributes
........
r14135 | weber | 2006-11-09 02:30:03 +0100 (Thu, 09 Nov 2006) | 2 lines
Migrate DB to texts.php on the fly (this functionality will be removed later), use only statictext, not DB
........
r14164 | mueller | 2006-11-09 19:23:40 +0100 (Thu, 09 Nov 2006) | 1 line
disable empty options in select
........
r14194 | mueller | 2006-11-13 14:34:25 +0100 (Mon, 13 Nov 2006) | 1 line
imply choose() in show()
........
r14212 | weber | 2006-11-13 18:14:33 +0100 (Mon, 13 Nov 2006) | 2 lines
Debug output is left-aligned
........
r14231 | cschneid | 2006-11-14 17:09:32 +0100 (Tue, 14 Nov 2006) | 1 line
Load js files before dom is ready and prevent loops on static=
........
r14288 | cschneid | 2006-11-15 13:16:54 +0100 (Wed, 15 Nov 2006) | 1 line
More compact serialization of arrays
........
r14388 | weber | 2006-11-22 18:19:34 +0100 (Wed, 22 Nov 2006) | 2 lines
Add optional IE PNG fix to it_html::img()
........
r14442 | mueller | 2006-11-27 23:22:23 +0100 (Mon, 27 Nov 2006) | 1 line
correctly handle <option value="">
........
r14444 | cschneid | 2006-11-28 12:35:43 +0100 (Tue, 28 Nov 2006) | 1 line
Handle null separately to preserve 0 == '0'
........
r14450 | cschneid | 2006-11-28 15:36:45 +0100 (Tue, 28 Nov 2006) | 1 line
Style commit (mainly done to test commit-email)
........
r14451 | cschneid | 2006-11-28 15:44:49 +0100 (Tue, 28 Nov 2006) | 1 line
Test commit for commit-email
........
r14638 | cschneid | 2006-12-01 14:20:45 +0100 (Fri, 01 Dec 2006) | 1 line
Suppress warning in case src file was removed by race
........
r14970 | weber | 2006-12-09 03:07:22 +0100 (Sat, 09 Dec 2006) | 2 lines
Added the highly useful timerlog() method from searchlib to justify the supporting code in auto_append.php ;)
........
r14971 | weber | 2006-12-09 03:08:49 +0100 (Sat, 09 Dec 2006) | 2 lines
Added set(), made dump_php's return value more convincing
........
r14993 | cschneid | 2006-12-11 14:05:29 +0100 (Mon, 11 Dec 2006) | 1 line
Added itjs::send_headers() to send HTTP headers suitable for JSON data
........
r14997 | cschneid | 2006-12-11 14:28:52 +0100 (Mon, 11 Dec 2006) | 1 line
Set JSON expiration date for IE
........
r15057 | weber | 2006-12-12 14:02:43 +0100 (Tue, 12 Dec 2006) | 2 lines
documentation update
........
Diffstat (limited to 'itjs/boot.js')
-rw-r--r-- | itjs/boot.js | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/itjs/boot.js b/itjs/boot.js index 78d1fd1..a0ec24f 100644 --- a/itjs/boot.js +++ b/itjs/boot.js @@ -1,6 +1,6 @@ // $Id$ -var it_boot_status = ""; +var it_boot_status = "boot"; var it_panictimer = window.setTimeout("it_panic(it_boot_status)", 31337); var it_catcherrstart = new Date().getTime(); @@ -34,7 +34,9 @@ function it_boot_addparam(url, param) function it_panic(msg) { - window.setTimeout("document.location.href = it_boot_addparam(document.location.href, 'static=" + msg + "')", 500); + if (!document.location.href.match(/[?&]static=/)) // Avoid loop + window.setTimeout("document.location.href = it_boot_addparam(document.location.href, 'static=" + msg + "')", 500); + return it_catcherr('panic ' + msg, '-', -1); } @@ -47,7 +49,12 @@ function it_boot_report(msg, file, line, error) new Image().src = "/itjs/error.gif/" + escape(msg) + "|" + escape(file) + "|" + line + "|" + (new Date().getTime() - it_catcherrstart) + "|" + escape(error); } -function it_boot(file, isretry) +function it_boot_checkcss(style, key, value) +{ + return navigator.userAgent.match(/konqueror/i) || (style && style.getPropertyValue && (style.getPropertyValue(key) == value)); +} + +function it_boot_init() { window.it_domtimer = null; var konqueror = navigator.userAgent.match(/konqueror/i); @@ -55,12 +62,12 @@ function it_boot(file, isretry) var dom = doc && (dom = document.getElementById('it_boot_dom')); // HTML has been rendered var view = dom && doc.defaultView; // We can check if stylesheet is active var style = view && view.getComputedStyle && view.getComputedStyle(dom, ''); - var css = style && style.getPropertyValue && ((style.getPropertyValue("visibility") == "hidden") || konqueror); // CSS active (inline style on tag) - var stylesheet = style && style.getPropertyValue && ((style.getPropertyValue("display") == "none") || konqueror); // External stylesheet loaded + var css = window.it_boot_checkcss(style, "visibility", "hidden"); // CSS active (inline style on tag) + var stylesheet = window.it_boot_checkcss(style, "display", "none"); // External stylesheet loaded - if (!(doc || !(it_boot_status = "doc")) || !(dom || !(it_boot_status = "dom")) || (style && (style.length > 0) && !(stylesheet || !(it_boot_status = "stylesheet")))) + if (!(doc || !(it_boot_status = "doc")) || !(dom || !(it_boot_status = "dom")) || (style && !(stylesheet || !(it_boot_status = "stylesheet")))) { - window.it_domtimer = window.setTimeout("it_boot('" + file + "')" , 42); + window.it_domtimer = window.setTimeout("it_boot_init()" , 42); if (style && !css) it_panic("css"); @@ -68,6 +75,12 @@ function it_boot(file, isretry) return; } + window.clearTimeout(window.it_panictimer); + window.it_boot_start(); +} + +function it_boot(file, isretry) +{ try { var loader = new XMLHttpRequest(); @@ -97,7 +110,7 @@ function it_boot(file, isretry) if (data.code.length == data.len) { - var code = "try {" + data.code + ";window.it_boot_init()} catch (e) { it_boot_report('Load error', '-', -1, e); }"; // Wrapped in try/catch as Konqueror does not support window.onerror + 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) |