* Chat now appears in a separate window
authorArt Cancro <ajc@citadel.org>
Mon, 15 Mar 2004 04:27:44 +0000 (04:27 +0000)
committerArt Cancro <ajc@citadel.org>
Mon, 15 Mar 2004 04:27:44 +0000 (04:27 +0000)
* Use regular frames instead of IFRAMEs for chat
* Display user's own chat text in bold+italic
* Added a "List Users" button

webcit/ChangeLog
webcit/iconbar.c
webcit/mainmenu.c
webcit/paging.c

index 1c377bc145236cb90b1597cbeede6a3f5e931f68..ba157ea5a209861928aae187231d49cc0f784cf6 100644 (file)
@@ -1,4 +1,10 @@
 $Log$
+Revision 505.15  2004/03/15 04:27:44  ajc
+* Chat now appears in a separate window
+* Use regular frames instead of IFRAMEs for chat
+* Display user's own chat text in bold+italic
+* Added a "List Users" button
+
 Revision 505.14  2004/03/09 20:45:45  error
 * Add a Linux Software Map file
 
@@ -1718,3 +1724,4 @@ 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 c3adb4ed23b80f05f73e2e78a15b50b1576fd5f2..1dde972045501eb6d6351a0050033219f15699c6 100644 (file)
@@ -202,7 +202,7 @@ void do_iconbar(void) {
                        "<A HREF=\"#\" onClick=\"window.open('/chat', "
                        "'ctdl_chat_window', "
                        "'toolbar=no,location=no,directories=no,copyhistory=no,"
-                       "status=yes,scrollbars=yes,resizable=yes');\""
+                       "status=no,scrollbars=yes,resizable=yes');\""
                        ">"
                );
                if (ib_displayas != IB_TEXTONLY) {
index e8e07fbf5dbf78bc2ba873776d64b07aa70b147e..d2c4f65f4b15dfab4aa2d659917f7b5cdd14a751 100644 (file)
@@ -144,7 +144,7 @@ void display_main_menu(void)
        wprintf("<A HREF=\"#\" onClick=\"window.open('/chat', "
                "'ctdl_chat_window', "
                "'toolbar=no,location=no,directories=no,copyhistory=no,"
-               "status=yes,scrollbars=yes,resizable=yes');\""
+               "status=no,scrollbars=yes,resizable=yes');\""
                ">"
                "<span class=\"mainmenu\">"
                "Chat with other users in <i>"
index cbfdd7accb5e39b4f7de64a21a6ae1eb5ce84677..b3d4b177765e506cac6f741571d05d77c8813f12 100644 (file)
@@ -338,11 +338,18 @@ void chat_recv(void) {
                        extract_token(cl_text, buf, 1, '|');
 
                        wprintf("parent.chat_transcript.document.write('");
-                       wprintf("<FONT SIZE=-1><B>");
+                       wprintf("<FONT SIZE=-1>");
+                       wprintf("<B>");
+                       if (!strcasecmp(cl_user, WC->wc_username)) {
+                               wprintf("<I>");
+                       }
                        jsescputs(cl_user);
-                       wprintf(":</B> ");
+                       wprintf(": ");
+                       if (strcasecmp(cl_user, WC->wc_username)) {
+                               wprintf("</B>");
+                       }
                        jsescputs(cl_text);
-                       wprintf("</FONT><BR>");
+                       wprintf("</I></B></FONT><BR>");
                        wprintf("'); \n");
                }
 
@@ -362,6 +369,7 @@ void chat_recv(void) {
 void chat_send(void) {
        int i;
        char send_this[SIZ];
+       char buf[SIZ];
 
        output_headers(0);
        wprintf("Content-type: text/html\n");
@@ -383,6 +391,10 @@ void chat_send(void) {
                        strcpy(send_this, "/help");
                }
 
+               if (!strcasecmp(bstr("sendbutton"), "List Users")) {
+                       strcpy(send_this, "/who");
+               }
+
                if (!strcasecmp(bstr("sendbutton"), "Exit")) {
                        strcpy(send_this, "/quit");
                }
@@ -398,7 +410,21 @@ void chat_send(void) {
                WC->serv_sock = WC->chat_sock;
                WC->chat_sock = i;
 
-               serv_puts(send_this);
+               while (strlen(send_this) > 0) {
+                       if (strlen(send_this) < 72) {
+                               serv_puts(send_this);
+                               strcpy(send_this, "");
+                       }
+                       else {
+                               for (i=60; i<72; ++i) {
+                                       if (send_this[i] == ' ') break;
+                               }
+                               strncpy(buf, send_this, i);
+                               buf[i] = 0;
+                               strcpy(send_this, &send_this[i]);
+                               serv_puts(buf);
+                       }
+               }
 
                /* Unswap the sockets. */
                i = WC->serv_sock;
@@ -408,9 +434,12 @@ void chat_send(void) {
        }
 
        wprintf("<FORM METHOD=\"POST\" ACTION=\"/chat_send\" NAME=\"chatsendform\">\n");
-       wprintf("<INPUT TYPE=\"text\" SIZE=\"80\" MAXLENGTH=\"80\" NAME=\"send_this\">\n");
+       wprintf("<INPUT TYPE=\"text\" SIZE=\"80\" MAXLENGTH=\"%d\" "
+               "NAME=\"send_this\">\n", SIZ-10);
+       wprintf("<BR>");
        wprintf("<INPUT TYPE=\"submit\" NAME=\"sendbutton\" VALUE=\"Send\">\n");
        wprintf("<INPUT TYPE=\"submit\" NAME=\"sendbutton\" VALUE=\"Help\">\n");
+       wprintf("<INPUT TYPE=\"submit\" NAME=\"sendbutton\" VALUE=\"List Users\">\n");
        wprintf("<INPUT TYPE=\"submit\" NAME=\"sendbutton\" VALUE=\"Exit\">\n");
        wprintf("</FORM>\n");