Monotone-Parent: d20b6efa6a8c415c1db8ca849c311e740a312646

Monotone-Revision: 5d08c3e624999be469da2fd6046209e122529287

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2007-11-06T22:34:42
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle
2007-11-06 22:34:42 +00:00
parent 54b6c29882
commit 96b00f426c
5 changed files with 28 additions and 24 deletions
+17 -22
View File
@@ -1485,28 +1485,23 @@ function appendCalendar(folderName, folderPath) {
// Update CSS for events color
if (!document.styleSheets) return;
var theRules = new Array();
var lastSheet = document.styleSheets[document.styleSheets.length - 1];
if (lastSheet.insertRule) { // Mozilla
lastSheet.insertRule('.calendarFolder' + folderPath.substr(1) + ' {'
+ ' background-color: '
+ color
+ ' !important; }', 0);
lastSheet.insertRule('div.colorBox.calendarFolder' + folderPath.substr(1) + ' {'
+ ' color: '
+ color
+ ' !important; }', 0);
}
else { // IE
lastSheet.addRule('.calendarFolder' + folderPath.substr(1),
' background-color: '
+ color
+ ' !important; }');
lastSheet.addRule('div.colorBox.calendarFolder' + folderPath.substr(1),
' color: '
+ color
+ ' !important; }');
}
var styleElement = document.createElement("style");
styleElement.type = "text/css";
var selectors = [
'.calendarFolder' + folderPath.substr(1),
'div.colorBox.calendarFolder' + folderPath.substr(1)
];
var rules = [
' { background-color: ' + color + ' !important; }',
' { color: ' + color + ' !important; }'
];
for (var i = 0; i < rules.length; i++)
if (styleElement.styleSheet && styleElement.styleSheet.addRule)
styleElement.styleSheet.addRule(selectors[i], rules[i]); // IE
else
styleElement.appendChild(document.createTextNode(selectors[i] + rules[i])); // Mozilla _+ Safari
document.getElementsByTagName("head")[0].appendChild(styleElement);
}
}