From a1c632977db512adc41add6d98ff0d25c9b91ed7 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Wed, 13 Jul 2011 16:05:30 +0000 Subject: [PATCH] See ChangeLog Monotone-Parent: 60d25b994a09cdf59d84fc33832800e5bd16d86b Monotone-Revision: cebbcbb7b32260bef20a831948eb14c29f494552 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2011-07-13T16:05:30 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 9 ++++ SoObjects/Contacts/SOGoContactSourceFolder.m | 12 ++++- UI/WebServerResources/ContactsUI.js | 3 +- UI/WebServerResources/generic.css | 2 +- UI/WebServerResources/generic.js | 52 +++++++++++++------- 5 files changed, 54 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4b3339752..79dded8f2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2011-07-13 Francis Lachapelle + + * SoObjects/Contacts/SOGoContactSourceFolder.m + (-_flattenedRecord:): added c_component key so the proper icon + appears beside entries in the Web interface. + + * UI/WebServerResources/generic.js (_showAlertDialog): added fade + effect when showing or hiding a dialog box. + 2011-07-12 Francis Lachapelle * UI/MailerUI/UIxMailFolderActions.m (-batchDeleteAction): we diff --git a/SoObjects/Contacts/SOGoContactSourceFolder.m b/SoObjects/Contacts/SOGoContactSourceFolder.m index 81edfc550..0947aac6f 100644 --- a/SoObjects/Contacts/SOGoContactSourceFolder.m +++ b/SoObjects/Contacts/SOGoContactSourceFolder.m @@ -204,8 +204,16 @@ // it's set. data = [oldRecord objectForKey: @"isGroup"]; if (data) - [newRecord setObject: data forKey: @"isGroup"]; - + { + [newRecord setObject: data forKey: @"isGroup"]; + [newRecord setObject: @"vlist" forKey: @"c_component"]; + } +#warning TODO: create a custom icon for resources + else + { + [newRecord setObject: @"vcard" forKey: @"c_component"]; + } + data = [oldRecord objectForKey: @"c_info"]; if ([data length] > 0) [newRecord setObject: data forKey: @"contactInfo"]; diff --git a/UI/WebServerResources/ContactsUI.js b/UI/WebServerResources/ContactsUI.js index b89242493..37d923ae8 100644 --- a/UI/WebServerResources/ContactsUI.js +++ b/UI/WebServerResources/ContactsUI.js @@ -497,6 +497,7 @@ function onToolbarDeleteSelectedContacts(event) { } function onToolbarDeleteSelectedContactsConfirm(dialogId) { + disposeDialog(); var contactsList = $('contactsList'); var rows = contactsList.getSelectedRowsId(); for (var i = 0; i < rows.length; i++) { @@ -510,8 +511,6 @@ function onToolbarDeleteSelectedContactsConfirm(dialogId) { triggerAjaxRequest(urlstr, onContactDeleteEventCallback, rows[i]); } - - disposeDialog(); } function onContactDeleteEventCallback(http) { diff --git a/UI/WebServerResources/generic.css b/UI/WebServerResources/generic.css index ab675cca3..62e0f4722 100644 --- a/UI/WebServerResources/generic.css +++ b/UI/WebServerResources/generic.css @@ -841,7 +841,7 @@ DIV.tabsContainer > UL LI.active SPAN { background: transparent url('tab_span_active_bg.png') no-repeat !important; } DIV.tabsContainer > UL LI.first { margin-left: -1px; - padding-left: -1px; } + padding-left: -1px; } /* Firefox will complain */ DIV.tabsContainer > DIV.tabs { position: absolute; diff --git a/UI/WebServerResources/generic.js b/UI/WebServerResources/generic.js index c803eea32..d37532b50 100644 --- a/UI/WebServerResources/generic.js +++ b/UI/WebServerResources/generic.js @@ -555,6 +555,7 @@ function onRowClick(event, target) { if (node.tagName == 'TD') { node = node.parentNode; // select TR } + if (node.tagName == 'TR') { var head = $(node).up('table').down('thead'); rowIndex = node.rowIndex; @@ -955,9 +956,6 @@ function setSearchCriteria(event) { var searchValue = $("searchValue"); var searchCriteria = $("searchCriteria"); - if (searchValue.ghostPhrase == searchValue.value) - searchValue.value = this.innerHTML; - searchValue.ghostPhrase = this.innerHTML; searchCriteria.value = this.getAttribute('id'); @@ -965,6 +963,8 @@ function setSearchCriteria(event) { this.parentNode.chosenNode.removeClassName("_chosen"); this.addClassName("_chosen"); + searchValue.focus(); + if (this.parentNode.chosenNode != this) { searchValue.lastSearch = ""; this.parentNode.chosenNode = this; @@ -1009,8 +1009,7 @@ function onSearchFocus(event) { } else { this.selectElement(); } - - this.setStyle({ color: "#535D6D" }); + this.setStyle({ color: "#262B33" }); } function onSearchBlur(event) { @@ -1030,7 +1029,7 @@ function onSearchBlur(event) { this.setStyle({ color: "#909090" }); } else { this.setAttribute("modified", "yes"); - this.setStyle({ color: "#535D6D" }); + this.setStyle({ color: "#262B33" }); } } @@ -1802,12 +1801,11 @@ function createButton(id, caption, action) { function showAlertDialog(label) { var div = $("bgDialogDiv"); - if (div && div.visible()) { + if (div && div.visible() && div.getOpacity() > 0) { dialogsStack.push(label); } - else { + else _showAlertDialog(label); - } } function _showAlertDialog(label) { @@ -1828,7 +1826,7 @@ function _showAlertDialog(label) { document.body.appendChild(dialog); dialogs[label] = dialog; } - dialog.show(); + dialog.appear({ duration: 0.2 }); } function showConfirmDialog(title, label, callbackYes, callbackNo) { @@ -1858,7 +1856,7 @@ function showConfirmDialog(title, label, callbackYes, callbackNo) { document.body.appendChild(dialog); dialogs[key] = dialog; } - dialog.show(); + dialog.appear({ duration: 0.2 }); } function showPromptDialog(title, label, callback, defaultValue) { @@ -1889,23 +1887,39 @@ function showPromptDialog(title, label, callback, defaultValue) { document.body.appendChild(dialog); dialogs[title+label] = dialog; } - dialog.show(); + dialog.appear({ duration: 0.2 }); dialog.down("input").focus(); } function disposeDialog() { $$("DIV.dialog").each(function(div) { - if (div.visible()) - div.hide(); - }); - + if (div.visible() && div.getOpacity() == 1) + div.fade({ duration: 0.2 }); + }); if (dialogsStack.length > 0) { + // Show the next dialog box var label = dialogsStack.first(); dialogsStack.splice(0, 1); - _showAlertDialog.delay(0.1, label); + _showAlertDialog.delay(0.2, label); + } + else { + var bgFade = Effect.Fade('bgDialogDiv', { duration: 0.2 }); + // By the end the background fade out, a new dialog + // may need to be displayed. + _disposeDialog.delay(0.1, bgFade); + } +} + +function _disposeDialog(bgEffect) { + if (dialogsStack.length) { + var div = $("bgDialogDiv"); + bgEffect.cancel(); + div.show(); + div.appear({ duration: 0.2, to: 0.3 }); + var label = dialogsStack.first(); + dialogsStack.splice(0, 1); + _showAlertDialog(label); } - else - $("bgDialogDiv").hide(); } function readCookie(name) {