2009-07-19 18:41:42 +02:00
|
|
|
/* -*- Mode: java; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2008-08-28 16:48:45 +02:00
|
|
|
|
2007-08-08 23:36:17 +02:00
|
|
|
function onPrintCurrentMessage(event) {
|
2009-09-14 19:44:39 +02:00
|
|
|
window.print();
|
2007-08-08 23:36:17 +02:00
|
|
|
|
2009-09-14 19:44:39 +02:00
|
|
|
preventDefault(event);
|
2007-08-08 23:36:17 +02:00
|
|
|
}
|
2007-08-15 00:09:20 +02:00
|
|
|
|
2007-10-27 00:17:29 +02:00
|
|
|
function initPopupMailer(event) {
|
2009-09-14 19:44:39 +02:00
|
|
|
configureLinksInMessage();
|
|
|
|
resizeMailContent();
|
2008-10-06 19:17:43 +02:00
|
|
|
|
2009-09-14 19:44:39 +02:00
|
|
|
var loadImagesButton = $("loadImagesButton");
|
|
|
|
if (loadImagesButton)
|
|
|
|
loadImagesButton.observe("click",
|
|
|
|
onMessageLoadImages.bindAsEventListener(loadImagesButton));
|
2008-10-06 19:17:43 +02:00
|
|
|
|
2009-09-14 19:44:39 +02:00
|
|
|
configureLoadImagesButton();
|
|
|
|
configureSignatureFlagImage();
|
2008-10-06 19:17:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function onMessageLoadImages(event) {
|
2009-09-14 19:44:39 +02:00
|
|
|
var msguid = window.opener.Mailer.currentMessages[window.opener.Mailer.currentMailbox];
|
|
|
|
var url = (window.opener.ApplicationBaseURL + window.opener.encodeURI(window.opener.Mailer.currentMailbox) + "/"
|
|
|
|
+ msguid + "/view?noframe=1&unsafe=1");
|
|
|
|
document.messageAjaxRequest
|
|
|
|
= triggerAjaxRequest(url, messageCallback, msguid);
|
2007-10-27 00:17:29 +02:00
|
|
|
}
|
|
|
|
|
2008-08-15 03:48:07 +02:00
|
|
|
function onICalendarButtonClick(event) {
|
2009-09-14 19:44:39 +02:00
|
|
|
var link = $("iCalendarAttachment").value;
|
|
|
|
if (link) {
|
|
|
|
var urlstr = link + "/" + this.action;
|
|
|
|
var currentMsg;
|
|
|
|
if (window.opener && window.opener.open && !window.opener.closed && window.messageUID) {
|
|
|
|
var c = window.opener;
|
|
|
|
window.opener.triggerAjaxRequest(urlstr,
|
|
|
|
window.opener.ICalendarButtonCallback,
|
|
|
|
window.messageUID);
|
|
|
|
}
|
2008-08-15 03:48:07 +02:00
|
|
|
}
|
2009-09-14 19:44:39 +02:00
|
|
|
else
|
|
|
|
log("no link");
|
2008-08-15 03:48:07 +02:00
|
|
|
}
|
2007-12-10 16:56:13 +01:00
|
|
|
|
2008-08-15 03:48:07 +02:00
|
|
|
function onMenuDeleteMessage(event) {
|
2009-09-14 19:44:39 +02:00
|
|
|
if (window.opener && window.opener.open && !window.opener.closed) {
|
|
|
|
var url = ApplicationBaseURL + encodeURI(mailboxName) + "/deleteMessages";
|
|
|
|
var path = mailboxName + "/" + messageName;
|
|
|
|
|
|
|
|
window.opener.deleteMessageWithDelay(url, messageName, mailboxName, path);
|
|
|
|
}
|
2007-12-10 16:56:13 +01:00
|
|
|
|
2009-09-14 19:44:39 +02:00
|
|
|
window.close();
|
|
|
|
return false;
|
2007-12-10 16:56:13 +01:00
|
|
|
}
|
|
|
|
|
2009-03-12 22:09:14 +01:00
|
|
|
document.observe("dom:loaded", initPopupMailer);
|