From 3be3ef125429f631e435ff2d55ecbef95209d5f8 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Thu, 23 Mar 2000 04:45:18 +0000 Subject: [PATCH] * Experimental move of wholist to a separate auto-refreshing window --- webcit/ChangeLog | 4 +- webcit/static/menubar.html | 12 ++++- webcit/webcit.c | 23 +++++++--- webcit/who.c | 92 +++++++++++++------------------------- 4 files changed, 61 insertions(+), 70 deletions(-) diff --git a/webcit/ChangeLog b/webcit/ChangeLog index a42cf9778..bf6ebc72d 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -1,4 +1,7 @@ $Log$ +Revision 211.6 2000/03/23 04:45:15 ajc +* Experimental move of wholist to a separate auto-refreshing window + Revision 211.5 2000/03/19 22:49:03 ajc * Made the header-bar buttons more visible * Added a "reply" header-bar button @@ -392,4 +395,3 @@ Sun Dec 6 19:50:55 EST 1998 Art Cancro 1998-12-03 Nathan Bryant * webserver.c: warning fix - diff --git a/webcit/static/menubar.html b/webcit/static/menubar.html index 5c934edcd..89bf5fdc3 100644 --- a/webcit/static/menubar.html +++ b/webcit/static/menubar.html @@ -1,3 +1,11 @@ + +


@@ -46,7 +54,9 @@ - Who is online? + + Who is online? + diff --git a/webcit/webcit.c b/webcit/webcit.c index fa50cc046..57d11dbc6 100644 --- a/webcit/webcit.c +++ b/webcit/webcit.c @@ -268,17 +268,25 @@ void urlescputs(char *strbuf) /* * Output all that important stuff that the browser will want to see * - * print_standard_html_head values: + * control codes: + * + * Bits 0 and 1: * 0 = Nothing. Do not display any leading HTTP or HTML. * 1 = HTTP headers plus the "fake frames" found in most windows. * 2 = HTTP headers required to terminate the session (unset cookies) - * 3 = HTTP headers only. + * 3 = HTTP and HTML headers, but no 'fake frames' + * + * Bit 2: Set to 1 to auto-refresh page every 30 seconds */ -void output_headers(int print_standard_html_head) +void output_headers(int controlcode) { - static char *unset = "; expires=28-May-1971 18:10:00 GMT"; char cookie[256]; + int print_standard_html_head = 0; + int refresh30 = 0; + + print_standard_html_head = controlcode & 0x03; + refresh30 = ((controlcode & 0x04) >> 2); wprintf("HTTP/1.0 200 OK\n"); @@ -303,8 +311,11 @@ void output_headers(int print_standard_html_head) wprintf(""); escputs(serv_info.serv_humannode); wprintf("\n" - "\n" - "\n"); + "\n" + "\n"); + if (refresh30) wprintf( + "\n"); + wprintf("\n"); if (WC->ExpressMessages != NULL) { wprintf("\n" + ); wprintf("
"); wprintf("Users currently on "); escputs(serv_info.serv_humannode); wprintf("
\n"); - wprintf("
\n\n\n"); - wprintf("\n"); - wprintf("\n"); - wprintf(""); - wprintf("\n\n"); + wprintf("\n"); + wprintf("
\n
Session IDUser NameRoomFrom host
\n\n"); + wprintf("\n"); + wprintf("\n"); + wprintf(""); + wprintf("\n\n"); serv_puts("RWHO"); serv_gets(buf); if (buf[0] == '1') { @@ -105,42 +114,28 @@ void whobbs(void) } while (wlist != NULL) { - wprintf("\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n"); + wprintf("\n"); wptr = wlist->next; free(wlist); wlist = wptr; @@ -148,8 +143,8 @@ void whobbs(void) } wprintf("
Session IDUser NameRoomFrom host
%d", wlist->sessionnum); + wprintf("
%d", wlist->sessionnum); if ((WC->is_aide) && (wlist->sessionnum != serv_info.serv_pid)) { wprintf(" sessionnum); urlescputs(wlist->username); - wprintf("\">(kill)"); + wprintf("\" onClick=\"return ConfirmKill();\" " + ">(kill)"); } if (wlist->sessionnum == serv_info.serv_pid) { - wprintf(" (edit)"); + wprintf(" (edit)"); } /* username */ - wprintf("username); - wprintf("\" onMouseOver=\"window.status='View profile for "); + wprintf(""); escputs(wlist->username); - wprintf("'; return true\">"); - escputs(wlist->username); - wprintf(""); /* room */ - wprintf(""); - /* handle chat */ - if (strstr(wlist->roomname, "chat") != NULL) { - wprintf("<chat>"); - } else { - wprintf("roomname); - wprintf("\" onMouseOver=\"window.status='Go to room "); - escputs(wlist->roomname); - wprintf("'; return true\">"); - escputs(wlist->roomname); - wprintf(""); - } - wprintf(""); + wprintf(""); + escputs(wlist->roomname); + wprintf(""); /* hostname */ escputs(wlist->hostname); - wprintf("
\n

\n"); wprintf("\n\n
\n"); - wprintf("Refresh\n"); - wprintf("
\n
"); + wprintf("Close window\n"); + wprintf("\n\n
"); wDumpContent(1); } @@ -158,36 +153,9 @@ void terminate_session(void) { char buf[256]; - if (!strcasecmp(bstr("confirm"), "Yes")) { - serv_printf("TERM %s", bstr("which_session")); - serv_gets(buf); - if (buf[0] == '2') { - whobbs(); - } else { - display_error(&buf[4]); - } - } else { - output_headers(1); - wprintf("
"); - wprintf("Confirm session termination"); - wprintf("
\n"); - - wprintf("Are you sure you want to terminate session %s", - bstr("which_session")); - if (strlen(bstr("session_owner")) > 0) { - wprintf(" ("); - escputs(bstr("session_owner")); - wprintf(")"); - } - wprintf("?

\n"); - - wprintf("", - bstr("which_session")); - wprintf("Yes   "); - wprintf("No
"); - wDumpContent(1); - } - + serv_printf("TERM %s", bstr("which_session")); + serv_gets(buf); + whobbs(); } -- 2.39.2