diff --git a/UI/Scheduler/English.lproj/Localizable.strings b/UI/Scheduler/English.lproj/Localizable.strings
index 69afbd28c..0ce7d868f 100644
--- a/UI/Scheduler/English.lproj/Localizable.strings
+++ b/UI/Scheduler/English.lproj/Localizable.strings
@@ -379,8 +379,8 @@ validate_endbeforestart = "Enddate is before startdate!";
"eventDeleteConfirmation" = "Erasing this event will be permanent.\\nWould you like to continue?";
"taskDeleteConfirmation" = "Erasing this task will be permanent.\\nWould you like to continue?";
-"Are you sure you want to delete the selected calendar?"
-= "Are you sure you want to delete the selected calendar?";
+"Are you sure you want to delete the calendar \"%{0}\"?"
+= "Are you sure you want to delete the calendar \"%{0}\"?";
/* Legend */
"Required participant" = "Required participant";
diff --git a/UI/Scheduler/French.lproj/Localizable.strings b/UI/Scheduler/French.lproj/Localizable.strings
index 3adda5cff..1c69351f3 100644
--- a/UI/Scheduler/French.lproj/Localizable.strings
+++ b/UI/Scheduler/French.lproj/Localizable.strings
@@ -377,8 +377,8 @@ validate_endbeforestart = "La date de fin est avant la date de début !";
"eventDeleteConfirmation" = "L'effacement de cet événement sera permanent.\\nVoulez-vous continuer?";
"taskDeleteConfirmation" = "L'effacement de cette tâche sera permanent.\\nVoulez-vous continuer?";
-"Are you sure you want to delete the selected calendar?"
-= "Voulez-vous vraiment supprimer l'agenda sélectionné ?";
+"Are you sure you want to delete the calendar \"%{0}\"?"
+= "Voulez-vous vraiment supprimer l'agenda «%{0}»?";
/* Legend */
"Required participant" = "Participant obligatoire";
diff --git a/UI/Scheduler/German.lproj/Localizable.strings b/UI/Scheduler/German.lproj/Localizable.strings
index 2093ad21d..e3ea85ee5 100644
--- a/UI/Scheduler/German.lproj/Localizable.strings
+++ b/UI/Scheduler/German.lproj/Localizable.strings
@@ -366,8 +366,8 @@ validate_endbeforestart = "Ihr Beginn ist nach dem Ende";
"eventDeleteConfirmation" = "L'effacement de cet événement sera permanent.\\nVoulez-vous continuer?";
"taskDeleteConfirmation" = "L'effacement de cette tâche sera permanent.\\nVoulez-vous continuer?";
-"Are you sure you want to delete the selected calendar?"
-= "Are you sure you want to delete the selected calendar?";
+"Are you sure you want to delete the calendar \"%{0}\"?"
+= "Are you sure you want to delete the calendar \"%{0}\"?";
/* Legend */
"Required participant" = "Participant obligatoire";
diff --git a/UI/Scheduler/UIxCalendarSelector.m b/UI/Scheduler/UIxCalendarSelector.m
index 6bee8aad6..7fad6b0f3 100644
--- a/UI/Scheduler/UIxCalendarSelector.m
+++ b/UI/Scheduler/UIxCalendarSelector.m
@@ -148,6 +148,12 @@ colorForNumber (unsigned int number)
return currentCalendar;
}
+- (NSString *) currentCalendarClass
+{
+ return [currentCalendar
+ keysWithFormat: @"colorBox calendarFolder%{folder}"];
+}
+
- (NSString *) currentCalendarStyle
{
return [currentCalendar
diff --git a/UI/Templates/SchedulerUI/UIxCalendarSelector.wox b/UI/Templates/SchedulerUI/UIxCalendarSelector.wox
index 6340a7257..3785b634c 100644
--- a/UI/Templates/SchedulerUI/UIxCalendarSelector.wox
+++ b/UI/Templates/SchedulerUI/UIxCalendarSelector.wox
@@ -10,6 +10,8 @@
.calendarFolder
{ background-color: !important; }
+div.colorBox.calendarFolder
+{ color: !important; }
@@ -34,7 +36,7 @@
-
OO
+
OO
diff --git a/UI/WebServerResources/MailerUI.js b/UI/WebServerResources/MailerUI.js
index c51a3ecc1..a2c35ed55 100644
--- a/UI/WebServerResources/MailerUI.js
+++ b/UI/WebServerResources/MailerUI.js
@@ -16,6 +16,8 @@ var usersRightsWindowWidth = 400;
var pageContent;
+var deleteMessageRequestCount = 0;
+
/* mail list */
function openMessageWindow(msguid, url) {
@@ -203,49 +205,47 @@ function ml_lowlight(sender) {
/* bulk delete of messages */
-function uixDeleteSelectedMessages(sender) {
- var failCount = 0;
-
+function deleteSelectedMessages(sender) {
var messageList = $("messageList");
var rowIds = messageList.getSelectedRowsId();
for (var i = 0; i < rowIds.length; i++) {
var url, http;
var rowId = rowIds[i].substr(4);
- /* send AJAX request (synchronously) */
-
var messageId = currentMailbox + "/" + rowId;
url = ApplicationBaseURL + messageId + "/trash";
- http = createHTTPClient();
- http.open("POST", url, false /* not async */);
- http.url = url;
- http.send("");
- if (!isHttpStatus204(http.status)) { /* request failed */
- failCount++;
- http = null;
- continue;
- } else {
- deleteCachedMessage(messageId);
- if (currentMessages[currentMailbox] == rowId) {
- var div = $('messageContent');
- div.update();
- currentMessages[currentMailbox] = null;
- }
- }
- http = null;
-
- /* remove from page */
- /* line-through would be nicer, but hiding is OK too */
- var row = $(rowIds[i]);
- row.parentNode.removeChild(row);
+ deleteMessageRequestCount++;
+ var data = { "id": rowId, "mailbox": currentMailbox, "messageId": messageId };
+ triggerAjaxRequest(url, deleteSelectedMessagesCallback, data);
}
- if (failCount > 0)
- alert("Could not delete " + failCount + " messages!");
-
return false;
}
+function deleteSelectedMessagesCallback(http) {
+ if (http.readyState == 4) {
+ if (isHttpStatus204(http.status)) {
+ var data = http.callbackData;
+ deleteCachedMessage(data["messageId"]);
+ if (currentMailbox == data["mailbox"]) {
+
+ var div = $('messageContent');
+ if (currentMessages[currentMailbox] == data["id"]) {
+ div.update();
+ currentMessages[currentMailbox] = null;
+ }
+
+ var row = $("row_" + data["id"]);
+ row.parentNode.removeChild(row);
+
+ deleteMessageRequestCount--;
+ }
+ }
+ }
+ else
+ log ("deleteSelectedMessagesCallback: problem during ajax request " + http.status);
+}
+
function moveMessages(rowIds, folder) {
var failCount = 0;
@@ -285,7 +285,7 @@ function moveMessages(rowIds, folder) {
}
function onMenuDeleteMessage(event) {
- uixDeleteSelectedMessages();
+ deleteSelectedMessages();
preventDefault(event);
}
diff --git a/UI/WebServerResources/SchedulerUI.js b/UI/WebServerResources/SchedulerUI.js
index 76da94d65..662a784a9 100644
--- a/UI/WebServerResources/SchedulerUI.js
+++ b/UI/WebServerResources/SchedulerUI.js
@@ -1041,7 +1041,7 @@ function onSearchFormSubmit() {
function onCalendarSelectEvent() {
var list = $("eventsList");
- list.tBodies[0].deselectAll();
+ $(list.tBodies[0]).deselectAll();
if (selectedCalendarCell)
for (var i = 0; i < selectedCalendarCell.length; i++)
@@ -1436,30 +1436,24 @@ function appendCalendar(folderName, folderPath) {
var li = document.createElement("li");
// Add the calendar to the proper place
- for (var i = 0; i < lis.length; i++) {
+ var previousOwner = null;
+ for (var i = 1; i < lis.length; i++) {
var currentFolderName = lis[i].lastChild.nodeValue.strip();
- if (lis[i].readAttribute('owner') != owner)
- continue;
- if (currentFolderName > folderName)
+ 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
+ if (i != lis.length) // User is subscribed to other calendars of the same owner
calendarList.insertBefore(li, lis[i]);
- }
- else {
- for (var i = 0; i < lis.length; i++) {
- if (lis[i].readAttribute('owner') == UserLogin)
- continue;
- if (lis[i].readAttribute('owner') > owner) {
- calendarList.insertBefore(li, lis[i]);
- break;
- }
- }
- if (i == lis.length) {
- calendarList.appendChild(li);
- }
- }
-
+ else
+ calendarList.appendChild(li);
+
li.setAttribute("id", folderPath);
li.setAttribute("owner", owner);
@@ -1475,9 +1469,7 @@ function appendCalendar(folderName, folderPath) {
colorBox.appendChild(document.createTextNode("OO"));
$(colorBox).addClassName("colorBox");
- if (color)
- $(colorBox).setStyle({color: color,
- backgroundColor: color});
+ $(colorBox).addClassName('calendarFolder' + folderPath.substr(1));
// Register events (doesn't work with Safari)
Event.observe(li, "mousedown", listRowMouseDownHandler);
@@ -1498,12 +1490,20 @@ function appendCalendar(folderName, folderPath) {
+ ' 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; }');
}
}
}
@@ -1534,19 +1534,18 @@ function onCalendarRemove(event) {
if (folderIdElements.length > 1) {
unsubscribeFromFolder(folderId, onFolderUnsubscribeCB, folderId);
}
- else {
- var calId = folderIdElements[0].substr(1);
- deletePersonalCalendar(calId);
- }
+ else
+ deletePersonalCalendar(folderIdElements[0]);
}
}
preventDefault(event);
}
-function deletePersonalCalendar(folderId) {
+function deletePersonalCalendar(folderElement) {
+ var folderId = folderElement.substr(1);
var label
- = labels["Are you sure you want to delete the selected calendar?"];
+ = labels["Are you sure you want to delete the calendar \"%{0}\"?"].formatted($(folderElement).lastChild.nodeValue.strip());
if (window.confirm(label)) {
removeFolderRequestCount++;
var url = ApplicationBaseURL + "/" + folderId + "/deleteFolder";