dafb17c05a
Monotone-Parent: 64c0713802f9595de3f792409a68ecb74bb80532 Monotone-Revision: 389ebfd16dbf972c7427f7a8ebab62d72400c15c Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2008-10-24T22:30:19 Monotone-Branch: ca.inverse.sogo
58 lines
1.7 KiB
JavaScript
58 lines
1.7 KiB
JavaScript
/* -*- Mode: java; tab-width: 2; c-tab-always-indent: t; indent-tabs-mode: t; c-basic-offset: 2 -*- */
|
|
|
|
function onPrintCurrentMessage(event) {
|
|
window.print();
|
|
|
|
preventDefault(event);
|
|
}
|
|
|
|
function initPopupMailer(event) {
|
|
configureLinksInMessage();
|
|
resizeMailContent();
|
|
|
|
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);
|
|
}
|
|
|
|
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,
|
|
window.opener.ICalendarButtonCallback,
|
|
window.messageUID);
|
|
}
|
|
}
|
|
else
|
|
log("no link");
|
|
}
|
|
|
|
function onMenuDeleteMessage(event) {
|
|
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);
|
|
}
|
|
|
|
window.close();
|
|
return false;
|
|
}
|
|
|
|
FastInit.addOnLoad(initPopupMailer);
|