From c3ff1d6c6e8aed153b11739043d980b594489daa Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Thu, 6 Aug 2009 19:07:25 +0000 Subject: [PATCH] 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 --- ChangeLog | 7 +++ .../Localizable.strings | 2 + .../Czech.lproj/Localizable.strings | 2 + .../Dutch.lproj/Localizable.strings | 2 + .../English.lproj/Localizable.strings | 3 + .../French.lproj/Localizable.strings | 2 + .../German.lproj/Localizable.strings | 2 + .../Hungarian.lproj/Localizable.strings | 2 + .../Italian.lproj/Localizable.strings | 2 + .../Spanish.lproj/Localizable.strings | 2 + UI/PreferencesUI/UIxPreferences.h | 2 +- UI/PreferencesUI/UIxPreferences.m | 22 +++++-- .../Welsh.lproj/Localizable.strings | 2 + UI/Templates/PreferencesUI/UIxPreferences.wox | 11 ++-- UI/WebServerResources/UIxPreferences.css | 41 ++++++++----- UI/WebServerResources/UIxPreferences.js | 60 +++++++++++-------- UI/WebServerResources/iefixes.css | 8 +++ 17 files changed, 119 insertions(+), 53 deletions(-) diff --git a/ChangeLog b/ChangeLog index f901159d8..617ec7527 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-08-06 Francis Lachapelle + + * 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 * SoObjects/SOGo/SOGoGCSFolder.m (-davSyncCollection): enhanced to diff --git a/UI/PreferencesUI/BrazilianPortuguese.lproj/Localizable.strings b/UI/PreferencesUI/BrazilianPortuguese.lproj/Localizable.strings index 5884e12a6..36b0f39bf 100755 --- a/UI/PreferencesUI/BrazilianPortuguese.lproj/Localizable.strings +++ b/UI/PreferencesUI/BrazilianPortuguese.lproj/Localizable.strings @@ -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"; diff --git a/UI/PreferencesUI/Czech.lproj/Localizable.strings b/UI/PreferencesUI/Czech.lproj/Localizable.strings index f984ab16f..244010f9c 100755 --- a/UI/PreferencesUI/Czech.lproj/Localizable.strings +++ b/UI/PreferencesUI/Czech.lproj/Localizable.strings @@ -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"; diff --git a/UI/PreferencesUI/Dutch.lproj/Localizable.strings b/UI/PreferencesUI/Dutch.lproj/Localizable.strings index 67adad840..63c2930f0 100644 --- a/UI/PreferencesUI/Dutch.lproj/Localizable.strings +++ b/UI/PreferencesUI/Dutch.lproj/Localizable.strings @@ -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"; diff --git a/UI/PreferencesUI/English.lproj/Localizable.strings b/UI/PreferencesUI/English.lproj/Localizable.strings index e0cf07586..c249357c2 100644 --- a/UI/PreferencesUI/English.lproj/Localizable.strings +++ b/UI/PreferencesUI/English.lproj/Localizable.strings @@ -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"; diff --git a/UI/PreferencesUI/French.lproj/Localizable.strings b/UI/PreferencesUI/French.lproj/Localizable.strings index c4f2591fb..83d414975 100644 --- a/UI/PreferencesUI/French.lproj/Localizable.strings +++ b/UI/PreferencesUI/French.lproj/Localizable.strings @@ -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"; diff --git a/UI/PreferencesUI/German.lproj/Localizable.strings b/UI/PreferencesUI/German.lproj/Localizable.strings index 36b31c80a..c7f0a2575 100644 --- a/UI/PreferencesUI/German.lproj/Localizable.strings +++ b/UI/PreferencesUI/German.lproj/Localizable.strings @@ -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"; diff --git a/UI/PreferencesUI/Hungarian.lproj/Localizable.strings b/UI/PreferencesUI/Hungarian.lproj/Localizable.strings index a68db4d05..a58edc25c 100644 --- a/UI/PreferencesUI/Hungarian.lproj/Localizable.strings +++ b/UI/PreferencesUI/Hungarian.lproj/Localizable.strings @@ -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"; diff --git a/UI/PreferencesUI/Italian.lproj/Localizable.strings b/UI/PreferencesUI/Italian.lproj/Localizable.strings index bbcc57134..19d4a44d1 100644 --- a/UI/PreferencesUI/Italian.lproj/Localizable.strings +++ b/UI/PreferencesUI/Italian.lproj/Localizable.strings @@ -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"; diff --git a/UI/PreferencesUI/Spanish.lproj/Localizable.strings b/UI/PreferencesUI/Spanish.lproj/Localizable.strings index 8f0541c13..2470d62b6 100644 --- a/UI/PreferencesUI/Spanish.lproj/Localizable.strings +++ b/UI/PreferencesUI/Spanish.lproj/Localizable.strings @@ -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"; diff --git a/UI/PreferencesUI/UIxPreferences.h b/UI/PreferencesUI/UIxPreferences.h index 745f5605b..2b916749b 100644 --- a/UI/PreferencesUI/UIxPreferences.h +++ b/UI/PreferencesUI/UIxPreferences.h @@ -39,7 +39,7 @@ NSCalendarDate *today; NSMutableArray *hours; NSArray *daysOfWeek; - BOOL hasChanged; + BOOL hasChanged, composeMessageTypeHasChanged; } @end diff --git a/UI/PreferencesUI/UIxPreferences.m b/UI/PreferencesUI/UIxPreferences.m index 40d980f38..704dec599 100644 --- a/UI/PreferencesUI/UIxPreferences.m +++ b/UI/PreferencesUI/UIxPreferences.m @@ -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; diff --git a/UI/PreferencesUI/Welsh.lproj/Localizable.strings b/UI/PreferencesUI/Welsh.lproj/Localizable.strings index 7df70137e..7580cd5ed 100644 --- a/UI/PreferencesUI/Welsh.lproj/Localizable.strings +++ b/UI/PreferencesUI/Welsh.lproj/Localizable.strings @@ -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"; diff --git a/UI/Templates/PreferencesUI/UIxPreferences.wox b/UI/Templates/PreferencesUI/UIxPreferences.wox index 8742f0c01..01bba48f6 100644 --- a/UI/Templates/PreferencesUI/UIxPreferences.wox +++ b/UI/Templates/PreferencesUI/UIxPreferences.wox @@ -105,11 +105,12 @@ -
- - +
+ + +
diff --git a/UI/WebServerResources/UIxPreferences.css b/UI/WebServerResources/UIxPreferences.css index 887f9cab3..d7e43a18e 100644 --- a/UI/WebServerResources/UIxPreferences.css +++ b/UI/WebServerResources/UIxPreferences.css @@ -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; } \ No newline at end of file +{ -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; } \ No newline at end of file diff --git a/UI/WebServerResources/UIxPreferences.js b/UI/WebServerResources/UIxPreferences.js index 92dc6498e..b4fbf5ee5 100644 --- a/UI/WebServerResources/UIxPreferences.js +++ b/UI/WebServerResources/UIxPreferences.js @@ -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