From 5df6130d8bd12e440131268635390f01ecbb063f Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Thu, 3 Jun 1999 03:48:55 +0000 Subject: [PATCH] * Ditched the frames mode completely. It wasn't working properly in, among other places, IE 5. Die, Bill, Die. --- webcit/ChangeLog | 4 ++++ webcit/auth.c | 24 ++------------------- webcit/braindamage.c | 6 +++--- webcit/context_loop.c | 2 +- webcit/cookie_conversion.c | 8 +++---- webcit/mainmenu.c | 11 ++-------- webcit/roomops.c | 26 ++++------------------ webcit/static/menubar.html | 22 +++++++++---------- webcit/webcit.c | 44 +++++++++++++++++--------------------- webcit/webcit.h | 18 ++++++++-------- webcit/who.c | 2 +- webcit/wildmat.c | 10 ++++----- 12 files changed, 64 insertions(+), 113 deletions(-) diff --git a/webcit/ChangeLog b/webcit/ChangeLog index 98093203a..71e401818 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -1,3 +1,7 @@ +Wed Jun 2 23:47:58 EDT 1999 Art Cancro + * Ditched the frames mode completely. It wasn't working properly in, + among other places, IE 5. Die, Bill, Die. + Sat May 29 00:25:47 EDT 1999 Art Cancro * Fixed the behavior of the "forget room" routine, to properly handle the transition back to the Lobby after it's all done. diff --git a/webcit/auth.c b/webcit/auth.c index 2301c38d8..738de528d 100644 --- a/webcit/auth.c +++ b/webcit/auth.c @@ -36,7 +36,7 @@ void display_login(char *mesg) char buf[256]; printf("HTTP/1.0 200 OK\n"); - output_headers(1); + output_headers(3); /* Da banner */ wprintf("
\n"); @@ -68,15 +68,6 @@ void display_login(char *mesg) wprintf("\n"); wprintf("\n"); - /* Only offer the "check to disable frames" selection if frames haven't - * already been disabled by the browser braindamage check. - */ - if (noframes == 0) { - wprintf("
"); - wprintf(" Check here to disable frames\n"); - wprintf("\n"); - } - /* Da instructions */ wprintf("
  • If you already have an account on %s,", serv_info.serv_humannode); @@ -115,12 +106,6 @@ void do_login(void) int need_regi = 0; - /* Note that the initial value of noframes is set by the browser braindamage - * check, so don't add an "else" clause here. - */ - if (!strcasecmp(bstr("noframes"), "on")) - noframes = 1; - if (!strcasecmp(bstr("action"), "Exit")) { do_logout(); } @@ -175,12 +160,7 @@ void do_login(void) void do_welcome(void) { - - if (noframes) { - smart_goto("_BASEROOM_"); - } else { - output_static("frameset.html"); - } + smart_goto("_BASEROOM_"); } diff --git a/webcit/braindamage.c b/webcit/braindamage.c index 71056f5af..564cda569 100644 --- a/webcit/braindamage.c +++ b/webcit/braindamage.c @@ -14,11 +14,11 @@ * * Given the value of the HTTP "User-agent:" directive supplied by * a web browser, determine using a local configuration file whether - * the browser is capable of handling WebCit's frames/JavaScript mode. + * the browser is capable of handling JavaScript. * * This function returns one of the following values: - * B_YES (Yes, it's ok to use frames and JavaScript) - * B_NO (No, fall back to the noframes version) + * B_YES (Yes, it's ok to use JavaScript) + * B_NO (No, fall back to HTML) * B_ASK (We don't know; ask the user) */ diff --git a/webcit/context_loop.c b/webcit/context_loop.c index 6128100ad..1088fc7e1 100644 --- a/webcit/context_loop.c +++ b/webcit/context_loop.c @@ -271,7 +271,7 @@ void *context_loop(int sock) req_gets(sock, buf, hold); if (!strncasecmp(buf, "Cookie: webcit=", 15)) { cookie_to_stuff(&buf[15], &desired_session, - NULL, NULL, NULL, NULL); + NULL, NULL, NULL); got_cookie = 1; } else if (!strncasecmp(buf, "Content-length: ", 16)) { diff --git a/webcit/cookie_conversion.c b/webcit/cookie_conversion.c index a4865f7d9..3bb3554b9 100644 --- a/webcit/cookie_conversion.c +++ b/webcit/cookie_conversion.c @@ -11,12 +11,12 @@ /* * Pack all session info into one easy-to-digest cookie. Healthy and delicious! */ -void stuff_to_cookie(char *cookie, int session, char *user, char *pass, char *room, int nofr) +void stuff_to_cookie(char *cookie, int session, char *user, char *pass, char *room) { char buf[256]; int i; - sprintf(buf, "%d|%s|%s|%s|%d", session, user, pass, room, nofr); + sprintf(buf, "%d|%s|%s|%s", session, user, pass, room); strcpy(cookie, ""); for (i = 0; i < strlen(buf); ++i) @@ -28,7 +28,7 @@ void stuff_to_cookie(char *cookie, int session, char *user, char *pass, char *ro /* * Extract all that fun stuff out of the cookie. */ -void cookie_to_stuff(char *cookie, int *session, char *user, char *pass, char *room, int *nofr) +void cookie_to_stuff(char *cookie, int *session, char *user, char *pass, char *room) { char buf[256]; int i; @@ -46,6 +46,4 @@ void cookie_to_stuff(char *cookie, int *session, char *user, char *pass, char *r extract(pass, buf, 2); if (room != NULL) extract(room, buf, 3); - if (nofr != NULL) - *nofr = extract_int(buf, 4); } diff --git a/webcit/mainmenu.c b/webcit/mainmenu.c index d35460da9..543a86ce1 100644 --- a/webcit/mainmenu.c +++ b/webcit/mainmenu.c @@ -314,14 +314,13 @@ void do_generic(void) /* - * Display the menubar. Set as_single_page to 1 if we're inside a frameset - * and need to display HTML headers and footers -- otherwise it's assumed + * Display the menubar. Set as_single_page to + * display HTML headers and footers -- otherwise it's assumed * that the menubar is being embedded in another page. */ void display_menubar(int as_single_page) { FILE *menubar_body; char buf[256]; - int i; if (as_single_page) { printf("HTTP/1.0 200 OK\n"); @@ -343,12 +342,6 @@ void display_menubar(int as_single_page) { wprintf("menubar
    %s", strerror(errno)); } else { while (fgets(buf, sizeof(buf), menubar_body) != NULL) { - /* Sleazy hack to disable TARGET= directive */ - if (noframes) for (i=0; i"); escputs1(rmname, 1); if ((f & QR_DIRECTORY) && (f & QR_NETWORK)) @@ -403,11 +402,6 @@ void gotoroom(char *gname, int display_name) output_headers(0); wprintf("\n\n"); } if (display_name != 2) { @@ -561,19 +555,8 @@ void gotonext(void) void smart_goto(char *next_room) { - /* In noframes mode, we goto the room silently, then do a - * read-new-messages which causes the banner to show up anyway. - */ - if (noframes) { - gotoroom(next_room, 0); - readloop("readnew"); - } else { - /* In frames mode, we let gotoroom() bring up the banner, which then - * uses JavaScript to bring up the new-messages display in the - * bottom frame. - */ - gotoroom(next_room, 1); - } + gotoroom(next_room, 0); + readloop("readnew"); } @@ -1122,9 +1105,8 @@ void display_zap(void) wprintf("disappear from your room list. Is this what you wish "); wprintf("to do?
    \n"); - wprintf("
    \n"); + wprintf("\n"); + wprintf(""); wprintf(""); wprintf("
    \n"); wDumpContent(1); diff --git a/webcit/static/menubar.html b/webcit/static/menubar.html index 88c4704c5..5637da877 100644 --- a/webcit/static/menubar.html +++ b/webcit/static/menubar.html @@ -5,66 +5,66 @@
  • - List known rooms + List known rooms
    - Goto next room + Goto next room
    - Skip this room + Skip this room
    - Ungoto + Ungoto
    - Read new messages + Read new messages
    - Read all messages + Read all messages
    - Enter a message + Enter a message
    - Who is online? + Who is online?
    - User list + User list
    - Advanced options + Advanced options
    - Log off
    + Log off
    diff --git a/webcit/webcit.c b/webcit/webcit.c index 0f577f5c0..2972ca1c3 100644 --- a/webcit/webcit.c +++ b/webcit/webcit.c @@ -22,8 +22,6 @@ #include "child.h" #include "mime_parser.h" -int fake_frames = 0; - int wc_session; char wc_username[256]; char wc_password[256]; @@ -33,10 +31,14 @@ int connected = 0; int logged_in = 0; int axlevel; char *ExpressMessages = NULL; -int noframes = 0; int new_mail = 0; int need_vali = 0; +/* This variable is set to 1 if the room banner and menubar have been + * displayed, and we need to close the tags. + */ +int fake_frames = 0; + struct webcontent *wlist = NULL; struct webcontent *wlast = NULL; @@ -201,7 +203,7 @@ int wContentLength(void) * calculate a Content-length: header. * * print_standard_html_footer should be set to 0 to transmit only, 1 to - * append the main menu (if in noframes mode) and closing tags, or 2 to + * append the main menu and closing tags, or 2 to * append the closing tags only. */ void wDumpContent(int print_standard_html_footer) @@ -214,9 +216,8 @@ void wDumpContent(int print_standard_html_footer) } if (print_standard_html_footer) { - if ((noframes) && (print_standard_html_footer != 2)) { + if (print_standard_html_footer != 2) { wprintf("
    "); - /* embed_main_menu(); */ /* not any more */ } wprintf("\n"); } @@ -333,8 +334,11 @@ char *getz(char *buf) /* * Output all that important stuff that the browser will want to see * - * If print_standard_html_head is nonzero, we also get some standard HTML - * headers. If it's set to 2, the session is considered to be closing. + * print_standard_html_head values: + * 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. */ void output_headers(int print_standard_html_head) { @@ -349,8 +353,8 @@ void output_headers(int print_standard_html_head) printf("Pragma: no-cache\n"); printf("Cache-Control: no-store\n"); } - stuff_to_cookie(cookie, wc_session, wc_username, wc_password, - wc_roomname, noframes); + stuff_to_cookie(cookie, wc_session, wc_username, + wc_password, wc_roomname); if (print_standard_html_head == 2) { printf("X-WebCit-Session: close\n"); printf("Set-cookie: webcit=%s\n", unset); @@ -379,9 +383,9 @@ void output_headers(int print_standard_html_head) wprintf("BACKGROUND=\"/image&name=background\" TEXT=\"#000000\" LINK=\"#004400\">\n"); - if ((print_standard_html_head == 1) && (noframes == 1)) { - wprintf("
    "); - wprintf("
    "); + if (print_standard_html_head == 1) { + wprintf("" + "
    "); display_menubar(0); @@ -393,7 +397,6 @@ void output_headers(int print_standard_html_head) wprintf("
    \n"); - fake_frames = 1; } } @@ -533,10 +536,8 @@ void convenience_page(char *titlebarcolor, char *titlebarmsg, char *messagetext) wprintf("

    \n"); escputs(messagetext); - if (noframes) { - wprintf("
    \n"); - embed_main_menu(); - } + wprintf("
    \n"); + embed_main_menu(); wDumpContent(1); } @@ -646,8 +647,7 @@ void session_loop(char *browser_host, char *user_agent) if (!strncasecmp(buf, "Cookie: webcit=", 15)) { strcpy(cookie, &buf[15]); cookie_to_stuff(cookie, NULL, - c_username, c_password, c_roomname, - &noframes); + c_username, c_password, c_roomname); } if (!strncasecmp(buf, "Content-length: ", 16)) { ContentLength = atoi(&buf[16]); @@ -950,10 +950,6 @@ int main(int argc, char *argv[]) strcpy(browser, argv[5]); bd = browser_braindamage_check(browser); - if (bd == B_NO) - noframes = 1; - else - noframes = 0; while (1) { session_loop(argv[4], browser); diff --git a/webcit/webcit.h b/webcit/webcit.h index 6195bd0e2..e015cc963 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -16,12 +16,6 @@ #define HOUSEKEEPING 60 /* Housekeeping frequency */ -/* Values that can be returned by browser_braindamage_check() */ -#define B_YES 0 /* Ok to use frames and JavaScript */ -#define B_NO 1 /* Do not use frames and JavaScript */ -#define B_ASK 2 /* Ask the user */ - - /* Room flags (from Citadel) */ #define QR_PERMANENT 1 /* Room does not purge */ #define QR_INUSE 2 /* Set if in use, clear if avail */ @@ -40,6 +34,13 @@ #define QR_MAILBOX 16384 /* Set if this is a private mailbox */ +/* Browser braindamage check values */ +enum { + B_NO, + B_YES, + B_ASK +}; + struct webcontent { struct webcontent *next; @@ -82,10 +83,9 @@ extern char *axdefs[]; extern int upload_length; extern char *upload; extern char floorlist[128][256]; -extern int noframes; extern int new_mail; extern int need_vali; -void stuff_to_cookie(char *, int, char *, char *, char *, int); -void cookie_to_stuff(char *, int *, char *, char *, char *, int *); +void stuff_to_cookie(char *, int, char *, char *, char *); +void cookie_to_stuff(char *, int *, char *, char *, char *); void locate_host(char *, int); diff --git a/webcit/who.c b/webcit/who.c index 2ae652dd4..371431869 100644 --- a/webcit/who.c +++ b/webcit/who.c @@ -116,7 +116,7 @@ void whobbs(void) urlescputs(wlist->roomname); wprintf("\" onMouseOver=\"window.status='Go to room "); escputs(wlist->roomname); - wprintf("'; return true\" TARGET=\"top\">"); + wprintf("'; return true\">"); escputs(wlist->roomname); wprintf(""); } diff --git a/webcit/wildmat.c b/webcit/wildmat.c index 1e5f6f493..c9e1db0a2 100644 --- a/webcit/wildmat.c +++ b/webcit/wildmat.c @@ -36,6 +36,10 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * $Log$ + * Revision 1.2 1999/06/03 03:48:52 ajc + * * Ditched the frames mode completely. It wasn't working properly in, + * among other places, IE 5. Die, Bill, Die. + * * Revision 1.1 1999/03/07 03:09:55 ajc * * wildmat.c, braindamage.c: added * @@ -44,12 +48,6 @@ * */ -#ifndef lint -static char *ident = "$Id$"; -static char *copyright = "Copyright (c) 1989 Mark H. Colburn.\nAll rights reserved.\n"; -#endif /* ! lint */ - - /* Includes */ #include -- 2.30.2