Added signature/reply placement options
Monotone-Parent: c465e35fc5f42324c08780dae83f7d225dca6e6a Monotone-Revision: 1d1c945ea058db7070c9b83c4c2bb60689c52f92 Monotone-Author: crobert@inverse.ca Monotone-Date: 2008-09-28T19:49:17 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
9edd16c0f4
commit
a828b049de
|
@ -1,3 +1,8 @@
|
||||||
|
<#signaturePlacementOnTop>
|
||||||
|
|
||||||
|
|
||||||
|
<#signature/>
|
||||||
|
</#signaturePlacementOnTop>
|
||||||
<#outlookMode>-------- Original Message --------
|
<#outlookMode>-------- Original Message --------
|
||||||
Subject: <#subject/>
|
Subject: <#subject/>
|
||||||
Date: <#date/>
|
Date: <#date/>
|
||||||
|
@ -8,4 +13,5 @@ From: <#from/>
|
||||||
|
|
||||||
<#messageBody/>
|
<#messageBody/>
|
||||||
|
|
||||||
<#signature/>
|
|
||||||
|
<#signaturePlacementOnBottom><#signature/></#signaturePlacementOnBottom>
|
||||||
|
|
|
@ -81,3 +81,21 @@ signature: WOString {
|
||||||
value = signature;
|
value = signature;
|
||||||
escapeHTML = NO;
|
escapeHTML = NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
replyPlacementOnTop: WOConditional {
|
||||||
|
condition = replyPlacementOnTop;
|
||||||
|
}
|
||||||
|
|
||||||
|
replyPlacementOnBottom: WOConditional {
|
||||||
|
condition = replyPlacementOnTop;
|
||||||
|
negate = YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
signaturePlacementOnTop: WOConditional {
|
||||||
|
condition = signaturePlacementOnTop;
|
||||||
|
}
|
||||||
|
|
||||||
|
signaturePlacementOnBottom: WOConditional {
|
||||||
|
condition = signaturePlacementOnTop;
|
||||||
|
negate = YES;
|
||||||
|
}
|
||||||
|
|
|
@ -157,6 +157,8 @@
|
||||||
inContext: context];
|
inContext: context];
|
||||||
[page setSourceMail: self];
|
[page setSourceMail: self];
|
||||||
[page setOutlookMode: [self useOutlookStyleReplies]];
|
[page setOutlookMode: [self useOutlookStyleReplies]];
|
||||||
|
[page setReplyPlacement: [[currentUser userDefaults] stringForKey: @"ReplyPlacement"]];
|
||||||
|
[page setSignaturePlacement: [[currentUser userDefaults] stringForKey: @"SignaturePlacement"]];
|
||||||
|
|
||||||
return [[page generateResponse] contentAsString];
|
return [[page generateResponse] contentAsString];
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,10 +30,14 @@
|
||||||
@interface SOGoMailReply : SOGoMailForward
|
@interface SOGoMailReply : SOGoMailForward
|
||||||
{
|
{
|
||||||
BOOL outlookMode;
|
BOOL outlookMode;
|
||||||
|
NSString *replyPlacement;
|
||||||
|
NSString *signaturePlacement;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) setOutlookMode: (BOOL) newOutlookMode;
|
- (void) setOutlookMode: (BOOL) newOutlookMode;
|
||||||
- (BOOL) outlookMode;
|
- (BOOL) outlookMode;
|
||||||
|
- (void) setReplyPlacement: (NSString *) newPlacement;
|
||||||
|
- (BOOL) replyPlacementOnTop;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
|
@ -51,6 +51,26 @@
|
||||||
return outlookMode;
|
return outlookMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void) setReplyPlacement: (NSString *) newPlacement
|
||||||
|
{
|
||||||
|
replyPlacement = newPlacement;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL) replyPlacementOnTop
|
||||||
|
{
|
||||||
|
return [replyPlacement isEqual: @"above"];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) setSignaturePlacement: (NSString *) newPlacement
|
||||||
|
{
|
||||||
|
signaturePlacement = newPlacement;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL) signaturePlacementOnTop
|
||||||
|
{
|
||||||
|
return [signaturePlacement isEqual: @"above"];
|
||||||
|
}
|
||||||
|
|
||||||
- (NSString *) messageBody
|
- (NSString *) messageBody
|
||||||
{
|
{
|
||||||
NSString *s;
|
NSString *s;
|
||||||
|
|
|
@ -137,6 +137,8 @@ extern NSString *SOGoWeekStartFirstFullWeek;
|
||||||
- (NSString *) messageCheck;
|
- (NSString *) messageCheck;
|
||||||
|
|
||||||
- (NSString *) signature;
|
- (NSString *) signature;
|
||||||
|
- (NSString *) replyPlacement;
|
||||||
|
- (NSString *) signaturePlacement;
|
||||||
|
|
||||||
- (void) saveMailAccounts;
|
- (void) saveMailAccounts;
|
||||||
|
|
||||||
|
|
|
@ -772,6 +772,33 @@ _timeValue (NSString *key)
|
||||||
return [[self primaryIdentity] objectForKey: @"signature"];
|
return [[self primaryIdentity] objectForKey: @"signature"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Modification */
|
||||||
|
- (NSString *) replyPlacement
|
||||||
|
{
|
||||||
|
NSString *replyPlacement;
|
||||||
|
|
||||||
|
replyPlacement
|
||||||
|
= [[self userDefaults] stringForKey: @"ReplyPlacement"];
|
||||||
|
if (![replyPlacement length])
|
||||||
|
replyPlacement = @"below";
|
||||||
|
|
||||||
|
return replyPlacement;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString *) signaturePlacement
|
||||||
|
{
|
||||||
|
NSString *signaturePlacement;
|
||||||
|
|
||||||
|
signaturePlacement
|
||||||
|
= [[self userDefaults] stringForKey: @"SignaturePlacement"];
|
||||||
|
if (![signaturePlacement length])
|
||||||
|
signaturePlacement = @"below";
|
||||||
|
|
||||||
|
return signaturePlacement;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Fin */
|
||||||
|
|
||||||
- (NSString *) messageForwarding
|
- (NSString *) messageForwarding
|
||||||
{
|
{
|
||||||
NSString *messageForwarding;
|
NSString *messageForwarding;
|
||||||
|
|
|
@ -82,6 +82,11 @@
|
||||||
"Default identity:" = "Standaardidentiteit:";
|
"Default identity:" = "Standaardidentiteit:";
|
||||||
"Manage identities..." = "Identiteiten beheren...";
|
"Manage identities..." = "Identiteiten beheren...";
|
||||||
"Signature" = "Signature";
|
"Signature" = "Signature";
|
||||||
|
"replyplacement_above" = "replyplacement_above";
|
||||||
|
"replyplacement_below" = "replyplacement_below";
|
||||||
|
"And place my signature" = "And place my signature";
|
||||||
|
"signatureplacement_above" = "signatureplacement_above";
|
||||||
|
"signatureplacement_below" = "signatureplacement_below";
|
||||||
|
|
||||||
/* Additional Parameters */
|
/* Additional Parameters */
|
||||||
"Additional Parameters" = "Additional Parameters";
|
"Additional Parameters" = "Additional Parameters";
|
||||||
|
|
|
@ -85,6 +85,11 @@
|
||||||
"Default identity:" = "Default identity:";
|
"Default identity:" = "Default identity:";
|
||||||
"Manage identities..." = "Manage identities...";
|
"Manage identities..." = "Manage identities...";
|
||||||
"Signature" = "Signature";
|
"Signature" = "Signature";
|
||||||
|
"replyplacement_above" = "Start my reply above the quote";
|
||||||
|
"replyplacement_below" = "Start my reply below the quote";
|
||||||
|
"And place my signature" = "And place my signature";
|
||||||
|
"signatureplacement_above" = "below my reply";
|
||||||
|
"signatureplacement_below" = "below the quote";
|
||||||
|
|
||||||
/* Additional Parameters */
|
/* Additional Parameters */
|
||||||
"Additional Parameters" = "Additional Parameters";
|
"Additional Parameters" = "Additional Parameters";
|
||||||
|
|
|
@ -83,6 +83,11 @@
|
||||||
"Default identity:" = "Identité par défaut :";
|
"Default identity:" = "Identité par défaut :";
|
||||||
"Manage identities..." = "Gérer les identitiés...";
|
"Manage identities..." = "Gérer les identitiés...";
|
||||||
"Signature" = "Signature";
|
"Signature" = "Signature";
|
||||||
|
"replyplacement_above" = "Placer ma reponse avant la citation";
|
||||||
|
"replyplacement_below" = "Placer ma reponse apres la citation";
|
||||||
|
"And place my signature" = "Et placer ma signature";
|
||||||
|
"signatureplacement_above" = "apres ma reponse";
|
||||||
|
"signatureplacement_below" = "apres la citation";
|
||||||
|
|
||||||
/* Additional Parameters */
|
/* Additional Parameters */
|
||||||
"Additional Parameters" = "Paramètres supplémentaires";
|
"Additional Parameters" = "Paramètres supplémentaires";
|
||||||
|
|
|
@ -82,6 +82,11 @@
|
||||||
"Default identity:" = "Standard Identität:";
|
"Default identity:" = "Standard Identität:";
|
||||||
"Manage identities..." = "Identitäten verwalten...";
|
"Manage identities..." = "Identitäten verwalten...";
|
||||||
"Signature" = "Unterschrift";
|
"Signature" = "Unterschrift";
|
||||||
|
"replyplacement_above" = "replyplacement_above";
|
||||||
|
"replyplacement_below" = "replyplacement_below";
|
||||||
|
"And place my signature" = "And place my signature";
|
||||||
|
"signatureplacement_above" = "signatureplacement_above";
|
||||||
|
"signatureplacement_below" = "signatureplacement_below";
|
||||||
|
|
||||||
/* Additional Parameters */
|
/* Additional Parameters */
|
||||||
"Additional Parameters" = "Additional Parameters";
|
"Additional Parameters" = "Additional Parameters";
|
||||||
|
|
|
@ -83,6 +83,11 @@
|
||||||
"Default identity:" = "Identità principale:";
|
"Default identity:" = "Identità principale:";
|
||||||
"Manage identities..." = "Gestisci identità...";
|
"Manage identities..." = "Gestisci identità...";
|
||||||
"Signature" = "Firma";
|
"Signature" = "Firma";
|
||||||
|
"replyplacement_above" = "replyplacement_above";
|
||||||
|
"replyplacement_below" = "replyplacement_below";
|
||||||
|
"And place my signature" = "And place my signature";
|
||||||
|
"signatureplacement_above" = "signatureplacement_above";
|
||||||
|
"signatureplacement_below" = "signatureplacement_below";
|
||||||
|
|
||||||
/* Additional Parameters */
|
/* Additional Parameters */
|
||||||
"Additional Parameters" = "Additional Parameters";
|
"Additional Parameters" = "Additional Parameters";
|
||||||
|
|
|
@ -94,6 +94,11 @@
|
||||||
"Default identity:" = "Identidad por defecto:";
|
"Default identity:" = "Identidad por defecto:";
|
||||||
"Manage identities..." = "Gestionar identidades...";
|
"Manage identities..." = "Gestionar identidades...";
|
||||||
"Signature" = "Firma";
|
"Signature" = "Firma";
|
||||||
|
"replyplacement_above" = "replyplacement_above";
|
||||||
|
"replyplacement_below" = "replyplacement_below";
|
||||||
|
"And place my signature" = "And place my signature";
|
||||||
|
"signatureplacement_above" = "signatureplacement_above";
|
||||||
|
"signatureplacement_below" = "signatureplacement_below";
|
||||||
|
|
||||||
/* Additional Parameters */
|
/* Additional Parameters */
|
||||||
"Additional Parameters" = "Additional Parameters";
|
"Additional Parameters" = "Additional Parameters";
|
||||||
|
|
|
@ -513,6 +513,50 @@ static BOOL shouldDisplayAdditionalPreferences = NO;
|
||||||
[user saveMailAccounts];
|
[user saveMailAccounts];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Modification */
|
||||||
|
- (NSArray *) replyPlacementList
|
||||||
|
{
|
||||||
|
return [NSArray arrayWithObjects: @"above", @"below", nil];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString *) itemReplyPlacementText
|
||||||
|
{
|
||||||
|
return [self labelForKey:
|
||||||
|
[NSString stringWithFormat: @"replyplacement_%@", item]];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString *) userReplyPlacement
|
||||||
|
{
|
||||||
|
return [user replyPlacement];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) setUserReplyPlacement: (NSString *) newReplyPlacement
|
||||||
|
{
|
||||||
|
[userDefaults setObject: newReplyPlacement forKey: @"ReplyPlacement"];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSArray *) signaturePlacementList
|
||||||
|
{
|
||||||
|
return [NSArray arrayWithObjects: @"above", @"below", nil];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString *) itemSignaturePlacementText
|
||||||
|
{
|
||||||
|
return [self labelForKey:
|
||||||
|
[NSString stringWithFormat: @"signatureplacement_%@", item]];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString *) userSignaturePlacement
|
||||||
|
{
|
||||||
|
return [user signaturePlacement];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) setUserSignaturePlacement: (NSString *) newSignaturePlacement
|
||||||
|
{
|
||||||
|
[userDefaults setObject: newSignaturePlacement forKey: @"SignaturePlacement"];
|
||||||
|
}
|
||||||
|
/* Fin */
|
||||||
|
|
||||||
- (id <WOActionResults>) defaultAction
|
- (id <WOActionResults>) defaultAction
|
||||||
{
|
{
|
||||||
id <WOActionResults> results;
|
id <WOActionResults> results;
|
||||||
|
|
|
@ -104,6 +104,15 @@
|
||||||
const:id="messageForwarding"
|
const:id="messageForwarding"
|
||||||
string="itemMessageForwardingText"
|
string="itemMessageForwardingText"
|
||||||
selection="userMessageForwarding"/></label><br/>
|
selection="userMessageForwarding"/></label><br/>
|
||||||
|
<var:popup list="replyPlacementList" item="item"
|
||||||
|
const:id="replyPlacementList"
|
||||||
|
string="itemReplyPlacementText"
|
||||||
|
selection="userReplyPlacement"/>
|
||||||
|
<br /><label><var:string label:value="And place my signature"/></label>
|
||||||
|
<var:popup list="signaturePlacementList" item="item"
|
||||||
|
const:id="signaturePlacementList"
|
||||||
|
string="itemSignaturePlacementText"
|
||||||
|
selection="userSignaturePlacement"/>
|
||||||
<!-- <label><input
|
<!-- <label><input
|
||||||
const:name="inTheOffice" type="radio" const:value="YES"
|
const:name="inTheOffice" type="radio" const:value="YES"
|
||||||
var:selection="inTheOffice"/>
|
var:selection="inTheOffice"/>
|
||||||
|
|
|
@ -313,14 +313,22 @@ function onTextIEUpdateCursorPos(event) {
|
||||||
|
|
||||||
function onTextFirstFocus() {
|
function onTextFirstFocus() {
|
||||||
var content = this.getValue();
|
var content = this.getValue();
|
||||||
if (content.lastIndexOf("--") == 0) {
|
var signaturePlacement = userDefaults["SignaturePlacement"];
|
||||||
this.insertBefore(document.createTextNode("\r"),
|
if ( typeof(signaturePlacement) == "undefined" ) {
|
||||||
this.lastChild);
|
signaturePlacement = "below";
|
||||||
}
|
}
|
||||||
if (signatureLength > 0) {
|
var replyPlacement = userDefaults["ReplyPlacement"];
|
||||||
var length = this.getValue().length - signatureLength - 2;
|
if ( typeof(replyPlacement) == "undefined" ) {
|
||||||
this.setCaretTo(length);
|
replyPlacement = signaturePlacement;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( replyPlacement == "above" ) {
|
||||||
|
this.setCaretTo(0);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.setCaretTo(this.getValue().length - signatureLength - 2);
|
||||||
|
}
|
||||||
|
|
||||||
Event.stopObserving(this, "focus", onTextFirstFocus);
|
Event.stopObserving(this, "focus", onTextFirstFocus);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
/* -*- Mode: java; tab-width: 2; c-tab-always-indent: t; indent-tabs-mode: t; c-basic-offset: 2 -*- */
|
/* -*- Mode: java; tab-width: 2; c-tab-always-indent: t; indent-tabs-mode: t; c-basic-offset: 2 -*- */
|
||||||
|
|
||||||
function savePreferences(sender) {
|
function savePreferences(sender) {
|
||||||
|
$("signaturePlacementList").disabled=false;
|
||||||
$("mainForm").submit();
|
$("mainForm").submit();
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -32,6 +33,19 @@ function initPreferences() {
|
||||||
_setupEvents(true);
|
_setupEvents(true);
|
||||||
if (typeof (initAdditionalPreferences) != "undefined")
|
if (typeof (initAdditionalPreferences) != "undefined")
|
||||||
initAdditionalPreferences();
|
initAdditionalPreferences();
|
||||||
|
$("replyPlacementList").observe("change", onReplyPlacementListChange);
|
||||||
|
onReplyPlacementListChange();
|
||||||
|
}
|
||||||
|
|
||||||
|
function onReplyPlacementListChange() {
|
||||||
|
// above = 0
|
||||||
|
if ($("replyPlacementList").value == 0) {
|
||||||
|
$("signaturePlacementList").disabled=false;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$("signaturePlacementList").value=1;
|
||||||
|
$("signaturePlacementList").disabled=true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FastInit.addOnLoad(initPreferences);
|
FastInit.addOnLoad(initPreferences);
|
||||||
|
|
Loading…
Reference in New Issue