Monotone-Parent: 39bee5d17f65aa91b7a4753496f25cd25094497f

Monotone-Revision: 44d8a5e3ba820c4f2a68d0efa49fee1570861b5f

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2007-09-29T00:22:11
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle
2007-09-29 00:22:11 +00:00
parent 7a6175b0ab
commit c703761b82
5 changed files with 17 additions and 18 deletions
+10 -12
View File
@@ -9,7 +9,6 @@ function onContactAdd() {
urlstr += '/';
urlstr += ("../../" + UserLogin + "/Contacts/"
+ contactSelectorAction + selectorURL);
// log (urlstr);
var w = window.open(urlstr, "Addressbook",
"width=640,height=400,resizable=1,scrollbars=0");
w.selector = selector;
@@ -159,6 +158,13 @@ function clickedEditorAttach(sender) {
}
var inputs = area.getElementsByTagName("input");
// Verify if there's already a visible file input field
for (var i = 0; i < inputs.length; i++)
if ($(inputs[i]).hasClassName("currentAttachment"))
return false;
// Add new file input field
var attachmentName = "attachment" + inputs.length;
var newAttachment = createElement("input", attachmentName,
"currentAttachment", null,
@@ -172,16 +178,7 @@ function clickedEditorAttach(sender) {
}
function onAddAttachment() {
var area = $("attachmentsArea");
var inputs = area.getElementsByTagName("input");
var attachmentName = "attachment" + inputs.length;
var newAttachment = createElement("input", attachmentName,
"currentAttachment", null,
{ type: "file",
name: attachmentName },
area);
Event.observe(newAttachment, "change",
onAttachmentChange.bindAsEventListener(newAttachment));
return clickedEditorAttach(null);
}
function onAttachmentChange(event) {
@@ -336,11 +333,12 @@ function onMailEditorClose(event) {
var parts = url.split("/");
parts[parts.length-1] = "delete";
url = parts.join("/");
http = createHTTPClient();
http.open("POST", url, false /* not async */);
http.send("");
}
Event.stopObserving(window, "beforeunload", onMailEditorClose);
}
addEvent(window, 'load', initMailEditor);