diff --git a/UI/Templates/SchedulerUI/UIxRecurrenceEditor.wox b/UI/Templates/SchedulerUI/UIxRecurrenceEditor.wox index 9a2d8335c..c3a11cb47 100644 --- a/UI/Templates/SchedulerUI/UIxRecurrenceEditor.wox +++ b/UI/Templates/SchedulerUI/UIxRecurrenceEditor.wox @@ -14,133 +14,226 @@
+ + + + + + - -
-
- - +
+ + + + + + + -
- -
- - +
+ + + + + + + -
- - +
+ + + + + + + + + + + -
- -
- - +
+ + + + + + + + + + + + + + + + +
+ + + +
+ - - - -
+ /> +
+ - -
- - - - -
- -
- - - -
- -
- +
+ - -
- -
- +
-
-
-
-
-
-
- -
-
- -
- - -
- + + + + + + + + + + +
+ +
+ +
+ + label:label="browse end date"/> +
@@ -151,4 +244,5 @@ >
+ diff --git a/UI/WebServerResources/UIxRecurrenceEditor.css b/UI/WebServerResources/UIxRecurrenceEditor.css index fc70dbf73..774d25054 100644 --- a/UI/WebServerResources/UIxRecurrenceEditor.css +++ b/UI/WebServerResources/UIxRecurrenceEditor.css @@ -4,4 +4,88 @@ DIV#windowButtons left: 0px; right: 0px; height: 4em; - text-align: right; } \ No newline at end of file + text-align: right; } + +DIV#pageContent +{ padding: 1em; } + +TABLE.section +{ border: 1px solid #aaa; + margin-top: -.5em; + margin-left: auto; + margin-right: auto; + margin-bottom: 1em; + padding: 1em; + -moz-border-radius: 6px; + table-layout: auto; + text-align: right; + width: 100%; } + +TABLE TH +{ font-weight: normal; + text-align: right; + width: 5em; } + +TABLE TD +{ text-align: left; } + +TABLE TD.label +{ width: 11em; } + +SPAN.caption +{ display: inline-block; + position: relative; + text-align: center; + cursor: default; + background-color: #d4d0c8; + width: auto; + padding: .25em; + margin-left: 7px; + border: 0px; } + +INPUT.textField +{ margin: 0px 0.7em; + width: 2em; } + +/* Days selectors */ + +DIV#week, +DIV#month +{ background-color: #fff; + border-top: 1px solid #ccc; + border-left: 1px solid #ccc; + border-right: 1px solid #999; + border-bottom: 1px solid #999; } + +DIV#week +{ width: 210px; /* 7*(28+2)px */ } + +DIV#month +{ width: 140px; /* 7*(18+2)px */ } + +DIV.week +{ clear: both; + display: block; } + +DIV.week DIV +{ border: 1px solid #fff; + display: block; + float: left; } + +DIV.week DIV.selected +{ background-color: #ccc; } + +DIV.week DIV P +{ display: block; + margin: 2px 0px; + padding: 0px; + text-align: center; } + +DIV#week DIV.week DIV P +{ width: 28px; } + +DIV#month DIV.week DIV P +{ width: 18px; } + +DIV.week DIV:hover +{ border: 1px solid blue; } diff --git a/UI/WebServerResources/UIxRecurrenceEditor.js b/UI/WebServerResources/UIxRecurrenceEditor.js index 0854dde66..8253d5309 100644 --- a/UI/WebServerResources/UIxRecurrenceEditor.js +++ b/UI/WebServerResources/UIxRecurrenceEditor.js @@ -1,15 +1,63 @@ +var RecurrenceEditor = { + types: new Array("Daily", "Weekly", "Monthly", "Yearly"), + currentRepeatType: 0 +} + +function onRepeatTypeChange(event) { + setRepeatType(parseInt(this.value)); +} + +function setRepeatType(type) { + var elements; + + RecurrenceEditor.currentRepeatType = type; + + for (var i = 0; i <=3; i++) { + elements = $$("TABLE TR.recurrence" + RecurrenceEditor.types[i]); + if (i != type) + elements.each(function(row) { + row.hide(); + }); + } + elements = $$("TABLE TR.recurrence" + RecurrenceEditor.types[type]); + elements.each(function(row) { + row.show(); + }); +} + +function onDayClick(event) { + var element = $(this); + if (element.hasClassName("selected")) + this.removeClassName("selected"); + else + this.addClassName("selected"); +} + +function initializeSelectors() { + $$("DIV#week DIV.week DIV").each(function(element) { + element.observe("click", onDayClick, false); + }); + + $$("DIV#month DIV.week DIV").each(function(element) { + element.observe("click", onDayClick, false); + }); +} + function initializeWindowButtons() { var okButton = $("okButton"); var cancelButton = $("cancelButton"); Event.observe(okButton, "click", onEditorOkClick, false); Event.observe(cancelButton, "click", onEditorCancelClick, false); + + $("repeatType").observe("change", onRepeatTypeChange, false); + } function initializeFormValues() { - $("repeatType").value = parent$("repeatType").value; + var repeatType = parent$("repeatType").value; - if ($("repeatType").value == 0) { + if (repeatType === 0) { $('recurrence_form').setRadioValue('dailyRadioButtonName', parent$("repeat1").value); $('dailyDaysField').value = parent$("repeat2").value; } @@ -24,7 +72,7 @@ function initializeFormValues() { $('monthlyDay').value = parent$("repeat4").value; $('recurrence_form').setCheckBoxListValues('monthlyCheckBoxName', parent$("repeat5").value); } - else { + else if (repeatType == 3) { $('yearlyYearsField').value = parent$("repeat1").value; $('recurrence_form').setRadioValue('yearlyRadioButtonName', parent$("repeat2").value); $('yearlyDayField').value = parent$("repeat3").value; @@ -33,6 +81,22 @@ function initializeFormValues() { $('yearlyDay').value = parent$("repeat6").value; $('yearlyMonth2').value = parent$("repeat7").value; } + else { + // Default values + setRepeatType(0); + $('recurrence_form').setRadioValue('dailyRadioButtonName', 0); + $('dailyDaysField').value = 1; + + $('weeklyWeeksField').value = 1; + + $('monthlyMonthsField').value = 1; + $('recurrence_form').setRadioValue('monthlyRadioButtonName', 0); + + $('yearlyYearsField').value = 1; + $('recurrence_form').setRadioValue('yearlyRadioButtonName', 0); + $('yearlyDayField').value = 1; + + } $('recurrence_form').setRadioValue('rangeRadioButtonName', parent$("range1").value); @@ -128,8 +192,9 @@ function onEditorCancelClick(event) { } function onRecurrenceLoadHandler() { - initializeWindowButtons(); - initializeFormValues(); + initializeFormValues(); + initializeSelectors(); + initializeWindowButtons(); } FastInit.addOnLoad(onRecurrenceLoadHandler);