Monotone-Parent: c6248a9c3f974ff7df67b342040fdd9b3380477f

Monotone-Revision: b68be9f250b22568280f0f3fe29f6b42ed225aa1

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2007-12-06T20:50:20
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle
2007-12-06 20:50:20 +00:00
parent 126e270a5c
commit 5ccbed256a
3 changed files with 56 additions and 22 deletions

View File

@@ -1548,25 +1548,13 @@ function appendCalendar(folderName, folderPath) {
window.alert(clabels["You have already subscribed to that folder!"]);
else {
var calendarList = $("calendarList");
var lis = calendarList.childNodesWithTag("li");
var items = calendarList.childNodesWithTag("li");
var li = document.createElement("li");
// Add the calendar to the proper place
var previousOwner = null;
for (var i = 0; i < lis.length; i++) {
var currentFolderName = lis[i].lastChild.nodeValue.strip();
var currentOwner = lis[i].readAttribute('owner');
if (currentOwner == owner) {
previousOwner = currentOwner;
if (currentFolderName > folderName)
break;
}
else if (previousOwner ||
(currentOwner != UserLogin && currentOwner > owner))
break;
}
if (i != lis.length) // User is subscribed to other calendars of the same owner
calendarList.insertBefore(li, lis[i]);
var i = getListIndexForFolder(items, owner, folderName);
if (i != items.length) // User is subscribed to other calendars of the same owner
calendarList.insertBefore(li, items[i]);
else
calendarList.appendChild(li);
@@ -1575,7 +1563,7 @@ function appendCalendar(folderName, folderPath) {
// Generate new color
if (calendarColorIndex == null)
calendarColorIndex = lis.length;
calendarColorIndex = items.length;
calendarColorIndex++;
var colorTable = [1, 1, 1];
var color;