]> code.citadel.org Git - citadel.git/blobdiff - webcit/paging.c
* Made all the title boxes the same background color. The old scheme was
[citadel.git] / webcit / paging.c
index cbfdd7accb5e39b4f7de64a21a6ae1eb5ce84677..be11aad49e09c982929516f0d49b35581a5e9313 100644 (file)
@@ -158,7 +158,7 @@ void page_popup(void)
 
                extract(pagefrom, &buf[4], 3);
 
-               wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#007700\"><TR><TD>");
+               wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>");
                wprintf("<SPAN CLASS=\"titlebar\">Instant message from ");
                escputs(pagefrom);
                wprintf("</SPAN></TD></TR></TABLE>\n");
@@ -337,13 +337,55 @@ void chat_recv(void) {
                        extract_token(cl_user, buf, 0, '|');
                        extract_token(cl_text, buf, 1, '|');
 
-                       wprintf("parent.chat_transcript.document.write('");
-                       wprintf("<FONT SIZE=-1><B>");
-                       jsescputs(cl_user);
-                       wprintf(":</B> ");
-                       jsescputs(cl_text);
-                       wprintf("</FONT><BR>");
-                       wprintf("'); \n");
+                       if (strcasecmp(cl_text, "NOOP")) {
+
+                               wprintf("parent.chat_transcript.document.write('");
+       
+                               if (strcasecmp(cl_user, WC->last_chat_user)) {
+                                       wprintf("<TABLE border=0 WIDTH=100%% "
+                                               "CELLSPACING=1 CELLPADDING=0 "
+                                               "BGCOLOR=&quot;#FFFFFF&quot;>"
+                                               "<TR><TD></TR></TD></TABLE>"
+                                       );
+       
+                               }
+
+                               wprintf("<TABLE border=0 WIDTH=100%% "
+                                       "CELLSPACING=0 CELLPADDING=0 "
+                                       "BGCOLOR=&quot;#EEEEEE&quot;>");
+       
+                               wprintf("<TR><TD>");
+       
+                               if (!strcasecmp(cl_user, ":")) {
+                                       wprintf("<I>");
+                               }
+
+                               if (strcasecmp(cl_user, WC->last_chat_user)) {
+                                       wprintf("<B>");
+       
+                                       if (!strcasecmp(cl_user, WC->wc_username)) {
+                                               wprintf("<FONT COLOR=&quot;#FF0000&quot;>");
+                                       }
+                                       else {
+                                               wprintf("<FONT COLOR=&quot;#0000FF&quot;>");
+                                       }
+                                       jsescputs(cl_user);
+       
+                                       wprintf("</FONT>: </B>");
+                               }
+                               else {
+                                       wprintf("&nbsp;&nbsp;&nbsp;");
+                               }
+                               jsescputs(cl_text);
+                               if (!strcasecmp(cl_user, ":")) {
+                                       wprintf("</I>");
+                               }
+
+                               wprintf("</TD></TR></TABLE>");
+                               wprintf("'); \n");
+
+                               strcpy(WC->last_chat_user, cl_user);
+                       }
                }
 
                wprintf("parent.chat_transcript.scrollTo(999999,999999);\">\n");
@@ -362,6 +404,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 +426,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 +445,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 +469,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");