* Ditched the frames mode completely. It wasn't working properly in,
authorArt Cancro <ajc@citadel.org>
Thu, 3 Jun 1999 03:48:55 +0000 (03:48 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 3 Jun 1999 03:48:55 +0000 (03:48 +0000)
          among other places, IE 5.  Die, Bill, Die.

12 files changed:
webcit/ChangeLog
webcit/auth.c
webcit/braindamage.c
webcit/context_loop.c
webcit/cookie_conversion.c
webcit/mainmenu.c
webcit/roomops.c
webcit/static/menubar.html
webcit/webcit.c
webcit/webcit.h
webcit/who.c
webcit/wildmat.c

index 98093203a0880e45a1755eb3d573c3eda9ce0968..71e4018182b701276bb8cba5ad4d50c9b8918efd 100644 (file)
@@ -1,3 +1,7 @@
+Wed Jun  2 23:47:58 EDT 1999 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
+       * 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 <ajc@uncnsrd.mt-kisco.ny.us>
        * Fixed the behavior of the "forget room" routine, to properly handle
          the transition back to the Lobby after it's all done.
index 2301c38d84d2d5ae2f2cd6b4e681182491f27f4a..738de528d28b942569c516c82290677d81331986 100644 (file)
@@ -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("<CENTER><TABLE border=0 width=100%><TR><TD>\n");
@@ -68,15 +68,6 @@ void display_login(char *mesg)
        wprintf("<INPUT type=\"submit\" NAME=\"action\" VALUE=\"New User\">\n");
        wprintf("<INPUT type=\"submit\" NAME=\"action\" VALUE=\"Exit\">\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("<BR><INPUT TYPE=\"checkbox\" NAME=\"noframes\">");
-               wprintf("<FONT SIZE=-1>&nbsp;Check here to disable frames</FONT>\n");
-               wprintf("</FORM></CENTER>\n");
-       }
-
        /* Da instructions */
        wprintf("<LI><EM>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_");
 }
 
 
index 71056f5afc99b24edeb3fb082ac703a5388b2995..564cda569187e0f4467c1fe167410031e61b48be 100644 (file)
  * 
  * 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)
  */
 
index 6128100ad233bc0c7da261011e925789a2365e96..1088fc7e173947a456e7b2ede94da33a053c3a63 100644 (file)
@@ -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)) {
index a4865f7d9db02910ce298dbce2d413efeaa6623b..3bb3554b9b6d93a726c9397e1eec7d9dba9ad484 100644 (file)
 /*
  * 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);
 }
index d35460da9b037757a5a08c2b5138ebd4fa7efcfd..543a86ce186e1606e6192fee22fbe82849d8c3d1 100644 (file)
@@ -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<BR>%s", strerror(errno));
        } else {
                while (fgets(buf, sizeof(buf), menubar_body) != NULL) {
-                       /* Sleazy hack to disable TARGET= directive */
-                       if (noframes) for (i=0; i<strlen(buf); ++i) {
-                               if (!strncasecmp(&buf[i], "TARGET", 6)) {
-                                       buf[i]='Q';
-                               }
-                       }
                        wprintf("%s", buf);
                }
                fclose(menubar_body);
index 6d853ebdedc111f0939690d73cdc3059f7f8f8db..d4824a592bf3d5adac06e37a0e0850539a3f4ab4 100644 (file)
@@ -116,7 +116,6 @@ void room_tree_list(struct roomlisting *rp)
        wprintf("<A HREF=\"/dotgoto&room=");
        urlescputs(rmname);
        wprintf("\"");
-       if (!noframes) wprintf("TARGET=\"top\"");
        wprintf(">");
        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("<HTML><HEAD></HEAD>\n<BODY ");
-
-               /* automatically fire up a read-new-msgs in the bottom frame */
-               if (!noframes)
-                       wprintf("onload=parent.frames.bottom.location=\"/readnew\" ");
-
                wprintf("BACKGROUND=\"/image&name=background\" TEXT=\"#000000\" LINK=\"#004400\">\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?<BR>\n");
 
-       wprintf("<FORM METHOD=\"POST\" ACTION=\"/zap\"");
-       if (!noframes) wprintf(" TARGET=top");
-       wprintf(">\n<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
+       wprintf("<FORM METHOD=\"POST\" ACTION=\"/zap\">\n");
+       wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
        wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
        wprintf("</FORM>\n");
        wDumpContent(1);
index 88c4704c505ef1b0674a4635d93a2dacd7b7bebe..5637da87742cd5e952a52b18dc902d5fc8fdc2fc 100644 (file)
@@ -5,66 +5,66 @@
 <TR>
        <TD BGCOLOR="#3333CC">
                <FONT FACE="Arial,Helvetica,sans-serif" SIZE=-1>
-               <A HREF="/knrooms" TARGET="bottom">List known rooms</A>
+               <A HREF="/knrooms">List known rooms</A>
                </FONT>
        </TD>
 </TR><TR>
        <TD BGCOLOR="#3333CC">
                <FONT FACE="Arial,Helvetica,sans-serif" SIZE=-1>
-               <A HREF="/gotonext" TARGET="top">Goto next room</A>
+               <A HREF="/gotonext">Goto next room</A>
                </FONT>
        </TD>
 </TR><TR>
        <TD BGCOLOR="#3333CC">
                <FONT FACE="Arial,Helvetica,sans-serif" SIZE=-1>
-               <A HREF="/skip" TARGET="top">Skip this room</A>
+               <A HREF="/skip">Skip this room</A>
                </FONT>
        </TD>
 </TR><TR>
        <TD BGCOLOR="#3333CC">
                <FONT FACE="Arial,Helvetica,sans-serif" SIZE=-1>
-               <A HREF="/ungoto" TARGET="top">Ungoto</A>
+               <A HREF="/ungoto">Ungoto</A>
        </TD>
 </TR><TR>
        <TD BGCOLOR="#003399">
                <FONT FACE="Arial,Helvetica,sans-serif" SIZE=-1>
-               <A HREF="/readnew" TARGET="bottom">Read&nbsp;new&nbsp;messages</A>
+               <A HREF="/readnew">Read&nbsp;new&nbsp;messages</A>
                </FONT>
        </TD>
 </TR><TR>
        <TD BGCOLOR="#003399">
                <FONT FACE="Arial,Helvetica,sans-serif" SIZE=-1>
-               <A HREF="/readfwd" TARGET="bottom">Read&nbsp;all&nbsp;messages</A>
+               <A HREF="/readfwd">Read&nbsp;all&nbsp;messages</A>
                </FONT>
        </TD>
 </TR><TR>
        <TD BGCOLOR="#003399">
                <FONT FACE="Arial,Helvetica,sans-serif" SIZE=-1>
-               <A HREF="/display_enter" TARGET="bottom">Enter&nbsp;a&nbsp;message</A>
+               <A HREF="/display_enter">Enter&nbsp;a&nbsp;message</A>
                </FONT>
        </TD>
 </TR><TR>
        <TD BGCOLOR="#663399">
                <FONT FACE="Arial,Helvetica,sans-serif" SIZE=-1>
-               <A HREF="/whobbs" TARGET="bottom">Who&nbsp;is&nbsp;online?</A>
+               <A HREF="/whobbs">Who&nbsp;is&nbsp;online?</A>
                </FONT>
        </TD>
 </TR><TR>
        <TD BGCOLOR="#663399">
                <FONT FACE="Arial,Helvetica,sans-serif" SIZE=-1>
-               <A HREF="/userlist" TARGET="bottom">User&nbsp;list</A>
+               <A HREF="/userlist">User&nbsp;list</A>
                </FONT>
        </TD>
 </TR><TR>
        <TD BGCOLOR="#663399">
                <FONT FACE="Arial,Helvetica,sans-serif" SIZE=-1>
-               <A HREF="/advanced" TARGET="bottom">Advanced&nbsp;options</A>
+               <A HREF="/advanced">Advanced&nbsp;options</A>
                </FONT>
        </TD>
 </TR><TR>
        <TD BGCOLOR="#CC0000">
                <FONT FACE="Arial,Helvetica,sans-serif" SIZE=-1>
-               <A HREF="/termquit" TARGET="_top" onClick="return confirm('Do you really want to log off?');">Log&nbsp;off</A><BR>
+               <A HREF="/termquit" onClick="return confirm('Do you really want to log off?');">Log&nbsp;off</A><BR>
        </TD>
 </TR>
 </TABLE>
index 0f577f5c036daea6377a5bf2004b9a160e4f5fdc..2972ca1c375774d3c0efcf179012b6d5e8d3448d 100644 (file)
@@ -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 <TABLE> 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("<BR>");
-                       /* embed_main_menu(); */  /* not any more */
                }
                wprintf("</BODY></HTML>\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("<TABLE border=0 width=100%>");
-               wprintf("<TR VALIGN=TOP><TD>");
+       if (print_standard_html_head == 1) {
+               wprintf("<TABLE border=0 width=100%>"
+                       "<TR VALIGN=TOP><TD>");
 
                display_menubar(0);
 
@@ -393,7 +397,6 @@ void output_headers(int print_standard_html_head)
 
                wprintf("</TD></TR><TR VALIGN=TOP><TD>\n");
                
-
                fake_frames = 1;
                }
        }
@@ -533,10 +536,8 @@ void convenience_page(char *titlebarcolor, char *titlebarmsg, char *messagetext)
        wprintf("</FONT></TD></TR></TABLE><BR>\n");
        escputs(messagetext);
 
-       if (noframes) {
-               wprintf("<HR>\n");
-               embed_main_menu();
-       }
+       wprintf("<HR>\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);
index 6195bd0e2ab8b8752d37915d3115a8841314fa89..e015cc963a721492e5c367af9f953ca48299eec6 100644 (file)
 #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    */
 #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);
index 2ae652dd4722cacab62ebdbc00104a3e83f0355e..3714318699f9bcb4061fd71f396092952ee2f7ca 100644 (file)
@@ -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("</A>");
                        }
index 1e5f6f49363451bf6c19ef3c1b722f255358e778..c9e1db0a2c65b000d129fffc1095414b14ca81de 100644 (file)
  * 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
  *
  * 
  */
 
-#ifndef lint
-static char *ident = "$Id$";
-static char *copyright = "Copyright (c) 1989 Mark H. Colburn.\nAll rights reserved.\n";
-#endif                         /* ! lint */
-
-
 /* Includes */
 
 #include <stdlib.h>