Monotone-Parent: f19a49f2c5d69679992d50a3ebb685975f47b75e Monotone-Revision: bb3c592590664390a1256fac17d92ed09a9484d3 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-08-18T16:23:13 Monotone-Branch: ca.inverse.sogo
44 lines
1.3 KiB
JavaScript
44 lines
1.3 KiB
JavaScript
function initializeWindowButtons() {
|
|
var okButton = $("okButton");
|
|
var cancelButton = $("cancelButton");
|
|
|
|
okButton.observe("click", onEditorOkClick, false);
|
|
cancelButton.observe("click", onEditorCancelClick, false);
|
|
}
|
|
|
|
|
|
function initializeFormValues() {
|
|
if (parent$("reminderUnit").value.length > 0) {
|
|
$("quantityField").value = parent$("reminderQuantity").value;
|
|
$("unitsList").value = parent$("reminderUnit").value;
|
|
$("relationsList").value = parent$("reminderRelation").value;
|
|
$("referencesList").value = parent$("reminderReference").value;
|
|
}
|
|
}
|
|
|
|
function onEditorOkClick(event) {
|
|
preventDefault(event);
|
|
if (parseInt($("quantityField").value) > 0) {
|
|
parent$("reminderQuantity").value = parseInt($("quantityField").value);
|
|
parent$("reminderUnit").value = $("unitsList").value;
|
|
parent$("reminderRelation").value = $("relationsList").value;
|
|
parent$("reminderReference").value = $("referencesList").value;
|
|
|
|
window.close();
|
|
}
|
|
else
|
|
alert("heu");
|
|
}
|
|
|
|
function onEditorCancelClick(event) {
|
|
preventDefault(event);
|
|
window.close();
|
|
}
|
|
|
|
function onRecurrenceLoadHandler() {
|
|
initializeFormValues();
|
|
initializeWindowButtons();
|
|
}
|
|
|
|
document.observe("dom:loaded", onRecurrenceLoadHandler);
|