Monotone-Parent: 8494d73eddd971425d160f71b9402b3e05217405
Monotone-Revision: e9991645e03e37c7b75619ac4070814a2b6e9ad8 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2008-03-27T21:05:47 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
9fc6aa568e
commit
00565ecbaf
2
NEWS
2
NEWS
|
@ -5,8 +5,10 @@
|
||||||
- pressing enter in the contact edition dialog will perform the creation/update operation
|
- pressing enter in the contact edition dialog will perform the creation/update operation
|
||||||
- implemented more of the CalDAV specification for compatibility with Lightning 0.8
|
- implemented more of the CalDAV specification for compatibility with Lightning 0.8
|
||||||
- added Italian translation, thanks to Marco Lertora
|
- added Italian translation, thanks to Marco Lertora
|
||||||
|
- added initial logic for splitting overlapping events
|
||||||
- improved restoration of drag handles state
|
- improved restoration of drag handles state
|
||||||
- improved contextual menu handling of Address Book module
|
- improved contextual menu handling of Address Book module
|
||||||
|
- fixed time/date control widget of attendees editor
|
||||||
- fixed various bugs occuring with Safari 3.1
|
- fixed various bugs occuring with Safari 3.1
|
||||||
- monthly events would not be returned properly
|
- monthly events would not be returned properly
|
||||||
- bi-weekly events would appear every week instead
|
- bi-weekly events would appear every week instead
|
||||||
|
|
|
@ -99,12 +99,14 @@
|
||||||
<div><var:string label:value="Start:"
|
<div><var:string label:value="Start:"
|
||||||
/><var:component className="UIxTimeDateControl"
|
/><var:component className="UIxTimeDateControl"
|
||||||
const:controlID="startTime"
|
const:controlID="startTime"
|
||||||
|
date="aptStartDate"
|
||||||
const:dayStartHour="0"
|
const:dayStartHour="0"
|
||||||
const:dayEndHour="23"
|
const:dayEndHour="23"
|
||||||
/></div>
|
/></div>
|
||||||
<div><var:string label:value="End:"
|
<div><var:string label:value="End:"
|
||||||
/><var:component className="UIxTimeDateControl"
|
/><var:component className="UIxTimeDateControl"
|
||||||
const:controlID="endTime"
|
const:controlID="endTime"
|
||||||
|
date="aptEndDate"
|
||||||
const:dayStartHour="0"
|
const:dayStartHour="0"
|
||||||
const:dayEndHour="23"
|
const:dayEndHour="23"
|
||||||
/></div>
|
/></div>
|
||||||
|
|
|
@ -703,9 +703,134 @@ function refreshCalendarEventsCallback(http) {
|
||||||
// log("refresh calendar events: " + data.length);
|
// log("refresh calendar events: " + data.length);
|
||||||
var dateTuples = new Array();
|
var dateTuples = new Array();
|
||||||
for (var i = 0; i < data.length; i++) {
|
for (var i = 0; i < data.length; i++) {
|
||||||
drawCalendarEvent(data[i],
|
var dates = drawCalendarEvent(data[i],
|
||||||
http.callbackData["startDate"],
|
http.callbackData["startDate"],
|
||||||
http.callbackData["endDate"]);
|
http.callbackData["endDate"]);
|
||||||
|
dates.each(function(tuple) {
|
||||||
|
if (tuple[3] == 0) tuple[3] = 96;
|
||||||
|
dateTuples.push(tuple);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
var c = {
|
||||||
|
div: 0,
|
||||||
|
day: 1,
|
||||||
|
start: 2,
|
||||||
|
end: 3,
|
||||||
|
siblingsCount: 4,
|
||||||
|
siblingsPosition: 5,
|
||||||
|
siblingsMaxCount: 6
|
||||||
|
};
|
||||||
|
for (var i = 0; i < dateTuples.length; i++) {
|
||||||
|
if (dateTuples[i].length < 6) {
|
||||||
|
dateTuples[i][c.siblingsCount] = 1;
|
||||||
|
dateTuples[i][c.siblingsPosition] = 0;
|
||||||
|
}
|
||||||
|
for (var j = 0; j < dateTuples.length; j++) {
|
||||||
|
if (j == i) continue;
|
||||||
|
if (dateTuples[i][c.day] == dateTuples[j][c.day]) {
|
||||||
|
// Same day
|
||||||
|
if (dateTuples[j][c.start] > dateTuples[i][c.start] &&
|
||||||
|
dateTuples[j][c.start] < dateTuples[i][c.end] ||
|
||||||
|
|
||||||
|
dateTuples[j][c.start] == dateTuples[i][c.start] &&
|
||||||
|
dateTuples[j][c.end] < dateTuples[i][c.end] ||
|
||||||
|
|
||||||
|
dateTuples[j][c.start] == dateTuples[i][c.start] &&
|
||||||
|
dateTuples[j][c.end] == dateTuples[i][c.end] &&
|
||||||
|
i < j) {
|
||||||
|
// Same period
|
||||||
|
if (dateTuples[j].length < 6) {
|
||||||
|
dateTuples[j][c.siblingsCount] = 2;
|
||||||
|
dateTuples[j][c.siblingsPosition] = dateTuples[i][c.siblingsPosition] + 1;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
dateTuples[j][c.siblingsCount]++;
|
||||||
|
dateTuples[j][c.siblingsPosition]++;
|
||||||
|
}
|
||||||
|
dateTuples[i][c.siblingsCount]++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Second loop; adjust total number of siblings for each event
|
||||||
|
for (var i = 0; i < dateTuples.length; i++) {
|
||||||
|
//log (i + " " + dateTuples[i].inspect());
|
||||||
|
var maxCount = 0;
|
||||||
|
for (var j = 0; j < dateTuples.length; j++) {
|
||||||
|
if (j == i) continue;
|
||||||
|
if (dateTuples[i][c.day] == dateTuples[j][c.day]) {
|
||||||
|
// Same day
|
||||||
|
if (dateTuples[j][c.start] > dateTuples[i][c.start] &&
|
||||||
|
dateTuples[j][c.start] < dateTuples[i][c.end] ||
|
||||||
|
|
||||||
|
dateTuples[j][c.start] == dateTuples[i][c.start] &&
|
||||||
|
dateTuples[j][c.end] < dateTuples[i][c.end] ){
|
||||||
|
// Same period
|
||||||
|
if (dateTuples[j][c.siblingsCount] > maxCount)
|
||||||
|
maxCount = dateTuples[j][c.siblingsCount];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (maxCount > 0) {
|
||||||
|
dateTuples[i][c.siblingsCount] = maxCount;
|
||||||
|
dateTuples[i][c.siblingsMaxCount] = maxCount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Third loop; adjust position and total number of siblings for each event
|
||||||
|
for (var i = 0; i < dateTuples.length; i++) {
|
||||||
|
//log (i + " " + dateTuples[i].inspect());
|
||||||
|
for (var j = 0; j < dateTuples.length; j++) {
|
||||||
|
if (j == i) continue;
|
||||||
|
if (dateTuples[i][c.day] == dateTuples[j][c.day]) {
|
||||||
|
// Same day
|
||||||
|
if (dateTuples[j][c.start] > dateTuples[i][c.start] &&
|
||||||
|
dateTuples[j][c.start] < dateTuples[i][c.end] ||
|
||||||
|
|
||||||
|
dateTuples[j][c.start] == dateTuples[i][c.start] &&
|
||||||
|
dateTuples[j][c.end] < dateTuples[i][c.end] ||
|
||||||
|
|
||||||
|
dateTuples[j][c.start] == dateTuples[i][c.start] &&
|
||||||
|
dateTuples[j][c.end] == dateTuples[i][c.end] &&
|
||||||
|
i < j) {
|
||||||
|
// Overlapping period
|
||||||
|
if (dateTuples[j][c.siblingsPosition] == dateTuples[i][c.siblingsPosition]) {
|
||||||
|
// Same position
|
||||||
|
dateTuples[j][c.siblingsPosition]--; // not very clever
|
||||||
|
}
|
||||||
|
if (dateTuples[j].length < 7 ||
|
||||||
|
dateTuples[j][c.siblingsMaxCount] < dateTuples[i][c.siblingsMaxCount])
|
||||||
|
dateTuples[j][c.siblingsMaxCount] = dateTuples[i][c.siblingsMaxCount];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (dateTuples[i].length < 7)
|
||||||
|
dateTuples[i][c.siblingsMaxCount] = dateTuples[i][c.siblingsCount];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Final loop; draw the events
|
||||||
|
//log ("[div, day, start index, end index, siblings count, siblings position, siblings max count]");
|
||||||
|
for (var i = 0; i < dateTuples.length; i++) {
|
||||||
|
//log (i + " " + dateTuples[i].inspect());
|
||||||
|
|
||||||
|
var base = dateTuples[i][c.siblingsCount] * dateTuples[i][c.siblingsMaxCount];
|
||||||
|
var length = 1;
|
||||||
|
var maxLength = 1 * dateTuples[i][c.siblingsMaxCount];
|
||||||
|
|
||||||
|
for (var j = dateTuples[i][c.siblingsCount];
|
||||||
|
j < maxLength;
|
||||||
|
j += dateTuples[i][c.siblingsCount]) { }
|
||||||
|
|
||||||
|
if (j > maxLength) {
|
||||||
|
j -= dateTuples[i][c.siblingsCount];
|
||||||
|
}
|
||||||
|
|
||||||
|
var width = 100 * j / base;
|
||||||
|
var left = width * dateTuples[i][c.siblingsPosition];
|
||||||
|
dateTuples[i][0].setStyle({ width: width + "%",
|
||||||
|
left: left + "%" });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
scrollDayView(http.callbackData["scrollEvent"]);
|
scrollDayView(http.callbackData["scrollEvent"]);
|
||||||
|
@ -715,6 +840,8 @@ function refreshCalendarEventsCallback(http) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function drawCalendarEvent(eventData, sd, ed) {
|
function drawCalendarEvent(eventData, sd, ed) {
|
||||||
|
var dateTuples = new Array();
|
||||||
|
|
||||||
var viewStartDate = sd.asDate();
|
var viewStartDate = sd.asDate();
|
||||||
var viewEndDate = ed.asDate();
|
var viewEndDate = ed.asDate();
|
||||||
|
|
||||||
|
@ -744,7 +871,7 @@ function drawCalendarEvent(eventData, sd, ed) {
|
||||||
if (days[i].earlierDate(viewStartDate) == viewStartDate
|
if (days[i].earlierDate(viewStartDate) == viewStartDate
|
||||||
&& days[i].laterDate(viewEndDate) == viewEndDate) {
|
&& days[i].laterDate(viewEndDate) == viewEndDate) {
|
||||||
var starts;
|
var starts;
|
||||||
|
|
||||||
// log("day: " + days[i]);
|
// log("day: " + days[i]);
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
var quarters = (startDate.getUTCHours() * 4
|
var quarters = (startDate.getUTCHours() * 4
|
||||||
|
@ -775,6 +902,10 @@ function drawCalendarEvent(eventData, sd, ed) {
|
||||||
eventDiv.siblings = siblings;
|
eventDiv.siblings = siblings;
|
||||||
if (eventData[9].length > 0)
|
if (eventData[9].length > 0)
|
||||||
eventDiv.addClassName(eventData[9]); // event owner status
|
eventDiv.addClassName(eventData[9]); // event owner status
|
||||||
|
//eventDiv.setStyle({ width: '50%' });
|
||||||
|
if (currentView != "monthview" &&
|
||||||
|
eventData[7] == 0) // not "all day"
|
||||||
|
dateTuples.push(new Array(eventDiv, days[i].getDayString(), starts, ends));
|
||||||
var dayString = days[i].getDayString();
|
var dayString = days[i].getDayString();
|
||||||
// log("day: " + dayString);
|
// log("day: " + dayString);
|
||||||
var parentDiv = null;
|
var parentDiv = null;
|
||||||
|
@ -817,6 +948,8 @@ function drawCalendarEvent(eventData, sd, ed) {
|
||||||
if (parentDiv)
|
if (parentDiv)
|
||||||
parentDiv.appendChild(eventDiv);
|
parentDiv.appendChild(eventDiv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return dateTuples;
|
||||||
}
|
}
|
||||||
|
|
||||||
function eventClass(cname) {
|
function eventClass(cname) {
|
||||||
|
@ -929,7 +1062,7 @@ function calendarDisplayCallback(http) {
|
||||||
function assignCalendar(name) {
|
function assignCalendar(name) {
|
||||||
if (typeof(skycalendar) != "undefined") {
|
if (typeof(skycalendar) != "undefined") {
|
||||||
var node = $(name);
|
var node = $(name);
|
||||||
|
|
||||||
node.calendar = new skycalendar(node);
|
node.calendar = new skycalendar(node);
|
||||||
node.calendar.setCalendarPage(ResourcesURL + "/skycalendar.html");
|
node.calendar.setCalendarPage(ResourcesURL + "/skycalendar.html");
|
||||||
var dateFormat = node.getAttribute("dateFormat");
|
var dateFormat = node.getAttribute("dateFormat");
|
||||||
|
@ -939,11 +1072,11 @@ function assignCalendar(name) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function popupCalendar(node) {
|
function popupCalendar(node) {
|
||||||
var nodeId = $(node).readAttribute("inputId");
|
var nodeId = $(node).readAttribute("inputId");
|
||||||
var input = $(nodeId);
|
var input = $(nodeId);
|
||||||
input.calendar.popup();
|
input.calendar.popup();
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function onEventContextMenu(event) {
|
function onEventContextMenu(event) {
|
||||||
|
|
|
@ -88,8 +88,8 @@ function validateAptEditor() {
|
||||||
start = parseInt(document.forms[0]['startTime_time_minute'].value);
|
start = parseInt(document.forms[0]['startTime_time_minute'].value);
|
||||||
end = parseInt(document.forms[0]['endTime_time_minute'].value);
|
end = parseInt(document.forms[0]['endTime_time_minute'].value);
|
||||||
if (start > end) {
|
if (start > end) {
|
||||||
alert(labels.validate_endbeforestart);
|
alert(labels.validate_endbeforestart);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -406,17 +406,17 @@ function getMenus() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function onAppointmentEditorLoad() {
|
function onAppointmentEditorLoad() {
|
||||||
assignCalendar('startTime_date');
|
assignCalendar('startTime_date');
|
||||||
assignCalendar('endTime_date');
|
assignCalendar('endTime_date');
|
||||||
|
|
||||||
var widgets = {'start': {'date': $("startTime_date"),
|
var widgets = {'start': {'date': $("startTime_date"),
|
||||||
'hour': $("startTime_time_hour"),
|
'hour': $("startTime_time_hour"),
|
||||||
'minute': $("startTime_time_minute")},
|
'minute': $("startTime_time_minute")},
|
||||||
'end': {'date': $("endTime_date"),
|
'end': {'date': $("endTime_date"),
|
||||||
'hour': $("endTime_time_hour"),
|
'hour': $("endTime_time_hour"),
|
||||||
'minute': $("endTime_time_minute")}};
|
'minute': $("endTime_time_minute")}};
|
||||||
initTimeWidgets(widgets);
|
initTimeWidgets(widgets);
|
||||||
initializeAttendeesHref();
|
initializeAttendeesHref();
|
||||||
}
|
}
|
||||||
|
|
||||||
FastInit.addOnLoad(onAppointmentEditorLoad);
|
FastInit.addOnLoad(onAppointmentEditorLoad);
|
||||||
|
|
|
@ -60,20 +60,20 @@ function onContactKeydown(event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function performSearch() {
|
function performSearch() {
|
||||||
if (currentField) {
|
if (currentField) {
|
||||||
if (document.contactLookupAjaxRequest) {
|
if (document.contactLookupAjaxRequest) {
|
||||||
// Abort any pending request
|
// Abort any pending request
|
||||||
document.contactLookupAjaxRequest.aborted = true;
|
document.contactLookupAjaxRequest.aborted = true;
|
||||||
document.contactLookupAjaxRequest.abort();
|
document.contactLookupAjaxRequest.abort();
|
||||||
}
|
}
|
||||||
if (currentField.value.trim().length > 0) {
|
if (currentField.value.trim().length > 0) {
|
||||||
var urlstr = ( UserFolderURL + "Contacts/contactSearch?search="
|
var urlstr = ( UserFolderURL + "Contacts/contactSearch?search="
|
||||||
+ escape(currentField.value) ); log (urlstr);
|
+ escape(currentField.value) );
|
||||||
document.contactLookupAjaxRequest =
|
document.contactLookupAjaxRequest =
|
||||||
triggerAjaxRequest(urlstr, performSearchCallback, currentField);
|
triggerAjaxRequest(urlstr, performSearchCallback, currentField);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
delayedSearch = false;
|
delayedSearch = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function performSearchCallback(http) {
|
function performSearchCallback(http) {
|
||||||
|
@ -465,14 +465,17 @@ function synchronizeWithParent(srcWidgetName, dstWidgetName) {
|
||||||
var srcDate = parent$(srcWidgetName + "_date");
|
var srcDate = parent$(srcWidgetName + "_date");
|
||||||
var dstDate = $(dstWidgetName + "_date");
|
var dstDate = $(dstWidgetName + "_date");
|
||||||
dstDate.value = srcDate.value;
|
dstDate.value = srcDate.value;
|
||||||
|
dstDate.updateShadowValue(srcDate);
|
||||||
|
|
||||||
var srcHour = parent$(srcWidgetName + "_time_hour");
|
var srcHour = parent$(srcWidgetName + "_time_hour");
|
||||||
var dstHour = $(dstWidgetName + "_time_hour");
|
var dstHour = $(dstWidgetName + "_time_hour");
|
||||||
dstHour.value = srcHour.value;
|
dstHour.value = srcHour.value;
|
||||||
|
dstHour.updateShadowValue(srcHour);
|
||||||
|
|
||||||
var srcMinute = parent$(srcWidgetName + "_time_minute");
|
var srcMinute = parent$(srcWidgetName + "_time_minute");
|
||||||
var dstMinute = $(dstWidgetName + "_time_minute");
|
var dstMinute = $(dstWidgetName + "_time_minute");
|
||||||
dstMinute.value = srcMinute.value;
|
dstMinute.value = srcMinute.value;
|
||||||
|
dstMinute.updateShadowValue(dstMinute);
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateParentDateFields(srcWidgetName, dstWidgetName) {
|
function updateParentDateFields(srcWidgetName, dstWidgetName) {
|
||||||
|
@ -489,44 +492,31 @@ function updateParentDateFields(srcWidgetName, dstWidgetName) {
|
||||||
dstMinute.value = srcMinute.value;
|
dstMinute.value = srcMinute.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
function initializeTimeWidgets() {
|
|
||||||
synchronizeWithParent("startTime", "startTime");
|
|
||||||
synchronizeWithParent("endTime", "endTime");
|
|
||||||
|
|
||||||
Event.observe($("startTime_date"), "change", onTimeDateWidgetChange, false);
|
|
||||||
Event.observe($("startTime_time_hour"), "change", onTimeWidgetChange, false);
|
|
||||||
Event.observe($("startTime_time_minute"), "change", onTimeWidgetChange, false);
|
|
||||||
|
|
||||||
Event.observe($("endTime_date"), "change", onTimeDateWidgetChange, false);
|
|
||||||
Event.observe($("endTime_time_hour"), "change", onTimeWidgetChange, false);
|
|
||||||
Event.observe($("endTime_time_minute"), "change", onTimeWidgetChange, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
function onTimeWidgetChange() {
|
function onTimeWidgetChange() {
|
||||||
redisplayFreeBusyZone();
|
redisplayFreeBusyZone();
|
||||||
}
|
}
|
||||||
|
|
||||||
function onTimeDateWidgetChange(event) {
|
function onTimeDateWidgetChange() {
|
||||||
var table = $("freeBusy");
|
var table = $("freeBusyHeader");
|
||||||
|
var rows = table.select("tr");
|
||||||
|
for (var i = 0; i < rows.length; i++) {
|
||||||
|
for (var j = rows[i].cells.length - 1; j > -1; j--) {
|
||||||
|
rows[i].deleteCell(j);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
table = $("freeBusyData");
|
||||||
|
rows = table.select("tr");
|
||||||
|
for (var i = 0; i < rows.length; i++) {
|
||||||
|
for (var j = rows[i].cells.length - 1; j > -1; j--) {
|
||||||
|
rows[i].deleteCell(j);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var rows = table.tHead.rows;
|
prepareTableHeaders();
|
||||||
for (var i = 0; i < rows.length; i++) {
|
prepareTableRows();
|
||||||
for (var j = rows[i].cells.length - 1; j > 0; j--) {
|
redisplayFreeBusyZone();
|
||||||
rows[i].deleteCell(j);
|
resetAllFreeBusys();
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
rows = table.tBodies[0].rows;
|
|
||||||
for (var i = 0; i < rows.length; i++) {
|
|
||||||
for (var j = rows[i].cells.length - 1; j > 0; j--) {
|
|
||||||
rows[i].deleteCell(j);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
prepareTableHeaders();
|
|
||||||
prepareTableRows();
|
|
||||||
redisplayFreeBusyZone();
|
|
||||||
resetAllFreeBusys();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function prepareTableHeaders() {
|
function prepareTableHeaders() {
|
||||||
|
@ -545,20 +535,20 @@ function prepareTableHeaders() {
|
||||||
header1.appendChild(document.createTextNode(days[i].toLocaleDateString()));
|
header1.appendChild(document.createTextNode(days[i].toLocaleDateString()));
|
||||||
rows[0].appendChild(header1);
|
rows[0].appendChild(header1);
|
||||||
for (var hour = dayStartHour; hour < (dayEndHour + 1); hour++) {
|
for (var hour = dayStartHour; hour < (dayEndHour + 1); hour++) {
|
||||||
var header2 = document.createElement("th");
|
var header2 = document.createElement("th");
|
||||||
var text = hour + ":00";
|
var text = hour + ":00";
|
||||||
if (hour < 10)
|
if (hour < 10)
|
||||||
text = "0" + text;
|
text = "0" + text;
|
||||||
header2.appendChild(document.createTextNode(text));
|
header2.appendChild(document.createTextNode(text));
|
||||||
rows[1].appendChild(header2);
|
rows[1].appendChild(header2);
|
||||||
|
|
||||||
var header3 = document.createElement("th");
|
var header3 = document.createElement("th");
|
||||||
for (var span = 0; span < 4; span++) {
|
for (var span = 0; span < 4; span++) {
|
||||||
var spanElement = document.createElement("span");
|
var spanElement = document.createElement("span");
|
||||||
$(spanElement).addClassName("freeBusyZoneElement");
|
$(spanElement).addClassName("freeBusyZoneElement");
|
||||||
header3.appendChild(spanElement);
|
header3.appendChild(spanElement);
|
||||||
}
|
}
|
||||||
rows[2].appendChild(header3);
|
rows[2].appendChild(header3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -600,29 +590,29 @@ function prepareAttendees() {
|
||||||
var newDataRow = tbodyData.rows[tbodyData.rows.length - 2];
|
var newDataRow = tbodyData.rows[tbodyData.rows.length - 2];
|
||||||
|
|
||||||
for (var i = 0; i < attendeesEditor.names.length; i++) {
|
for (var i = 0; i < attendeesEditor.names.length; i++) {
|
||||||
var row = modelAttendee.cloneNode(true);
|
var row = modelAttendee.cloneNode(true);
|
||||||
tbodyAttendees.insertBefore(row, newAttendeeRow);
|
tbodyAttendees.insertBefore(row, newAttendeeRow);
|
||||||
$(row).removeClassName("attendeeModel");
|
$(row).removeClassName("attendeeModel");
|
||||||
$(row).addClassName(attendeesEditor.states[i]);
|
$(row).addClassName(attendeesEditor.states[i]);
|
||||||
var input = $(row).down("input");
|
var input = $(row).down("input");
|
||||||
var value = "";
|
var value = "";
|
||||||
if (attendeesEditor.names[i].length > 0
|
if (attendeesEditor.names[i].length > 0
|
||||||
&& attendeesEditor.names[i] != attendeesEditor.emails[i])
|
&& attendeesEditor.names[i] != attendeesEditor.emails[i])
|
||||||
value += attendeesEditor.names[i] + " ";
|
value += attendeesEditor.names[i] + " ";
|
||||||
value += "<" + attendeesEditor.emails[i] + ">";
|
value += "<" + attendeesEditor.emails[i] + ">";
|
||||||
input.value = value;
|
input.value = value;
|
||||||
if (attendeesEditor.UIDs[i].length > 0)
|
if (attendeesEditor.UIDs[i].length > 0)
|
||||||
input.uid = attendeesEditor.UIDs[i];
|
input.uid = attendeesEditor.UIDs[i];
|
||||||
input.setAttribute("name", "");
|
input.setAttribute("name", "");
|
||||||
input.setAttribute("modified", "0");
|
input.setAttribute("modified", "0");
|
||||||
input.observe("blur", checkAttendee);
|
input.observe("blur", checkAttendee);
|
||||||
input.observe("keydown", onContactKeydown);
|
input.observe("keydown", onContactKeydown);
|
||||||
|
|
||||||
row = modelData.cloneNode(true);
|
row = modelData.cloneNode(true);
|
||||||
tbodyData.insertBefore(row, newDataRow);
|
tbodyData.insertBefore(row, newDataRow);
|
||||||
$(row).removeClassName("dataModel");
|
$(row).removeClassName("dataModel");
|
||||||
|
|
||||||
displayFreeBusyForNode(input);
|
displayFreeBusyForNode(input);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -638,18 +628,18 @@ function prepareAttendees() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function onWindowResize(event) {
|
function onWindowResize(event) {
|
||||||
var view = $('freeBusyView');
|
var view = $('freeBusyView');
|
||||||
var attendeesCell = $$('TABLE#freeBusy TD.freeBusyAttendees').first();
|
var attendeesCell = $$('TABLE#freeBusy TD.freeBusyAttendees').first();
|
||||||
var headerDiv = $$('TABLE#freeBusy TD.freeBusyHeader DIV').first();
|
var headerDiv = $$('TABLE#freeBusy TD.freeBusyHeader DIV').first();
|
||||||
var attendeesDiv = $$('TABLE#freeBusy TD.freeBusyAttendees DIV').first();
|
var attendeesDiv = $$('TABLE#freeBusy TD.freeBusyAttendees DIV').first();
|
||||||
var dataDiv = $$('TABLE#freeBusy TD.freeBusyData DIV').first();
|
var dataDiv = $$('TABLE#freeBusy TD.freeBusyData DIV').first();
|
||||||
var width = view.getWidth() - attendeesCell.getWidth();
|
var width = view.getWidth() - attendeesCell.getWidth();
|
||||||
var height = view.getHeight() - headerDiv.getHeight();
|
var height = view.getHeight() - headerDiv.getHeight();
|
||||||
|
|
||||||
attendeesDiv.setStyle({ height: (height - 20) + 'px' });
|
attendeesDiv.setStyle({ height: (height - 20) + 'px' });
|
||||||
headerDiv.setStyle({ width: (width - 20) + 'px' });
|
headerDiv.setStyle({ width: (width - 20) + 'px' });
|
||||||
dataDiv.setStyle({ width: (width - 4) + 'px',
|
dataDiv.setStyle({ width: (width - 4) + 'px',
|
||||||
height: (height - 2) + 'px' });
|
height: (height - 2) + 'px' });
|
||||||
}
|
}
|
||||||
|
|
||||||
function onScroll(event) {
|
function onScroll(event) {
|
||||||
|
@ -662,8 +652,18 @@ function onScroll(event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function onFreeBusyLoadHandler() {
|
function onFreeBusyLoadHandler() {
|
||||||
|
var widgets = {'start': {'date': $("startTime_date"),
|
||||||
|
'hour': $("startTime_time_hour"),
|
||||||
|
'minute': $("startTime_time_minute")},
|
||||||
|
'end': {'date': $("endTime_date"),
|
||||||
|
'hour': $("endTime_time_hour"),
|
||||||
|
'minute': $("endTime_time_minute")}};
|
||||||
|
|
||||||
|
synchronizeWithParent("startTime", "startTime");
|
||||||
|
synchronizeWithParent("endTime", "endTime");
|
||||||
|
|
||||||
|
initTimeWidgets(widgets);
|
||||||
initializeWindowButtons();
|
initializeWindowButtons();
|
||||||
initializeTimeWidgets();
|
|
||||||
prepareTableHeaders();
|
prepareTableHeaders();
|
||||||
prepareTableRows();
|
prepareTableRows();
|
||||||
redisplayFreeBusyZone();
|
redisplayFreeBusyZone();
|
||||||
|
@ -674,3 +674,123 @@ function onFreeBusyLoadHandler() {
|
||||||
}
|
}
|
||||||
|
|
||||||
FastInit.addOnLoad(onFreeBusyLoadHandler);
|
FastInit.addOnLoad(onFreeBusyLoadHandler);
|
||||||
|
|
||||||
|
/* Functions related to UIxTimeDateControl widget */
|
||||||
|
|
||||||
|
function initTimeWidgets(widgets) {
|
||||||
|
this.timeWidgets = widgets;
|
||||||
|
|
||||||
|
assignCalendar('startTime_date');
|
||||||
|
assignCalendar('endTime_date');
|
||||||
|
|
||||||
|
Event.observe(widgets['start']['date'], "change",
|
||||||
|
this.onAdjustTime, false);
|
||||||
|
Event.observe(widgets['start']['hour'], "change",
|
||||||
|
this.onAdjustTime, false);
|
||||||
|
Event.observe(widgets['start']['minute'], "change",
|
||||||
|
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");
|
||||||
|
if (allDayLabel) {
|
||||||
|
var input = $(allDayLabel).childNodesWithTag("input")[0];
|
||||||
|
Event.observe(input, "change", onAllDayChanged.bindAsEventListener(input));
|
||||||
|
if (input.checked) {
|
||||||
|
for (var type in widgets) {
|
||||||
|
widgets[type]['hour'].disabled = true;
|
||||||
|
widgets[type]['minute'].disabled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Specific function for the attendees editor
|
||||||
|
onTimeDateWidgetChange();
|
||||||
|
}
|
||||||
|
|
||||||
|
function _getDate(which) {
|
||||||
|
var date = window.timeWidgets[which]['date'].valueAsDate();
|
||||||
|
date.setHours( window.timeWidgets[which]['hour'].value );
|
||||||
|
date.setMinutes( window.timeWidgets[which]['minute'].value );
|
||||||
|
|
||||||
|
return date;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getStartDate() {
|
||||||
|
return this._getDate('start');
|
||||||
|
}
|
||||||
|
|
||||||
|
function getEndDate() {
|
||||||
|
return this._getDate('end');
|
||||||
|
}
|
||||||
|
|
||||||
|
function _getShadowDate(which) {
|
||||||
|
var date = window.timeWidgets[which]['date'].getAttribute("shadow-value").asDate();
|
||||||
|
var intValue = parseInt(window.timeWidgets[which]['hour'].getAttribute("shadow-value"));
|
||||||
|
date.setHours(intValue);
|
||||||
|
intValue = parseInt(window.timeWidgets[which]['minute'].getAttribute("shadow-value"));
|
||||||
|
date.setMinutes(intValue);
|
||||||
|
|
||||||
|
return date;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getShadowStartDate() {
|
||||||
|
return this._getShadowDate('start');
|
||||||
|
}
|
||||||
|
|
||||||
|
function getShadowEndDate() {
|
||||||
|
return this._getShadowDate('end');
|
||||||
|
}
|
||||||
|
|
||||||
|
function _setDate(which, newDate) {
|
||||||
|
window.timeWidgets[which]['date'].setValueAsDate(newDate);
|
||||||
|
window.timeWidgets[which]['hour'].value = newDate.getHours();
|
||||||
|
var minutes = newDate.getMinutes();
|
||||||
|
if (minutes % 15)
|
||||||
|
minutes += (15 - minutes % 15);
|
||||||
|
window.timeWidgets[which]['minute'].value = minutes;
|
||||||
|
}
|
||||||
|
|
||||||
|
function setStartDate(newStartDate) {
|
||||||
|
this._setDate('start', newStartDate);
|
||||||
|
}
|
||||||
|
|
||||||
|
function setEndDate(newEndDate) {
|
||||||
|
this._setDate('end', newEndDate);
|
||||||
|
}
|
||||||
|
|
|
@ -115,15 +115,15 @@ function onComponentEditorLoad(event) {
|
||||||
initializePrivacyMenu();
|
initializePrivacyMenu();
|
||||||
var list = $("calendarList");
|
var list = $("calendarList");
|
||||||
Event.observe(list, "mousedown",
|
Event.observe(list, "mousedown",
|
||||||
onChangeCalendar.bindAsEventListener(list),
|
onChangeCalendar.bindAsEventListener(list),
|
||||||
false);
|
false);
|
||||||
list.fire("mousedown");
|
list.fire("mousedown");
|
||||||
|
|
||||||
var menuItems = $("itemPrivacyList").childNodesWithTag("li");
|
var menuItems = $("itemPrivacyList").childNodesWithTag("li");
|
||||||
for (var i = 0; i < menuItems.length; i++)
|
for (var i = 0; i < menuItems.length; i++)
|
||||||
Event.observe(menuItems[i], "mousedown",
|
Event.observe(menuItems[i], "mousedown",
|
||||||
onMenuSetClassification.bindAsEventListener(menuItems[i]),
|
onMenuSetClassification.bindAsEventListener(menuItems[i]),
|
||||||
false);
|
false);
|
||||||
|
|
||||||
$("repeatHref").observe("click", onPopupRecurrenceWindow);
|
$("repeatHref").observe("click", onPopupRecurrenceWindow);
|
||||||
$("repeatList").observe("change", onPopupRecurrenceWindow);
|
$("repeatList").observe("change", onPopupRecurrenceWindow);
|
||||||
|
|
|
@ -180,109 +180,113 @@ function dueDayAsShortString() {
|
||||||
}
|
}
|
||||||
|
|
||||||
this._getDate = function(which) {
|
this._getDate = function(which) {
|
||||||
var date = window.timeWidgets[which]['date'].valueAsDate();
|
var date = window.timeWidgets[which]['date'].valueAsDate();
|
||||||
date.setHours( window.timeWidgets[which]['hour'].value );
|
date.setHours( window.timeWidgets[which]['hour'].value );
|
||||||
date.setMinutes( window.timeWidgets[which]['minute'].value );
|
date.setMinutes( window.timeWidgets[which]['minute'].value );
|
||||||
|
|
||||||
|
return date;
|
||||||
|
};
|
||||||
|
|
||||||
return date;
|
this._getShadowDate = function(which) {
|
||||||
}
|
var date = window.timeWidgets[which]['date'].getAttribute("shadow-value").asDate();
|
||||||
|
var intValue = parseInt(window.timeWidgets[which]['hour'].getAttribute("shadow-value"));
|
||||||
|
date.setHours(intValue);
|
||||||
|
intValue = parseInt(window.timeWidgets[which]['minute'].getAttribute("shadow-value"));
|
||||||
|
date.setMinutes(intValue);
|
||||||
|
// window.alert("shadow: " + date);
|
||||||
|
|
||||||
|
return date;
|
||||||
|
};
|
||||||
|
|
||||||
this._getShadowDate = function(which) {
|
this.getStartDate = function() {
|
||||||
var date = window.timeWidgets[which]['date'].getAttribute("shadow-value").asDate();
|
return this._getDate('start');
|
||||||
var intValue = parseInt(window.timeWidgets[which]['hour'].getAttribute("shadow-value"));
|
};
|
||||||
date.setHours(intValue);
|
|
||||||
intValue = parseInt(window.timeWidgets[which]['minute'].getAttribute("shadow-value"));
|
|
||||||
date.setMinutes(intValue);
|
|
||||||
// window.alert("shadow: " + date);
|
|
||||||
|
|
||||||
return date;
|
this.getDueDate = function() {
|
||||||
}
|
return this._getDate('due');
|
||||||
|
};
|
||||||
|
|
||||||
|
this.getShadowStartDate = function() {
|
||||||
|
return this._getShadowDate('start');
|
||||||
|
};
|
||||||
|
|
||||||
this.getStartDate = function() {
|
this.getShadowDueDate = function() {
|
||||||
return this._getDate('start');
|
return this._getShadowDate('due');
|
||||||
}
|
};
|
||||||
|
|
||||||
this.getDueDate = function() {
|
this._setDate = function(which, newDate) {
|
||||||
return this._getDate('due');
|
window.timeWidgets[which]['date'].setValueAsDate(newDate);
|
||||||
}
|
window.timeWidgets[which]['hour'].value = newDate.getHours();
|
||||||
|
var minutes = newDate.getMinutes();
|
||||||
this.getShadowStartDate = function() {
|
if (minutes % 15)
|
||||||
return this._getShadowDate('start');
|
|
||||||
}
|
|
||||||
|
|
||||||
this.getShadowDueDate = function() {
|
|
||||||
return this._getShadowDate('due');
|
|
||||||
}
|
|
||||||
|
|
||||||
this._setDate = function(which, newDate) {
|
|
||||||
window.timeWidgets[which]['date'].setValueAsDate(newDate);
|
|
||||||
window.timeWidgets[which]['hour'].value = newDate.getHours();
|
|
||||||
var minutes = newDate.getMinutes();
|
|
||||||
if (minutes % 15)
|
|
||||||
minutes += (15 - minutes % 15);
|
minutes += (15 - minutes % 15);
|
||||||
window.timeWidgets[which]['minute'].value = minutes;
|
window.timeWidgets[which]['minute'].value = minutes;
|
||||||
}
|
};
|
||||||
|
|
||||||
this.setStartDate = function(newStartDate) {
|
this.setStartDate = function(newStartDate) {
|
||||||
this._setDate('start', newStartDate);
|
this._setDate('start', newStartDate);
|
||||||
}
|
};
|
||||||
|
|
||||||
this.setDueDate = function(newDueDate) {
|
this.setDueDate = function(newDueDate) {
|
||||||
// window.alert(newDueDate);
|
// window.alert(newDueDate);
|
||||||
this._setDate('due', newDueDate);
|
this._setDate('due', newDueDate);
|
||||||
}
|
};
|
||||||
|
|
||||||
this.onAdjustDueTime = function(event) {
|
this.onAdjustTime = function(event) {
|
||||||
if (!window.timeWidgets['due']['date'].disabled) {
|
onAdjustDueTime(event);
|
||||||
var dateDelta = (window.getStartDate().valueOf()
|
};
|
||||||
- window.getShadowStartDate().valueOf());
|
|
||||||
var newDueDate = new Date(window.getDueDate().valueOf() + dateDelta);
|
|
||||||
window.setDueDate(newDueDate);
|
|
||||||
}
|
|
||||||
window.timeWidgets['start']['date'].updateShadowValue();
|
|
||||||
window.timeWidgets['start']['hour'].updateShadowValue();
|
|
||||||
window.timeWidgets['start']['minute'].updateShadowValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.initTimeWidgets = function (widgets) {
|
this.onAdjustDueTime = function(event) {
|
||||||
this.timeWidgets = widgets;
|
if (!window.timeWidgets['due']['date'].disabled) {
|
||||||
|
var dateDelta = (window.getStartDate().valueOf()
|
||||||
Event.observe(widgets['start']['date'], "change", this.onAdjustDueTime, false);
|
- window.getShadowStartDate().valueOf());
|
||||||
Event.observe(widgets['start']['hour'], "change", this.onAdjustDueTime, false);
|
var newDueDate = new Date(window.getDueDate().valueOf() + dateDelta);
|
||||||
Event.observe(widgets['start']['minute'], "change", this.onAdjustDueTime, false);
|
window.setDueDate(newDueDate);
|
||||||
}
|
}
|
||||||
|
window.timeWidgets['start']['date'].updateShadowValue();
|
||||||
function onStatusListChange(event) {
|
window.timeWidgets['start']['hour'].updateShadowValue();
|
||||||
var value = $("statusList").value;
|
window.timeWidgets['start']['minute'].updateShadowValue();
|
||||||
var statusTimeDate = $("statusTime_date");
|
};
|
||||||
var statusPercent = $("statusPercent");
|
|
||||||
|
this.initTimeWidgets = function (widgets) {
|
||||||
if (value == "WONoSelectionString") {
|
this.timeWidgets = widgets;
|
||||||
statusTimeDate.disabled = true;
|
|
||||||
statusPercent.disabled = true;
|
Event.observe(widgets['start']['date'], "change", this.onAdjustDueTime, false);
|
||||||
statusPercent.value = "";
|
Event.observe(widgets['start']['hour'], "change", this.onAdjustDueTime, false);
|
||||||
}
|
Event.observe(widgets['start']['minute'], "change", this.onAdjustDueTime, false);
|
||||||
else if (value == "0") {
|
};
|
||||||
statusTimeDate.disabled = true;
|
|
||||||
statusPercent.disabled = false;
|
function onStatusListChange(event) {
|
||||||
}
|
var value = $("statusList").value;
|
||||||
else if (value == "1") {
|
var statusTimeDate = $("statusTime_date");
|
||||||
statusTimeDate.disabled = true;
|
var statusPercent = $("statusPercent");
|
||||||
statusPercent.disabled = false;
|
|
||||||
}
|
if (value == "WONoSelectionString") {
|
||||||
else if (value == "2") {
|
statusTimeDate.disabled = true;
|
||||||
statusTimeDate.disabled = false;
|
statusPercent.disabled = true;
|
||||||
statusPercent.disabled = false;
|
statusPercent.value = "";
|
||||||
statusPercent.value = "100";
|
}
|
||||||
}
|
else if (value == "0") {
|
||||||
else if (value == "3") {
|
statusTimeDate.disabled = true;
|
||||||
statusTimeDate.disabled = true;
|
statusPercent.disabled = false;
|
||||||
statusPercent.disabled = true;
|
}
|
||||||
}
|
else if (value == "1") {
|
||||||
else {
|
statusTimeDate.disabled = true;
|
||||||
statusTimeDate.disabled = true;
|
statusPercent.disabled = false;
|
||||||
}
|
}
|
||||||
}
|
else if (value == "2") {
|
||||||
|
statusTimeDate.disabled = false;
|
||||||
|
statusPercent.disabled = false;
|
||||||
|
statusPercent.value = "100";
|
||||||
|
}
|
||||||
|
else if (value == "3") {
|
||||||
|
statusTimeDate.disabled = true;
|
||||||
|
statusPercent.disabled = true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
statusTimeDate.disabled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function initializeStatusLine() {
|
function initializeStatusLine() {
|
||||||
var statusList = $("statusList");
|
var statusList = $("statusList");
|
||||||
|
@ -290,10 +294,18 @@ function initializeStatusLine() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function onTaskEditorLoad() {
|
function onTaskEditorLoad() {
|
||||||
assignCalendar('startTime_date');
|
assignCalendar('startTime_date');
|
||||||
assignCalendar('dueTime_date');
|
assignCalendar('dueTime_date');
|
||||||
assignCalendar('statusTime_date');
|
assignCalendar('statusTime_date');
|
||||||
|
|
||||||
|
var widgets = {'start': {'date': $("startTime_date"),
|
||||||
|
'hour': $("startTime_time_hour"),
|
||||||
|
'minute': $("startTime_time_minute")},
|
||||||
|
'due': {'date': $("dueTime_date"),
|
||||||
|
'hour': $("dueTime_time_hour"),
|
||||||
|
'minute': $("dueTime_time_minute")}};
|
||||||
|
initTimeWidgets(widgets);
|
||||||
|
|
||||||
initializeStatusLine();
|
initializeStatusLine();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue