21ab040534
Monotone-Parent: 244f630f9b5b56de06c1348c5371d785e2f3d3a3 Monotone-Revision: 3a4ed372ee2495e9c893842ebe71384ea3ebcd65 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2009-03-12T21:09:14 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;
|
|
}
|
|
|
|
document.observe("dom:loaded", initPopupMailer);
|