HTML Composing, see changelog

Monotone-Parent: b895c283a3da52c67fd91339f704dc8cd49b743f
Monotone-Revision: 5f0e6bd5b6298ffdd908398135216841ba3b6909

Monotone-Author: crobert@inverse.ca
Monotone-Date: 2009-06-23T17:53:18
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
C Robert
2009-06-23 17:53:18 +00:00
parent 445224aa8f
commit f9337f183f
13 changed files with 236 additions and 113 deletions
+1
View File
@@ -12,6 +12,7 @@ install ::
else \
mkdir -p $(SOGO_WEBSERVERRESOURCESDIR); \
cp $(WEBSERVER_RESOURCE_FILES) $(SOGO_WEBSERVERRESOURCESDIR); \
cp -r fckeditor $(SOGO_WEBSERVERRESOURCESDIR); \
fi
clean ::
+17 -1
View File
@@ -570,6 +570,15 @@ function initMailEditor() {
focusField.focus();
initializePriorityMenu();
var composeMode = UserDefaults["ComposeMessagesType"];
if (composeMode == "html") {
var oFCKeditor = new FCKeditor ('text');
oFCKeditor.BasePath = "/SOGo.woa/WebServerResources/fckeditor/";
oFCKeditor.ToolbarSet = 'Basic';
oFCKeditor.ReplaceTextarea ();
}
onWindowResize (null);
}
function initializePriorityMenu() {
@@ -720,7 +729,14 @@ function onWindowResize(event) {
textarea.setStyle({ 'top': hr.offsetTop + 'px' });
// Resize the textarea (message content)
textarea.rows = Math.floor((window.height() - textarea.offsetTop) / rowheight);
var composeMode = UserDefaults["ComposeMessagesType"];
if (composeMode == "html") {
var editor = $('text___Frame');
editor.height = Math.floor(window.height() - editor.offsetTop) + "px";
editor.style.height = Math.floor(window.height() - editor.offsetTop) + "px";
editor.setStyle({ 'top': hr.offsetTop + 'px' });
}
textarea.rows = Math.floor((window.height() - textarea.offsetTop) / rowheight);
}
function onMailEditorClose(event) {
+32 -1
View File
@@ -33,8 +33,22 @@ function initPreferences() {
_setupEvents(true);
if (typeof (initAdditionalPreferences) != "undefined")
initAdditionalPreferences();
$("replyPlacementList").observe("change", onReplyPlacementListChange);
$("replyPlacementList").observe ("change", onReplyPlacementListChange);
onReplyPlacementListChange();
var oFCKeditor = new FCKeditor ('signature');
oFCKeditor.BasePath = "/SOGo.woa/WebServerResources/fckeditor/";
oFCKeditor.ToolbarSet = 'Basic';
oFCKeditor.ReplaceTextarea ();
$('signature___Frame').style.height = "150px";
$('signature___Frame').height = "150px";
if (UserDefaults["ComposeMessagesType"] != "html") {
$("signature").style.display = 'inline';
$('signature___Frame').style.display = 'none';
}
$("composeMessagesType").observe ("change", onComposeMessagesTypeChange);
}
function onReplyPlacementListChange() {
@@ -48,4 +62,21 @@ function onReplyPlacementListChange() {
}
}
function onComposeMessagesTypeChange () {
var textArea = $('signature');
var oEditor = FCKeditorAPI.GetInstance('signature');
var editor = $('signature___Frame');
if ($("composeMessagesType").value == 0) {
textArea.style.display = 'inline';
editor.style.display = 'none';
textArea.value = oEditor.GetData();
}
else {
textArea.style.display = 'none';
editor.style.display = '';
oEditor.SetHTML(textArea.value);
}
}
document.observe("dom:loaded", initPreferences);