* 'Check Attendee Availability' button is now enabled or disabled depending upon...
authorArt Cancro <ajc@citadel.org>
Fri, 20 Feb 2009 21:47:01 +0000 (21:47 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 20 Feb 2009 21:47:01 +0000 (21:47 +0000)
webcit/event.c
webcit/static/wclib.js

index f8fb1611f836e4b097d9d901cc347166b7f5e68f..25ad1514a3c1a3dc7beee05bef321c60c88e79fd 100644 (file)
@@ -133,7 +133,7 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum,
        wprintf("SEQUENCE == %d<br />\n", sequence);
        *************************************************************/
 
-       wprintf("<FORM NAME=\"EventForm\" METHOD=\"POST\" action=\"save_event\">\n");
+       wprintf("<form name=\"EventForm\" method=\"POST\" action=\"save_event\">\n");
        wprintf("<input type=\"hidden\" name=\"nonce\" value=\"%d\">\n", WC->nonce);
 
        wprintf("<INPUT TYPE=\"hidden\" NAME=\"msgnum\" VALUE=\"%ld\">\n",
@@ -388,6 +388,8 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum,
 
        wprintf("</TD><TD>"
                "<TEXTAREA %s NAME=\"attendees\" id=\"attendees_box\" wrap=soft "
+               "onchange=\"EnableOrDisableCheckButton();\" "
+               "onKeyPress=\"EnableOrDisableCheckButton();\" "
                "ROWS=10 COLS=72 WIDTH=72>\n",
                (organizer_is_me ? "" : "DISABLED ")
        );
@@ -708,8 +710,7 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum,
                "&nbsp;&nbsp;"
                "<INPUT TYPE=\"submit\" NAME=\"delete_button\" VALUE=\"%s\">\n"
                "&nbsp;&nbsp;"
-               "<INPUT TYPE=\"submit\" NAME=\"check_button\" "
-                               "VALUE=\"%s\">\n"
+               "<INPUT TYPE=\"submit\" id=\"check_button\" NAME=\"check_button\" VALUE=\"%s\">\n"
                "&nbsp;&nbsp;"
                "<INPUT TYPE=\"submit\" NAME=\"cancel_button\" VALUE=\"%s\">\n"
                "</CENTER>\n",
@@ -724,8 +725,9 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum,
        wprintf("</div>\n");                    /* end 'fix_scrollbar_bug' div */
 
        StrBufAppendPrintf(WC->trailing_javascript,
-               "eventEditAllDay();     \n"
-               "RecurrenceShowHide();  \n"
+               "eventEditAllDay();             \n"
+               "RecurrenceShowHide();          \n"
+               "EnableOrDisableCheckButton();  \n"
        );
        address_book_popup();
        wDumpContent(1);
index 01febd884da1a311a67f8c3979507050ac02fac3..be07284322ef7bd4b41bfa3605be31882dabd6d4 100644 (file)
@@ -783,6 +783,23 @@ function RecurrenceShowHide() {
        }
 
 }
+
+
+// Enable or disable the 'check attendee availability' button depending on whether
+// the attendees list is empty
+function EnableOrDisableCheckButton()
+{
+       if ($('attendees_box').value.length == 0) {
+               $('check_button').disabled = true;
+       }
+       else {
+               $('check_button').disabled = false;
+       }
+}
+
+
+
+
 function launchChat(event) {
 window.open('chat', 'ctdl_chat_window', 'toolbar=no,location=no,directories=no,copyhistory=no,status=no,scrollbars=yes,resizable=yes');
 }