mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-02 18:15:26 +00:00
Monotone-Parent: c81c7151deb5466ad48ca5eb97d70f3b1172934c
Monotone-Revision: aae7c0443ed50c145721274def3a8a4f2d2216e2 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-05-27T13:30:36 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -20,15 +20,17 @@ var attendeesEditor = {
|
||||
};
|
||||
|
||||
function handleAllDay() {
|
||||
window.timeWidgets['end']['hour'].value = 17;
|
||||
window.timeWidgets['end']['minute'].value = 0;
|
||||
window.timeWidgets['start']['hour'].value = 9;
|
||||
window.timeWidgets['start']['hour'].value = dayStartHour;
|
||||
window.timeWidgets['start']['minute'].value = 0;
|
||||
window.timeWidgets['end']['hour'].value = dayEndHour;
|
||||
window.timeWidgets['end']['minute'].value = 0;
|
||||
|
||||
$("startTime_time_hour").disabled = true;
|
||||
$("startTime_time_minute").disabled = true;
|
||||
$("endTime_time_hour").disabled = true;
|
||||
$("endTime_time_minute").disabled = true;
|
||||
|
||||
$("freeBusyTimeRange").addClassName("hidden");
|
||||
}
|
||||
|
||||
/* address completion */
|
||||
@@ -550,6 +552,7 @@ function availabilitySession(uids, direction, start, end, listener) {
|
||||
this._findDate = this._backwardFindDate;
|
||||
this._adjustCurrentStart = this._backwardAdjustCurrentStart;
|
||||
}
|
||||
|
||||
this.mStart = start;
|
||||
|
||||
this.mStartLimit = 0;
|
||||
@@ -756,6 +759,7 @@ availabilitySession.prototype = {
|
||||
};
|
||||
|
||||
function availabilityController(previousSlotButton, nextSlotButton) {
|
||||
this.mActive = false;
|
||||
this.previousSlotButton = previousSlotButton;
|
||||
this.nextSlotButton = nextSlotButton;
|
||||
|
||||
@@ -766,15 +770,22 @@ function availabilityController(previousSlotButton, nextSlotButton) {
|
||||
}
|
||||
|
||||
availabilityController.prototype = {
|
||||
mActive: false,
|
||||
previousSlotButton: null,
|
||||
nextSlotButton: null,
|
||||
|
||||
onPreviousSlotClick: function ac_onPreviousSlotClick(event) {
|
||||
this._findSlot(-1);
|
||||
if (!this.mActive) {
|
||||
this.mActive = true;
|
||||
this._findSlot(-1);
|
||||
}
|
||||
this.previousSlotButton.blur();
|
||||
},
|
||||
onNextSlotClick: function aC_onNextSlotClick(event) {
|
||||
this._findSlot(1);
|
||||
if (!this.mActive) {
|
||||
this.mActive = true;
|
||||
this._findSlot(1);
|
||||
}
|
||||
this.nextSlotButton.blur();
|
||||
},
|
||||
_findSlot: function aC__findSlot(direction) {
|
||||
@@ -788,22 +799,27 @@ availabilityController.prototype = {
|
||||
}
|
||||
|
||||
var start = window.timeWidgets['start']['date'].valueAsDate();
|
||||
start.setHours(window.timeWidgets['start']['hour'].value);
|
||||
start.setMinutes(window.timeWidgets['start']['minute'].value);
|
||||
|
||||
var end = window.timeWidgets['end']['date'].valueAsDate();
|
||||
end.setHours(window.timeWidgets['end']['hour'].value);
|
||||
end.setMinutes(window.timeWidgets['end']['minute'].value);
|
||||
if (isAllDay) {
|
||||
start.setHours(dayStartHour);
|
||||
start.setMinutes(0);
|
||||
start.setSeconds(0);
|
||||
end.setHours(dayEndHour);
|
||||
end.setMinutes(0);
|
||||
end.setSeconds(0);
|
||||
}
|
||||
else {
|
||||
start.setHours(window.timeWidgets['start']['hour'].value);
|
||||
start.setMinutes(window.timeWidgets['start']['minute'].value);
|
||||
end.setHours(window.timeWidgets['end']['hour'].value);
|
||||
end.setMinutes(window.timeWidgets['end']['minute'].value);
|
||||
}
|
||||
var session = new availabilitySession(uids, direction,
|
||||
start, end,
|
||||
this);
|
||||
var limits = $("timeSlotLimits");
|
||||
if (limits.value == "office-hours") {
|
||||
var start = dayStartHour * 4;
|
||||
var end = dayEndHour * 4;
|
||||
session.setLimits(start, end);
|
||||
}
|
||||
else if (limits.value == "range") {
|
||||
if (isAllDay) {
|
||||
session.setLimits(dayStartHour * 4, dayEndHour * 4);
|
||||
} else {
|
||||
var start = (parseInt($("timeSlotStartLimitHour").value)
|
||||
+ parseInt($("timeSlotStartLimitMinute").value));
|
||||
var end = (parseInt($("timeSlotEndLimitHour").value)
|
||||
@@ -828,6 +844,7 @@ availabilityController.prototype = {
|
||||
else {
|
||||
redisplayEventSpans();
|
||||
}
|
||||
this.mActive = false;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1169,9 +1186,9 @@ function initializeTimeSlotWidgets() {
|
||||
}
|
||||
}
|
||||
var limitWidget = $("timeSlotStartLimitHour");
|
||||
limitWidget.value = parseInt($("startTime_time_hour").value) * 4;
|
||||
limitWidget.value = dayStartHour * 4;
|
||||
limitWidget = $("timeSlotEndLimitHour");
|
||||
limitWidget.value = parseInt($("endTime_time_hour").value) * 4;
|
||||
limitWidget.value = dayEndHour * 4;
|
||||
|
||||
var minuteWidgets = [ "timeSlotStartLimitMinute",
|
||||
"timeSlotEndLimitMinute" ];
|
||||
@@ -1227,20 +1244,6 @@ function scrollToEvent () {
|
||||
dataDiv.scrollLeft = headerDiv.scrollLeft;
|
||||
}
|
||||
|
||||
function toggleOfficeHours () {
|
||||
var endDate = window.getEndDate();
|
||||
var startDate = window.getStartDate();
|
||||
|
||||
if (startDate.getHours () < dayStartHour
|
||||
|| startDate.getHours () > dayEndHour
|
||||
|| endDate.getHours () > dayEndHour
|
||||
|| endDate.getHours () < dayStartHour) {
|
||||
if ($("onlyOfficeHours")) {
|
||||
$("onlyOfficeHours").checked = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function updateSlotDisplayCallback(http) {
|
||||
var data = http.responseText.evalJSON(true);
|
||||
var start = new Date();
|
||||
@@ -1565,9 +1568,10 @@ function onFreeBusyLoadHandler() {
|
||||
'minute': $("endTime_time_minute")}};
|
||||
synchronizeWithParent("startTime", "startTime");
|
||||
synchronizeWithParent("endTime", "endTime");
|
||||
initTimeWidgets(widgets);
|
||||
|
||||
initTimeWidgets(widgets);
|
||||
initializeTimeSlotWidgets();
|
||||
|
||||
initializeWindowButtons();
|
||||
prepareTableHeaders();
|
||||
prepareTableRows();
|
||||
@@ -1577,7 +1581,6 @@ function onFreeBusyLoadHandler() {
|
||||
Event.observe(window, "resize", onWindowResize);
|
||||
$$('TABLE#freeBusy TD.freeBusyData DIV').first().observe("scroll", onScroll);
|
||||
scrollToEvent();
|
||||
toggleOfficeHours();
|
||||
}
|
||||
|
||||
document.observe("dom:loaded", onFreeBusyLoadHandler);
|
||||
@@ -1652,7 +1655,6 @@ function onAdjustTime(event) {
|
||||
|
||||
// Specific function for the attendees editor
|
||||
onTimeDateWidgetChange();
|
||||
toggleOfficeHours ();
|
||||
}
|
||||
|
||||
function _getDate(which) {
|
||||
|
||||
Reference in New Issue
Block a user