Various improvements to the Preferences module

Monotone-Parent: f5af4bb05528ecf5545e12a51e343876ffad7270
Monotone-Revision: 997781056d484980738b11e151b8156a66f0998b

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2009-08-06T19:07:25
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle
2009-08-06 19:07:25 +00:00
parent 8bf4515d6f
commit c3ff1d6c6e
17 changed files with 119 additions and 53 deletions
+25 -16
View File
@@ -15,31 +15,29 @@ DIV#general LABEL
margin-left: 0px;
white-space: normal; }
DIV#mailOptionsView TEXTAREA
{ width: 420px;
height: 4em; }
DIV#passwordView
{ padding-top: 3em;
padding-right: 10em; }
DIV#identitiesView
{ padding-top: 5px;
padding-left: 5px; }
{ padding: 5px 5px 5px 0px;
overflow: hidden; }
#signature
{ overflow: auto;
width: 390px;
max-width: 390px;
height: 145px; }
TEXTAREA#signature
{ height: 100%;
width: 100%; }
TABLE#categoriesList
{ width: 95%; }
{ width: 100%; }
DIV#categoriesListWrapper
{ overflow:auto;
height:230px;
padding:2px; }
{ overflow: auto;
position: absolute;
bottom: 30px;
right: 0;
top: 8em;
left: 0;
padding: 2px; }
DIV.colorBox
{ border: 1px solid #333333;
@@ -55,4 +53,15 @@ TR._selected
{ background: #333333; }
TD.categoryListCell
{ -moz-user-select: none; }
{ -moz-user-select: none; }
DIV#windowButtons
{ position: fixed;
top: auto;
bottom: 0px;
left: 0px;
right: 25px;
height: 3.5em;
line-height: 2em;
vertical-align: middle;
text-align: right; }
+34 -26
View File
@@ -6,8 +6,9 @@ function savePreferences(sender) {
sigList.disabled=false;
serializeCategories (null);
$("mainForm").submit();
$("mainForm").submit();
return false;
}
@@ -27,7 +28,7 @@ function _setupEvents(enable) {
$("replyPlacementList").observe ("change", onReplyPlacementListChange);
$("composeMessagesType").observe ("change", onComposeMessagesTypeChange);
$("categoriesValue").value = "prout";
$("categoriesValue").value = "";
}
function onChoiceChanged(event) {
@@ -52,23 +53,21 @@ function initPreferences() {
for (var i=0; i<r.length; i++)
r[i].identify ();
table.multiselect = true;
TableKit.Resizable.init(table,
{'trueResize' : true, 'keepWidth' : true});
resetTableActions ();
$("categoryAdd").observe ("click", onCategoryAdd);
$("categoryDelete").observe ("click", onCategoryDelete);
}
function resetTableActions () {
function resetTableActions() {
var r = $$("TABLE#categoriesList tbody tr");
for (var i = 0; i < r.length; i++) {
var row = $(r[i]);
row.observe("mousedown", onRowClick);
var tds = row.childElements ();
var tds = row.childElements();
tds[0].observe("mousedown", endAllEditables);
tds[0].observe ("dblclick", onNameEdit);
tds[0].observe("dblclick", onNameEdit);
tds[1].observe("mousedown", endAllEditables);
tds[1].childElements ()[0].observe ("dblclick", onColorEdit);
tds[1].childElements()[0].observe ("dblclick", onColorEdit);
}
}
@@ -198,14 +197,15 @@ function serializeCategories (e) {
function resetCategoriesColors (e) {
var divs = $$("DIV.colorBox");
var divs = $$("TABLE#categoriesList DIV.colorBox");
for (var i = 0; i < divs.length; i++) {
var d = $(divs[i]);
var d = divs[i];
var color = d.innerHTML;
d.showColor = color;
d.style.background = color;
d.innerHTML = "&nbsp;";
if (color != "undefined")
d.setStyle({ backgroundColor: color });
d.update("&nbsp;");
}
}
@@ -220,32 +220,40 @@ function onReplyPlacementListChange() {
}
}
function onComposeMessagesTypeChange () {
function onComposeMessagesTypeChange(event) {
var textArea = $('signature');
var editor = $('cke_signature');
// Textmode
if ($("composeMessagesType").value == 0) {
textArea.style.height = "340px";
if (editor) {
CKEDITOR.instances.signature.removeListener ()
CKEDITOR.instances.signature.destroy (false);
CKEDITOR.instances.signature = null;
delete (CKEDITOR.instances.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(labels["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;
}
}
else {
if ($("composeMessagesType").value == 1) {
// HTML mode
CKEDITOR.replace('signature',
{
skin: "v2",
height: "280px",
resizable: CKEDITOR.DIALOG_RESIZE_NONE,
height: "290px",
toolbar :
[['Bold', 'Italic', '-', 'Link',
'Font','FontSize','-','TextColor',
'BGColor']
]
}
}
);
CKEDITOR.config.disableObjectResizing = true;
}
}
+8
View File
@@ -321,3 +321,11 @@ fieldset div, fieldset p
/* UIxMailEditor */
DIV#headerArea
{ padding-bottom: 0px; }
/* UIxPreferences */
TEXTAREA#signature
{ height: 33em;
overflow: auto; }
TABLE#categoriesList
{ width: auto; }