mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-22 11:55:24 +00:00
Monotone-Parent: 9adf735e0d77302071b7cf3311f5304804b3927f
Monotone-Revision: 4fca67487156a8b01b5ee792e06e1df078519437 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-03-08T16:40:18 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -76,20 +76,6 @@ function prototypeIfyFilters() {
|
||||
}
|
||||
|
||||
function _setupEvents(enable) {
|
||||
var widgets = [ "timezone", "shortDateFormat", "longDateFormat",
|
||||
"timeFormat", "weekStartDay", "dayStartTime", "dayEndTime",
|
||||
"firstWeek", "messageCheck", "subscribedFoldersOnly",
|
||||
"language"];
|
||||
for (var i = 0; i < widgets.length; i++) {
|
||||
var widget = $(widgets[i]);
|
||||
if (widget) {
|
||||
if (enable)
|
||||
widget.observe("change", onChoiceChanged);
|
||||
else
|
||||
widget.stopObserving("change", onChoiceChanged);
|
||||
}
|
||||
}
|
||||
|
||||
$("replyPlacementList").observe ("change", onReplyPlacementListChange);
|
||||
$("composeMessagesType").observe ("change", onComposeMessagesTypeChange);
|
||||
|
||||
@@ -98,13 +84,6 @@ function _setupEvents(enable) {
|
||||
categoriesValue.value = "";
|
||||
}
|
||||
|
||||
function onChoiceChanged(event) {
|
||||
var hasChanged = $("hasChanged");
|
||||
hasChanged.value = "1";
|
||||
|
||||
_setupEvents(false);
|
||||
}
|
||||
|
||||
function addDefaultEmailAddresses(event) {
|
||||
var defaultAddresses = $("defaultEmailAddresses").value.split(/, */);
|
||||
var addresses = $("autoReplyEmailAddresses").value.trim();
|
||||
@@ -522,36 +501,32 @@ function onReplyPlacementListChange() {
|
||||
}
|
||||
|
||||
function onComposeMessagesTypeChange(event) {
|
||||
var textArea = $('signature');
|
||||
|
||||
if (event) {
|
||||
// Due to a limitation of CKEDITOR, we reload the page when the user
|
||||
// changes the composition mode to avoid Javascript errors.
|
||||
var saveAndReload = confirm(getLabel("composeMessageChanged"));
|
||||
if (saveAndReload)
|
||||
return savePreferences();
|
||||
else {
|
||||
// Restore previous value of composeMessagesType
|
||||
$("composeMessagesType").stopObserving("change", onComposeMessagesTypeChange);
|
||||
$("composeMessagesType").value = ((Event.element(event).value == 1)?"0":"1");
|
||||
Event.element(event).blur();
|
||||
$("composeMessagesType").observe("change", onComposeMessagesTypeChange);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// var textArea = $('signature');
|
||||
|
||||
if ($("composeMessagesType").value == 1) {
|
||||
// HTML mode
|
||||
CKEDITOR.replace('signature',
|
||||
{
|
||||
height: "290px",
|
||||
toolbar :
|
||||
[['Bold', 'Italic', '-', 'Link',
|
||||
'Font','FontSize','-','TextColor',
|
||||
'BGColor']
|
||||
]
|
||||
}
|
||||
);
|
||||
if ($("composeMessagesType").value == 0) /* text */ {
|
||||
if (CKEDITOR.instances["signature"]) {
|
||||
var content = CKEDITOR.instances["signature"].getData();
|
||||
var htmlEditorWidget = $('cke_signature');
|
||||
htmlEditorWidget.parentNode.removeChild(htmlEditorWidget);
|
||||
delete CKEDITOR.instances["signature"];
|
||||
var textArea = $("signature");
|
||||
textArea.value = content;
|
||||
textArea.style.display = "";
|
||||
textArea.style.visibility = "";
|
||||
}
|
||||
} else {
|
||||
if (!CKEDITOR.instances["signature"]) {
|
||||
CKEDITOR.replace('signature',
|
||||
{
|
||||
height: "290px",
|
||||
toolbar :
|
||||
[['Bold', 'Italic', '-', 'Link',
|
||||
'Font','FontSize','-','TextColor',
|
||||
'BGColor']
|
||||
]
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user