From d0499620df5d5cefd1d8a5a180faee1ed48547a9 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Mon, 14 Aug 2006 20:31:49 +0000 Subject: [PATCH] Monotone-Parent: edc1f01e5cb91e7694dd281ec3e06bcfd9a3c5f1 Monotone-Revision: 29276051aae3738adb5fbfa6b52ffbc6eb8f3968 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-08-14T20:31:49 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 3 ++ UI/WebServerResources/generic.js | 48 +++++++++++++++++++++++++++++++- 2 files changed, 50 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e392f283f..82939a78e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2006-08-14 Wolfgang Sourdeau + * UI/WebServerResources/generic.js: added code to manage contact + lists through the new implementation of the UIxContactSelector. + * UI/Templates: put the templates related to SchedulerUI in its own directory. diff --git a/UI/WebServerResources/generic.js b/UI/WebServerResources/generic.js index f1b71d451..20e72b56d 100644 --- a/UI/WebServerResources/generic.js +++ b/UI/WebServerResources/generic.js @@ -478,7 +478,7 @@ function onMenuEntryClick(event, menuId) function initLogConsole() { logConsole = document.getElementById('logConsole'); - logConsole.innerHTML = ''; + logConsole.innerHTML = 'X'; } function toggleLogConsole() { @@ -697,3 +697,49 @@ function dragHandleDoubleClick(event) { } } } + +/* contact selector */ + +function onContactSelectorPopup(node) +{ + var contactSelectorId = node.parentNode.getAttribute("id"); + + urlstr = ApplicationBaseURL + "../../" + UserLogin + "/Contacts/select?selectorId=" + contactSelectorId; + var w = window.open(urlstr, "Addressbook", + "width=640,height=400,left=10,top=10,toolbar=no," + + "dependent=yes,menubar=no,location=no,resizable=yes," + + "scrollbars=yes,directories=no,status=no"); + w.focus(); + + return false; +} + +function addContact(selectorId, contactId, contactName) +{ + var uids = document.getElementById('uixselector-' + selectorId + + '-uidList'); + log ("contactId: " + contactId); + if (contactId) + { + var re = new RegExp("(^|,)" + contactId + "($|,)"); + + if (!re.test(uids.value)) + { + log ("no match... realling adding"); + if (uids.value.length > 0) + uids.value += ',' + contactId; + else + uids.value = contactId; + + log ('values: ' + uids.value); + var names = document.getElementById('uixselector-' + selectorId + + '-display'); + names.innerHTML += ('' + + contactName + '
'); + } + else + log ("match... ignoring contact"); + } + + return false; +}