* Checked in a copy of the "script.aculo.us" library by Thomas Fuchs.
authorArt Cancro <ajc@citadel.org>
Fri, 9 Sep 2005 04:43:23 +0000 (04:43 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 9 Sep 2005 04:43:23 +0000 (04:43 +0000)
  NOTE: I had to search-and-replace "Effect" to "ScriptaculousEffect" in
  all of their files, to avoid a conflict with the name "Effect" in Rico.
* Implemented recipient autocompletion when composing mail, using the
  script.aculo.us drop-down box and an ajax fetch.  Cool!!
Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)

webcit/ChangeLog
webcit/Makefile.in
webcit/README.txt
webcit/messages.c
webcit/webcit.c
webcit/webcit.h

index 86843c2e2fa5d7af4ebb7b9e649f6db646f3460e..0b0f9f903a8dfb0508affd947dad0304c17713ed 100644 (file)
@@ -1,4 +1,12 @@
 $Log$
+Revision 621.34  2005/09/09 04:43:22  ajc
+* Checked in a copy of the "script.aculo.us" library by Thomas Fuchs.
+  NOTE: I had to search-and-replace "Effect" to "ScriptaculousEffect" in
+  all of their files, to avoid a conflict with the name "Effect" in Rico.
+* Implemented recipient autocompletion when composing mail, using the
+  script.aculo.us drop-down box and an ajax fetch.  Cool!!
+Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
+
 Revision 621.33  2005/09/06 14:44:28  ajc
 * Altered the logic which determines whether to display a "Post message"
   or "Send message" button on the message entry screen.
@@ -2919,4 +2927,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 b53acba4ed29fba095aa53d942395523c384afaa..9c5cbe4de42c98cbce8d7797c2fa4fe0183cf773 100644 (file)
@@ -38,7 +38,7 @@ webserver: webserver.o context_loop.o tools.o ical_dezonify.o \
        calendar.o calendar_tools.o calendar_view.o event.o \
        availability.o iconbar.o crypto.o inetconf.o notes.o \
        groupdav_main.o groupdav_get.o groupdav_propfind.o fmt_date.o \
-       groupdav_options.o \
+       groupdav_options.o autocompletion.o \
        groupdav_delete.o groupdav_put.o http_datestring.o setup_wizard.o \
        $(LIBOBJS)
        $(CC) webserver.o context_loop.o tools.o cookie_conversion.o \
@@ -49,7 +49,7 @@ webserver: webserver.o context_loop.o tools.o ical_dezonify.o \
        summary.o calendar.o calendar_tools.o calendar_view.o event.o \
        availability.o ical_dezonify.o iconbar.o crypto.o inetconf.o notes.o \
        groupdav_main.o groupdav_get.o groupdav_propfind.o groupdav_delete.o \
-       groupdav_options.o \
+       groupdav_options.o autocompletion.o \
        groupdav_put.o http_datestring.o setup_wizard.o fmt_date.o \
        $(LIBOBJS) $(LIBS) $(LDFLAGS) -o webserver
 
index 9476927d2ae3d3f45bd8f9c3a268520059efada3..fc02c199b3add8ccf1c5bbbc752854c1bc7ecddd 100644 (file)
    Stephenson [http://prototype.conio.net].  These components are licensed to
    you under the terms of an MIT-style license.
 
+   WebCit bundles the script.aculo.us JavaScript library, written by
+   Thomas Fuchs [http://script.aculo.us, http://mir.aculo.us].  These
+   components are licensed to you under the terms of an MIT-style license.
+
+
    The Citadel logo was designed by Lisa Aurigemma.
  
  INTRODUCTION
index eda02b0af575eacd4c1ee50d5928bc79a229d851..38be780a4d504ca8e017ab32d6656d07dfeae6f6 100644 (file)
@@ -2054,6 +2054,11 @@ void display_enter(void)
 
        /* begin message entry screen */
 
+
+       wprintf(
+       "<style> div.auto_complete { width: 350px; background: #fff; } div.auto_complete ul { border:1px solid #888; margin:0; padding:0; width:100%; list-style-type:none; } div.auto_complete ul li { margin:0; padding:3px; } div.auto_complete ul li.selected { background-color: #ffb; } div.auto_complete ul strong.highlight { color: #800; margin:0; padding:0; } </style> \n "
+       );
+
        wprintf("<form enctype=\"multipart/form-data\" "
                "method=\"POST\" action=\"/post\" "
                "name=\"enterform\""
@@ -2074,9 +2079,19 @@ void display_enter(void)
                wprintf(_("To:"));
                wprintf("</font>");
                wprintf("</td><td>"
-                       "<input type=\"text\" name=\"recp\" value=\"");
+                       "<input autocomplete=\"off\" type=\"text\" name=\"recp\" id=\"recp_name\" value=\"");
                escputs(bstr("recp"));
-               wprintf("\" size=50 maxlength=70></td><td></td></tr>\n");
+               wprintf("\" size=50 maxlength=70>");
+       
+               wprintf("<div class=\"auto_complete\" id=\"recp_name_choices\"></div>");
+       
+               wprintf("<script type=\"text/javascript\">                                      "
+                       " new Ajax.Autocompleter('recp_name', 'recp_name_choices',              "
+                       "       '/recp_autocomplete', {} );                             "
+                       "</script>\n                                                            "
+               );
+
+               wprintf("</td><td></td></tr>\n");
        }
 
        wprintf("<tr><td>");
index 1c19ec3bd3b7eabe8dafbe8e2d103afcf0c50647..04ed981024890372c7e506223c10b4f2b97e2e77 100644 (file)
@@ -1351,6 +1351,8 @@ void session_loop(struct httprequest *req)
                display_preferences();
        } else if (!strcasecmp(action, "set_preferences")) {
                set_preferences();
+       } else if (!strcasecmp(action, "recp_autocomplete")) {
+               recp_autocomplete();
        } else if (!strcasecmp(action, "diagnostics")) {
                output_headers(1, 1, 1, 0, 0, 0, 0);
                wprintf("Session: %d<hr />\n", WC->wc_session);
@@ -1362,6 +1364,7 @@ void session_loop(struct httprequest *req)
                wprintf("</PRE><hr />\n");
                wDumpContent(1);
        }
+
        /* When all else fais, display the main menu. */
        else {
                display_main_menu();
index 21afcc042f153ed7add3680f273c5a1680069e4c..393646d524b9797c1a815ac5bf49a9a6d3050dbc 100644 (file)
@@ -522,6 +522,7 @@ void save_inetconf(void);
 void generate_uuid(char *);
 void display_preferences(void);
 void set_preferences(void);
+void recp_autocomplete(void);
 
 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
 void display_edit_task(void);