2009-07-19 18:41:42 +02:00
|
|
|
/* -*- Mode: java; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2008-08-28 16:48:45 +02:00
|
|
|
|
2008-04-22 01:04:26 +02:00
|
|
|
function onLoadCalendarProperties() {
|
|
|
|
var colorButton = $("colorButton");
|
|
|
|
var calendarColor = $("calendarColor");
|
|
|
|
colorButton.setStyle({ "backgroundColor": calendarColor.value, display: "inline" });
|
|
|
|
colorButton.observe("click", onColorClick);
|
|
|
|
|
|
|
|
var cancelButton = $("cancelButton");
|
|
|
|
cancelButton.observe("click", onCancelClick);
|
|
|
|
|
|
|
|
var okButton = $("okButton");
|
|
|
|
okButton.observe("click", onOKClick);
|
|
|
|
}
|
|
|
|
|
|
|
|
function onCancelClick(event) {
|
|
|
|
window.close();
|
|
|
|
}
|
|
|
|
|
|
|
|
function onOKClick(event) {
|
|
|
|
var calendarName = $("calendarName");
|
|
|
|
var calendarColor = $("calendarColor");
|
|
|
|
var calendarID = $("calendarID");
|
|
|
|
|
|
|
|
window.opener.updateCalendarProperties(calendarID.value,
|
2008-08-09 18:40:52 +02:00
|
|
|
calendarName.value,
|
|
|
|
calendarColor.value);
|
2008-04-22 01:04:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function onColorClick(event) {
|
|
|
|
var cPicker = window.open(ApplicationBaseURL + "colorPicker", "colorPicker",
|
2009-07-29 20:29:02 +02:00
|
|
|
"width=250,height=200,resizable=0,scrollbars=0"
|
|
|
|
+ "toolbar=0,location=0,directories=0,status=0,"
|
|
|
|
+ "menubar=0,copyhistory=0", "test"
|
|
|
|
);
|
2008-04-22 01:04:26 +02:00
|
|
|
cPicker.focus();
|
2009-07-29 20:29:02 +02:00
|
|
|
|
2008-04-22 01:04:26 +02:00
|
|
|
preventDefault(event);
|
|
|
|
}
|
|
|
|
|
|
|
|
function onColorPickerChoice(newColor) {
|
|
|
|
var colorButton = $("colorButton");
|
|
|
|
colorButton.setStyle({ "backgroundColor": newColor });
|
|
|
|
var calendarColor = $("calendarColor");
|
|
|
|
calendarColor.value = newColor;
|
|
|
|
}
|
|
|
|
|
2009-03-12 22:09:14 +01:00
|
|
|
document.observe("dom:loaded", onLoadCalendarProperties);
|