Monotone-Parent: 8ef0ab24c4c10895d5e911f82260ba93fedbb853

Monotone-Revision: 0f1ef8f1bf7e8be2363a84056b5ce417b06606f7

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2007-10-30T19:56:50
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle
2007-10-30 19:56:50 +00:00
parent 10fd7bbc86
commit 3f1fadd28b
3 changed files with 30 additions and 14 deletions

View File

@@ -247,6 +247,17 @@ function deleteSelectedMessagesCallback(http) {
log ("deleteSelectedMessagesCallback: problem during ajax request " + http.status);
}
function deleteDraft(url) {
/* this is called by UIxMailEditor with window.opener */
new Ajax.Request(url, {
method: 'post',
onFailure: function(transport) {
if (!isHttpStatus204)
log("draftDeleteCallback: problem during ajax request: " + transport.status);
}
});
}
function moveMessages(rowIds, folder) {
var failCount = 0;

View File

@@ -232,15 +232,12 @@ function clickedEditorSave(sender) {
if (input)
input.parentNode.removeChild(input);
var toolbar = document.getElementById("toolbar");
if (!document.busyAnim)
document.busyAnim = startAnimation(toolbar);
window.shouldPreserve = true;
document.pageform.action = "save";
document.pageform.submit();
refreshMailbox();
if (window.opener && window.open && !window.closed)
window.opener.refreshFolderByType('draft');
return false;
}
@@ -355,13 +352,13 @@ function onMailEditorClose(event) {
if (window.shouldPreserve)
window.shouldPreserve = false;
else {
var url = "" + window.location;
var parts = url.split("/");
parts[parts.length-1] = "delete";
url = parts.join("/");
http = createHTTPClient();
http.open("POST", url, false /* not async */);
http.send("");
if (window.opener && window.opener.open && !window.opener.closed) {
var url = "" + window.location;
var parts = url.split("/");
parts[parts.length-1] = "delete";
url = parts.join("/");
window.opener.deleteDraft(url);
}
}
Event.stopObserving(window, "beforeunload", onMailEditorClose);

View File

@@ -228,12 +228,19 @@ function openContactWindow(url, wId) {
}
function openMailComposeWindow(url, wId) {
var parentWindow = this;
if (!wId)
wId = "" + (new Date().getTime());
var w = window.open(url, wId,
else
if (document.body.hasClassName("popup"))
parentWindow = window.opener;
var w = parentWindow.open(url, wId,
"width=680,height=520,resizable=1,scrollbars=1,toolbar=0,"
+ "location=0,directories=0,status=0,menubar=0"
+ ",copyhistory=0");
w.focus();
return w;
@@ -290,7 +297,8 @@ function triggerAjaxRequest(url, callback, userdata) {
if (http.readyState == 4
&& activeAjaxRequests > 0) {
if (!http.aborted) {
http.callbackData = userdata;
if (userdata)
http.callbackData = userdata;
callback(http);
}
activeAjaxRequests -= 1;