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.sogo
This commit is contained in:
C Robert
2008-09-28 19:49:17 +00:00
parent 9edd16c0f4
commit a828b049de
17 changed files with 194 additions and 10 deletions
+16 -8
View File
@@ -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);
}