* Open chat in a separate window.
authorArt Cancro <ajc@citadel.org>
Mon, 15 Mar 2004 03:45:01 +0000 (03:45 +0000)
committerArt Cancro <ajc@citadel.org>
Mon, 15 Mar 2004 03:45:01 +0000 (03:45 +0000)
* Use regular frames instead of IFRAMEs.

webcit/iconbar.c
webcit/mainmenu.c
webcit/paging.c

index 717fd5c2fd8039e89b1ec7fbf9311362d8a81517..c3adb4ed23b80f05f73e2e78a15b50b1576fd5f2 100644 (file)
@@ -199,8 +199,11 @@ void do_iconbar(void) {
 
        if (ib_chat) {
                wprintf("<SPAN CLASS=\"iconbar_link\">"
-                       "<A HREF=\"/chat\" TITLE=\"Chat with other users in this room\" "
-                       "TARGET=\"workspace\">"
+                       "<A HREF=\"#\" onClick=\"window.open('/chat', "
+                       "'ctdl_chat_window', "
+                       "'toolbar=no,location=no,directories=no,copyhistory=no,"
+                       "status=yes,scrollbars=yes,resizable=yes');\""
+                       ">"
                );
                if (ib_displayas != IB_TEXTONLY) {
                        wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
index 48cbe03dfece9f2f54d6b33928226d6746bc9342..e8e07fbf5dbf78bc2ba873776d64b07aa70b147e 100644 (file)
@@ -141,7 +141,11 @@ void display_main_menu(void)
                "</span><BR>\n"
        );
 
-       wprintf("<A HREF=\"/chat\">"
+       wprintf("<A HREF=\"#\" onClick=\"window.open('/chat', "
+               "'ctdl_chat_window', "
+               "'toolbar=no,location=no,directories=no,copyhistory=no,"
+               "status=yes,scrollbars=yes,resizable=yes');\""
+               ">"
                "<span class=\"mainmenu\">"
                "Chat with other users in <i>"
        );
index 87b87707600c8d5080985348adf6cb8f4ed4089b..cbfdd7accb5e39b4f7de64a21a6ae1eb5ce84677 100644 (file)
@@ -135,37 +135,11 @@ void do_chat(void)
                WC->chat_sock = (-1);
        }
 
-       /* Ok, we're good.  Here we go. */
-       output_headers(3);
-
-       wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#000077\"><TR><TD>"
-               "<SPAN CLASS=\"titlebar\">"
-               "<IMG SRC=\"/static/chat-icon.gif\" WIDTH=16 HEIGHT=16 ALIGN=MIDDLE>"
-       );
-       escputs(WC->wc_roomname);
-       wprintf(": real-time chat</SPAN>\n"
-               "</TD></TR></TABLE>\n"
-
-               "<IFRAME WIDTH=100%% HEIGHT=200 SRC=\"about:blank\" "
-               "NAME=\"chat_transcript\">\n"
-               "<!-- Alternate content for non-supporting browsers -->\n"
-               "If you are seeing this message, your browser does not contain\n"
-               "the IFRAME support required for the chat window.  Please upgrade\n"
-               "to a supported browser, such as\n"
-               "<A HREF=\"http://www.mozilla.org\">Mozilla</A>.\n"
-               "</IFRAME>\n"
-
-               "<IFRAME WIDTH=100%% HEIGHT=1 SRC=\"/chat_recv\" "
-               "NAME=\"chat_recv\">\n"
-               "</IFRAME>"
-
-               "<BR>\n"
-
-               "<IFRAME WIDTH=100%% HEIGHT=60 SRC=\"/chat_send\" "
-               "NAME=\"chat_send\">\n"
-               "</IFRAME>\n"
-       );
-       wDumpContent(1);
+       /* WebCit Chat works by having transmit, receive, and refresh
+        * frames.  Load the frameset.
+        */
+       do_template("chatframeset");
+       return;
 }
 
 
@@ -344,7 +318,7 @@ void chat_recv(void) {
        if (end_chat_now) {
                close(WC->chat_sock);
                WC->chat_sock = (-1);
-               wprintf("<IMG SRC=\"/static/blank.gif\" onLoad=\"parent.location.replace('/display_main_menu');\">\n");
+               wprintf("<IMG SRC=\"/static/blank.gif\" onLoad=\"parent.window.close();\">\n");
        }
 
        if (strlen(output_data) > 0) {