Monotone-Parent: 1b7e32ba68558b623b1ae7c252ace2acac8680fd

Monotone-Revision: a157cdab1102429e9d7b24c14204d15f42e774f5

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2008-01-15T21:45:48
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle committed 2008-01-15 21:45:48 +00:00
1 parent 0e71166572
commit 341c5477fe
17 files changed
+490 -442

No files matched your search

+2
View File
@@ -1595,6 +1595,8 @@ function appendCalendar(folderName, folderPath) {
li.appendChild(checkBox);
li.appendChild(document.createTextNode(" "));
$(checkBox).addClassName("checkBox");
if (owner == UserLogin)
checkBox.checked = 1;
var colorBox = document.createElement("div");
li.appendChild(colorBox);
@@ -93,7 +93,7 @@ TEXTAREA
padding-bottom: 0em; }
SELECT#calendarList
{ width: 17em; }
{ width: 16em; }
A#changeUrlButton
{ margin-left: 1em; }
+12 -3
View File
@@ -125,16 +125,25 @@ function onComponentEditorLoad(event) {
onMenuSetClassification.bindAsEventListener(menuItems[i]),
false);
$("repeatHref").observe("click", onPopupRecurrenceWindow);
$("repeatList").observe("change", onPopupRecurrenceWindow);
onPopupRecurrenceWindow(null);
}
function onPopupRecurrenceWindow(event) {
if (event)
preventDefault(event);
if ($("repeatList").value == 7)
window.open(ApplicationBaseURL + "/editRecurrence", null,
"width=803,height=573");
var repeatHref = $("repeatHref");
if ($("repeatList").value == 7) {
repeatHref.show();
if (event)
window.open(ApplicationBaseURL + "editRecurrence", null,
"width=500,height=400");
}
else
repeatHref.hide();
return false;
}
+19 -12
View File
@@ -3,7 +3,8 @@ DIV#windowButtons
bottom: 0px;
left: 0px;
right: 0px;
height: 4em;
height: 2em;
margin: 1em;
text-align: right; }
DIV#pageContent
@@ -47,13 +48,16 @@ INPUT.textField
{ margin: 0px 0.7em;
width: 2em; }
SPAN.datePicker INPUT.textField
{ width: 6em; }
/* Days selectors */
DIV#week,
DIV#month
{ background-color: #fff;
border-top: 1px solid #ccc;
border-left: 1px solid #ccc;
border-top: 1px solid #fff;
border-left: 1px solid #fff;
border-right: 1px solid #999;
border-bottom: 1px solid #999; }
@@ -63,29 +67,32 @@ DIV#week
DIV#month
{ width: 140px; /* 7*(18+2)px */ }
DIV.week
SPAN.week
{ clear: both;
display: block; }
DIV.week DIV
SPAN.week DIV
{ border: 1px solid #fff;
cursor: pointer;
display: block;
float: left; }
DIV.week DIV.selected
{ background-color: #ccc; }
SPAN.week DIV._selected
{ background-color: #4b6983;
border-color: #4b6983;
color: #fff; }
DIV.week DIV P
SPAN.week DIV P
{ display: block;
margin: 2px 0px;
padding: 0px;
text-align: center; }
DIV#week DIV.week DIV P
DIV#week SPAN.week DIV P
{ width: 28px; }
DIV#month DIV.week DIV P
DIV#month SPAN.week DIV P
{ width: 18px; }
DIV.week DIV:hover
{ border: 1px solid blue; }
SPAN.week DIV:hover
{ border: 1px solid #4b6983; }
+100 -51
View File
@@ -12,7 +12,7 @@ function setRepeatType(type) {
RecurrenceEditor.currentRepeatType = type;
for (var i = 0; i <=3; i++) {
for (var i = 0; i <= 3; i++) {
elements = $$("TABLE TR.recurrence" + RecurrenceEditor.types[i]);
if (i != type)
elements.each(function(row) {
@@ -25,20 +25,38 @@ function setRepeatType(type) {
});
}
function getSelectedDays(element) {
var elementsArray = $A(element.getElementsByTagName('DIV'));
var days = new Array();
elementsArray.each(function(item) {
if (isNodeSelected(item))
days.push(item.readAttribute("name"));
});
return days.join(",");
}
function onDayClick(event) {
var element = $(this);
if (element.hasClassName("selected"))
this.removeClassName("selected");
if (isNodeSelected(element))
this.removeClassName("_selected");
else
this.addClassName("selected");
this.addClassName("_selected");
}
function onRangeChange(event) {
$('endDate_date').disabled = (this.value != 2);
}
function onAdjustTime(event) {
// must be defined for date picker widget
}
function initializeSelectors() {
$$("DIV#week DIV.week DIV").each(function(element) {
$$("DIV#week SPAN.week DIV").each(function(element) {
element.observe("click", onDayClick, false);
});
$$("DIV#month DIV.week DIV").each(function(element) {
$$("DIV#month SPAN.week DIV").each(function(element) {
element.observe("click", onDayClick, false);
});
}
@@ -51,28 +69,48 @@ function initializeWindowButtons() {
Event.observe(cancelButton, "click", onEditorCancelClick, false);
$("repeatType").observe("change", onRepeatTypeChange, false);
}
function initializeFormValues() {
var repeatType = parent$("repeatType").value;
if (repeatType === 0) {
// Select repeat type
$("repeatType").value = repeatType;
// Default values
$('recurrence_form').setRadioValue('dailyRadioButtonName', 0);
$('recurrence_form').setRadioValue('monthlyRadioButtonName', 0);
$('recurrence_form').setRadioValue('yearlyRadioButtonName', 0);
$('endDate_date').disabled = true;
if (repeatType == 0) {
// Repeat daily
$('recurrence_form').setRadioValue('dailyRadioButtonName', parent$("repeat1").value);
$('dailyDaysField').value = parent$("repeat2").value;
}
else if ($("repeatType").value == 1) {
else if (repeatType == 1) {
// Repeat weekly
$('weeklyWeeksField').value = parent$("repeat1").value;
$('recurrence_form').setCheckBoxListValues('weeklyCheckBoxName', parent$("repeat2").value);
var weekDiv = $("week").firstChild;
var daysArray = parent$("repeat2").value.split(",");
daysArray.each(function(index) {
$(weekDiv).down('div', index).addClassName("_selected");
});
}
else if ($("repeatType").value == 2) {
else if (repeatType == 2) {
// Repeat monthly
$('monthlyMonthsField').value = parent$("repeat1").value;
$('recurrence_form').setRadioValue('monthlyRadioButtonName', parent$("repeat2").value);
$('monthlyRepeat').value = parent$("repeat3").value;
$('monthlyDay').value = parent$("repeat4").value;
$('recurrence_form').setCheckBoxListValues('monthlyCheckBoxName', parent$("repeat5").value);
var monthDiv = $("month");
var daysArray = parent$("repeat5").value.split(",");
daysArray.each(function(index) {
$(monthDiv).down('DIV[name="'+index+'"]').addClassName("_selected");
});
}
else if (repeatType == 3) {
// Repeat yearly
$('yearlyYearsField').value = parent$("repeat1").value;
$('recurrence_form').setRadioValue('yearlyRadioButtonName', parent$("repeat2").value);
$('yearlyDayField').value = parent$("repeat3").value;
@@ -81,76 +119,85 @@ function initializeFormValues() {
$('yearlyDay').value = parent$("repeat6").value;
$('yearlyMonth2').value = parent$("repeat7").value;
}
else {
// Default values
setRepeatType(0);
$('recurrence_form').setRadioValue('dailyRadioButtonName', 0);
$('dailyDaysField').value = 1;
else
repeatType = 0;
setRepeatType(repeatType);
$('weeklyWeeksField').value = 1;
var range = parent$("range1").value;
$('recurrence_form').setRadioValue('rangeRadioButtonName', range);
$('monthlyMonthsField').value = 1;
$('recurrence_form').setRadioValue('monthlyRadioButtonName', 0);
$('yearlyYearsField').value = 1;
$('recurrence_form').setRadioValue('yearlyRadioButtonName', 0);
$('yearlyDayField').value = 1;
}
$('recurrence_form').setRadioValue('rangeRadioButtonName', parent$("range1").value);
if (parent$("range1").value == 1) {
if (range == 1) {
$('rangeAppointmentsField').value = parent$("range2").value;
}
else if (parent$("range1").value == 2) {
else if (range == 2) {
$('endDate').value = parent$("range2").value;
$('endDate_date').disabled = false;
}
// Observe change of range radio buttons to activate the date picker when required
Form.getInputs($('recurrence_form'), 'radio', 'rangeRadioButtonName').each(function(input) {
input.observe("change", onRangeChange);
});
// Show page
$("recurrence_pattern").show();
$("range_of_recurrence").show();
}
function onEditorOkClick(event) {
preventDefault(event);
var repeatType = $("repeatType").value;
var v;
parent$("repeatType").value = $("repeatType").value;
parent$("repeatType").value = repeatType;
if ($("repeatType").value == 0) {
parent$("repeat1").value = $('recurrence_form').getRadioValue('dailyRadioButtonName');
parent$("repeat2").value = $('dailyDaysField').value;
if (repeatType == 0) {
// Repeat daily
v = $('recurrence_form').getRadioValue('dailyRadioButtonName')
parent$("repeat1").value = v;
// We check if the dailyDaysField really contains an integer
v = parseInt(parent$("repeat2").value);
if (parent$("repeat1").value == 0 && (isNaN(v) || v <= 0)) {
window.alert("Please specify a numerical value in the Days field greater or equal to 1.");
return false;
if (v == 0) {
parent$("repeat2").value = $('dailyDaysField').value;
v = parseInt(parent$("repeat2").value);
if (isNaN(v) || v <= 0) {
window.alert("Please specify a numerical value in the Days field greater or equal to 1.");
return false;
}
}
}
else if ($("repeatType").value == 1) {
parent$("repeat1").value = $('weeklyWeeksField').value;
parent$("repeat2").value = $('recurrence_form').getCheckBoxListValues('weeklyCheckBoxName');
else if (repeatType == 1) {
// Repeat weekly
v = $('weeklyWeeksField').value;
parent$("repeat1").value = v;
parent$("repeat2").value = getSelectedDays($('week'));
// We check if the weeklyWeeksField really contains an integer
v = parseInt(parent$("repeat1").value);
v = parseInt(v);
if (isNaN(v) || v <= 0) {
window.alert("Please specify a numerical value in the Week(s) field greater or equal to 1.");
return false;
}
}
else if ($("repeatType").value == 2) {
parent$("repeat1").value = $('monthlyMonthsField').value;
else if (repeatType == 2) {
// Repeat monthly
v = $('monthlyMonthsField').value;
parent$("repeat1").value = v;
parent$("repeat2").value = $('recurrence_form').getRadioValue('monthlyRadioButtonName');
parent$("repeat3").value = $('monthlyRepeat').value;
parent$("repeat4").value = $('monthlyDay').value;
parent$("repeat5").value = $('recurrence_form').getCheckBoxListValues('monthlyCheckBoxName');
parent$("repeat5").value = getSelectedDays($('month'));
// We check if the monthlyMonthsField really contains an integer
v = parseInt(parent$("repeat1").value);
v = parseInt(v);
if (isNaN(v) || v <= 0) {
window.alert("Please specify a numerical value in the Month(s) field greater or equal to 1.");
return false;
}
}
else {
// Repeat yearly
parent$("repeat1").value = $('yearlyYearsField').value;
parent$("repeat2").value = $('recurrence_form').getRadioValue('yearlyRadioButtonName');
parent$("repeat3").value = $('yearlyDayField').value;
@@ -167,9 +214,10 @@ function onEditorOkClick(event) {
}
}
parent$("range1").value = $('recurrence_form').getRadioValue('rangeRadioButtonName');
var range = $('recurrence_form').getRadioValue('rangeRadioButtonName');
parent$("range1").value = range;
if (parent$("range1").value == 1) {
if (range == 1) {
parent$("range2").value = $('rangeAppointmentsField').value;
// We check if the rangeAppointmentsField really contains an integer
@@ -179,7 +227,7 @@ function onEditorOkClick(event) {
return false;
}
}
else if (parent$("range1").value == 2) {
else if (range == 2) {
parent$("range2").value = $('endDate').value;
}
@@ -195,6 +243,7 @@ function onRecurrenceLoadHandler() {
initializeFormValues();
initializeSelectors();
initializeWindowButtons();
assignCalendar('endDate_date');
}
FastInit.addOnLoad(onRecurrenceLoadHandler);
+1 -1
View File
@@ -62,7 +62,7 @@ function cal_popup1(str_datetime) {
var obj_calwindow = window.open(
this.calpage+'?datetime=' + this.dt_current.valueOf()+ '&id=' + this.id,
'Calendar', 'width=200,height=190'+
'Calendar', 'width=253,height=190'+
',status=no,resizable=no,top=200,left=200,dependent=yes,alwaysRaised=yes'
);
obj_calwindow.opener = window;