From 3fb11fade34fa870f7b01b9334b3ffeb61799dc4 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 13 Sep 2006 21:23:44 +0000 Subject: [PATCH] Monotone-Parent: d3d13025350af6364527c65ace59ad308e3e8ffe Monotone-Revision: 448455bad9d5f72d9a932fd3427bd756cb54e81c Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-09-13T21:23:44 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 5 ++ UI/WebServerResources/ContactsUI.css | 74 +++++++++++++++++++++++++- UI/WebServerResources/ContactsUI.js | 79 +++++++++++----------------- 3 files changed, 107 insertions(+), 51 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7e1d24b41..83c07fd99 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-09-13 Wolfgang Sourdeau + + * UI/WebServerResources/ContactsUI.js: added code to download card + views and display them beneath the list. + 2006-09-08 Wolfgang Sourdeau * SoObjects/SOGo/SOGoObject.m ([SOGoObject -userTimeZone]): retain diff --git a/UI/WebServerResources/ContactsUI.css b/UI/WebServerResources/ContactsUI.css index 357543a64..f390b03d0 100644 --- a/UI/WebServerResources/ContactsUI.css +++ b/UI/WebServerResources/ContactsUI.css @@ -24,13 +24,17 @@ DIV#contactsListContent { position: absolute; left: 15em; - top: 5.5em; + top: 7.5em; right: 0px; - bottom: 0px; border: 0px dashed #f00; margin: 0px; padding: 0px; overflow: hidden; + position: absolute; + background: #fff; + width: 100%; + height: 15.7em; + overflow: auto; } DIV#mailboxContent @@ -315,6 +319,7 @@ TABLE#contactsList TD TABLE#contactsList TD IMG { + vertical-align: middle; margin-left: 1em; margin-right: .2em; } @@ -330,6 +335,59 @@ TABLE#contactsList TR._deleted TD text-decoration: line-through; } +DIV#rightDragHandle +{ + cursor: n-resize; + top: 23em; + left: 15em; + right: 0px; + height: 5px; +} + +DIV#contactView +{ + position: absolute; + background: #fff; + padding: .5em; + top: 23.5em; + left: 15em; + bottom: 0em; + width: 100%; + overflow: hidden; + border-top: 1px solid #aaa; + border-left: 1px solid #aaa; + line-height: 1em; +} + +DIV#contactView H3.contactCardTitle +{ display: block; + margin: .2em 0px; + font-size: large; + font-weight: bold; + width: 100%; + text-decoration: underline; } + +DIV.contactColumn +{ + width: 38%; + padding: .5em; + float: left; +} + +DIV.contactColumn DIV +{ margin-bottom: 1em; } + +DIV.contactColumn H4 +{ + margin: .2em 0px; + margin-left: -.5em; + font-weight: bold; + color: #fff; + background: #4b6983; + width: 100%; + padding: .1em .2em; +} + INPUT#searchValue:focus { color: #000; } @@ -352,6 +410,18 @@ DIV#mailboxDragHandle height: .4em; } +DIV#calendarView +{ + position: absolute; + background: #fff; + top: 18em; + bottom: 0px; + width: 100%; + overflow: hidden; + border-top: 1px solid #aaa; + border-left: 1px solid #aaa; +} + DIV.contactSelector { position: absolute; diff --git a/UI/WebServerResources/ContactsUI.js b/UI/WebServerResources/ContactsUI.js index 0da22333e..17ccee840 100644 --- a/UI/WebServerResources/ContactsUI.js +++ b/UI/WebServerResources/ContactsUI.js @@ -51,7 +51,8 @@ function openContactWindow(sender, contactuid, url) { function clickedUid(sender, contactuid) { resetSelection(window); openContactWindow(sender, contactuid, - ApplicationBaseURL + currentContactFolder + "/" + contactuid + "/view"); + ApplicationBaseURL + currentContactFolder + + "/" + contactuid + "/edit"); return true; } @@ -264,7 +265,7 @@ function onContactContextMenu(event, element) var selectedNodes = topNode.getSelectedRows(); topNode.menuSelectedRows = selectedNodes; for (var i = 0; i < selectedNodes.length; i++) - deselectNode(selectedNode); + deselectNode(selectedNodes[i]); topNode.menuSelectedEntry = element; selectNode(element); } @@ -338,62 +339,30 @@ function storeCachedMessage(cachedContact) cachedContacts[oldest] = cachedContact; } -function onMessageSelectionChange() +function loadContact(idx) { - var contactsList = document.getElementById('contactsList'); - - var selection = contactsList.getSelectedRowsId(); - if (selection.length == 1) - { - var idx = selection[0]; - - if (currentMessages[currentContactFolder] != idx) { - currentMessages[currentContactFolder] = idx; - loadMessage(idx); - } - } -} - -function loadMessage(idx) -{ - var cachedContact = getCachedMessage(idx); - - if (document.messageAjaxRequest) { - document.messageAjaxRequest.aborted = true; - document.messageAjaxRequest.abort(); + if (document.contactAjaxRequest) { + document.contactAjaxRequest.aborted = true; + document.contactAjaxRequest.abort(); } - if (cachedContact == null) { - var url = (ApplicationBaseURL + currentContactFolder + "/" - + idx + "/view?noframe=1"); - document.messageAjaxRequest - = triggerAjaxRequest(url, messageCallback, idx); - markMailInWindow(window, idx, true); - } else { - var div = document.getElementById('messageContent'); - div.innerHTML = cachedContact['text']; - cachedContact['time'] = (new Date()).getTime(); - document.messageAjaxRequest = null; - } + var url = (ApplicationBaseURL + currentContactFolder + "/" + + idx + "/view?noframe=1"); + log ("url: " + url); + document.contactAjaxRequest + = triggerAjaxRequest(url, contactLoadCallback, idx); } -function messageCallback(http) +function contactLoadCallback(http) { - var div = document.getElementById('messageContent'); + var div = $('contactView'); + log ("div: " + div); + log ("http: " + http.status); if (http.readyState == 4 && http.status == 200) { - document.messageAjaxRequest = null; + document.contactAjaxRequest = null; div.innerHTML = http.responseText; - - if (http.callbackData) { - var cachedContact = new Array(); - cachedContact['idx'] = currentContactFolder + '/' + http.callbackData; - cachedContact['time'] = (new Date()).getTime(); - cachedContact['text'] = http.responseText; - if (cachedContact['text'].length < 30000) - storeCachedMessage(cachedContact); - } } else log ("ajax fuckage"); @@ -429,13 +398,25 @@ function moveTo(uri) { } /* contact menu entries */ +function onContactRowClick(event, node) +{ + var contactId = node.getAttribute('id'); + + loadContact(contactId); + log ("clicked contact: " + contactId); +// changeCalendarDisplay(day); +// changeDateSelectorDisplay(day); + + return onRowClick(event); +} + function onContactRowDblClick(event, node) { var contactId = node.getAttribute('id'); openContactWindow(null, contactId, ApplicationBaseURL + currentContactFolder - + "/" + contactId + "/view"); + + "/" + contactId + "/edit"); return false; }