Monotone-Parent: a9acd9019d1a4eac616803c0f5ee8fe8af50cf15

Monotone-Revision: f344a8f89281014e1cb44ad2830da364e111324e

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2007-11-27T21:58:36
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle
2007-11-27 21:58:36 +00:00
parent 5447d83d4b
commit 9b58554ca0
6 changed files with 48 additions and 36 deletions

View File

@@ -134,15 +134,13 @@ function toggleCycleVisibility(node, nodeName, hiddenValue) {
function addContact(tag, fullContactName, contactId, contactName, contactEmail) {
var uids = $('uixselector-participants-uidList');
log ("contactId: " + contactId);
if (contactId)
{
var re = new RegExp("(^|,)" + contactId + "($|,)");
log ("uids: " + uids);
if (!re.test(uids.value))
{
log ("no match... realling adding");
if (uids.value.length > 0)
uids.value += ',' + contactId;
else
@@ -154,8 +152,6 @@ function addContact(tag, fullContactName, contactId, contactName, contactEmail)
+ ResourcesURL + '/abcard.gif" />'
+ contactName + '</li>');
}
else
log ("match... ignoring contact");
}
return false;
@@ -190,7 +186,6 @@ function _getShadowDate(which) {
date.setHours(intValue);
intValue = parseInt(window.timeWidgets[which]['minute'].getAttribute("shadow-value"));
date.setMinutes(intValue);
// window.alert("shadow: " + date);
return date;
}
@@ -225,19 +220,40 @@ function setStartDate(newStartDate) {
}
function setEndDate(newEndDate) {
// window.alert(newEndDate);
this._setDate('end', newEndDate);
}
function onAdjustEndTime(event) {
var dateDelta = (window.getStartDate().valueOf()
- window.getShadowStartDate().valueOf());
// window.alert(window.getEndDate().valueOf() + ' ' + dateDelta);
var newEndDate = new Date(window.getEndDate().valueOf() + dateDelta);
window.setEndDate(newEndDate);
window.timeWidgets['start']['date'].updateShadowValue();
window.timeWidgets['start']['hour'].updateShadowValue();
window.timeWidgets['start']['minute'].updateShadowValue();
function onAdjustTime(event) {
var endDate = window.getEndDate();
var startDate = window.getStartDate();
if ($(this).readAttribute("id").startsWith("start")) {
// Start date was changed
var delta = window.getShadowStartDate().valueOf() -
startDate.valueOf();
var newEndDate = new Date(endDate.valueOf() - delta);
window.setEndDate(newEndDate);
window.timeWidgets['end']['date'].updateShadowValue();
window.timeWidgets['end']['hour'].updateShadowValue();
window.timeWidgets['end']['minute'].updateShadowValue();
window.timeWidgets['start']['date'].updateShadowValue();
window.timeWidgets['start']['hour'].updateShadowValue();
window.timeWidgets['start']['minute'].updateShadowValue();
}
else {
// End date was changed
var delta = endDate.valueOf() - startDate.valueOf();
if (delta < 0) {
alert(labels.validate_endbeforestart);
var oldEndDate = window.getShadowEndDate();
window.setEndDate(oldEndDate);
window.timeWidgets['end']['date'].updateShadowValue();
window.timeWidgets['end']['hour'].updateShadowValue();
window.timeWidgets['end']['minute'].updateShadowValue();
}
}
}
function onAllDayChanged(event) {
@@ -251,11 +267,18 @@ function initTimeWidgets(widgets) {
this.timeWidgets = widgets;
Event.observe(widgets['start']['date'], "change",
this.onAdjustEndTime, false);
this.onAdjustTime, false);
Event.observe(widgets['start']['hour'], "change",
this.onAdjustEndTime, false);
this.onAdjustTime, false);
Event.observe(widgets['start']['minute'], "change",
this.onAdjustEndTime, false);
this.onAdjustTime, false);
Event.observe(widgets['end']['date'], "change",
this.onAdjustTime, false);
Event.observe(widgets['end']['hour'], "change",
this.onAdjustTime, false);
Event.observe(widgets['end']['minute'], "change",
this.onAdjustTime, false);
var allDayLabel = $("allDay");
var input = $(allDayLabel).childNodesWithTag("input")[0];