recurrence editor
authorArt Cancro <ajc@citadel.org>
Tue, 23 Sep 2008 17:33:36 +0000 (17:33 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 23 Sep 2008 17:33:36 +0000 (17:33 +0000)
webcit/event.c
webcit/static/wclib.js

index 51c59c0871bc9f696ae24d7606847e5d7c9e601c..4618e8bd695319d72e5c10c564ca2bd118a93a9f 100644 (file)
@@ -7,21 +7,6 @@
 #include "webcit.h"
 #include "webserver.h"
 
-
-
-
-       struct tm tm;
-       time_t thetime;
-       int i;
-
-
-
-
-
-
-
-
-
 /*
  * Display an event by itself (for editing)
  * supplied_vevent     the event to edit
@@ -462,7 +447,8 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum,
        wprintf("<input type=\"text\" name=\"interval\" maxlength=\"3\" size=\"3\" ");
        wprintf("value=\"%d\"> ", recur.interval);
 
-       wprintf("<select name=\"freq\" size=\"1\">\n");
+       wprintf("<select name=\"freq\" id=\"freq_selector\" size=\"1\" "
+               "onclick=\"RecurrenceShowHide();\">\n");
        for (i=0; i<(sizeof frequency_units / sizeof(char *)); ++i) {
 
                /* We only want to offer daily, weekly, monthly, or yearly, which are
@@ -480,11 +466,12 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum,
 
        wprintf("</td></tr>\n");
 
+
+       wprintf("<div id=\"weekday_selector\">\n");             /* begin 'weekday_selector' div */
        wprintf("<tr><td><b>");
        wprintf("%s", _("on these weekdays:"));
        wprintf("</b></td><td>");
 
-
        char weekday_is_selected[7];
        memset(weekday_is_selected, 0, 7);
 
@@ -508,6 +495,8 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum,
        }
 
        wprintf("</td></tr>\n");
+       wprintf("</div>\n");                            /* end 'weekday_selector' div */
+
        wprintf("</table>\n");
        wprintf("</div>\n");                            /* end 'rrule' div */
 
index 1b3b8f78c65eea6d4dd2e2c457841d67033ebf5f..00d6c577ff80b79a150c92921af4d8588d6c6f31 100644 (file)
@@ -986,10 +986,19 @@ function eventEditAllDay() {
 // Functions which handle show/hide of various elements in the recurrence editor
 
 function RecurrenceShowHide() {
+
        if ($('is_recur').checked) {
                $('rrule').style.display = 'block';
        }
        else {
                $('rrule').style.display = 'none';
        }
+
+       if ($('freq_selector').selectedIndex == 4) {
+               $('weekday_selector').style.display = 'block';
+       }
+       else {
+               $('weekday_selector').style.display = 'none';
+       }
+
 }