bad DOM implemenation in Konqueror and Opera -> list is no long expandable/collapsible with this browsers

This commit is contained in:
Loïc Chapeaux
2001-07-07 10:23:50 +00:00
parent beaaef29ae
commit f14d147643

79
left.js
View File

@@ -9,14 +9,16 @@
// Rewritten and put in a libray 2nd May 2001 by Lo<4C>c Chapeaux // Rewritten and put in a libray 2nd May 2001 by Lo<4C>c Chapeaux
// Test passed with: // Test passed with:
// - Mozilla 0.8.1 for Windows (js enabled & disabled) // - Mozilla 0.8.1, 0.9.0, 0.9.1, 0.9.2 for Windows (js enabled
// & disabled)
// - IE5, 5.01, 5.5 for Windows // - IE5, 5.01, 5.5 for Windows
// - Netscape 4.75 for Windows // - Netscape 4.75 for Windows
// - Opera 5.02 for windows (js disabled)
// Test failed with: // Test failed (crappy DOM implementations) with:
// - Opera 5.02 for windows with js enabled -> crappy DOM implementation // - Opera 5.02 for windows: 'getElementsByTagName' is unsupported
// ('getElementsByTagName' is unsupported), nothing to do :( // - Opera 5.10 to 5.12 for windows, Opera 5+ for Linux: 'style.display' can't
// be changed
// - Konqueror 2+: 'style.display' can't be changed
var isExpanded = false; var isExpanded = false;
@@ -47,29 +49,6 @@ if (isNS4) {
} }
/**
* Specific stuffs for IE4
*/
function doDocumentOnMouseOver() {
var eSrc = window.event.srcElement ;
if (eSrc.className == 'item') {
window.event.srcElement.className = 'highlight';
}
} // end of the 'doDocumentOnMouseOver()' function
function doDocumentOnMouseOut() {
var eSrc = window.event.srcElement ;
if (eSrc.className == 'highlight') {
window.event.srcElement.className = 'item';
}
} // end of the 'doDocumentOnMouseOut()' function
if (isIE4) {
document.onmouseover = doDocumentOnMouseOver ;
document.onmouseout = doDocumentOnMouseOut ;
}
/** /**
* Gets the id of the first collapsible room * Gets the id of the first collapsible room
* *
@@ -238,35 +217,45 @@ if (capable) {
// to write(). // to write().
if (isDOM) { if (isDOM) {
var lstyle = '<style type="text/css">' var lstyle = '<style type="text/css">'
+ '.parent {font-family: ' + fontFamily + '; color: #000000; text-decoration:none; display:block}' + 'div {color: #000000;}'
+ '.child {font-family: ' + fontFamily + '; color: #000000; text-decoration:none; display:none}' + '.heada {font: 12px\/13px; Times}'
+ '.item { color: darkblue; text-decoration:none; font-size: 8pt;}' + '.parent {font-family: ' + fontFamily + '; color: #000000; text-decoration:none; display: block}'
+ '.highlight { color: red; font-size: 8pt;}' + '.child {font-family: ' + fontFamily + '; font-size: 8pt; color: #333399; text-decoration:none; display: none}'
+ '.heada { font: 12px\/13px; Times}' + '.item, .item:active, .item:hover, .tblItem, .tblItem:active {color: #333399; text-decoration: none; font-size: 8pt;}'
+ 'div { color:black; }' + '.tblItem:hover {color: #FF0000; text-decoration: underline;}'
+ '<\/style>'; + '<\/style>';
write(lstyle); write(lstyle);
} }
else { else {
write('<style type="text/css">'); write('<style type="text/css">');
write('div {color: #000000; }');
write('.heada {font: 12px\/13px; Times}');
if (isIE4) { if (isIE4) {
write('.parent {font-family: ' + fontFamily + '; color: #000000; text-decoration:none;}'); write('.parent {font-family: ' + fontFamily + '; color: #000000; text-decoration: none; display: block}');
write('.child {font-family: ' + fontFamily + '; color: #000000; text-decoration:none; display:none}'); write('.child {font-family: ' + fontFamily + '; font-size: 8pt; color: #333399; text-decoration: none; display: none}');
write('.item { color: darkblue; text-decoration:none; font-size: 8pt;}'); write('.item, .item:active, .item:hover, .tblItem, .tblItem:active {color: #333399; text-decoration: none; font-size: 8pt;}');
write('.highlight { color: red; font-size: 8pt;}'); write('.tblItem:hover {color: #FF0000; text-decoration: underline;}');
write('.heada { font: 12px\/13px; Times}');
write('div { color:black; }');
} }
else { else {
write('.parent {font-family:' + fontFamily + '; color: #000000; text-decoration:none; position:absolute; visibility:hidden; color: black;}'); write('.parent {font-family: ' + fontFamily + '; color: #000000; text-decoration: none; position: absolute; visibility: hidden;}');
write('.child {font-family: ' + fontFamily + '; font-size: 8pt;color: #000000; position:absolute; visibility:hidden}'); write('.child {font-family: ' + fontFamily + '; font-size: 8pt; color: #333399; position: absolute; visibility: hidden}');
write('.item { color: darkblue; text-decoration:none;}'); write('.item, .tblItem {color: #333399; text-decoration: none;}');
write('.regular {font-family: ' + fontFamily + '; position:absolute; visibility:hidden}');
write('div { color:black; }');
} }
write('<\/style>'); write('<\/style>');
} }
} }
}
else {
with (document) {
write('<style type="text/css">');
write('div {color: #000000; }');
write('.heada {font: 12px\/13px; Times}');
write('.parent {font-family: ' + fontFamily + '; color: #000000; text-decoration: none;}');
write('.child {font-family: ' + fontFamily + '; font-size: 8pt; color: #333399; text-decoration: none;}');
write('.item, .item:active, .item:hover, .tblItem, .tblItem:active {color: #333399; text-decoration: none;}');
write('.tblItem:hover {color: #FF0000; text-decoration: underline;}');
write('<\/style>');
}
} // end of adding styles } // end of adding styles