* 'whobbs' is now 'who'
authorArt Cancro <ajc@citadel.org>
Fri, 22 Jul 2005 15:07:29 +0000 (15:07 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 22 Jul 2005 15:07:29 +0000 (15:07 +0000)
* Refactored the wholist code to have its inner div output by a separate
  function, in anticipation of possible ajax functionality being added

webcit/ChangeLog
webcit/iconbar.c
webcit/static/menubar.html
webcit/webcit.c
webcit/webcit.h
webcit/who.c

index 2830db5437f3d7f06c3358ae95aea52cff5b79e9..0d6c9da0ca9066ec04da12e5da756dc7c098338f 100644 (file)
@@ -1,4 +1,9 @@
 $Log$
+Revision 619.31  2005/07/22 15:07:29  ajc
+* 'whobbs' is now 'who'
+* Refactored the wholist code to have its inner div output by a separate
+  function, in anticipation of possible ajax functionality being added
+
 Revision 619.30  2005/07/22 04:03:30  ajc
 * HTML messages in foreign character sets are now converted to UTF-8 for
   display.
@@ -2732,3 +2737,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 3faf9809d66a4cc790b7710304549f883b7882d9..65efed0bcd4640d79c2d604e53f0bd081c3c6f8f 100644 (file)
@@ -217,7 +217,7 @@ void do_iconbar(void) {
 
        if (ib_users) {
                wprintf("<li>"
-                       "<A HREF=\"/whobbs\" TITLE=\"See who is online right now\" "
+                       "<A HREF=\"/who\" TITLE=\"See who is online right now\" "
                        ">"
                );
                if (ib_displayas != IB_TEXTONLY) {
index 3ed56e55b13be63ca04e9910bd6bafe7e6e43527..cd2c8ab76c87ca5e302c8346cabe2db03577780b 100644 (file)
@@ -1,7 +1,7 @@
 <script type="text/javascript">
 <!--hide
        function OpenWholist() {
-               window.open('/whobbs', 'whobbs', 'toolbar=no,location=no,directories=no,copyhistory=no,status=yes,scrollbars=yes,resizable=yes,height=200,width=600');
+               window.open('/who', 'who', 'toolbar=no,location=no,directories=no,copyhistory=no,status=yes,scrollbars=yes,resizable=yes,height=200,width=600');
        }
 //-->
 </script>
index 3dc05c5fd969c8d559104c3b6060a0bd9f0dd4da..1d6b7be49e2bc8705cfa441236ff1cd133e8117c 100644 (file)
@@ -1157,8 +1157,8 @@ void session_loop(struct httprequest *req)
                display_aide_menu();
        } else if (!strcasecmp(action, "display_main_menu")) {
                display_main_menu();
-       } else if (!strcasecmp(action, "whobbs")) {
-               whobbs();
+       } else if (!strcasecmp(action, "who")) {
+               who();
        } else if (!strcasecmp(action, "knrooms")) {
                knrooms();
        } else if (!strcasecmp(action, "gotonext")) {
index 5fc1b2b5611f0d9bf55b33de5f96a14046356472..1e761dd17d1f2f07f7f60bc162b6fcea6f2ee5a3 100644 (file)
@@ -293,7 +293,7 @@ int uds_connectsock(char *);
 int tcp_connectsock(char *, char *);
 void serv_getln(char *strbuf, int bufsize);
 void serv_puts(char *string);
-void whobbs(void);
+void who(void);
 void fmout(FILE *fp, char *align);
 void wDumpContent(int);
 void serv_printf(const char *format,...);
index f506e2d6b60073bc35eceda3446564fac6b28e42..d6fd0512ac6899f574636fca91575acd0bc347fe 100644 (file)
 
 
 
-
-
-
 /*
- * who is on?
+ * Display inner div of Wholist
  */
-void whobbs(void)
-{
+void who_inner_div(void) {
        char buf[SIZ], user[SIZ], room[SIZ], host[SIZ],
                realroom[SIZ], realhost[SIZ];
        int sess;
@@ -42,28 +38,7 @@ void whobbs(void)
        time_t now;
        int bg = 0;
 
-       output_headers(1, 1, 2, 0, 1, 0, 0);
-
-       wprintf("<script type=\"text/javascript\">\n"
-               "function ConfirmKill() { \n"
-               "return confirm('Do you really want to kill this session?');\n"
-               "}\n"
-               "</script>\n"
-       );
-
-       wprintf("<div id=\"banner\">\n");
-       wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>");
-       wprintf("<IMG SRC=\"/static/usermanag_48x.gif\" ALT=\" \" ALIGN=MIDDLE>");
-       wprintf("<SPAN CLASS=\"titlebar\">&nbsp;Users currently on ");
-       escputs(serv_info.serv_humannode);
-       wprintf("</SPAN></TD><TD ALIGN=RIGHT>");
-       offer_start_page();
-       wprintf("</TD></TR></TABLE>\n");
-       wprintf("</div>\n"
-               "<div id=\"content\">\n");
-
-       wprintf("<div id=\"fix_scrollbar_bug\">"
-               "<table border=0 cellspacing=0 width=100%% bgcolor=\"#FFFFFF\">"
+       wprintf("<table border=0 cellspacing=0 width=100%% bgcolor=\"#FFFFFF\">"
                "<tr>\n");
        wprintf("<TH COLSPAN=3>&nbsp;</TH>\n");
        wprintf("<TH>User Name</TH>\n");
@@ -166,8 +141,42 @@ void whobbs(void)
                        wprintf("</TD>\n</TR>");
                }
        }
-       wprintf("</TABLE></div>\n"
-               "<div align=center>"
+       wprintf("</TABLE>");
+}
+
+
+
+/*
+ * who is on?
+ */
+void who(void)
+{
+       output_headers(1, 1, 2, 0, 1, 0, 0);
+
+       wprintf("<script type=\"text/javascript\">\n"
+               "function ConfirmKill() { \n"
+               "return confirm('Do you really want to kill this session?');\n"
+               "}\n"
+               "</script>\n"
+       );
+
+       wprintf("<div id=\"banner\">\n");
+       wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>");
+       wprintf("<IMG SRC=\"/static/usermanag_48x.gif\" ALT=\" \" ALIGN=MIDDLE>");
+       wprintf("<SPAN CLASS=\"titlebar\">&nbsp;Users currently on ");
+       escputs(serv_info.serv_humannode);
+       wprintf("</SPAN></TD><TD ALIGN=RIGHT>");
+       offer_start_page();
+       wprintf("</TD></TR></TABLE>\n");
+       wprintf("</div>\n");
+
+       wprintf("<div id=\"content\">\n");
+
+       wprintf("<div id=\"fix_scrollbar_bug\">");
+       who_inner_div();        /* Actual data handled by another function */
+       wprintf("</div>\n");
+
+       wprintf("<div align=center>"
                "Click on a name to read user info.  Click on "
                "<IMG ALIGN=MIDDLE SRC=\"/static/citadelchat_16x.gif\" ALT=\"(p)\" "
                "BORDER=0> to send an instant message to that user.</div>\n");
@@ -181,7 +190,7 @@ void terminate_session(void)
 
        serv_printf("TERM %s", bstr("which_session"));
        serv_getln(buf, sizeof buf);
-       whobbs();
+       who();
 }
 
 
@@ -195,17 +204,17 @@ void edit_me(void)
        if (!strcasecmp(bstr("sc"), "Change room name")) {
                serv_printf("RCHG %s", bstr("fake_roomname"));
                serv_getln(buf, sizeof buf);
-               http_redirect("/whobbs");
+               http_redirect("/who");
        } else if (!strcasecmp(bstr("sc"), "Change host name")) {
                serv_printf("HCHG %s", bstr("fake_hostname"));
                serv_getln(buf, sizeof buf);
-               http_redirect("/whobbs");
+               http_redirect("/who");
        } else if (!strcasecmp(bstr("sc"), "Change user name")) {
                serv_printf("UCHG %s", bstr("fake_username"));
                serv_getln(buf, sizeof buf);
-               http_redirect("/whobbs");
+               http_redirect("/who");
        } else if (!strcasecmp(bstr("sc"), "Cancel")) {
-               http_redirect("/whobbs");
+               http_redirect("/who");
        } else {
 
                output_headers(1, 1, 0, 0, 0, 0, 0);