mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-02-20 00:46:23 +00:00
Monotone-Parent: d2bec7005b1132e0cdbaba9d59a590f4f9b95b6b
Monotone-Revision: 7cc3351f7b4c30b2183e351afaf429ade9f6ab9b Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2008-08-28T14:48:45 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
/* -*- Mode: java; tab-width: 2; c-tab-always-indent: t; indent-tabs-mode: t; c-basic-offset: 2 -*- */
|
||||
|
||||
var contactSelectorAction = 'calendars-contacts';
|
||||
|
||||
function uixEarlierDate(date1, date2) {
|
||||
@@ -180,112 +182,112 @@ function dueDayAsShortString() {
|
||||
}
|
||||
|
||||
this._getDate = function(which) {
|
||||
var date = window.timeWidgets[which]['date'].valueAsDate();
|
||||
date.setHours( window.timeWidgets[which]['hour'].value );
|
||||
date.setMinutes( window.timeWidgets[which]['minute'].value );
|
||||
var date = window.timeWidgets[which]['date'].valueAsDate();
|
||||
date.setHours( window.timeWidgets[which]['hour'].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);
|
||||
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;
|
||||
return date;
|
||||
};
|
||||
|
||||
this.getStartDate = function() {
|
||||
return this._getDate('start');
|
||||
return this._getDate('start');
|
||||
};
|
||||
|
||||
this.getDueDate = function() {
|
||||
return this._getDate('due');
|
||||
return this._getDate('due');
|
||||
};
|
||||
|
||||
this.getShadowStartDate = function() {
|
||||
return this._getShadowDate('start');
|
||||
return this._getShadowDate('start');
|
||||
};
|
||||
|
||||
this.getShadowDueDate = function() {
|
||||
return this._getShadowDate('due');
|
||||
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)
|
||||
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;
|
||||
window.timeWidgets[which]['minute'].value = minutes;
|
||||
};
|
||||
|
||||
this.setStartDate = function(newStartDate) {
|
||||
this._setDate('start', newStartDate);
|
||||
this._setDate('start', newStartDate);
|
||||
};
|
||||
|
||||
this.setDueDate = function(newDueDate) {
|
||||
// window.alert(newDueDate);
|
||||
this._setDate('due', newDueDate);
|
||||
// window.alert(newDueDate);
|
||||
this._setDate('due', newDueDate);
|
||||
};
|
||||
|
||||
this.onAdjustTime = function(event) {
|
||||
onAdjustDueTime(event);
|
||||
onAdjustDueTime(event);
|
||||
};
|
||||
|
||||
this.onAdjustDueTime = function(event) {
|
||||
if (!window.timeWidgets['due']['date'].disabled) {
|
||||
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();
|
||||
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.timeWidgets = widgets;
|
||||
this.timeWidgets = widgets;
|
||||
|
||||
widgets['start']['date'].observe("change", this.onAdjustDueTime, false);
|
||||
widgets['start']['hour'].observe("change", this.onAdjustDueTime, false);
|
||||
widgets['start']['minute'].observe("change", this.onAdjustDueTime, false);
|
||||
widgets['start']['date'].observe("change", this.onAdjustDueTime, false);
|
||||
widgets['start']['hour'].observe("change", this.onAdjustDueTime, false);
|
||||
widgets['start']['minute'].observe("change", this.onAdjustDueTime, false);
|
||||
};
|
||||
|
||||
function onStatusListChange(event) {
|
||||
var value = $("statusList").value;
|
||||
var statusTimeDate = $("statusTime_date");
|
||||
var statusPercent = $("statusPercent");
|
||||
var value = $("statusList").value;
|
||||
var statusTimeDate = $("statusTime_date");
|
||||
var statusPercent = $("statusPercent");
|
||||
|
||||
if (value == "WONoSelectionString") {
|
||||
statusTimeDate.disabled = true;
|
||||
statusPercent.disabled = true;
|
||||
statusPercent.value = "";
|
||||
}
|
||||
else if (value == "0") {
|
||||
statusTimeDate.disabled = true;
|
||||
statusPercent.disabled = false;
|
||||
}
|
||||
else if (value == "1") {
|
||||
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;
|
||||
}
|
||||
if (value == "WONoSelectionString") {
|
||||
statusTimeDate.disabled = true;
|
||||
statusPercent.disabled = true;
|
||||
statusPercent.value = "";
|
||||
}
|
||||
else if (value == "0") {
|
||||
statusTimeDate.disabled = true;
|
||||
statusPercent.disabled = false;
|
||||
}
|
||||
else if (value == "1") {
|
||||
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() {
|
||||
@@ -294,17 +296,17 @@ function initializeStatusLine() {
|
||||
}
|
||||
|
||||
function onTaskEditorLoad() {
|
||||
assignCalendar('startTime_date');
|
||||
assignCalendar('dueTime_date');
|
||||
assignCalendar('statusTime_date');
|
||||
assignCalendar('startTime_date');
|
||||
assignCalendar('dueTime_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);
|
||||
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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user