sogo/UI/WebServerResources/UIxCalendarProperties.js
Wolfgang Sourdeau fcb174bdfd Monotone-Parent: d2bec7005b1132e0cdbaba9d59a590f4f9b95b6b
Monotone-Revision: 7cc3351f7b4c30b2183e351afaf429ade9f6ab9b

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2008-08-28T14:48:45
Monotone-Branch: ca.inverse.sogo
2008-08-28 14:48:45 +00:00

49 lines
1.5 KiB
JavaScript

/* -*- Mode: java; tab-width: 2; c-tab-always-indent: t; indent-tabs-mode: t; c-basic-offset: 2 -*- */
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;
}
FastInit.addOnLoad(onLoadCalendarProperties);