mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-27 22:35:22 +00:00
Monotone-Parent: f90d169fbc251326ea6c8a2f620e125a8a7b4168
Monotone-Revision: 7786f49f6724383b92e91ba7998b99cfb52ceec3 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-04-20T13:27:21
This commit is contained in:
@@ -104,6 +104,7 @@ static NSArray *infoKeys = nil;
|
||||
infoKeys = [[NSArray alloc] initWithObjects:
|
||||
@"subject", @"to", @"cc", @"bcc",
|
||||
@"from", @"inReplyTo",
|
||||
@"replyTo",
|
||||
@"priority", @"receipt", nil];
|
||||
}
|
||||
|
||||
@@ -255,6 +256,15 @@ static NSArray *infoKeys = nil;
|
||||
return from;
|
||||
}
|
||||
|
||||
- (NSString *) replyTo
|
||||
{
|
||||
SOGoUserDefaults *ud;
|
||||
|
||||
ud = [[context activeUser] userDefaults];
|
||||
|
||||
return [ud mailReplyTo];
|
||||
}
|
||||
|
||||
- (void) setSubject: (NSString *) newSubject
|
||||
{
|
||||
ASSIGN (subject, newSubject);
|
||||
|
||||
@@ -160,6 +160,7 @@
|
||||
|
||||
"Full Name:" = "Full Name:";
|
||||
"Email:" = "Email:";
|
||||
"Reply To Email:" = "Reply To Email:";
|
||||
"Signature:" = "Signature:";
|
||||
"(Click to create)" = "(Click to create)";
|
||||
|
||||
|
||||
@@ -1273,33 +1273,21 @@
|
||||
return [[user domainDefaults] mailAuxiliaryUserAccountsEnabled];
|
||||
}
|
||||
|
||||
- (void) _extractMainSignature: (NSDictionary *) account
|
||||
- (void) _extractMainIdentity: (NSDictionary *) identity
|
||||
{
|
||||
/* We perform some validation here as we have no guaranty on the input
|
||||
validity. */
|
||||
NSString *signature;
|
||||
NSArray *identities;
|
||||
NSDictionary *identity;
|
||||
NSString *value;
|
||||
|
||||
if ([account isKindOfClass: [NSDictionary class]])
|
||||
if ([identity isKindOfClass: [NSDictionary class]])
|
||||
{
|
||||
identities = [account objectForKey: @"identities"];
|
||||
if ([identities isKindOfClass: [NSArray class]])
|
||||
{
|
||||
signature = nil;
|
||||
|
||||
if ([identities count] > 0)
|
||||
{
|
||||
identity = [identities objectAtIndex: 0];
|
||||
if ([identity isKindOfClass: [NSDictionary class]])
|
||||
{
|
||||
signature = [identity objectForKey: @"signature"];
|
||||
if (!signature)
|
||||
signature = @"";
|
||||
[userDefaults setMailSignature: signature];
|
||||
}
|
||||
}
|
||||
}
|
||||
value = [identity objectForKey: @"signature"];
|
||||
if (!value)
|
||||
value = @"";
|
||||
[userDefaults setMailSignature: value];
|
||||
value = [[identity objectForKey: @"replyTo"]
|
||||
stringByTrimmingSpaces];
|
||||
[userDefaults setMailReplyTo: value];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1311,37 +1299,40 @@
|
||||
|| [action isEqualToString: @"ask"]));
|
||||
}
|
||||
|
||||
- (void) _extractMainReceiptsPreferences: (NSDictionary *) account
|
||||
- (void) _extractMainReceiptsPreferences: (NSDictionary *) receipts
|
||||
{
|
||||
/* We perform some validation here as we have no guaranty on the input
|
||||
validity. */
|
||||
NSDictionary *receipts;
|
||||
NSString *action;
|
||||
|
||||
if ([account isKindOfClass: [NSDictionary class]])
|
||||
if ([receipts isKindOfClass: [NSDictionary class]])
|
||||
{
|
||||
receipts = [account objectForKey: @"receipts"];
|
||||
if ([receipts isKindOfClass: [NSDictionary class]])
|
||||
{
|
||||
action = [receipts objectForKey: @"receiptAction"];
|
||||
[userDefaults
|
||||
setAllowUserReceipt: [action isEqualToString: @"allow"]];
|
||||
action = [receipts objectForKey: @"receiptAction"];
|
||||
[userDefaults
|
||||
setAllowUserReceipt: [action isEqualToString: @"allow"]];
|
||||
|
||||
action = [receipts objectForKey: @"receiptNonRecipientAction"];
|
||||
if ([self _validateReceiptAction: action])
|
||||
[userDefaults setUserReceiptNonRecipientAction: action];
|
||||
|
||||
action = [receipts objectForKey: @"receiptNonRecipientAction"];
|
||||
if ([self _validateReceiptAction: action])
|
||||
[userDefaults setUserReceiptNonRecipientAction: action];
|
||||
|
||||
action = [receipts objectForKey: @"receiptOutsideDomainAction"];
|
||||
if ([self _validateReceiptAction: action])
|
||||
[userDefaults setUserReceiptOutsideDomainAction: action];
|
||||
|
||||
action = [receipts objectForKey: @"receiptAnyAction"];
|
||||
if ([self _validateReceiptAction: action])
|
||||
[userDefaults setUserReceiptAnyAction: action];
|
||||
}
|
||||
action = [receipts objectForKey: @"receiptOutsideDomainAction"];
|
||||
if ([self _validateReceiptAction: action])
|
||||
[userDefaults setUserReceiptOutsideDomainAction: action];
|
||||
|
||||
action = [receipts objectForKey: @"receiptAnyAction"];
|
||||
if ([self _validateReceiptAction: action])
|
||||
[userDefaults setUserReceiptAnyAction: action];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) _extractMainCustomFrom: (NSDictionary *) account
|
||||
{
|
||||
}
|
||||
|
||||
- (void) _extractMainReplyTo: (NSDictionary *) account
|
||||
{
|
||||
}
|
||||
|
||||
- (BOOL) _validateAccountIdentities: (NSArray *) identities
|
||||
{
|
||||
static NSString *identityKeys[] = { @"fullName", @"email", nil };
|
||||
@@ -1355,7 +1346,7 @@
|
||||
if (!knownKeys)
|
||||
{
|
||||
knownKeys = [NSArray arrayWithObjects: @"fullName", @"email",
|
||||
@"signature", nil];
|
||||
@"signature", @"replyTo", nil];
|
||||
[knownKeys retain];
|
||||
}
|
||||
|
||||
@@ -1407,7 +1398,7 @@
|
||||
if (!knownKeys)
|
||||
{
|
||||
knownKeys = [NSArray arrayWithObjects: @"name", @"serverName", @"port",
|
||||
@"userName", @"password", @"encryption",
|
||||
@"userName", @"password", @"encryption", @"replyTo",
|
||||
@"identities", @"mailboxes",
|
||||
@"receipts",
|
||||
nil];
|
||||
@@ -1449,6 +1440,20 @@
|
||||
return valid;
|
||||
}
|
||||
|
||||
- (void) _extractMainAccountSettings: (NSDictionary *) account
|
||||
{
|
||||
NSArray *identities;
|
||||
|
||||
if ([account isKindOfClass: [NSDictionary class]])
|
||||
{
|
||||
identities = [account objectForKey: @"identities"];
|
||||
if ([identities isKindOfClass: [NSArray class]]
|
||||
&& [identities count] > 0)
|
||||
[self _extractMainIdentity: [identities objectAtIndex: 0]];
|
||||
[self _extractMainReceiptsPreferences: [account objectForKey: @"receipts"]];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) _extractAuxiliaryAccounts: (NSArray *) accounts
|
||||
{
|
||||
int count, max, oldMax;
|
||||
@@ -1499,9 +1504,7 @@
|
||||
max = [accounts count];
|
||||
if (max > 0)
|
||||
{
|
||||
[self _extractMainSignature: [accounts objectAtIndex: 0]];
|
||||
[self _extractMainReceiptsPreferences: [accounts objectAtIndex: 0]];
|
||||
|
||||
[self _extractMainAccountSettings: [accounts objectAtIndex: 0]];
|
||||
if ([self mailAuxiliaryUserAccountsEnabled])
|
||||
[self _extractAuxiliaryAccounts: accounts];
|
||||
}
|
||||
|
||||
@@ -324,6 +324,8 @@
|
||||
/></label><br/>
|
||||
<label><var:string label:value="Email:"/>
|
||||
<input const:name="email" const:id="email" type="text" const:value=""/></label><br/>
|
||||
<label><var:string label:value="Reply To Email:"/>
|
||||
<input const:name="replyTo" const:id="replyTo" type="text" const:value=""/></label><br/>
|
||||
<var:string label:value="Signature:"/>
|
||||
<span id="actSignature"><!--space --></span>
|
||||
</fieldset>
|
||||
|
||||
@@ -1,5 +1,18 @@
|
||||
/* -*- Mode: java; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
|
||||
if (NodeList) {
|
||||
var _each = NodeList.prototype.forEach;
|
||||
if (!_each) {
|
||||
_each = function NodeList_each(iterator, context) {
|
||||
for (var i = 0, length = this.length >>> 0; i < length; i++) {
|
||||
if (i in this) iterator.call(context, this[i], i, this);
|
||||
}
|
||||
};
|
||||
}
|
||||
NodeList.prototype._each = _each;
|
||||
Object.extend(NodeList.prototype, Enumerable);
|
||||
}
|
||||
|
||||
/* custom extensions to the DOM api */
|
||||
Element.addMethods({
|
||||
addInterface: function(element, objectInterface) {
|
||||
|
||||
@@ -657,16 +657,15 @@ function onMailAccountEntryClick(event) {
|
||||
|
||||
function displayMailAccount(mailAccount, readOnly) {
|
||||
var fieldSet = $("accountInfo");
|
||||
var inputs = fieldSet.getElementsByTagName("input");
|
||||
for (var i = 0; i < inputs.length; i++) {
|
||||
inputs[i].disabled = readOnly;
|
||||
inputs[i].mailAccount = mailAccount;
|
||||
}
|
||||
var inputs = $(fieldSet.getElementsByTagName("input"));
|
||||
inputs.each(function (i) { i.disabled = readOnly;
|
||||
i.mailAccount = mailAccount; });
|
||||
|
||||
fieldSet = $("identityInfo");
|
||||
inputs = fieldSet.getElementsByTagName("input");
|
||||
for (var i = 0; i < inputs.length; i++) {
|
||||
inputs = $(fieldSet.getElementsByTagName("input"));
|
||||
inputs.each(function (i) { i.mailAccount = mailAccount; });
|
||||
for (var i = 0; i < 2; i++) {
|
||||
inputs[i].disabled = readOnly;
|
||||
inputs[i].mailAccount = mailAccount;
|
||||
}
|
||||
|
||||
var form = $("mainForm");
|
||||
@@ -701,6 +700,7 @@ function displayMailAccount(mailAccount, readOnly) {
|
||||
: {} );
|
||||
$("fullName").value = identity["fullName"] || "";
|
||||
$("email").value = identity["email"] || "";
|
||||
$("replyTo").value = identity["replyTo"] || "";
|
||||
|
||||
displayAccountSignature(mailAccount);
|
||||
|
||||
|
||||
@@ -1681,13 +1681,10 @@ function onPreferencesClick(event) {
|
||||
}
|
||||
else {
|
||||
var w = window.open(urlstr, "SOGoPreferences",
|
||||
"width=580,height=450,resizable=1,scrollbars=0,location=0");
|
||||
"width=580,height=476,resizable=1,scrollbars=0,location=0");
|
||||
w.opener = window;
|
||||
w.focus();
|
||||
}
|
||||
|
||||
preventDefault(event);
|
||||
return false;
|
||||
}
|
||||
|
||||
function configureLinkBanner() {
|
||||
@@ -1704,7 +1701,7 @@ function configureLinkBanner() {
|
||||
link = $("preferencesBannerLink");
|
||||
if (link) {
|
||||
link.observe("mousedown", listRowMouseDownHandler);
|
||||
link.observe("click", onPreferencesClick);
|
||||
link.observe("click", clickEventWrapper(onPreferencesClick));
|
||||
}
|
||||
link = $("consoleBannerLink");
|
||||
if (link) {
|
||||
|
||||
Reference in New Issue
Block a user