2008-08-28 16:48:45 +02:00
|
|
|
/* -*- Mode: java; tab-width: 2; c-tab-always-indent: t; indent-tabs-mode: t; c-basic-offset: 2 -*- */
|
|
|
|
|
2007-08-08 23:36:17 +02:00
|
|
|
function onPrintCurrentMessage(event) {
|
|
|
|
window.print();
|
|
|
|
|
|
|
|
preventDefault(event);
|
|
|
|
}
|
2007-08-15 00:09:20 +02:00
|
|
|
|
2007-10-27 00:17:29 +02:00
|
|
|
function initPopupMailer(event) {
|
|
|
|
configureLinksInMessage();
|
|
|
|
resizeMailContent();
|
2008-10-06 19:17:43 +02:00
|
|
|
|
|
|
|
var loadImagesButton = $("loadImagesButton");
|
|
|
|
if (loadImagesButton)
|
|
|
|
loadImagesButton.observe("click",
|
|
|
|
onMessageLoadImages.bindAsEventListener(loadImagesButton));
|
|
|
|
|
|
|
|
configureLoadImagesButton();
|
|
|
|
}
|
|
|
|
|
|
|
|
function onMessageLoadImages(event) {
|
|
|
|
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) {
|
|
|
|
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,
|
2008-08-28 16:48:45 +02:00
|
|
|
window.opener.ICalendarButtonCallback,
|
|
|
|
window.messageUID);
|
2008-08-15 03:48:07 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
log("no link");
|
|
|
|
}
|
2007-12-10 16:56:13 +01:00
|
|
|
|
2008-08-15 03:48:07 +02:00
|
|
|
function onMenuDeleteMessage(event) {
|
2007-12-10 16:56:13 +01:00
|
|
|
if (window.opener && window.opener.open && !window.opener.closed) {
|
2008-09-02 20:44:48 +02:00
|
|
|
var rowId_index = window.name.search(/[0-9]+$/);
|
|
|
|
var rowId = window.name.substr(rowId_index);
|
2007-12-10 16:56:13 +01:00
|
|
|
var messageId = window.opener.Mailer.currentMailbox + "/" + rowId;
|
|
|
|
var url = ApplicationBaseURL + messageId + "/trash";
|
|
|
|
|
|
|
|
window.opener.deleteMessageWithDelay(url,
|
2008-08-28 16:48:45 +02:00
|
|
|
rowId,
|
|
|
|
window.opener.Mailer.currentMailbox,
|
|
|
|
messageId);
|
2007-12-10 16:56:13 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
window.close();
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2007-11-15 20:02:23 +01:00
|
|
|
FastInit.addOnLoad(initPopupMailer);
|