mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-10 10:55:08 +00:00
Monotone-Parent: d730814de50b7c4fd0fa165b4b6e02e968ff60ef
Monotone-Revision: 148caf2ae66d2024b6008a2633e9145890921239 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-09-01T20:27:45 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -31,6 +31,16 @@ String.prototype.capitalize = function() {
|
||||
});
|
||||
};
|
||||
|
||||
String.prototype.cssIdToHungarianId = function() {
|
||||
var parts = this.split("-");
|
||||
var newId = parts[0];
|
||||
for (var i = 1; i < parts.length; i++) {
|
||||
newId += parts[i].capitalize();
|
||||
}
|
||||
|
||||
return newId;
|
||||
}
|
||||
|
||||
String.prototype.decodeEntities = function() {
|
||||
return this.replace(/&#(\d+);/g,
|
||||
function(wholematch, parenmatch1) {
|
||||
|
||||
@@ -1425,6 +1425,35 @@ function onAttachmentClick (event) {
|
||||
return false;
|
||||
}
|
||||
|
||||
function handleReturnReceipt() {
|
||||
var input = $("shouldAskReceipt");
|
||||
if (input) {
|
||||
if (eval(input.value)) {
|
||||
showConfirmDialog(_("Return Receipt"),
|
||||
_("The sender of this message has asked to be notified when you read this message. "
|
||||
+ "Do you with to notify the sender?"),
|
||||
onReadMessageConfirmMDN);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onReadMessageConfirmMDN(event) {
|
||||
var messageURL;
|
||||
if (window.opener && window.opener.Mailer) {
|
||||
/* from UIxMailPopupView */
|
||||
messageURL = (ApplicationBaseURL + encodeURI(mailboxName)
|
||||
+ "/" + messageName);
|
||||
}
|
||||
else {
|
||||
/* from main window */
|
||||
messageURL = (ApplicationBaseURL + encodeURI(Mailer.currentMailbox) + "/"
|
||||
+ Mailer.currentMessages[Mailer.currentMailbox]);
|
||||
}
|
||||
disposeDialog();
|
||||
var url = messageURL + "/sendMDN";
|
||||
triggerAjaxRequest(url);
|
||||
}
|
||||
|
||||
function loadMessageCallback(http) {
|
||||
var div = $('messageContent');
|
||||
|
||||
@@ -1435,7 +1464,7 @@ function loadMessageCallback(http) {
|
||||
resizeMailContent();
|
||||
configureLoadImagesButton();
|
||||
configureSignatureFlagImage();
|
||||
|
||||
handleReturnReceipt();
|
||||
if (http.callbackData) {
|
||||
var cachedMessage = new Array();
|
||||
var msguid = http.callbackData.msguid;
|
||||
|
||||
@@ -14,6 +14,8 @@ function initPopupMailer(event) {
|
||||
configureSignatureFlagImage();
|
||||
|
||||
window.messageUID = mailboxName + "/" + messageName;
|
||||
|
||||
handleReturnReceipt();
|
||||
}
|
||||
|
||||
function onICalendarButtonClick(event) {
|
||||
|
||||
@@ -190,3 +190,6 @@ P.infoMessage#passwordError
|
||||
height: 90px;
|
||||
margin: 0px auto;
|
||||
margin-bottom: 10px; }
|
||||
|
||||
#receiptOptions
|
||||
{ text-align: right; }
|
||||
|
||||
@@ -414,6 +414,16 @@ function initMailAccounts() {
|
||||
}
|
||||
$("actSignature").observe("click", onMailIdentitySignatureClick);
|
||||
displayMailAccount(mailAccounts[0], true);
|
||||
|
||||
info = $("returnReceiptsInfo");
|
||||
inputs = info.getElementsByTagName("input");
|
||||
for (var i = 0; i < inputs.length; i++) {
|
||||
$(inputs[i]).observe("change", onMailReceiptInfoChange);
|
||||
}
|
||||
inputs = info.getElementsByTagName("select");
|
||||
for (var i = 0; i < inputs.length; i++) {
|
||||
$(inputs[i]).observe("change", onMailReceiptActionChange);
|
||||
}
|
||||
}
|
||||
|
||||
function onMailAccountInfoChange(event) {
|
||||
@@ -432,6 +442,31 @@ function onMailIdentityInfoChange(event) {
|
||||
hasChanged.value = "1";
|
||||
}
|
||||
|
||||
function onMailReceiptInfoChange(event) {
|
||||
if (!this.mailAccount["receipts"]) {
|
||||
this.mailAccount["receipts"] = {};
|
||||
}
|
||||
var keyName = this.name.cssIdToHungarianId();
|
||||
this.mailAccount["receipts"][keyName] = this.value;
|
||||
|
||||
var popupIds = [ "receipt-non-recipient-action",
|
||||
"receipt-outside-domain-action",
|
||||
"receipt-any-action" ];
|
||||
var receiptActionsDisable = (this.value == "ignore");
|
||||
for (var i = 0; i < popupIds.length; i++) {
|
||||
var actionPopup = $(popupIds[i]);
|
||||
actionPopup.disabled = receiptActionsDisable;
|
||||
}
|
||||
}
|
||||
|
||||
function onMailReceiptActionChange(event) {
|
||||
if (!this.mailAccount["receipts"]) {
|
||||
this.mailAccount["receipts"] = {};
|
||||
}
|
||||
var keyName = this.name.cssIdToHungarianId();
|
||||
this.mailAccount["receipts"][keyName] = this.value;
|
||||
}
|
||||
|
||||
function onMailIdentitySignatureClick(event) {
|
||||
if (!this.readOnly) {
|
||||
var dialogId = "signatureDialog";
|
||||
@@ -526,20 +561,26 @@ function onMailAccountEntryClick(event) {
|
||||
}
|
||||
|
||||
function displayMailAccount(mailAccount, readOnly) {
|
||||
var editor = $("mailAccountEditor");
|
||||
var inputs = editor.getElementsByTagName("input");
|
||||
var fieldSet = $("accountInfo");
|
||||
var inputs = fieldSet.getElementsByTagName("input");
|
||||
for (var i = 0; i < inputs.length; i++) {
|
||||
inputs[i].disabled = readOnly;
|
||||
inputs[i].mailAccount = mailAccount;
|
||||
}
|
||||
fieldSet = $("identityInfo");
|
||||
inputs = fieldSet.getElementsByTagName("input");
|
||||
for (var i = 0; i < inputs.length; i++) {
|
||||
inputs[i].disabled = readOnly;
|
||||
inputs[i].mailAccount = mailAccount;
|
||||
}
|
||||
|
||||
var encryption = "none";
|
||||
var form = $("mainForm");
|
||||
|
||||
var encryption = "none";
|
||||
var encRadioValues = [ "none", "ssl", "tls" ];
|
||||
if (mailAccount["encryption"]) {
|
||||
encryption = mailAccount["encryption"];
|
||||
}
|
||||
var form = $("mainForm");
|
||||
form.setRadioValue("encryption", encRadioValues.indexOf(encryption));
|
||||
|
||||
var port;
|
||||
@@ -567,6 +608,34 @@ function displayMailAccount(mailAccount, readOnly) {
|
||||
$("email").value = identity["email"] || "";
|
||||
|
||||
displayAccountSignature(mailAccount);
|
||||
|
||||
var receiptAction = "ignore";
|
||||
var receiptActionValues = [ "ignore", "allow" ];
|
||||
if (mailAccount["receipts"] && mailAccount["receipts"]["receiptAction"]) {
|
||||
receiptAction = mailAccount["receipts"]["receiptAction"];
|
||||
}
|
||||
for (var i = 0; i < receiptActionValues.length; i++) {
|
||||
var keyName = "receipt-action-" + receiptActionValues[i];
|
||||
var input = $(keyName);
|
||||
input.mailAccount = mailAccount;
|
||||
}
|
||||
form.setRadioValue("receipt-action",
|
||||
receiptActionValues.indexOf(receiptAction));
|
||||
var popupIds = [ "receipt-non-recipient-action",
|
||||
"receipt-outside-domain-action",
|
||||
"receipt-any-action" ];
|
||||
var receiptActionsDisable = (receiptAction == "ignore");
|
||||
for (var i = 0; i < popupIds.length; i++) {
|
||||
var actionPopup = $(popupIds[i]);
|
||||
actionPopup.disabled = receiptActionsDisable;
|
||||
var settingValue = "ignore";
|
||||
var settingName = popupIds[i].cssIdToHungarianId();
|
||||
if (mailAccount["receipts"] && mailAccount["receipts"][settingName]) {
|
||||
settingValue = mailAccount["receipts"][settingName];
|
||||
}
|
||||
actionPopup.value = settingValue;
|
||||
actionPopup.mailAccount = mailAccount;
|
||||
}
|
||||
}
|
||||
|
||||
function displayAccountSignature(mailAccount) {
|
||||
|
||||
Reference in New Issue
Block a user