diff --git a/ChangeLog b/ChangeLog index dd1fbe1a2..9ce06de95 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2006-08-30 Wolfgang Sourdeau + * UI/WebServerResources/generic.js: adapted code for the new + implementation of the UIxContactSelector component (added a + "remove" button, removed the previous INPUT and replaced them with + links of class "button"). + * UI/Scheduler/UIxTimeDateControl.h: separated interface from UIxTimeDateControl.m. diff --git a/UI/Templates/ContactsUI/UIxContactSelector.wox b/UI/Templates/ContactsUI/UIxContactSelector.wox index 69f0b924f..27d0ced30 100644 --- a/UI/Templates/ContactsUI/UIxContactSelector.wox +++ b/UI/Templates/ContactsUI/UIxContactSelector.wox @@ -8,16 +8,33 @@ xmlns:rsrc="OGo:url" >
+ + + + -
+
    - -
+ class="contactList"> +
  • +
    +
    - - + +
    -->
    diff --git a/UI/WebServerResources/generic.js b/UI/WebServerResources/generic.js index 4e084cc53..0eb3afe21 100644 --- a/UI/WebServerResources/generic.js +++ b/UI/WebServerResources/generic.js @@ -25,6 +25,8 @@ /* generic stuff */ var logConsole; +var logWindow = null; + var queryParameters; var activeAjaxRequests = 0; @@ -543,7 +545,12 @@ function toggleLogConsole() { } function log(message) { - var logConsole = document.getElementById('logConsole'); + if (!logWindow) { + logWindow = window; + while (logWindow.opener) + logWindow = logWindow.opener; + } + var logConsole = logWindow.document.getElementById('logConsole'); logConsole.innerHTML += message + '
    ' + "\n"; } @@ -865,11 +872,10 @@ function initCriteria() /* contact selector */ -function onContactSelectorPopup(node) +function onContactAdd(node) { - var contactSelectorId = node.parentNode.getAttribute("id"); - - urlstr = ApplicationBaseURL + "../../" + UserLogin + "/Contacts/select?selectorId=" + contactSelectorId; + var selectorId = node.parentNode.parentNode.getAttribute("id"); + urlstr = ApplicationBaseURL + "../../" + UserLogin + "/Contacts/select?selectorId=" + selectorId; var w = window.open(urlstr, "Addressbook", "width=640,height=400,left=10,top=10,toolbar=no," + "dependent=yes,menubar=no,location=no,resizable=yes," + @@ -879,6 +885,27 @@ function onContactSelectorPopup(node) return false; } +function onContactRemove(node) { + var selectorId = node.parentNode.parentNode.getAttribute("id"); + + var names = $('uixselector-' + selectorId + '-display'); + var nodes = names.getSelectedNodes(); + for (var i = 0; i < nodes.length; i++) { + var currentNode = nodes[i]; + currentNode.parentNode.removeChild(currentNode); + } + + var uids = $('uixselector-' + selectorId + '-uidList'); + nodes = node.parentNode.childNodes; + var ids = new Array(); + for (var i = 0; i < nodes.length; i++) + if (nodes[i] instanceof HTMLLIElement) + ids.push(nodes[i].getAttribute("uid")); + uids.value = ids.join(","); + + return false; +} + function addContact(selectorId, contactId, contactName) { var uids = document.getElementById('uixselector-' + selectorId @@ -888,6 +915,7 @@ function addContact(selectorId, contactId, contactName) { var re = new RegExp("(^|,)" + contactId + "($|,)"); + log ("uids: " + uids); if (!re.test(uids.value)) { log ("no match... realling adding"); @@ -895,12 +923,14 @@ function addContact(selectorId, contactId, contactName) uids.value += ',' + contactId; else uids.value = contactId; - + log ('values: ' + uids.value); var names = document.getElementById('uixselector-' + selectorId + '-display'); - names.innerHTML += ('' - + contactName + '
    '); + names.innerHTML += ('
  • ' + + contactName + '
  • '); } else log ("match... ignoring contact");