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
maint-2.0.2
Francis Lachapelle 2009-08-06 19:07:25 +00:00
parent 8bf4515d6f
commit c3ff1d6c6e
17 changed files with 119 additions and 53 deletions

View File

@ -1,3 +1,10 @@
2009-08-06 Francis Lachapelle <flachapelle@inverse.ca>
* UI/PreferencesUI/UIxPreferences.m ([UIxPreferences
-defaultAction]): if the compose message type (HTML or plain text)
has changed, reload the page (don't close it). This is a fix for a
bug with disabling or enabling the CKEDITOR dynamically (in JavaScript).
2009-08-05 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/SOGo/SOGoGCSFolder.m (-davSyncCollection): enhanced to

View File

@ -97,6 +97,8 @@
"signatureplacement_above" = "abaixo da minha resposta";
"signatureplacement_below" = "abaixo da citação";
"composeMessageChanged" = "Changing your messages composition type requires to save your preferences immediately. Continue?";
/* Additional Parameters */
"Additional Parameters" = "Parâmetros Adicionais";

View File

@ -97,6 +97,8 @@
"signatureplacement_above" = "pod odpověď";
"signatureplacement_below" = "pod citaci";
"composeMessageChanged" = "Changing your messages composition type requires to save your preferences immediately. Continue?";
/* Additional Parameters */
"Additional Parameters" = "Dodatečné parametry";

View File

@ -97,6 +97,8 @@
"composemessagestype_html" = "HTML";
"composemessagestype_text" = "Plain text";
"composeMessageChanged" = "Changing your messages composition type requires to save your preferences immediately. Continue?";
/* Additional Parameters */
"Additional Parameters" = "Extra Parameters";

View File

@ -88,6 +88,7 @@
"messageforward_inline" = "Inline";
"messageforward_attached" = "As Attachment";
/* Identities */
"Default identity:" = "Default identity:";
"Manage identities..." = "Manage identities...";
"Signature" = "Signature";
@ -100,6 +101,8 @@
"composemessagestype_html" = "HTML";
"composemessagestype_text" = "Plain text";
"composeMessageChanged" = "Changing your messages composition type requires to save your preferences immediately. Continue?";
/* Additional Parameters */
"Additional Parameters" = "Additional Parameters";

View File

@ -98,6 +98,8 @@
"composemessagestype_html" = "HTML";
"composemessagestype_text" = "Texte";
"composeMessageChanged" = "Changer la composition des messages nécessite d'enregistrer immédiatement vos préférences. Voulez-vous continuez?";
/* Additional Parameters */
"Additional Parameters" = "Paramètres supplémentaires";

View File

@ -98,6 +98,8 @@
"composemessagestype_html" = "HTML";
"composemessagestype_text" = "Plain text";
"composeMessageChanged" = "Changing your messages composition type requires to save your preferences immediately. Continue?";
/* Additional Parameters */
"Additional Parameters" = "Zusätzliche Einstellungen";

View File

@ -95,6 +95,8 @@
"composemessagestype_html" = "HTML";
"composemessagestype_text" = "Egyszerű szöveg";
"composeMessageChanged" = "Changing your messages composition type requires to save your preferences immediately. Continue?";
/* Additional Parameters */
"Additional Parameters" = "További beállítások";

View File

@ -98,6 +98,8 @@
"composemessagestype_html" = "HTML";
"composemessagestype_text" = "Plain text";
"composeMessageChanged" = "Changing your messages composition type requires to save your preferences immediately. Continue?";
/* Additional Parameters */
"Additional Parameters" = "Parametri addizionali";

View File

@ -109,6 +109,8 @@
"composemessagestype_html" = "HTML";
"composemessagestype_text" = "Plain text";
"composeMessageChanged" = "Changing your messages composition type requires to save your preferences immediately. Continue?";
/* Additional Parameters */
"Additional Parameters" = "Additional Parameters";

View File

@ -39,7 +39,7 @@
NSCalendarDate *today;
NSMutableArray *hours;
NSArray *daysOfWeek;
BOOL hasChanged;
BOOL hasChanged, composeMessageTypeHasChanged;
}
@end

View File

@ -87,6 +87,7 @@ static BOOL defaultShowSubscribedFoldersOnly = NO;
ASSIGN (daysOfWeek,
[locale objectForKey: NSWeekDayNameArray]);
hasChanged = NO;
composeMessageTypeHasChanged = NO;
}
return self;
@ -633,7 +634,11 @@ static BOOL defaultShowSubscribedFoldersOnly = NO;
- (void) setUserComposeMessagesType: (NSString *) newType
{
[userDefaults setObject: newType forKey: @"ComposeMessagesType"];
if (![[self userComposeMessagesType] isEqualToString: newType])
{
composeMessageTypeHasChanged = YES;
[userDefaults setObject: newType forKey: @"ComposeMessagesType"];
}
}
@ -652,11 +657,18 @@ static BOOL defaultShowSubscribedFoldersOnly = NO;
if ([[request method] isEqualToString: @"POST"])
{
[userDefaults synchronize];
if (hasChanged)
method = @"window.location.reload()";
if (composeMessageTypeHasChanged)
// Due to a limitation of CKEDITOR, we reload the page when the user
// changes the composition mode to avoid Javascript errors.
results = self;
else
method = nil;
results = [self jsCloseWithRefreshMethod: method];
{
if (hasChanged)
method = @"window.location.reload()";
else
method = nil;
results = [self jsCloseWithRefreshMethod: method];
}
}
else
results = self;

View File

@ -100,6 +100,8 @@
"composemessagestype_html" = "HTML";
"composemessagestype_text" = "Plain text";
"composeMessageChanged" = "Changing your messages composition type requires to save your preferences immediately. Continue?";
/* Additional Parameters */
"Additional Parameters" = "Additional Parameters";

View File

@ -105,11 +105,12 @@
</table></div>
<input type="hidden" const:id="categoriesValue"
const:name="categoriesValue" var:value="categoriesValue"/>
<br/>
<label><input type="button" class="button"
id="categoryAdd" label:value="Add"/></label>
<label><input type="button" class="button"
id="categoryDelete" label:value="Delete"/></label>
<div id="windowButtons">
<label><input type="button" class="button"
id="categoryAdd" label:value="Add"/></label>
<label><input type="button" class="button"
id="categoryDelete" label:value="Delete"/></label>
</div>
<!-- <br/> -->
<!-- <label><input class="checkBox" -->
<!-- type="checkbox" var:selection="reminderEnabled" -->

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; }

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;
}
}

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; }