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 --------
|
||||
Subject: <#subject/>
|
||||
Date: <#date/>
|
||||
|
@ -8,4 +13,5 @@ From: <#from/>
|
|||
|
||||
<#messageBody/>
|
||||
|
||||
<#signature/>
|
||||
|
||||
<#signaturePlacementOnBottom><#signature/></#signaturePlacementOnBottom>
|
||||
|
|
|
@ -81,3 +81,21 @@ signature: WOString {
|
|||
value = signature;
|
||||
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];
|
||||
[page setSourceMail: self];
|
||||
[page setOutlookMode: [self useOutlookStyleReplies]];
|
||||
[page setReplyPlacement: [[currentUser userDefaults] stringForKey: @"ReplyPlacement"]];
|
||||
[page setSignaturePlacement: [[currentUser userDefaults] stringForKey: @"SignaturePlacement"]];
|
||||
|
||||
return [[page generateResponse] contentAsString];
|
||||
}
|
||||
|
|
|
@ -30,10 +30,14 @@
|
|||
@interface SOGoMailReply : SOGoMailForward
|
||||
{
|
||||
BOOL outlookMode;
|
||||
NSString *replyPlacement;
|
||||
NSString *signaturePlacement;
|
||||
}
|
||||
|
||||
- (void) setOutlookMode: (BOOL) newOutlookMode;
|
||||
- (BOOL) outlookMode;
|
||||
- (void) setReplyPlacement: (NSString *) newPlacement;
|
||||
- (BOOL) replyPlacementOnTop;
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -51,6 +51,26 @@
|
|||
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 *s;
|
||||
|
|
|
@ -137,6 +137,8 @@ extern NSString *SOGoWeekStartFirstFullWeek;
|
|||
- (NSString *) messageCheck;
|
||||
|
||||
- (NSString *) signature;
|
||||
- (NSString *) replyPlacement;
|
||||
- (NSString *) signaturePlacement;
|
||||
|
||||
- (void) saveMailAccounts;
|
||||
|
||||
|
|
|
@ -772,6 +772,33 @@ _timeValue (NSString *key)
|
|||
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;
|
||||
|
|
|
@ -82,6 +82,11 @@
|
|||
"Default identity:" = "Standaardidentiteit:";
|
||||
"Manage identities..." = "Identiteiten beheren...";
|
||||
"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";
|
||||
|
|
|
@ -85,6 +85,11 @@
|
|||
"Default identity:" = "Default identity:";
|
||||
"Manage identities..." = "Manage identities...";
|
||||
"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";
|
||||
|
|
|
@ -83,6 +83,11 @@
|
|||
"Default identity:" = "Identité par défaut :";
|
||||
"Manage identities..." = "Gérer les identitiés...";
|
||||
"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" = "Paramètres supplémentaires";
|
||||
|
|
|
@ -82,6 +82,11 @@
|
|||
"Default identity:" = "Standard Identität:";
|
||||
"Manage identities..." = "Identitäten verwalten...";
|
||||
"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";
|
||||
|
|
|
@ -83,6 +83,11 @@
|
|||
"Default identity:" = "Identità principale:";
|
||||
"Manage identities..." = "Gestisci identità...";
|
||||
"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";
|
||||
|
|
|
@ -94,6 +94,11 @@
|
|||
"Default identity:" = "Identidad por defecto:";
|
||||
"Manage identities..." = "Gestionar identidades...";
|
||||
"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";
|
||||
|
|
|
@ -513,6 +513,50 @@ static BOOL shouldDisplayAdditionalPreferences = NO;
|
|||
[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> results;
|
||||
|
|
|
@ -104,6 +104,15 @@
|
|||
const:id="messageForwarding"
|
||||
string="itemMessageForwardingText"
|
||||
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
|
||||
const:name="inTheOffice" type="radio" const:value="YES"
|
||||
var:selection="inTheOffice"/>
|
||||
|
@ -124,7 +133,7 @@
|
|||
</var:multiselection>
|
||||
<br/>-->
|
||||
<textarea const:id="signature" const:name="signature"
|
||||
var:value="signature"/>
|
||||
var:value="signature" />
|
||||
</div>
|
||||
</var:if>
|
||||
<var:if condition="shouldDisplayAdditionalPreferences"
|
||||
|
|
|
@ -313,14 +313,22 @@ function onTextIEUpdateCursorPos(event) {
|
|||
|
||||
function onTextFirstFocus() {
|
||||
var content = this.getValue();
|
||||
if (content.lastIndexOf("--") == 0) {
|
||||
this.insertBefore(document.createTextNode("\r"),
|
||||
this.lastChild);
|
||||
}
|
||||
if (signatureLength > 0) {
|
||||
var length = this.getValue().length - signatureLength - 2;
|
||||
this.setCaretTo(length);
|
||||
}
|
||||
var signaturePlacement = userDefaults["SignaturePlacement"];
|
||||
if ( typeof(signaturePlacement) == "undefined" ) {
|
||||
signaturePlacement = "below";
|
||||
}
|
||||
var replyPlacement = userDefaults["ReplyPlacement"];
|
||||
if ( typeof(replyPlacement) == "undefined" ) {
|
||||
replyPlacement = signaturePlacement;
|
||||
}
|
||||
|
||||
if ( replyPlacement == "above" ) {
|
||||
this.setCaretTo(0);
|
||||
}
|
||||
else {
|
||||
this.setCaretTo(this.getValue().length - signatureLength - 2);
|
||||
}
|
||||
|
||||
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 -*- */
|
||||
|
||||
function savePreferences(sender) {
|
||||
$("signaturePlacementList").disabled=false;
|
||||
$("mainForm").submit();
|
||||
|
||||
return false;
|
||||
|
@ -32,6 +33,19 @@ function initPreferences() {
|
|||
_setupEvents(true);
|
||||
if (typeof (initAdditionalPreferences) != "undefined")
|
||||
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);
|
||||
|
|
Loading…
Reference in New Issue