Monotone-Parent: 571cefaf08c4135173074cee7d496b47702798bc
Monotone-Revision: 0fe240e59b53ed43169486029f2d23d953547489 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-08-30T23:02:53 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
parent
33adda29c1
commit
63579af5eb
|
@ -1,5 +1,10 @@
|
|||
2006-08-30 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* 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.
|
||||
|
||||
|
|
|
@ -8,16 +8,33 @@
|
|||
xmlns:rsrc="OGo:url"
|
||||
>
|
||||
<div class="contactSelector" var:id="selectorId">
|
||||
<span class="contactSelectorButtons">
|
||||
<a href="#" class="button"
|
||||
onclick="return onContactAdd(this);"
|
||||
><img rsrc:src="add-contact.gif"
|
||||
label:title="Add..."
|
||||
/></a>
|
||||
<a href="#" class="button"
|
||||
onclick="return onContactRemove(this);"
|
||||
><img rsrc:src="remove-contact.gif"
|
||||
label:title="Remove"
|
||||
/></a>
|
||||
</span>
|
||||
<input type="hidden"
|
||||
var:id="selectorIdList"
|
||||
var:name="selectorId"
|
||||
var:value="initialParticipantIds" />
|
||||
<div
|
||||
class="contactList"
|
||||
var:value="initialContactsAsString" />
|
||||
<ul
|
||||
var:id="selectorIdDisplay"
|
||||
var:name="selectorIdDisplay">
|
||||
<var:string value="initialParticipants" />
|
||||
</div>
|
||||
class="contactList">
|
||||
<var:foreach list="contacts" item="currentContact"
|
||||
><li var:uid="currentContactId"
|
||||
onmousedown="return false;"
|
||||
onclick="onRowClick(event);"
|
||||
><img rsrc:src="abcard.gif"
|
||||
/><var:string value="currentContactName" /></li>
|
||||
</var:foreach>
|
||||
</ul><br />
|
||||
<!-- <span xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:var="http://www.skyrix.com/od/binding"
|
||||
xmlns:const="http://www.skyrix.com/od/constant"
|
||||
|
@ -30,14 +47,7 @@
|
|||
<a var:href="jsFunctionHref"
|
||||
class="button_submit"
|
||||
><var:string value="title" /></a>
|
||||
</span> -->
|
||||
<input class="button"
|
||||
type="submit"
|
||||
label:value="Search in Addressbook"
|
||||
onclick="return onContactSelectorPopup(this);" />
|
||||
<input class="button"
|
||||
type="submit"
|
||||
onclick="return onContactRefresh(this);"
|
||||
label:value="Refresh" />
|
||||
</span>
|
||||
<br /> -->
|
||||
</div>
|
||||
</container>
|
||||
|
|
|
@ -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 + '<br />' + "\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");
|
||||
|
@ -899,8 +927,10 @@ function addContact(selectorId, contactId, contactName)
|
|||
log ('values: ' + uids.value);
|
||||
var names = document.getElementById('uixselector-' + selectorId
|
||||
+ '-display');
|
||||
names.innerHTML += ('<img src="' + ResourcesURL + '/abcard.gif" />'
|
||||
+ contactName + '<br />');
|
||||
names.innerHTML += ('<li onmousedown="return false;"'
|
||||
+ ' onclick="onRowClick(event);"><img src="'
|
||||
+ ResourcesURL + '/abcard.gif" />'
|
||||
+ contactName + '</li>');
|
||||
}
|
||||
else
|
||||
log ("match... ignoring contact");
|
||||
|
|
Loading…
Reference in a new issue