merge of '29dc700a0a33827e16bd46a8d97f89d5f11630e9'
and 'b539ed81e839a831ce07b7618690feb8ac799176' Monotone-Parent: 29dc700a0a33827e16bd46a8d97f89d5f11630e9 Monotone-Parent: b539ed81e839a831ce07b7618690feb8ac799176 Monotone-Revision: a322b26bc82b5d04dfdd3997d676eec971639aec Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-05-05T18:52:51 Monotone-Branch: ca.inverse.sogo
@@ -796,22 +796,34 @@ TR#messageCountHeader TD
|
||||
{ padding: 0; }
|
||||
|
||||
#iCalAttendees SPAN
|
||||
{ line-height: 19px; }
|
||||
|
||||
#iCalAttendees DIV.status-icon
|
||||
{ background-repeat: no-repeat;
|
||||
background-position: 5px 1px;
|
||||
padding-left: 22px;
|
||||
padding-right: 4px; }
|
||||
float: left;
|
||||
padding: 0px;
|
||||
clear: both;
|
||||
width: 12px;
|
||||
height: 18px;
|
||||
margin-top: 1px;
|
||||
margin-left: 4px;
|
||||
margin-right: 4px;
|
||||
background-image: url("attendee-partstats.png"); }
|
||||
|
||||
#iCalAttendees .accepted
|
||||
{ background-image: url("accepted.png"); }
|
||||
#iCalAttendees .accepted DIV.status-icon
|
||||
{ background-position: 0px 0px; }
|
||||
|
||||
#iCalAttendees .needs-action
|
||||
{ background-image: url("needs-action.png"); }
|
||||
#iCalAttendees .declined DIV.status-icon
|
||||
{ background-position: -12px 0px; }
|
||||
|
||||
#iCalAttendees .declined
|
||||
{ background-image: url("declined.png"); }
|
||||
#iCalAttendees .needs-action DIV.status-icon
|
||||
{ background-position: -24px 0px; }
|
||||
|
||||
#iCalAttendees .delegated
|
||||
{ background-image: url("delegated.png"); }
|
||||
#iCalAttendees .tentative DIV.status-icon
|
||||
{ background-position: -36px 0px; }
|
||||
|
||||
#iCalAttendees .delegated DIV.status-icon
|
||||
{ background-position: -48px 0px; }
|
||||
|
||||
#iCalAttendees .attendeeUser,
|
||||
#iCalAttendees .attendeeUser A
|
||||
|
||||
@@ -1330,18 +1330,23 @@ DIV.event.alarm DIV.text
|
||||
background-repeat: no-repeat;
|
||||
background-position: top right; }
|
||||
|
||||
DIV.eventInside.tentative,
|
||||
DIV.eventInside.needs-action
|
||||
{ border: 1px dotted #666;
|
||||
-moz-opacity: 0.6;
|
||||
{ -moz-opacity: 0.7;
|
||||
opacity: 0.7; }
|
||||
|
||||
DIV.eventInside.needs-action
|
||||
{ border: 2px dotted #000; }
|
||||
|
||||
DIV.eventInside.tentative DIV.text,
|
||||
DIV.eventInside.needs-action DIV.text
|
||||
{ top: 0px;
|
||||
left: 0px; }
|
||||
left: 2px; }
|
||||
|
||||
DIV.eventInside.delegated,
|
||||
DIV.eventInside.declined
|
||||
{ -moz-opacity: 0.3;
|
||||
opacity: 0.3; }
|
||||
{ -moz-opacity: 0.4;
|
||||
opacity: 0.4; }
|
||||
|
||||
/* event DnD */
|
||||
DIV.event DIV.topDragGrip,
|
||||
|
||||
@@ -25,7 +25,7 @@ var calendarEvents = null;
|
||||
|
||||
var preventAutoScroll = false;
|
||||
|
||||
var userStates = [ "needs-action", "accepted", "declined", "tentative" ];
|
||||
var userStates = [ "needs-action", "accepted", "declined", "tentative", "delegated" ];
|
||||
|
||||
var calendarHeaderAdjusted = false;
|
||||
|
||||
@@ -297,7 +297,7 @@ function closeInvitationWindow() {
|
||||
|
||||
function modifyEventCallback(http) {
|
||||
if (http.readyState == 4) {
|
||||
if (http.status == 200) {
|
||||
if (isHttpStatus204(http.status) || http.status == 200) {
|
||||
var mailInvitation = queryParameters["mail-invitation"];
|
||||
if (mailInvitation && mailInvitation.toLowerCase() == "yes")
|
||||
closeInvitationWindow();
|
||||
|
||||
@@ -122,42 +122,53 @@ A#attendeesHref
|
||||
text-decoration: underline; }
|
||||
|
||||
DIV#attendeesMenu LI
|
||||
{ padding-left: 10px; }
|
||||
{ padding-left: 10px;
|
||||
width: auto; }
|
||||
|
||||
DIV#attendeesMenu .attendee,
|
||||
DIV#attendeesMenu DIV
|
||||
DIV#attendeesMenu .attendeeUser
|
||||
{ font-weight: bold; }
|
||||
|
||||
DIV#attendeesMenu .opt-participant
|
||||
{ font-style: italic; }
|
||||
|
||||
DIV#attendeesMenu .non-participant A
|
||||
{ color: #888; }
|
||||
|
||||
#attendeesLabel DIV#attendeesMenu > DIV
|
||||
{ margin-left: 4px; }
|
||||
|
||||
#attendeesLabel DIV#attendeesMenu > DIV,
|
||||
DIV#attendeesMenu .attendee
|
||||
{ height: 18px; }
|
||||
|
||||
#attendeesLabel DIV#attendeesMenu .statusIcon
|
||||
{ margin-top: 4px; }
|
||||
|
||||
DIV#attendeesMenu .statusIcon
|
||||
{ background-repeat: no-repeat;
|
||||
background-position: 5px center;
|
||||
padding-left: 22px; }
|
||||
float: left;
|
||||
width: 12px;
|
||||
height: 14px;
|
||||
margin-right: 4px;
|
||||
background-image: url("attendee-partstats.png"); }
|
||||
|
||||
DIV#attendeesMenu .accepted
|
||||
{ background-image: url("accepted.png"); }
|
||||
DIV#attendeesMenu .accepted .statusIcon
|
||||
{ background-position: 0px 0px; }
|
||||
|
||||
DIV#attendeesMenu .accepted:hover
|
||||
{ background-image: url("accepted.selected.png"); }
|
||||
DIV#attendeesMenu .declined .statusIcon
|
||||
{ background-position: -12px 0px; }
|
||||
|
||||
DIV#attendeesMenu .needs-action
|
||||
{ background-image: url("needs-action.png"); }
|
||||
DIV#attendeesMenu .needs-action .statusIcon
|
||||
{ background-position: -24px 0px; }
|
||||
|
||||
DIV#attendeesMenu .needs-action:hover
|
||||
{ background-image: url("needs-action.selected.png"); }
|
||||
DIV#attendeesMenu .tentative .statusIcon
|
||||
{ background-position: -36px 0px; }
|
||||
|
||||
DIV#attendeesMenu .declined
|
||||
{ background-image: url("declined.png"); }
|
||||
DIV#attendeesMenu .delegated .statusIcon
|
||||
{ background-position: -48px 0px; }
|
||||
|
||||
DIV#attendeesMenu .declined:hover
|
||||
{ background-image: url("declined.selected.png"); }
|
||||
|
||||
DIV#attendeesMenu .delegated
|
||||
{ background-image: url("delegated.png"); }
|
||||
|
||||
DIV#attendeesMenu .delegated:hover
|
||||
{ background-image: url("delegated.selected.png"); }
|
||||
DIV#attendeesMenu .no-partstat .statusIcon
|
||||
{ background-position: -60px 0px; }
|
||||
|
||||
DIV#attendeesMenu .delegate
|
||||
{ background-position: 15px center;
|
||||
padding-left: 32px; }
|
||||
|
||||
/* read-only view */
|
||||
DIV#attendeesMenu DIV
|
||||
{ padding-left: 20px; }
|
||||
{ padding-left: 16px !important; }
|
||||
|
||||
@@ -164,7 +164,7 @@ function addContact(tag, fullContactName, contactId, contactName, contactEmail)
|
||||
|
||||
function saveEvent(sender) {
|
||||
if (validateAptEditor()) {
|
||||
document.forms['editform'].attendees.value = attendees.toJSON();
|
||||
document.forms['editform'].attendees.value = $(attendees).toJSON();
|
||||
document.forms['editform'].submit();
|
||||
}
|
||||
|
||||
@@ -298,7 +298,7 @@ function initTimeWidgets(widgets) {
|
||||
}
|
||||
}
|
||||
|
||||
function refreshAttendeesRO () {
|
||||
function refreshAttendeesRO() {
|
||||
var attendeesMenu = $("attendeesMenu");
|
||||
var attendeesLabel = $("attendeesLabel");
|
||||
var attendeesDiv = $("attendeesDiv");
|
||||
@@ -323,7 +323,7 @@ function refreshAttendees(newAttendees) {
|
||||
var attendeesMenu = $("attendeesMenu");
|
||||
|
||||
if (!attendeesHref)
|
||||
return refreshAttendeesRO ();
|
||||
return refreshAttendeesRO();
|
||||
|
||||
if (attendeesMenu)
|
||||
attendeesMenu = $("attendeesMenu").down("ul");
|
||||
@@ -337,9 +337,10 @@ function refreshAttendees(newAttendees) {
|
||||
if (menuItems && attendeesMenu)
|
||||
for (var i = 0; i < menuItems.length; i++)
|
||||
attendeesMenu.removeChild(menuItems[i]);
|
||||
|
||||
if (newAttendees)
|
||||
attendees = $H(newAttendees.evalJSON(true));
|
||||
|
||||
if (newAttendees) {
|
||||
attendees = $H(newAttendees.evalJSON());
|
||||
}
|
||||
|
||||
if (attendees.keys().length > 0) {
|
||||
// Update attendees link and show label
|
||||
@@ -353,13 +354,13 @@ function refreshAttendees(newAttendees) {
|
||||
if (attendeesMenu) {
|
||||
var delegatedTo = attendee.get('delegated-to');
|
||||
if (!attendee.get('delegated-from') || delegatedTo) {
|
||||
var node = document.createElement("li");
|
||||
var node = createElement("li");
|
||||
attendeesMenu.appendChild(node);
|
||||
setupAttendeeNode(node, attendee);
|
||||
}
|
||||
if (delegatedTo) {
|
||||
var delegate = attendees.get(delegatedTo);
|
||||
var node = document.createElement("li");
|
||||
var node = createElement("li");
|
||||
attendeesMenu.appendChild(node);
|
||||
setupAttendeeNode(node, $H(delegate), true);
|
||||
}
|
||||
@@ -384,13 +385,18 @@ function setupAttendeeNode(aNode, aAttendee, isDelegate) {
|
||||
// name = email;
|
||||
name = name || email;
|
||||
|
||||
$(aNode).writeAttribute("email", email);
|
||||
$(aNode).addClassName("attendee");
|
||||
$(aNode).addClassName(aAttendee.get('partstat'));
|
||||
aNode.writeAttribute("email", email);
|
||||
aNode.addClassName("attendee");
|
||||
var partstat = aAttendee.get('partstat');
|
||||
if (!partstat)
|
||||
partstat = "no-partstat";
|
||||
aNode.addClassName(partstat);
|
||||
if (isDelegate)
|
||||
$(aNode).addClassName("delegate");
|
||||
aNode.addClassName("delegate");
|
||||
var statusIconNode = createElement("div", null, "statusIcon");
|
||||
aNode.appendChild(statusIconNode);
|
||||
aNode.appendChild(document.createTextNode(name));
|
||||
$(aNode).observe("click", onMailTo);
|
||||
aNode.observe("click", onMailTo);
|
||||
}
|
||||
|
||||
function initializeAttendeesHref() {
|
||||
@@ -410,8 +416,8 @@ function onAttendeesHrefClick(event) {
|
||||
}
|
||||
|
||||
function onMailTo(event) {
|
||||
var target = getTarget(event);
|
||||
var address = target.firstChild.nodeValue.trim() + " <" + target.readAttribute("email") + ">";
|
||||
var target = $(getTarget(event));
|
||||
var address = target.lastChild.nodeValue.trim() + " <" + target.readAttribute("email") + ">";
|
||||
openMailTo(address);
|
||||
Event.stop(event);
|
||||
return false;
|
||||
|
||||
@@ -48,20 +48,62 @@ TABLE#freeBusy TD.freeBusyAttendees DIV
|
||||
TABLE#freeBusy TD.freeBusyData DIV
|
||||
{ overflow: scroll; }
|
||||
|
||||
TABLE#freeBusyAttendees TR.needs-action TD.attendees
|
||||
{ background-image: url("needs-action.png");
|
||||
background-repeat: no-repeat;
|
||||
background-position: 5px center; }
|
||||
TABLE#freeBusyAttendees TD.attendeeStatus
|
||||
{ width: 24px;
|
||||
min-width: 24px;
|
||||
max-width: 24px; }
|
||||
|
||||
TABLE#freeBusyAttendees TR.declined TD.attendees
|
||||
{ background-image: url("declined.png");
|
||||
background-repeat: no-repeat;
|
||||
background-position: 5px center; }
|
||||
TABLE#freeBusyAttendees TD.attendeeStatus DIV
|
||||
{ width: 12px;
|
||||
min-width: 12px;
|
||||
max-width: 24px;
|
||||
background-image: none; }
|
||||
|
||||
TABLE#freeBusyAttendees TR.accepted TD.attendees
|
||||
{ background-image: url("accepted.png");
|
||||
background-repeat: no-repeat;
|
||||
background-position: 5px center; }
|
||||
UL.roles-legend SPAN.role-icon
|
||||
{ display: block;
|
||||
float: left; }
|
||||
|
||||
UL.roles-legend SPAN.role-icon,
|
||||
TABLE#freeBusyAttendees TR.attendee-row TD.attendeeStatus DIV
|
||||
{ background-repeat: no-repeat;
|
||||
width: 24px;
|
||||
height: 20px;
|
||||
background-image: url("attendee-roles.png"); }
|
||||
|
||||
LI[role="req-participant"] > SPAN.role-icon,
|
||||
TABLE#freeBusyAttendees TR[role="req-participant"].attendee-row TD.attendeeStatus DIV
|
||||
{ background-position: 0px 4px; }
|
||||
|
||||
LI[role="opt-participant"] > SPAN.role-icon,
|
||||
TABLE#freeBusyAttendees TR[role="opt-participant"].attendee-row TD.attendeeStatus DIV
|
||||
{ background-position: -24px 4px; }
|
||||
|
||||
LI[role="non-participant"] > SPAN.role-icon,
|
||||
TABLE#freeBusyAttendees TR[role="non-participant"].attendee-row TD.attendeeStatus DIV
|
||||
{ background-position: -72px 4px; }
|
||||
|
||||
LI[role="chair"] > SPAN.role-icon,
|
||||
TABLE#freeBusyAttendees TR[role="chair"].attendee-row TD.attendeeStatus DIV
|
||||
{ background-position: -48px 4px; }
|
||||
|
||||
TABLE#freeBusyAttendees TR.organizer-row TD.attendeeStatus DIV
|
||||
{ background-repeat: no-repeat;
|
||||
width: 12px;
|
||||
height: 18px;
|
||||
margin-left: 6px;
|
||||
background-image: url("attendee-partstats.png"); }
|
||||
|
||||
TABLE#freeBusyAttendees TR[partstat="accepted"].organizer-row TD.attendeeStatus DIV
|
||||
{ background-position: 0px 4px; }
|
||||
|
||||
TABLE#freeBusyAttendees TR[partstat="declined"].organizer-row TD.attendeeStatus DIV
|
||||
{ background-position: -12px 4px; }
|
||||
|
||||
TABLE#freeBusyAttendees TR[partstat="needs-action"].organizer-row TD.attendeeStatus DIV
|
||||
{ background-position: -24px 4px; }
|
||||
|
||||
TABLE#freeBusyAttendees TR[partstat="tentative"].organizer-row TD.attendeeStatus DIV
|
||||
{ background-position: -36px 4px; }
|
||||
|
||||
TABLE#freeBusyHeader TR.freeBusyHeader2 TH
|
||||
{ font-weight: normal; }
|
||||
@@ -112,8 +154,7 @@ TABLE#freeBusyAttendees TD.attendees INPUT
|
||||
background-position: 4px center;
|
||||
border: 0px;
|
||||
width: 12em;
|
||||
padding-left: 24px;
|
||||
margin-left: 2em; }
|
||||
padding-left: 24px; }
|
||||
|
||||
TABLE#freeBusyAttendees TR.futureAttendee INPUT
|
||||
{ background-image: none;
|
||||
@@ -124,9 +165,6 @@ TABLE#freeBusyData TR.futureData TD
|
||||
{ border: 0;
|
||||
line-height: 3em; }
|
||||
|
||||
TABLE#freeBusyAttendees TR.futureAttendee TD A
|
||||
{ margin-left: 20px; }
|
||||
|
||||
SPAN.freeBusyZoneElement
|
||||
{ display: block;
|
||||
float: left;
|
||||
@@ -165,32 +203,29 @@ DIV#legend
|
||||
DIV#legend UL
|
||||
{ cursor: default;
|
||||
float: left;
|
||||
width: 30%;
|
||||
margin: 0px;
|
||||
margin-right: 10px;
|
||||
padding: 0px;
|
||||
line-height: 1.5em;
|
||||
list-style-type: none;
|
||||
list-style-image: none; }
|
||||
|
||||
DIV#legend UL LI
|
||||
{ white-space: nowrap;
|
||||
DIV#legend LI
|
||||
{ height: 20px;
|
||||
white-space: nowrap;
|
||||
margin: 0px;
|
||||
padding: 0px; }
|
||||
|
||||
DIV#legend UL IMG
|
||||
{ margin-right: .5em; }
|
||||
|
||||
DIV#legend UL LI SPAN.colorBox
|
||||
UL.freebusy-legend SPAN.colorBox
|
||||
{ float: left;
|
||||
margin-right: .5em; }
|
||||
|
||||
SPAN.colorBox
|
||||
{ display: block;
|
||||
float: right;
|
||||
border: 1px solid #333;
|
||||
margin: .12em;
|
||||
width: 1em;
|
||||
height: .75em; }
|
||||
margin-top: 5px;
|
||||
margin-right: 2px;
|
||||
display: block;
|
||||
border: 1px solid #999;
|
||||
border-left: 1px solid #ccc;
|
||||
border-right: 1px solid #ccc;
|
||||
border-bottom: 1px solid #eee;
|
||||
width: 32px;
|
||||
height: 10px; }
|
||||
|
||||
SPAN.colorBox.busy,
|
||||
SPAN.freeBusyZoneElement.busy
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/* -*- Mode: java; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
|
||||
var OwnerLogin = "";
|
||||
|
||||
var resultsDiv;
|
||||
var address;
|
||||
var awaitingFreeBusyRequests = new Array();
|
||||
var additionalDays = 2;
|
||||
|
||||
var isAllDay = parent$("isAllDay").checked + 0;
|
||||
@@ -11,12 +12,9 @@ var displayEndHour = 23;
|
||||
|
||||
var attendeesEditor = {
|
||||
delay: 500,
|
||||
delayedSearch: false,
|
||||
currentField: null,
|
||||
selectedIndex: -1
|
||||
};
|
||||
|
||||
|
||||
function handleAllDay () {
|
||||
window.timeWidgets['end']['hour'].value = 17;
|
||||
window.timeWidgets['end']['minute'].value = 0;
|
||||
@@ -31,67 +29,135 @@ function handleAllDay () {
|
||||
|
||||
/* address completion */
|
||||
|
||||
function resolveListAttendees(input, append) {
|
||||
var urlstr = (UserFolderURL
|
||||
+ "Contacts/"
|
||||
+ escape(input.container) + "/"
|
||||
+ escape(input.cname) + "/properties");
|
||||
triggerAjaxRequest(urlstr, resolveListAttendeesCallback,
|
||||
{ "input": input, "append": append });
|
||||
}
|
||||
|
||||
function resolveListAttendeesCallback(http) {
|
||||
if (http.readyState == 4 && http.status == 200) {
|
||||
var input = http.callbackData["input"];
|
||||
var append = http.callbackData["append"];
|
||||
var contacts = http.responseText.evalJSON(true);
|
||||
for (var i = 0; i < contacts.length; i++) {
|
||||
var contact = contacts[i];
|
||||
var fullName = contact[1];
|
||||
if (fullName && fullName.length > 0) {
|
||||
fullName += " <" + contact[2] + ">";
|
||||
}
|
||||
else {
|
||||
fullName = contact[2];
|
||||
}
|
||||
input.uid = null;
|
||||
input.cname = null;
|
||||
input.container = null;
|
||||
input.isList = false;
|
||||
input.value = contact[2];
|
||||
input.confirmedValue = null;
|
||||
input.hasfreebusy = false;
|
||||
input.modified = true;
|
||||
// input.focussed = true;
|
||||
// input.activate();
|
||||
input.checkAfterLookup = true;
|
||||
performSearch(input);
|
||||
if (i < (contacts.length - 1)) {
|
||||
var nextRow = newAttendee(input.parentNode.parentNode);
|
||||
input = nextRow.down("input");
|
||||
} else if (append) {
|
||||
var row = input.parentNode.parentNode;
|
||||
var tBody = row.parentNode;
|
||||
if (row.rowIndex == (tBody.rows.length - 3)) {
|
||||
if (input.selectText) {
|
||||
input.selectText(0, 0);
|
||||
} else if (input.createTextRange) {
|
||||
input.createTextRange().moveStart();
|
||||
}
|
||||
newAttendee();
|
||||
} else {
|
||||
var nextRow = tBody.rows[row.rowIndex + 1];
|
||||
var input = nextRow.down("input");
|
||||
input.selectText(0, input.value.length);
|
||||
input.focussed = true;
|
||||
}
|
||||
} else {
|
||||
if (input.selectText) {
|
||||
input.selectText(0, 0);
|
||||
} else if (input.createTextRange) {
|
||||
input.createTextRange().moveStart();
|
||||
}
|
||||
input.blur();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onContactKeydown(event) {
|
||||
if (event.ctrlKey || event.metaKey) {
|
||||
this.focussed = true;
|
||||
return;
|
||||
}
|
||||
if (event.keyCode == 9) { // Tab
|
||||
if (event.keyCode == 9 || event.keyCode == 13) { // Tab
|
||||
preventDefault(event);
|
||||
if (this.confirmedValue)
|
||||
this.value = this.confirmedValue;
|
||||
this.hasfreebusy = false;
|
||||
var row = $(this).up("tr").next();
|
||||
this.blur(); // triggers checkAttendee function call
|
||||
var input = row.down("input");
|
||||
if (input) {
|
||||
input.focussed = true;
|
||||
input.activate();
|
||||
if (this.isList) {
|
||||
resolveListAttendees(this, true);
|
||||
event.stop();
|
||||
} else {
|
||||
checkAttendee(this);
|
||||
// this.blur(); // triggers checkAttendee function call
|
||||
var input = row.down("input");
|
||||
if (input) {
|
||||
input.focussed = true;
|
||||
input.activate();
|
||||
}
|
||||
else
|
||||
newAttendee();
|
||||
}
|
||||
else
|
||||
newAttendee(null);
|
||||
}
|
||||
else if (event.keyCode == 0
|
||||
|| event.keyCode == 8 // Backspace
|
||||
|| event.keyCode == 32 // Space
|
||||
|| event.keyCode > 47) {
|
||||
this.setAttribute("modified", "1");
|
||||
this.modified = true;
|
||||
this.confirmedValue = null;
|
||||
this.cname = null;
|
||||
this.uid = null;
|
||||
this.container = null;
|
||||
this.hasfreebusy = false;
|
||||
attendeesEditor.currentField = this;
|
||||
if (this.value.length > 0 && !attendeesEditor.delayedSearch) {
|
||||
attendeesEditor.delayedSearch = true;
|
||||
setTimeout("performSearch()", attendeesEditor.delay);
|
||||
if (this.searchTimeout) {
|
||||
window.clearTimeout(this.searchTimeout);
|
||||
}
|
||||
if (this.value.length > 0) {
|
||||
var thisInput = this;
|
||||
this.searchTimeout = setTimeout(function()
|
||||
{performSearch(thisInput);
|
||||
thisInput = null;},
|
||||
attendeesEditor.delay);
|
||||
}
|
||||
else if (this.value.length == 0) {
|
||||
if (document.currentPopupMenu)
|
||||
hideMenu(document.currentPopupMenu);
|
||||
}
|
||||
}
|
||||
else if (event.keyCode == 13) {
|
||||
preventDefault(event);
|
||||
if (this.confirmedValue)
|
||||
this.value = this.confirmedValue;
|
||||
$(this).selectText(0, this.value.length);
|
||||
if (document.currentPopupMenu)
|
||||
hideMenu(document.currentPopupMenu);
|
||||
attendeesEditor.selectedIndex = -1;
|
||||
if (this.uid) {
|
||||
this.hasfreebusy = false;
|
||||
this.writeAttribute("modified", "1");
|
||||
this.blur(); // triggers checkAttendee function call
|
||||
}
|
||||
}
|
||||
else if ($('attendeesMenu').getStyle('visibility') == 'visible') {
|
||||
attendeesEditor.currentField = this;
|
||||
if (event.keyCode == Event.KEY_UP) { // Up arrow
|
||||
if (attendeesEditor.selectedIndex > 0) {
|
||||
var attendees = $('attendeesMenu').select("li");
|
||||
attendees[attendeesEditor.selectedIndex--].removeClassName("selected");
|
||||
attendees[attendeesEditor.selectedIndex].addClassName("selected");
|
||||
this.value = this.confirmedValue = attendees[attendeesEditor.selectedIndex].readAttribute("address");
|
||||
this.uid = attendees[attendeesEditor.selectedIndex].uid;
|
||||
var attendee = attendees[attendeesEditor.selectedIndex];
|
||||
attendee.addClassName("selected");
|
||||
this.value = this.confirmedValue = attendee.address;
|
||||
this.uid = attendee.uid;
|
||||
this.isList = attendee.isList;
|
||||
this.cname = attendee.cname;
|
||||
this.container = attendee.container;
|
||||
}
|
||||
}
|
||||
else if (event.keyCode == Event.KEY_DOWN) { // Down arrow
|
||||
@@ -100,30 +166,27 @@ function onContactKeydown(event) {
|
||||
if (attendeesEditor.selectedIndex >= 0)
|
||||
attendees[attendeesEditor.selectedIndex].removeClassName("selected");
|
||||
attendeesEditor.selectedIndex++;
|
||||
attendees[attendeesEditor.selectedIndex].addClassName("selected");
|
||||
this.value = this.confirmedValue = attendees[attendeesEditor.selectedIndex].readAttribute("address");
|
||||
this.uid = attendees[attendeesEditor.selectedIndex].uid;
|
||||
var attendee = attendees[attendeesEditor.selectedIndex];
|
||||
attendee.addClassName("selected");
|
||||
this.value = this.confirmedValue = attendee.address;
|
||||
this.isList = attendee.isList;
|
||||
this.uid = attendee.uid;
|
||||
this.cname = attendee.cname;
|
||||
this.container = attendee.container;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function performSearch() {
|
||||
function performSearch(input) {
|
||||
// Perform address completion
|
||||
if (attendeesEditor.currentField) {
|
||||
if (document.contactLookupAjaxRequest) {
|
||||
// Abort any pending request
|
||||
document.contactLookupAjaxRequest.aborted = true;
|
||||
document.contactLookupAjaxRequest.abort();
|
||||
}
|
||||
if (attendeesEditor.currentField.value.trim().length > 0) {
|
||||
var urlstr = ( UserFolderURL + "Contacts/contactSearch?search="
|
||||
+ escape(attendeesEditor.currentField.value) );
|
||||
document.contactLookupAjaxRequest =
|
||||
triggerAjaxRequest(urlstr, performSearchCallback, attendeesEditor.currentField);
|
||||
}
|
||||
if (input.value.trim().length > 0) {
|
||||
var urlstr = (UserFolderURL
|
||||
+ "Contacts/allContactSearch?excludeGroups=1&search="
|
||||
+ escape(input.value));
|
||||
triggerAjaxRequest(urlstr, performSearchCallback, input);
|
||||
}
|
||||
attendeesEditor.delayedSearch = false;
|
||||
input.searchTimeout = null;
|
||||
}
|
||||
|
||||
function performSearchCallback(http) {
|
||||
@@ -138,6 +201,7 @@ function performSearchCallback(http) {
|
||||
var data = http.responseText.evalJSON(true);
|
||||
|
||||
if (data.contacts.length > 1) {
|
||||
list.input = input;
|
||||
$(list.childNodesWithTag("li")).each(function(item) {
|
||||
item.remove();
|
||||
});
|
||||
@@ -145,25 +209,42 @@ function performSearchCallback(http) {
|
||||
// Populate popup menu
|
||||
for (var i = 0; i < data.contacts.length; i++) {
|
||||
var contact = data.contacts[i];
|
||||
var completeEmail = contact["name"] + " <" + contact["email"] + ">";
|
||||
var node = new Element('li', { 'address': completeEmail });
|
||||
var isList = (contact["c_component"] &&
|
||||
contact["c_component"] == "vlist");
|
||||
var completeEmail = contact["c_cn"].trim();
|
||||
if (!isList) {
|
||||
if (completeEmail)
|
||||
completeEmail += " <" + contact["c_mail"] + ">";
|
||||
else
|
||||
completeEmail = contact["c_mail"];
|
||||
}
|
||||
var node = createElement('li');
|
||||
list.appendChild(node);
|
||||
node.address = completeEmail;
|
||||
log("node.address: " + node.address);
|
||||
node.uid = contact["c_uid"];
|
||||
node.isList = isList;
|
||||
if (isList) {
|
||||
node.cname = contact["c_name"];
|
||||
node.container = contact["container"];
|
||||
}
|
||||
var matchPosition = completeEmail.toLowerCase().indexOf(data.searchText.toLowerCase());
|
||||
var matchBefore = completeEmail.substring(0, matchPosition);
|
||||
var matchText = completeEmail.substring(matchPosition, matchPosition + data.searchText.length);
|
||||
var matchAfter = completeEmail.substring(matchPosition + data.searchText.length);
|
||||
list.appendChild(node);
|
||||
node.uid = contact["uid"];
|
||||
node.appendChild(document.createTextNode(matchBefore));
|
||||
node.appendChild(new Element('strong').update(matchText));
|
||||
node.appendChild(document.createTextNode(matchAfter));
|
||||
if (contact["contactInfo"])
|
||||
node.appendChild(document.createTextNode(" (" + contact["contactInfo"] + ")"));
|
||||
$(node).observe("mousedown", onAttendeeResultClick);
|
||||
node.appendChild(document.createTextNode(" (" +
|
||||
contact["contactInfo"] + ")"));
|
||||
node.observe("mousedown",
|
||||
onAttendeeResultClick.bindAsEventListener(node));
|
||||
}
|
||||
|
||||
// Show popup menu
|
||||
var offsetScroll = Element.cumulativeScrollOffset(attendeesEditor.currentField);
|
||||
var offset = Element.cumulativeOffset(attendeesEditor.currentField);
|
||||
var offsetScroll = Element.cumulativeScrollOffset(input);
|
||||
var offset = Element.cumulativeOffset(input);
|
||||
var top = offset[1] - offsetScroll[1] + node.offsetHeight + 3;
|
||||
var height = 'auto';
|
||||
var heightDiff = window.height() - offset[1];
|
||||
@@ -189,37 +270,73 @@ function performSearchCallback(http) {
|
||||
if (data.contacts.length == 1) {
|
||||
// Single result
|
||||
var contact = data.contacts[0];
|
||||
if (contact["uid"].length > 0)
|
||||
input.uid = contact["uid"];
|
||||
var completeEmail = contact["name"] + " <" + contact["email"] + ">";
|
||||
if (contact["name"].substring(0, input.value.length).toUpperCase()
|
||||
== input.value.toUpperCase())
|
||||
input.uid = contact["c_uid"];
|
||||
var row = $(input.parentNode.parentNode);
|
||||
if (input.uid == OwnerLogin) {
|
||||
row.removeAttribute("role");
|
||||
row.setAttribute("partstat", "accepted");
|
||||
row.addClassName("organizer-row");
|
||||
row.removeClassName("attendee-row");
|
||||
row.isOrganizer = true;
|
||||
} else {
|
||||
row.removeAttribute("partstat");
|
||||
row.setAttribute("role", "req-participant");
|
||||
row.addClassName("attendee-row");
|
||||
row.removeClassName("organizer-row");
|
||||
row.isOrganizer = false;
|
||||
}
|
||||
var isList = (contact["c_component"] &&
|
||||
contact["c_component"] == "vlist");
|
||||
if (isList) {
|
||||
input.cname = contact["c_name"];
|
||||
input.container = contact["container"];
|
||||
}
|
||||
var completeEmail = contact["c_cn"].trim();
|
||||
if (!isList) {
|
||||
if (completeEmail)
|
||||
completeEmail += " <" + contact["c_mail"] + ">";
|
||||
else
|
||||
completeEmail = contact["c_mail"];
|
||||
}
|
||||
if ((input.value == contact["c_mail"])
|
||||
|| (contact["c_cn"].substring(0, input.value.length).toUpperCase()
|
||||
== input.value.toUpperCase())) {
|
||||
input.value = completeEmail;
|
||||
}
|
||||
else
|
||||
// The result matches email address, not user name
|
||||
input.value += ' >> ' + completeEmail;
|
||||
input.isList = isList;
|
||||
input.confirmedValue = completeEmail;
|
||||
var end = input.value.length;
|
||||
$(input).selectText(start, end);
|
||||
|
||||
attendeesEditor.selectedIndex = -1;
|
||||
|
||||
if (input.checkAfterLookup) {
|
||||
input.checkAfterLookup = false;
|
||||
input.modified = true;
|
||||
input.hasfreebusy = false;
|
||||
checkAttendee(input);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
if (document.currentPopupMenu)
|
||||
hideMenu(document.currentPopupMenu);
|
||||
document.contactLookupAjaxRequest = null;
|
||||
}
|
||||
}
|
||||
|
||||
function onAttendeeResultClick(event) {
|
||||
if (attendeesEditor.currentField) {
|
||||
attendeesEditor.currentField.uid = this.uid;
|
||||
attendeesEditor.currentField.value = $(this).readAttribute("address");
|
||||
attendeesEditor.currentField.confirmedValue = attendeesEditor.currentField.value;
|
||||
attendeesEditor.currentField.blur(); // triggers checkAttendee function call
|
||||
}
|
||||
var input = this.parentNode.input;
|
||||
input.uid = this.uid;
|
||||
input.cname = this.cname;
|
||||
input.container = this.container;
|
||||
input.isList = this.isList;
|
||||
input.confirmedValue = input.value = this.address;
|
||||
checkAttendee(input);
|
||||
this.parentNode.input = null;
|
||||
}
|
||||
|
||||
function resetFreeBusyZone() {
|
||||
@@ -284,19 +401,66 @@ function redisplayFreeBusyZone() {
|
||||
scrollToEvent();
|
||||
}
|
||||
|
||||
function newAttendee(event) {
|
||||
function onAttendeeStatusClick(event) {
|
||||
rotateAttendeeStatus(this);
|
||||
}
|
||||
|
||||
function rotateAttendeeStatus(row) {
|
||||
var values;
|
||||
var attributeName;
|
||||
if (row.isOrganizer) {
|
||||
values = [ "accepted", "declined", "tentative", "needs-action" ];
|
||||
attributeName = "partstat";
|
||||
} else {
|
||||
values = [ "req-participant", "opt-participant",
|
||||
"chair", "non-participant" ];
|
||||
attributeName = "role";
|
||||
}
|
||||
var value = row.getAttribute(attributeName);
|
||||
var idx = (value ? values.indexOf(value) : -1);
|
||||
if (idx == -1 || idx > (values.length - 2)) {
|
||||
idx = 0;
|
||||
} else {
|
||||
idx++;
|
||||
}
|
||||
row.setAttribute(attributeName, values[idx]);
|
||||
if (Prototype.Browser.IE) {
|
||||
/* This hack enables a refresh of the row element right after the
|
||||
click. Otherwise, this occurs only when leaving the element with
|
||||
them mouse cursor. */
|
||||
row.className = row.className;
|
||||
}
|
||||
}
|
||||
|
||||
function onNewAttendeeClick(event) {
|
||||
newAttendee();
|
||||
event.stop();
|
||||
}
|
||||
|
||||
function newAttendee(previousAttendee) {
|
||||
var table = $("freeBusyAttendees");
|
||||
var tbody = table.tBodies[0];
|
||||
var model = tbody.rows[tbody.rows.length - 1];
|
||||
var futureRow = tbody.rows[tbody.rows.length - 2];
|
||||
var newRow = model.cloneNode(true);
|
||||
tbody.insertBefore(newRow, futureRow);
|
||||
|
||||
var nextRowIndex = tbody.rows.length - 2;
|
||||
if (previousAttendee) {
|
||||
nextRowIndex = previousAttendee.rowIndex + 1;
|
||||
}
|
||||
var nextRow = tbody.rows[nextRowIndex];
|
||||
var newRow = $(model.cloneNode(true));
|
||||
tbody.insertBefore(newRow, nextRow);
|
||||
var result = newRow;
|
||||
|
||||
var statusTD = newRow.down(".attendeeStatus");
|
||||
if (statusTD) {
|
||||
var boundOnStatusClick = onAttendeeStatusClick.bindAsEventListener(newRow);
|
||||
statusTD.observe("click", boundOnStatusClick, false);
|
||||
}
|
||||
|
||||
$(newRow).removeClassName("attendeeModel");
|
||||
|
||||
var input = $(newRow).down("input");
|
||||
input.observe("keydown", onContactKeydown);
|
||||
input.observe("blur", checkAttendee);
|
||||
var input = newRow.down("input");
|
||||
input.observe("keydown", onContactKeydown.bindAsEventListener(input));
|
||||
input.observe("blur", onInputBlur);
|
||||
|
||||
input.focussed = true;
|
||||
input.activate();
|
||||
@@ -304,91 +468,98 @@ function newAttendee(event) {
|
||||
table = $("freeBusyData");
|
||||
tbody = table.tBodies[0];
|
||||
model = tbody.rows[tbody.rows.length - 1];
|
||||
futureRow = tbody.rows[tbody.rows.length - 2];
|
||||
newRow = model.cloneNode(true);
|
||||
tbody.insertBefore(newRow, futureRow);
|
||||
$(newRow).removeClassName("dataModel");
|
||||
nextRow = tbody.rows[nextRowIndex];
|
||||
newRow = $(model.cloneNode(true));
|
||||
tbody.insertBefore(newRow, nextRow);
|
||||
newRow.removeClassName("dataModel");
|
||||
|
||||
var attendeesDiv = $$('TABLE#freeBusy TD.freeBusyAttendees DIV').first();
|
||||
var dataDiv = $$('TABLE#freeBusy TD.freeBusyData DIV').first();
|
||||
|
||||
dataDiv.scrollTop = attendeesDiv.scrollTop;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function checkAttendee() { log ("checkAttendee");
|
||||
if (document.currentPopupMenu)
|
||||
hideMenu(document.currentPopupMenu);
|
||||
|
||||
if (document.currentPopupMenu && !this.confirmedValue) {
|
||||
// Hack for IE7; blur event is triggered on input field when
|
||||
// selecting a menu item
|
||||
var visible = $(document.currentPopupMenu).getStyle('visibility') != 'hidden';
|
||||
if (visible)
|
||||
return;
|
||||
}
|
||||
|
||||
this.focussed = false;
|
||||
var row = this.parentNode.parentNode;
|
||||
function checkAttendee(input) {
|
||||
var row = $(input.parentNode.parentNode);
|
||||
var tbody = row.parentNode;
|
||||
if (tbody && this.value.trim().length == 0) {
|
||||
if (tbody && input.value.trim().length == 0) {
|
||||
var dataTable = $("freeBusyData").tBodies[0];
|
||||
var dataRow = dataTable.rows[row.sectionRowIndex];
|
||||
tbody.removeChild(row);
|
||||
dataTable.removeChild(dataRow);
|
||||
}
|
||||
else if (this.readAttribute("modified") == "1") {
|
||||
if (!$(row).hasClassName("needs-action")) {
|
||||
$(row).addClassName("needs-action");
|
||||
$(row).removeClassName("declined");
|
||||
$(row).removeClassName("accepted");
|
||||
}
|
||||
else if (input.modified) {
|
||||
if (!row.hasClassName("needs-action")) {
|
||||
row.addClassName("needs-action");
|
||||
row.removeClassName("declined");
|
||||
row.removeClassName("accepted");
|
||||
}
|
||||
if (!this.hasfreebusy) {
|
||||
if (this.uid && this.confirmedValue)
|
||||
this.value = this.confirmedValue;
|
||||
log ("4");
|
||||
displayFreeBusyForNode(this);
|
||||
this.hasfreebusy = true;
|
||||
if (!input.hasfreebusy) {
|
||||
if (input.uid && input.confirmedValue) {
|
||||
input.value = input.confirmedValue;
|
||||
}
|
||||
displayFreeBusyForNode(input);
|
||||
input.hasfreebusy = true;
|
||||
}
|
||||
this.setAttribute("modified", "0");
|
||||
input.modified = false;
|
||||
}
|
||||
}
|
||||
|
||||
function onInputBlur(event) {
|
||||
if (document.currentPopupMenu && !this.confirmedValue) {
|
||||
// Hack for IE7; blur event is triggered on input field when
|
||||
// selecting a menu item
|
||||
var visible = $(document.currentPopupMenu).getStyle('visibility') != 'hidden';
|
||||
if (visible) {
|
||||
log("XXX we return");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (document.currentPopupMenu)
|
||||
hideMenu(document.currentPopupMenu);
|
||||
|
||||
if (this.isList) {
|
||||
resolveListAttendees(this, false);
|
||||
} else {
|
||||
checkAttendee(this);
|
||||
}
|
||||
|
||||
attendeesEditor.currentField = null;
|
||||
}
|
||||
|
||||
function displayFreeBusyForNode(input) {
|
||||
var rowIndex = input.parentNode.parentNode.sectionRowIndex;
|
||||
var nodes = $("freeBusyData").tBodies[0].rows[rowIndex].cells; log ("displayFreeBusyForNode index " + rowIndex + " (" + nodes.length + " cells)");
|
||||
var nodes = $("freeBusyData").tBodies[0].rows[rowIndex].cells;
|
||||
log ("displayFreeBusyForNode index " + rowIndex + " (" + nodes.length + " cells)");
|
||||
if (input.uid) {
|
||||
if (document.contactFreeBusyAjaxRequest) { log ("busy -- delay " + rowIndex);
|
||||
awaitingFreeBusyRequests.push(input); }
|
||||
else {
|
||||
for (var i = 0; i < nodes.length; i++) {
|
||||
$(nodes[i]).removeClassName("noFreeBusy");
|
||||
$(nodes[i]).innerHTML = ('<span class="freeBusyZoneElement"></span>'
|
||||
+ '<span class="freeBusyZoneElement"></span>'
|
||||
+ '<span class="freeBusyZoneElement"></span>'
|
||||
+ '<span class="freeBusyZoneElement"></span>');
|
||||
for (var i = 0; i < nodes.length; i++) {
|
||||
var node = $(nodes[i]);
|
||||
node.removeClassName("noFreeBusy");
|
||||
while (node.firstChild) {
|
||||
node.removeChild(node.firstChild);
|
||||
}
|
||||
for (var j = 0; j < 4; j++) {
|
||||
createElement("span", null, "freeBusyZoneElement",
|
||||
null, null, node);
|
||||
}
|
||||
// if (document.contactFreeBusyAjaxRequest) {
|
||||
// // Abort any pending request
|
||||
// document.contactFreeBusyAjaxRequest.aborted = true;
|
||||
// document.contactFreeBusyAjaxRequest.abort();
|
||||
// }
|
||||
var sd = $('startTime_date').valueAsShortDateString();
|
||||
var ed = $('endTime_date').valueAsShortDateString();
|
||||
var urlstr = ( UserFolderURL + "../" + input.uid
|
||||
+ "/freebusy.ifb/ajaxRead?"
|
||||
+ "sday=" + sd + "&eday=" + ed + "&additional=" +
|
||||
additionalDays ); log (urlstr);
|
||||
document.contactFreeBusyAjaxRequest
|
||||
= triggerAjaxRequest(urlstr,
|
||||
updateFreeBusyDataCallback,
|
||||
input);
|
||||
}
|
||||
var sd = $('startTime_date').valueAsShortDateString();
|
||||
var ed = $('endTime_date').valueAsShortDateString();
|
||||
var urlstr = (UserFolderURL + "../" + input.uid
|
||||
+ "/freebusy.ifb/ajaxRead?"
|
||||
+ "sday=" + sd + "&eday=" + ed + "&additional=" +
|
||||
additionalDays);
|
||||
triggerAjaxRequest(urlstr,
|
||||
updateFreeBusyDataCallback,
|
||||
input);
|
||||
} else {
|
||||
for (var i = 0; i < nodes.length; i++) {
|
||||
$(nodes[i]).addClassName("noFreeBusy");
|
||||
$(nodes[i]).update();
|
||||
var node = $(nodes[i]);
|
||||
node.addClassName("noFreeBusy");
|
||||
while (node.firstChild) {
|
||||
node.removeChild(node.firstChild);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -419,15 +590,12 @@ function updateFreeBusyDataCallback(http) {
|
||||
var slots = http.responseText.split(",");
|
||||
var rowIndex = input.parentNode.parentNode.sectionRowIndex;
|
||||
var nodes = $("freeBusyData").tBodies[0].rows[rowIndex].cells;
|
||||
log ("received " + slots.length + " slots for " + rowIndex + " with " + nodes.length + " cells");
|
||||
// log ("received " + slots.length + " slots for " + rowIndex + " with " + nodes.length + " cells");
|
||||
for (var i = 0; i < slots.length; i++) {
|
||||
if (slots[i] != '0')
|
||||
setSlot(nodes, i, slots[i]);
|
||||
}
|
||||
}
|
||||
document.contactFreeBusyAjaxRequest = null;
|
||||
if (awaitingFreeBusyRequests.length > 0) { log ("1");
|
||||
displayFreeBusyForNode(awaitingFreeBusyRequests.shift()); }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -436,8 +604,8 @@ function resetAllFreeBusys() {
|
||||
var inputs = table.getElementsByTagName("input");
|
||||
|
||||
for (var i = 0; i < inputs.length - 1; i++) {
|
||||
var currentInput = inputs[i]; log ("reset fb " + currentInput.uid);
|
||||
currentInput.hasfreebusy = false; log ("2");
|
||||
var currentInput = inputs[i];
|
||||
currentInput.hasfreebusy = false;
|
||||
displayFreeBusyForNode(currentInput);
|
||||
}
|
||||
}
|
||||
@@ -453,7 +621,7 @@ function initializeWindowButtons() {
|
||||
$("nextSlot").observe ("click", onNextSlotClick, false);
|
||||
}
|
||||
|
||||
function findSlot (direction) {
|
||||
function findSlot(direction) {
|
||||
var userList = UserLogin;
|
||||
var table = $("freeBusy");
|
||||
var inputs = table.getElementsByTagName("input");
|
||||
@@ -565,7 +733,7 @@ function onNextSlotClick(event) {
|
||||
|
||||
function onEditorOkClick(event) {
|
||||
preventDefault(event);
|
||||
|
||||
|
||||
var attendees = window.opener.attendees;
|
||||
var newAttendees = new Hash();
|
||||
var table = $("freeBusy");
|
||||
@@ -578,16 +746,24 @@ function onEditorOkClick(event) {
|
||||
if (inputs[i].uid)
|
||||
uid = inputs[i].uid;
|
||||
if (!(name && name.length > 0))
|
||||
if (inputs[i].uid)
|
||||
name = inputs[i].uid;
|
||||
if (uid.length > 0)
|
||||
name = uid;
|
||||
else
|
||||
name = email;
|
||||
var attendee = attendees.get(email);
|
||||
if (!attendee)
|
||||
attendee = new Hash({'email': email,
|
||||
'name': name,
|
||||
'uid': uid,
|
||||
'partstat': 'needs-action'});
|
||||
var attendee = attendees["email"];
|
||||
if (!attendee) {
|
||||
attendee = {"email": email,
|
||||
"name": name,
|
||||
"role": "req-participant",
|
||||
"partstat": "needs-action",
|
||||
"uid": uid};
|
||||
}
|
||||
var partstat = row.getAttribute("partstat");
|
||||
if (partstat)
|
||||
attendee["partstat"] = partstat;
|
||||
var role = row.getAttribute("role");
|
||||
if (role)
|
||||
attendee["role"] = role;
|
||||
newAttendees.set(email, attendee);
|
||||
}
|
||||
window.opener.refreshAttendees(newAttendees.toJSON());
|
||||
@@ -733,38 +909,56 @@ function prepareAttendees() {
|
||||
var modelData = tbodyData.rows[tbodyData.rows.length - 1];
|
||||
var newDataRow = tbodyData.rows[tbodyData.rows.length - 2];
|
||||
|
||||
attendees.values().each(function(attendee) {
|
||||
attendee = $H(attendee);
|
||||
var row = modelAttendee.cloneNode(true);
|
||||
tbodyAttendees.insertBefore(row, newAttendeeRow);
|
||||
$(row).removeClassName("attendeeModel");
|
||||
$(row).addClassName(attendee.get('partstat'));
|
||||
var input = $(row).down("input");
|
||||
var value = attendee.get('name');
|
||||
if (value)
|
||||
value += " ";
|
||||
else
|
||||
value = "";
|
||||
value += "<" + attendee.get('email') + ">";
|
||||
input.value = value;
|
||||
if (attendee.get('uid'))
|
||||
input.uid = attendee.get('uid');
|
||||
input.setAttribute("name", "");
|
||||
input.setAttribute("modified", "0");
|
||||
input.observe("blur", checkAttendee);
|
||||
input.observe("keydown", onContactKeydown);
|
||||
|
||||
row = modelData.cloneNode(true);
|
||||
tbodyData.insertBefore(row, newDataRow);
|
||||
$(row).removeClassName("dataModel");
|
||||
log ("3");
|
||||
displayFreeBusyForNode(input);
|
||||
});
|
||||
attendees.keys().each(function(atKey) {
|
||||
var attendee = attendees.get(atKey);
|
||||
var row = $(modelAttendee.cloneNode(true));
|
||||
tbodyAttendees.insertBefore(row, newAttendeeRow);
|
||||
row.removeClassName("attendeeModel");
|
||||
row.setAttribute("partstat", attendee["partstat"]);
|
||||
row.setAttribute("role", attendee["role"]);
|
||||
var uid = attendee["uid"];
|
||||
if (uid && uid == OwnerLogin) {
|
||||
row.addClassName("organizer-row");
|
||||
row.removeClassName("attendee-row");
|
||||
row.isOrganizer = true;
|
||||
} else {
|
||||
row.addClassName("attendee-row");
|
||||
row.removeClassName("organizer-row");
|
||||
row.isOrganizer = false;
|
||||
}
|
||||
var statusTD = row.down(".attendeeStatus");
|
||||
if (statusTD) {
|
||||
var boundOnStatusClick
|
||||
= onAttendeeStatusClick.bindAsEventListener(row);
|
||||
statusTD.observe("click", boundOnStatusClick, false);
|
||||
}
|
||||
|
||||
var input = row.down("input");
|
||||
var value = attendee["name"];
|
||||
if (value)
|
||||
value += " ";
|
||||
else
|
||||
value = "";
|
||||
value += "<" + attendee["email"] + ">";
|
||||
input.value = value;
|
||||
input.uid = attendee["uid"];
|
||||
input.cname = attendee["cname"];
|
||||
input.setAttribute("name", "");
|
||||
input.modified = false;
|
||||
input.observe("blur", onInputBlur);
|
||||
input.observe("keydown", onContactKeydown.bindAsEventListener(input)
|
||||
);
|
||||
|
||||
row = $(modelData.cloneNode(true));
|
||||
tbodyData.insertBefore(row, newDataRow);
|
||||
row.removeClassName("dataModel");
|
||||
displayFreeBusyForNode(input);
|
||||
});
|
||||
}
|
||||
|
||||
// Activate "Add attendee" button
|
||||
var links = tableAttendees.select("TR.futureAttendee TD A");
|
||||
links.first().observe("click", newAttendee);
|
||||
links.first().observe("click", onNewAttendeeClick);
|
||||
}
|
||||
|
||||
function onWindowResize(event) {
|
||||
@@ -799,6 +993,8 @@ function onFreeBusyLoadHandler() {
|
||||
'hour': $("endTime_time_hour"),
|
||||
'minute': $("endTime_time_minute")}};
|
||||
|
||||
OwnerLogin = window.opener.getOwnerLogin();
|
||||
|
||||
synchronizeWithParent("startTime", "startTime");
|
||||
synchronizeWithParent("endTime", "endTime");
|
||||
|
||||
@@ -858,7 +1054,7 @@ function initTimeWidgets(widgets) {
|
||||
function onAdjustTime(event) {
|
||||
var endDate = window.getEndDate();
|
||||
var startDate = window.getStartDate();
|
||||
if ($(this).readAttribute("id").startsWith("start")) {
|
||||
if (this.id.startsWith("start")) {
|
||||
// Start date was changed
|
||||
var delta = window.getShadowStartDate().valueOf() -
|
||||
startDate.valueOf();
|
||||
|
||||
@@ -6,6 +6,10 @@ var ComponentEditor = {
|
||||
reminderWindow: null
|
||||
};
|
||||
|
||||
function getOwnerLogin() {
|
||||
return ownerLogin;
|
||||
}
|
||||
|
||||
function onPopupAttendeesWindow(event) {
|
||||
if (event)
|
||||
preventDefault(event);
|
||||
@@ -202,7 +206,7 @@ function onSummaryChange (e) {
|
||||
|
||||
function onReplyChange(event) {
|
||||
var delegateEditor = $("delegateEditor");
|
||||
if (this.value == 2) {
|
||||
if (this.value == 4) {
|
||||
// Delegated
|
||||
delegateEditor.show();
|
||||
$("delegatedTo").focus();
|
||||
@@ -328,7 +332,11 @@ function onOkButtonClick (e) {
|
||||
action = 'accept';
|
||||
else if (value == 1)
|
||||
action = 'decline';
|
||||
else if (value == 2) {
|
||||
else if (value == 2)
|
||||
action = 'needsaction';
|
||||
else if (value == 3)
|
||||
action = 'tentative';
|
||||
else if (value == 4) {
|
||||
var url = ApplicationBaseURL + activeCalendar + '/' + activeComponent;
|
||||
document.modifyEventAjaxRequest = delegateInvitation(url, modifyEventCallback);
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 510 B |
|
Before Width: | Height: | Size: 511 B |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 419 B |
|
Before Width: | Height: | Size: 354 B |
|
Before Width: | Height: | Size: 540 B |
|
Before Width: | Height: | Size: 452 B |
@@ -67,7 +67,7 @@ function createElement(tagName, id, classes,
|
||||
if (parentNode)
|
||||
parentNode.appendChild(newElement);
|
||||
|
||||
return $(newElement);
|
||||
return newElement;
|
||||
}
|
||||
|
||||
function URLForFolderID(folderID) {
|
||||
|
||||
@@ -83,6 +83,10 @@ DIV#attendeesMenu LI.separator
|
||||
DIV#attendeesView
|
||||
{ left: 0.5em; }
|
||||
|
||||
TABLE#freeBusyAttendees TD.attendeeStatus,
|
||||
TABLE#freeBusyAttendees TD.attendeeStatus DIV
|
||||
{ width: 24px; }
|
||||
|
||||
TABLE
|
||||
{ empty-cells: show; }
|
||||
|
||||
@@ -100,6 +104,18 @@ DIV#propertiesView LEGEND
|
||||
|
||||
/* UIxMailPartICalViewer */
|
||||
|
||||
#iCalAttendees SPAN
|
||||
{ display: block;
|
||||
height: 18px;
|
||||
border: 0px;
|
||||
margin: 0px;
|
||||
padding: 0px; }
|
||||
|
||||
#iCalAttendees DIV.status-icon
|
||||
{ margin-top: 2px;
|
||||
border: 0px;
|
||||
padding: 0px; }
|
||||
|
||||
.clear
|
||||
{ padding-top: 0; }
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 506 B |
|
Before Width: | Height: | Size: 428 B |