Mercurial > hg > digilib-old
comparison client/digitallibrary/buttons/menu.js @ 107:85126da2ae21 vendor start
XUL: Digilib Buttons in chrome
author | engler |
---|---|
date | Tue, 13 May 2003 21:02:22 +0200 |
parents | 2aa1205e3b71 |
children | 4f1752d80560 |
comparison
equal
deleted
inserted
replaced
105:ecee3ff2f4d0 | 107:85126da2ae21 |
---|---|
1 function checkBrowser(){ | 1 function checkBrowser() { |
2 this.ver = navigator.appVersion; | 2 |
3 this.dom = document.getElementById ? 1 : 0; | 3 this.ua = navigator.userAgent; |
4 this.ie5 = (this.ver.indexOf("MSIE 5")>-1 && this.dom) ? 1 : 0; | 4 this.ver = navigator.appVersion; |
5 this.ie4 = (document.all && !this.dom) ? 1 : 0; | 5 this.dom = ( document.getElementById ); |
6 this.ns5 = (this.dom && parseInt(this.ver) >= 5) ? 1 : 0; | 6 this.opera = ( this.dom ) && ( this.ua.toLowerCase().indexOf("opera") > -1 ); |
7 this.ns4 = (document.layers && !this.dom) ? 1 : 0; | 7 this.ie4 = ( document.all ) && ( !this.dom ); |
8 this.ie = (this.ie4 || this.ie5); | 8 this.ie5 = ( this.ver.indexOf("MSIE 5") > -1 ) && ( this.dom ); |
9 this.ie6 = ( this.ver.indexOf("MSIE 6") > -1 ) && ( this.dom ); | |
10 this.ns4 = ( document.layers ) && ( !this.dom ); | |
11 this.ns6 = ( this.dom ) && ( parseInt(this.ver) >= 5 ) && ( !this.opera ); | |
12 this.ns = this.ns4 || this.ns6; | |
13 this.ie = this.ie4 || this.ie5 || this.ie6; | |
14 | |
9 return this; | 15 return this; |
10 } | 16 } |
11 | 17 |
12 browser = new checkBrowser(); | 18 browser = new checkBrowser(); |
13 | 19 |
61 changeBc("menu" + obj, '#770000'); | 67 changeBc("menu" + obj, '#770000'); |
62 clearTimeout(timeID); | 68 clearTimeout(timeID); |
63 } | 69 } |
64 | 70 |
65 function awayItem(obj) { | 71 function awayItem(obj) { |
66 changeBc("menu" + obj, ''); | 72 changeBc("menu" + obj, '#666666'); |
67 timeID = setTimeout("hideMenu()", 700); | 73 timeID = setTimeout("hideMenu()", 700); |
68 } | 74 } |
69 | 75 |
70 var timeID = null; | 76 var timeID = null; |
71 | 77 |
136 helpWindow.document.write(help[0] + '</tr><tr><td class="text">'); | 142 helpWindow.document.write(help[0] + '</tr><tr><td class="text">'); |
137 helpWindow.document.write(help[1] + '</tr></td></table></body></html>'); | 143 helpWindow.document.write(help[1] + '</tr></td></table></body></html>'); |
138 helpWindow.document.close(); | 144 helpWindow.document.close(); |
139 | 145 |
140 // stupid workaround because of netscape 6, that doesen't know the opener property | 146 // stupid workaround because of netscape 6, that doesen't know the opener property |
141 // this workaround is still ok cause netscape 6 has eventbuffer checks so no overflow | 147 // this workaround is still ok because netscape 6 has eventbuffer checks so no overflow |
142 if (browser.ns5) { | 148 if (browser.ns6) { |
143 semaphor = true; | 149 semaphor = true; |
144 } | 150 } |
151 | |
152 // next stupid workaround because of opera 6, that somehow don't start the 'onLoad'- | |
153 // attribute in the body tag (the helpwindow does not finish loading) | |
154 if (browser.opera) { | |
155 setTimeout("semaphor = true;", 50); | |
156 } | |
157 | |
145 } | 158 } |
146 | 159 |
147 } | 160 } |
148 | 161 |
149 function openContextHelp() { | 162 function openContextHelp() { |