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
|
|
|
configureLoadImagesButton();
|
|
|
|
configureSignatureFlagImage();
|
2010-04-16 23:44:26 +02:00
|
|
|
|
2013-09-12 23:08:02 +02:00
|
|
|
if (UserDefaults["SOGoMailDisplayRemoteInlineImages"] == 'always')
|
|
|
|
loadRemoteImages();
|
|
|
|
|
2010-04-16 23:44:26 +02:00
|
|
|
window.messageUID = mailboxName + "/" + messageName;
|
2010-09-01 22:27:45 +02:00
|
|
|
|
|
|
|
handleReturnReceipt();
|
2012-09-26 17:28:18 +02:00
|
|
|
|
|
|
|
var td = $("subject");
|
|
|
|
if (td)
|
|
|
|
document.title = td.allTextContent();
|
2016-01-22 16:32:13 +01:00
|
|
|
|
|
|
|
var button = $$(".tbicon_junk").first();
|
|
|
|
button.stopObserving("click");
|
|
|
|
|
|
|
|
if (window.mailboxType == "SOGoJunkFolder") {
|
|
|
|
button.title = "Mark the selected messages as not junk";
|
|
|
|
button.select('span').first().childNodes[3].nodeValue = "Not junk";
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
button.title = "Mark the selected messages as junk";
|
|
|
|
button.select('span').first().childNodes[3].nodeValue = "Junk";
|
|
|
|
}
|
|
|
|
|
|
|
|
button.on("click", window.opener.onMarkOrUnmarkMessagesAsJunk.bind(button, (window.mailboxType == "SOGoJunkFolder")));
|
2008-10-06 19:17:43 +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;
|
|
|
|
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) {
|
2010-04-07 22:26:15 +02:00
|
|
|
var url = ApplicationBaseURL + encodeURI(mailboxName) + "/batchDelete";
|
2009-09-14 19:44:39 +02:00
|
|
|
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);
|