some comments

This commit is contained in:
Michal Čihař
2004-04-16 17:54:11 +00:00
parent 8743073b2e
commit 596fbef915

View File

@@ -116,12 +116,23 @@ var day;
var month; var month;
var year; var year;
/**
* Opens calendar window.
*
* @param string calendar.php parameters
* @param string form name
* @param string field name
* @param string edit type - date/timestamp
*/
function openCalendar(params, form, field, type) { function openCalendar(params, form, field, type) {
window.open("./calendar.php?" + params, "calendar", "width=400,height=200,status=yes"); window.open("./calendar.php?" + params, "calendar", "width=400,height=200,status=yes");
dateField = eval("document." + form + "." + field); dateField = eval("document." + form + "." + field);
dateType = type; dateType = type;
} }
/**
* Initializes calendar window.
*/
function initCalendar() { function initCalendar() {
if (!year && !month && !day) { if (!year && !month && !day) {
/* Called for first time */ /* Called for first time */
@@ -206,6 +217,11 @@ function initCalendar() {
cnt.innerHTML = str; cnt.innerHTML = str;
} }
/**
* Returns date from calendar.
*
* @param string date text
*/
function returnDate(d) { function returnDate(d) {
window.opener.dateField.value = d; window.opener.dateField.value = d;
window.close(); window.close();