Name |
Type |
Size |
Values |
Description |
Atributes |
TopicType |
label |
10 |
EventTopic |
|
h |
TopicTitle |
text |
50 |
|
|
|
Summary |
text |
50 |
|
Short description of this event |
|
StartDate |
date |
20 |
|
Beginning of event, or start of recurring events |
|
EndDate |
date |
20 |
|
End of event; or end of time span when the recurrences happen; leave empty for never ending recurrences |
|
Recurrence |
radio+values |
50 |
none=none, daily=daily, weekly=weekly, monthly=monthly, yearly=yearly |
Kind of recurrence |
|
WeekDay |
checkbox+values |
7 |
Monday=mo, Tuesday=tu, Wednesday=we, Thursday=th, Friday=fr, Saturday=sa, Sunday=su |
Weekday of a recurrence |
|
MonthDay |
checkbox |
5 |
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 |
Day within a month of a recurrence |
|
Month |
checkbox+values |
6 |
January=1, Feburary=2, March=3, April=4, May=5, July=6, June=7, August=8, September=9, October=10, November=11, December=12 |
Month within a year of a recurrence |
|
YearDay |
text |
20 |
|
Comma separate list of days within a year; values range between 1 and 365 |
|
Interval |
text |
3 |
|
Interval of recurrence; unit depends on recurrence type |
|
%STARTSECTION{"init"}%%ADDTOZONE{"script" id="%TOPIC%" section="init::js"}%%ADDTOZONE{"head" id="%TOPIC%" section="init:css"}%%ENDSECTION{"init"}%
%STARTSECTION{"init::css"}%
<literal>
<style>
.Interval, WeekDay, MonthDay, Month, Exception, YearDay {
display:none;
}
</style>
%ENDSECTION{"init:css"}%
%STARTSECTION{"init::js"}%
<script>
jQuery(function($) {
$(".event").livequery(function() {
var $event = $(this);
function updateState(elem) {
var $elem = $(elem),
$radio = $elem.find("input[type=radio]:checked"),
val = $radio.val();
if ($radio.length) {
//console.log("val=",val);
if (val == 'daily') {
$event.find(".Interval, .Exception").fadeIn();
$event.find(".WeekDay, .MonthDay, .Month, .YearDay").stop().hide();
} else if (val === 'weekly') {
$event.find(".Interval, .Exception, .WeekDay").fadeIn();
$event.find(".MonthDay, .Month, .YearDay").stop().hide();
} else if (val === 'monthly') {
$event.find(".Interval, .Exception, .MonthDay").fadeIn();
$event.find(".WeekDay, .Month, .YearDay").stop().hide();
} else if (val === 'yearly') {
$event.find(".WeekDay").stop().hide();
$event.find(".Interval, .Exception, .MonthDay, .Month, .YearDay").fadeIn();
} else {
$event.find(".Interval, .WeekDay, .MonthDay, .Month, .Exception, .YearDay").stop().hide();
}
} else {
$elem.find("input[value=none]").attr('checked', 'checked');
$event.find(".Interval, .WeekDay, .MonthDay, .Month, .Exception, .YearDay").stop().hide();
}
}
$event.find(".Recurrence").each(function() {
$(this).change(function() {
updateState(this);
});
updateState(this);
});
});
});
</script>
</literal>
%ENDSECTION{"init::js"}%