sogo/UI/WebServerResources/UIxCalendarProperties.js
Wolfgang Sourdeau b89bcb1a93 Monotone-Parent: ae3345097f59fc699c864086217dff63e641ee3d
Monotone-Revision: 5122dba2cf6d25cecc6935ab5313e950bc38b7a8

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2009-07-19T16:41:42
Monotone-Branch: ca.inverse.sogo
2009-07-19 16:41:42 +00:00

49 lines
1.5 KiB
JavaScript

/* -*- Mode: java; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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,
calendarName.value,
calendarColor.value);
}
function onColorClick(event) {
var cPicker = window.open(ApplicationBaseURL + "colorPicker", "colorPicker",
"width=250,height=200,resizable=0,scrollbars=0"
+ "toolbar=0,location=0,directories=0,status=0,"
+ "menubar=0,copyhistory=0", "test"
);
cPicker.focus();
preventDefault(event);
}
function onColorPickerChoice(newColor) {
var colorButton = $("colorButton");
colorButton.setStyle({ "backgroundColor": newColor });
var calendarColor = $("calendarColor");
calendarColor.value = newColor;
}
document.observe("dom:loaded", onLoadCalendarProperties);