]> code.citadel.org Git - citadel.git/commitdiff
* More intelligent JavaScript to handle the greying out of end date and
authorArt Cancro <ajc@citadel.org>
Thu, 14 Jul 2005 04:21:53 +0000 (04:21 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 14 Jul 2005 04:21:53 +0000 (04:21 +0000)
  start/end times when "all day event" is selected.

webcit/ChangeLog
webcit/event.c

index 4eed4c6e10a34a8b9254a1703871cd03d805e029..8516b132a4d6a07491ec2839c41555b7d98a520e 100644 (file)
@@ -1,4 +1,8 @@
 $Log$
+Revision 619.24  2005/07/14 04:21:53  ajc
+* More intelligent JavaScript to handle the greying out of end date and
+  start/end times when "all day event" is selected.
+
 Revision 619.23  2005/07/14 04:02:18  ajc
 * Fix bug #147 (date sometimes saved incorrectly for all day events due
   to timezone differences)
@@ -2699,4 +2703,3 @@ Sun Dec  6 19:50:55 EST 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
 
 1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
        * webserver.c: warning fix
-
index 67338c9d989d41daf55aae3df69e0381eceb501d..87586aaf00810a0e492653e801ab4a9438545f32 100644 (file)
@@ -92,6 +92,35 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum)
                "</div>\n<div id=\"content\">\n"
        );
 
+       wprintf("<script type=\"text/javascript\">"
+               "function grey_all_day() { "
+                       "if (document.EventForm.alldayevent.checked) {"
+                               "document.EventForm.dtstart_hour.value='0';"
+                               "document.EventForm.dtstart_hour.disabled = true;"
+                               "document.EventForm.dtstart_minute.value='0';"
+                               "document.EventForm.dtstart_minute.disabled = true;"
+                               "document.EventForm.dtend_hour.value='0';"
+                               "document.EventForm.dtend_hour.disabled = true;"
+                               "document.EventForm.dtend_minute.value='0';"
+                               "document.EventForm.dtend_minute.disabled = true;"
+                               "document.EventForm.dtend_month.disabled = true;"
+                               "document.EventForm.dtend_day.disabled = true;"
+                               "document.EventForm.dtend_year.disabled = true;"
+                       "}"
+                       "else {"
+                               "document.EventForm.dtstart_hour.disabled = false;"
+                               "document.EventForm.dtstart_minute.disabled = false;"
+                               "document.EventForm.dtend_hour.disabled = false;"
+                               "document.EventForm.dtend_minute.disabled = false;"
+                               "document.EventForm.dtend_month.disabled = false;"
+                               "document.EventForm.dtend_day.disabled = false;"
+                               "document.EventForm.dtend_year.disabled = false;"
+                       "}"
+               "}"
+               "</script>\n"
+       );
+
+
        wprintf("<div id=\"fix_scrollbar_bug\">"
                "<table border=0 width=100%% bgcolor=\"#ffffff\"><tr><td>\n");
 
@@ -179,33 +208,8 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum)
        display_icaltimetype_as_webform(&t_start, "dtstart");
 
        wprintf("<INPUT TYPE=\"checkbox\" NAME=\"alldayevent\" "
-               "VALUE=\"yes\" onClick=\""
-""
-"                      if (this.checked) { "
-"                              this.form.dtstart_hour.value='0'; "
-"                              this.form.dtstart_hour.disabled = true; "
-"                              this.form.dtstart_minute.value='0'; "
-"                              this.form.dtstart_minute.disabled = true; "
-"                              this.form.dtend_hour.value='0'; "
-"                              this.form.dtend_hour.disabled = true; "
-"                              this.form.dtend_minute.value='0'; "
-"                              this.form.dtend_minute.disabled = true; "
-"                              this.form.dtend_month.disabled = true; "
-"                              this.form.dtend_day.disabled = true; "
-"                              this.form.dtend_year.disabled = true; "
-"                      } "
-"                      else { "
-"                              this.form.dtstart_hour.disabled = false; "
-"                              this.form.dtstart_minute.disabled = false; "
-"                              this.form.dtend_hour.disabled = false; "
-"                              this.form.dtend_minute.disabled = false; "
-"                              this.form.dtend_month.disabled = false; "
-"                              this.form.dtend_day.disabled = false; "
-"                              this.form.dtend_year.disabled = false; "
-"                      } "
-" "
-" "
-"              \" %s >All day event",
+               "VALUE=\"yes\" onClick=\"grey_all_day();\""
+               " %s >All day event",
                (t_start.is_date ? "CHECKED" : "" )
        );
 
@@ -374,35 +378,11 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum)
 
        wprintf("</FORM>\n");
        
+       wprintf("</td></tr></table></div>\n");
        wprintf("<script type=\"text/javascript\">"
-               "<!--"
-                       "if (document.EventForm.alldayevent.checked) {"
-                               "document.EventForm.dtstart_hour.value='0';"
-                               "document.EventForm.dtstart_hour.disabled = true;"
-                               "document.EventForm.dtstart_minute.value='0';"
-                               "document.EventForm.dtstart_minute.disabled = true;"
-                               "document.EventForm.dtend_hour.value='0';"
-                               "document.EventForm.dtend_hour.disabled = true;"
-                               "document.EventForm.dtend_minute.value='0';"
-                               "document.EventForm.dtend_minute.disabled = true;"
-                               "document.EventForm.dtend_month.disabled = true;"
-                               "document.EventForm.dtend_day.disabled = true;"
-                               "document.EventForm.dtend_year.disabled = true;"
-                       "}"
-                       "else {"
-                               "document.EventForm.dtstart_hour.disabled = false;"
-                               "document.EventForm.dtstart_minute.disabled = false;"
-                               "document.EventForm.dtend_hour.disabled = false;"
-                               "document.EventForm.dtend_minute.disabled = false;"
-                               "document.EventForm.dtend_month.disabled = false;"
-                               "document.EventForm.dtend_day.disabled = false;"
-                               "document.EventForm.dtend_year.disabled = false;"
-                       "}"
-               "//-->"
+               "grey_all_day();"
                "</script>\n"
        );
-
-       wprintf("</td></tr></table></div>\n");
        wDumpContent(1);
 
        if (created_new_vevent) {