Monotone-Parent: d07959b964a2582bf5674d383b0dac7303346571

Monotone-Revision: 0bf13271077dfd22aaca8a2663fe7490f9d84cb3

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2008-02-01T15:49:33
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2008-02-01 15:49:33 +00:00
parent 8bb92ebe43
commit 6951e6a527
3 changed files with 101 additions and 108 deletions
+45 -57
View File
@@ -179,15 +179,14 @@ function mailListMarkMessage(event) {
}
function mailListMarkMessageCallback(http) {
if (http.readyState == 4)
if (isHttpStatus204(http.status)) {
var data = http.callbackData;
markMailInWindow(data["window"], data["msguid"], data["markread"]);
}
else {
alert("Message Mark Failed (" + http.status + "): " + http.statusText);
window.location.reload();
}
if (isHttpStatus204(http.status)) {
var data = http.callbackData;
markMailInWindow(data["window"], data["msguid"], data["markread"]);
}
else {
alert("Message Mark Failed (" + http.status + "): " + http.statusText);
window.location.reload();
}
}
/* maillist row highlight */
@@ -235,31 +234,29 @@ function deleteSelectedMessages(sender) {
}
function deleteSelectedMessagesCallback(http) {
if (http.readyState == 4) {
if (isHttpStatus204(http.status)) {
var data = http.callbackData;
deleteCachedMessage(data["messageId"]);
deleteMessageRequestCount--;
if (Mailer.currentMailbox == data["mailbox"]) {
var div = $('messageContent');
if (Mailer.currentMessages[Mailer.currentMailbox] == data["id"]) {
div.update();
Mailer.currentMessages[Mailer.currentMailbox] = null;
}
if (isHttpStatus204(http.status)) {
var data = http.callbackData;
deleteCachedMessage(data["messageId"]);
deleteMessageRequestCount--;
if (Mailer.currentMailbox == data["mailbox"]) {
var div = $('messageContent');
if (Mailer.currentMessages[Mailer.currentMailbox] == data["id"]) {
div.update();
Mailer.currentMessages[Mailer.currentMailbox] = null;
}
var row = $("row_" + data["id"]);
var nextRow = row.next("tr");
if (!nextRow)
nextRow = row.previous("tr");
row.parentNode.removeChild(row);
var row = $("row_" + data["id"]);
var nextRow = row.next("tr");
if (!nextRow)
nextRow = row.previous("tr");
row.parentNode.removeChild(row);
// row.addClassName("deleted"); // when we'll offer "mark as deleted"
if (deleteMessageRequestCount == 0) {
if (nextRow) {
Mailer.currentMessages[Mailer.currentMailbox] = nextRow.getAttribute("id").substr(4);
nextRow.select();
loadMessage(Mailer.currentMessages[Mailer.currentMailbox]);
}
if (deleteMessageRequestCount == 0) {
if (nextRow) {
Mailer.currentMessages[Mailer.currentMailbox] = nextRow.getAttribute("id").substr(4);
nextRow.select();
loadMessage(Mailer.currentMessages[Mailer.currentMailbox]);
}
}
}
@@ -488,8 +485,7 @@ function openMailbox(mailbox, reload, idx) {
currentMessage);
var quotasUrl = ApplicationBaseURL + mailbox + "/quotas";
document.quotasAjaxRequest
= triggerAjaxRequest(quotasUrl, quotasCallback);
triggerAjaxRequest(quotasUrl, quotasCallback);
}
}
@@ -503,8 +499,7 @@ function messageListCallback(http) {
var div = $('mailboxContent');
var table = $('messageList');
if (http.readyState == 4
&& http.status == 200) {
if (http.status == 200) {
document.messageListAjaxRequest = null;
if (table) {
@@ -571,8 +566,7 @@ function messageListCallback(http) {
}
function quotasCallback(http) {
if (http.readyState == 4
&& http.status == 200) {
if (http.status == 200) {
var hasQuotas = false;
if (http.responseText.length > 0) {
@@ -822,18 +816,16 @@ function onICalendarButtonClick(event) {
}
function ICalendarButtonCallback(http) {
if (http.readyState == 4)
if (isHttpStatus204(http.status)) {
var oldMsg = http.callbackData;
var msg = Mailer.currentMailbox + "/" + Mailer.currentMessages[Mailer.currentMailbox];
if (oldMsg == msg) {
deleteCachedMessage(oldMsg);
loadMessage(Mailer.currentMessages[Mailer.currentMailbox]);
}
}
else {
window.alert("received code: " + http.status);
if (isHttpStatus204(http.status)) {
var oldMsg = http.callbackData;
var msg = Mailer.currentMailbox + "/" + Mailer.currentMessages[Mailer.currentMailbox];
if (oldMsg == msg) {
deleteCachedMessage(oldMsg);
loadMessage(Mailer.currentMessages[Mailer.currentMailbox]);
}
}
else
window.alert("received code: " + http.status);
}
function resizeMailContent() {
@@ -878,8 +870,7 @@ function onImageClick(event) {
function messageCallback(http) {
var div = $('messageContent');
if (http.readyState == 4
&& http.status == 200) {
if (http.status == 200) {
document.messageAjaxRequest = null;
div.update(http.responseText);
configureLinksInMessage();
@@ -1418,8 +1409,7 @@ function updateMailboxMenus() {
}
function onLoadMailboxesCallback(http) {
if (http.readyState == 4
&& http.status == 200) {
if (http.status == 200) {
checkAjaxRequestsState();
if (http.responseText.length > 0) {
var newAccount = buildMailboxes(http.callbackData,
@@ -1489,8 +1479,7 @@ function getFoldersState() {
}
function getFoldersStateCallback(http) {
if (http.readyState == 4
&& http.status == 200) {
if (http.status == 200) {
if (http.responseText.length > 0) {
// The response text is a JSOn representation
// of the folders that were left opened.
@@ -1501,8 +1490,8 @@ function getFoldersStateCallback(http) {
mailboxTree.o(i);
}
}
mailboxTree.autoSync();
}
mailboxTree.autoSync();
}
function saveFoldersState() {
@@ -1514,8 +1503,7 @@ function saveFoldersState() {
}
function saveFoldersStateCallback(http) {
if (http.readyState == 4
&& isHttpStatus204(http.status)) {
if (isHttpStatus204(http.status)) {
log ("folders state saved");
}
}