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 committed 2008-09-28 19:49:17 +00:00
1 parent 9edd16c0f4
commit a828b049de
17 files changed
+194 -10

No files matched your search

+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);
}
+14
View File
@@ -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);