* Awesome new 2-pane layout with ajax functionality for mailbox view.
authorArt Cancro <ajc@citadel.org>
Thu, 28 Jul 2005 03:16:30 +0000 (03:16 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 28 Jul 2005 03:16:30 +0000 (03:16 +0000)
* Slick new fade-out effect for "important message" boxes.

webcit/ChangeLog
webcit/messages.c
webcit/roomops.c
webcit/serv_func.c
webcit/static/head.html
webcit/static/wclib.js
webcit/static/webcit.css
webcit/webcit.c
webcit/webcit.h

index 4f6ccc17cc2d37b2c833db1668ed8f41e44892df..7ad3a8ae5f2c58cb874b841dc6ed4c1f836a5c4a 100644 (file)
@@ -1,4 +1,8 @@
 $Log$
+Revision 619.37  2005/07/28 03:16:30  ajc
+* Awesome new 2-pane layout with ajax functionality for mailbox view.
+* Slick new fade-out effect for "important message" boxes.
+
 Revision 619.36  2005/07/26 04:08:41  ajc
 * Previous checkin broke viewing of individual messages while in
   mailbox summary mode.  Fixed.
@@ -2756,3 +2760,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 53e5461db9c5069eb6db88f8b565604667dc3970..575c0216f21e0d548b5798ad0959fd801a91832b 100644 (file)
@@ -337,7 +337,7 @@ void display_parsed_vcard(struct vCard *v, int full) {
                                if (strlen(mailto) > 0) strcat(mailto, "<br />");
                                strcat(mailto,
                                        "<A HREF=\"/display_enter"
-                                       "?force_room=_MAIL_&recp=");
+                                       "?force_room=_MAIL_?recp=");
                                urlesc(&mailto[strlen(mailto)], thisvalue);
                                strcat(mailto, "\">");
                                urlesc(&mailto[strlen(mailto)], thisvalue);
@@ -550,7 +550,7 @@ void read_message(long msgnum) {
                        format_type = atoi(&buf[5]);
                if (!strncasecmp(buf, "from=", 5)) {
                        strcpy(from, &buf[5]);
-                       wprintf("from <A HREF=\"/showuser&who=");
+                       wprintf("from <A HREF=\"/showuser?who=");
 #ifdef HAVE_ICONV
                        utf8ify_rfc822_string(from);
 #endif
@@ -603,7 +603,7 @@ void read_message(long msgnum) {
                                snprintf(&mime_http[strlen(mime_http)],
                                        (sizeof(mime_http) - strlen(mime_http) - 1),
                                        "<A HREF=\"/output_mimepart?"
-                                       "msgnum=%ld&partnum=%s\" "
+                                       "msgnum=%ld?partnum=%s\" "
                                        "TARGET=\"wc.%ld.%s\">"
                                        "<IMG SRC=\"/static/diskette_24x.gif\" "
                                        "BORDER=0 ALIGN=MIDDLE>\n"
@@ -619,7 +619,7 @@ void read_message(long msgnum) {
                                snprintf(&mime_http[strlen(mime_http)],
                                        (sizeof(mime_http) - strlen(mime_http) - 1),
                                        "<IMG SRC=\"/output_mimepart?"
-                                       "msgnum=%ld&partnum=%s\">",
+                                       "msgnum=%ld?partnum=%s\">",
                                        msgnum, mime_partnum);
                        }
 
@@ -677,7 +677,7 @@ void read_message(long msgnum) {
        /* Reply */
        wprintf("<a href=\"/display_enter?recp=");
        urlescputs(reply_to);
-       wprintf("&subject=");
+       wprintf("?subject=");
        if (strncasecmp(m_subject, "Re:", 3)) wprintf("Re:%20");
        urlescputs(m_subject);
        wprintf("\">[Reply]</a> ");
@@ -810,7 +810,7 @@ void read_message(long msgnum) {
                                || (WC->wc_view == VIEW_ADDRESSBOOK)
                        ) {
                                wprintf("<A HREF=\"/edit_vcard?"
-                                       "msgnum=%ld&partnum=%s\">",
+                                       "msgnum=%ld?partnum=%s\">",
                                        msgnum, vcard_partnum);
                                wprintf("[edit]</A>");
                        }
@@ -849,14 +849,60 @@ ENDBODY:
 }
 
 
+
+/*
+ * Unadorned HTML output of an individual message, suitable
+ * for placing in a hidden iframe, for printing, or whatever
+ */
+void embed_message(void) {
+       long msgnum = 0L;
+       char *sourceiframe;
+       char *targetdiv;
+
+       msgnum = atol(bstr("msgnum"));
+       sourceiframe = bstr("sourceiframe");
+       targetdiv = bstr("targetdiv");
+
+       output_headers(1, 0, 0, 0, 0, 1, 0);
+       begin_burst();
+
+       wprintf("<html><head>");
+
+       /* If we're loading into a hidden iframe, chances are the caller told us
+        * about a target div somewhere that we need to copy into when we're done.
+        */
+       if (strlen(targetdiv) > 0) wprintf(
+"                                                                      \n"
+" <script type=\"text/javascript\">                                    \n"
+"      function loaded_now_copy_it() {                                 \n"
+"              parent.document.getElementById(\"%s\").innerHTML = parent.frames['%s'].document.body.innerHTML; \n"
+"      }                                                                                       \n"
+"</script>\n",
+               targetdiv,
+               sourceiframe
+       );
+
+       wprintf("</head>");
+       wprintf("<body");
+       if (strlen(targetdiv) > 0) {
+               wprintf(" onLoad='loaded_now_copy_it();'");
+       }
+       wprintf(">\n");
+       read_message(msgnum);
+       wprintf("</body></html>\n");
+       wDumpContent(0);
+}
+
+
+
+
 void display_summarized(int num) {
        char datebuf[64];
 
        wprintf("<TD>");
        if (WC->summ[num].is_new) wprintf("<B>");
-       wprintf("<A HREF=\"/readfwd?startmsg=%ld"
-               "&maxmsgs=1&summary=0\">", 
-               WC->msgarr[num]);
+       wprintf("<A HREF=\"/msg?msgnum=%ld?sourceiframe=msgloader1?targetdiv=preview_pane\" target=\"msgloader1\">",
+               WC->summ[num].msgnum);
        escputs(WC->summ[num].subj);
        wprintf("</A>");
        if (WC->summ[num].is_new) wprintf("</B>");
@@ -987,7 +1033,7 @@ void display_addressbook(long msgnum, char alpha) {
                                || (WC->wc_view == VIEW_ADDRESSBOOK)
                        ) {
                                wprintf("<A HREF=\"/edit_vcard?"
-                                       "msgnum=%ld&partnum=%s\">",
+                                       "msgnum=%ld?partnum=%s\">",
                                        msgnum, vcard_partnum);
                                wprintf("[edit]</A>");
                        }
@@ -1179,7 +1225,7 @@ void do_addrbook_view(struct addrbookent *addrbook, int num_ab) {
        
                        wprintf("<A HREF=\"/readfwd?startmsg=%ld&is_singlecard=1",
                                addrbook[i].ab_msgnum);
-                       wprintf("&maxmsgs=1&summary=0&alpha=%s\">", bstr("alpha"));
+                       wprintf("?maxmsgs=1?summary=0?alpha=%s\">", bstr("alpha"));
                        vcard_n_prettyize(addrbook[i].ab_name);
                        escputs(addrbook[i].ab_name);
                        wprintf("</A></TD>\n");
@@ -1330,10 +1376,6 @@ void readloop(char *oper)
        }
        if (strlen(sortby) == 0) sortby = sortpref_value;
        if (strlen(sortby) == 0) sortby = "msgid";
-       if ( (strcasecmp(sortby, "msgid")) & (maxmsgs != 1) ) {
-               startmsg = 1;
-               maxmsgs = 9999999;
-       }
 
        output_headers(1, 1, 1, 0, 0, 0, 0);
 
@@ -1358,11 +1400,13 @@ void readloop(char *oper)
        if ((WC->wc_view == VIEW_ADDRESSBOOK) && (maxmsgs > 1)) {
                is_addressbook = 1;
                strcpy(cmd, "MSGS ALL");
-               maxmsgs = 32767;
+               maxmsgs = 9999999;
        }
 
        if (is_summary) {
                strcpy(cmd, "MSGS ALL");
+               startmsg = 1;
+               maxmsgs = 9999999;
        }
 
        /* Are we doing a summary view?  If so, we need to know old messages
@@ -1471,41 +1515,42 @@ void readloop(char *oper)
                }
        }
 
-       wprintf("<form name=\"msgomatic\" "
-               "METHOD=\"POST\" ACTION=\"/do_stuff_to_msgs\">\n");
-
        if (!strcasecmp(sortby, "subject")) {
-               subjsort_button = "<a href=\"/readfwd?startmsg=1&maxmsgs=9999999&summary=1&sortby=rsubject\"><img border=\"0\" src=\"/static/down_pointer.gif\"></img></a>" ;
+               subjsort_button = "<a href=\"/readfwd?startmsg=1?maxmsgs=9999999?summary=1?sortby=rsubject\"><img border=\"0\" src=\"/static/down_pointer.gif\" /></a>" ;
        }
        else if (!strcasecmp(sortby, "rsubject")) {
-               subjsort_button = "<a href=\"/readfwd?startmsg=1&maxmsgs=9999999&summary=1&sortby=subject\"><img border=\"0\" src=\"/static/up_pointer.gif\"></img></a>" ;
+               subjsort_button = "<a href=\"/readfwd?startmsg=1?maxmsgs=9999999?summary=1?sortby=subject\"><img border=\"0\" src=\"/static/up_pointer.gif\" /></a>" ;
        }
        else {
-               subjsort_button = "<a href=\"/readfwd?startmsg=1&maxmsgs=9999999&summary=1&sortby=subject\"><img border=\"0\" src=\"/static/sort_none.gif\"></img></a>" ;
+               subjsort_button = "<a href=\"/readfwd?startmsg=1?maxmsgs=9999999?summary=1?sortby=subject\"><img border=\"0\" src=\"/static/sort_none.gif\" /></a>" ;
        }
 
        if (!strcasecmp(sortby, "sender")) {
-               sendsort_button = "<a href=\"/readfwd?startmsg=1&maxmsgs=9999999&summary=1&sortby=rsender\"><img border=\"0\" src=\"/static/down_pointer.gif\"></img></a>" ;
+               sendsort_button = "<a href=\"/readfwd?startmsg=1?maxmsgs=9999999?summary=1?sortby=rsender\"><img border=\"0\" src=\"/static/down_pointer.gif\" /></a>" ;
        }
        else if (!strcasecmp(sortby, "rsender")) {
-               sendsort_button = "<a href=\"/readfwd?startmsg=1&maxmsgs=9999999&summary=1&sortby=sender\"><img border=\"0\" src=\"/static/up_pointer.gif\"></img></a>" ;
+               sendsort_button = "<a href=\"/readfwd?startmsg=1?maxmsgs=9999999?summary=1?sortby=sender\"><img border=\"0\" src=\"/static/up_pointer.gif\" /></a>" ;
        }
        else {
-               sendsort_button = "<a href=\"/readfwd?startmsg=1&maxmsgs=9999999&summary=1&sortby=sender\"><img border=\"0\" src=\"/static/sort_none.gif\"></img></a>" ;
+               sendsort_button = "<a href=\"/readfwd?startmsg=1?maxmsgs=9999999?summary=1?sortby=sender\"><img border=\"0\" src=\"/static/sort_none.gif\" /></a>" ;
        }
 
        if (!strcasecmp(sortby, "date")) {
-               datesort_button = "<a href=\"/readfwd?startmsg=1&maxmsgs=9999999&summary=1&sortby=rdate\"><img border=\"0\" src=\"/static/down_pointer.gif\"></img></a>" ;
+               datesort_button = "<a href=\"/readfwd?startmsg=1?maxmsgs=9999999?summary=1?sortby=rdate\"><img border=\"0\" src=\"/static/down_pointer.gif\" /></a>" ;
        }
        else if (!strcasecmp(sortby, "rdate")) {
-               datesort_button = "<a href=\"/readfwd?startmsg=1&maxmsgs=9999999&summary=1&sortby=date\"><img border=\"0\" src=\"/static/up_pointer.gif\"></img></a>" ;
+               datesort_button = "<a href=\"/readfwd?startmsg=1?maxmsgs=9999999?summary=1?sortby=date\"><img border=\"0\" src=\"/static/up_pointer.gif\" /></a>" ;
        }
        else {
-               datesort_button = "<a href=\"/readfwd?startmsg=1&maxmsgs=9999999&summary=1&sortby=date\"><img border=\"0\" src=\"/static/sort_none.gif\"></img></a>" ;
+               datesort_button = "<a href=\"/readfwd?startmsg=1?maxmsgs=9999999?summary=1?sortby=date\"><img border=\"0\" src=\"/static/sort_none.gif\" /></a>" ;
        }
 
        if (is_summary) {
-               wprintf("<div id=\"fix_scrollbar_bug\">"
+               wprintf("</div>");              /* end of 'content' div */
+
+               wprintf("<div id=\"message_list\">"
+
+                       "<div id=\"fix_scrollbar_bug\">\n"
                        "<table border=0 cellspacing=0 "
                        "cellpadding=0 width=100%%>\n"
                        "<TR>"
@@ -1577,7 +1622,16 @@ void readloop(char *oper)
        }
 
        if (is_summary) {
-               wprintf("</table></div>\n");
+               wprintf("</table></div>\n");            /* end of 'fix_scrollbar_bug' div */
+               wprintf("</div>");                      /* end of 'message_list' div */
+
+               /* Put the data transfer hidden iframe in a hidden div, to make it *really* hidden */
+               wprintf("<div display=\"hidden\">\n"
+                       "<iframe name=\"msgloader1\" id=\"msgloader1\" width=\"1\"></iframe>\n"
+                       "</div>\n"
+               );
+
+               wprintf("<div id=\"preview_pane\">");   /* The preview pane will initially be empty */
        }
 
        /* Bump these because although we're thinking in zero base, the user
@@ -1596,16 +1650,11 @@ void readloop(char *oper)
                        "<TD ALIGN=RIGHT><FONT SIZE=+1>",
                        lowest_displayed, nummsgs);
 
-               if (is_summary) {
-                       wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" "
-                               "VALUE=\"Delete selected\">\n");
-               }
-
                if (pn_previous > 0L) {
                        wprintf("<A HREF=\"/%s"
                                "?startmsg=%ld"
-                               "&maxmsgs=1"
-                               "&summary=0\">"
+                               "?maxmsgs=1"
+                               "?summary=0\">"
                                "Previous</A> \n",
                                        oper,
                                        pn_previous );
@@ -1614,15 +1663,15 @@ void readloop(char *oper)
                if (pn_next > 0L) {
                        wprintf("<A HREF=\"/%s"
                                "?startmsg=%ld"
-                               "&maxmsgs=1"
-                               "&summary=0\">"
+                               "?maxmsgs=1"
+                               "?summary=0\">"
                                "Next</A> \n",
                                        oper,
                                        pn_next );
                }
 
                wprintf("<A HREF=\"/%s?startmsg=%ld"
-                       "&maxmsgs=%d&summary=1\">"
+                       "?maxmsgs=%d?summary=1\">"
                        "Summary"
                        "</A>",
                        oper,
@@ -1640,11 +1689,14 @@ void readloop(char *oper)
         */
        if (num_displayed > 1) {
           if ((!is_tasks) && (!is_calendar) && (!is_addressbook)
-             && (!is_notes) && (!is_singlecard)) {
+             && (!is_notes) && (!is_singlecard) && (!is_summary)) {
+
+               wprintf("<form name=\"msgomatic\" "
+                       "method=\"POST\" action=\"/do_stuff_to_msgs\">\n");
 
                wprintf("Reading #", lowest_displayed, highest_displayed);
 
-               wprintf("<SELECT NAME=\"whichones\" SIZE=\"1\" "
+               wprintf("<select name=\"whichones\" size=\"1\" "
                        "OnChange=\"location.href=msgomatic.whichones.options"
                        "[selectedIndex].value\">\n");
 
@@ -1652,36 +1704,30 @@ void readloop(char *oper)
                lo = b+1;
                hi = b+maxmsgs;
                if (hi > nummsgs) hi = nummsgs;
-                       wprintf("<OPTION %s VALUE="
+                       wprintf("<option %s value="
                                "\"/%s"
                                "?startmsg=%ld"
-                               "&maxmsgs=%d"
-                               "&summary=%d\">"
-                               "%d-%d</OPTION> \n",
-                               ((WC->msgarr[b] == startmsg) ? "SELECTED" : ""),
+                               "?maxmsgs=%d"
+                               "?summary=%d\">"
+                               "%d-%d</option> \n",
+                               ((WC->msgarr[b] == startmsg) ? "selected" : ""),
                                oper,
                                WC->msgarr[b],
                                maxmsgs,
                                is_summary,
                                lo, hi);
                }
-               wprintf("<OPTION VALUE=\"/%s?startmsg=%ld"
-                       "&maxmsgs=9999999&summary=%d\">"
+               wprintf("<option value=\"/%s?startmsg=%ld"
+                       "?maxmsgs=9999999?summary=%d\">"
                        "ALL"
-                       "</OPTION> ",
+                       "</option> ",
                        oper,
                        WC->msgarr[0], is_summary);
 
-               wprintf("</SELECT> of %d messages.", nummsgs);
-
-               if (is_summary) {
-                       wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" "
-                               "VALUE=\"Delete selected\">\n");
-               }
-
+               wprintf("</select> of %d messages.", nummsgs);
+               wprintf("</form>\n");
            }
        }
-       wprintf("</form>\n");
 
 DONE:
        if (is_tasks) {
@@ -1696,6 +1742,11 @@ DONE:
                do_addrbook_view(addrbook, num_ab);     /* Render the address book */
        }
 
+       /* Note: wDumpContent() will output one additional </div> tag.
+        * Which div it is the end of depends on what mode we're viewing in.
+        * If we're in summary mode, it's the end of the preview pane.
+        * Otherwise it's the end of the usual content div.
+        */
        wDumpContent(1);
        if (addrbook != NULL) free(addrbook);
 
index c3807b4c045b0aaf69cc5d357c414c2a150122b2..bee25dd2a7fa38ab6df96e11eac25d88f55063a8 100644 (file)
@@ -335,7 +335,7 @@ void embed_newmail_button(void) {
 void embed_view_o_matic(void) {
        int i;
 
-       wprintf("<FORM NAME=\"viewomatic\">\n"
+       wprintf("<form name=\"viewomatic\" action=\"/changeview\">\n"
                "<span class=\"room_banner_new_messages\">View as: "
                "<SELECT NAME=\"newview\" SIZE=\"1\" "
                "STYLE=\"font-family: Bitstream Vera Sans,Arial,Helvetica,sans-serif;"
@@ -553,7 +553,6 @@ void embed_room_banner(char *got, int navbar_style) {
                                        );
                                        break;
                        }
-                       wprintf("</span></a></td>\n");
                }
 
                if (navbar_style == navbar_default) wprintf(
index 160105f5536742f6139be2b96f49eb8761cfe31e..93a8465eb63f93c3a603dd765a480f0d077b2191 100644 (file)
@@ -119,7 +119,7 @@ void fmout(FILE *fp, char *align)
        int bq = 0;
        char buf[SIZ];
 
-       wprintf("<DIV ALIGN=%s>\n", align);
+       wprintf("<div align=%s>\n", align);
        while (1) {
                if (fp == NULL)
                        serv_getln(buf, sizeof buf);
@@ -131,7 +131,7 @@ void fmout(FILE *fp, char *align)
                if (!strcmp(buf, "000")) {
                        if (bq == 1)
                                wprintf("</I>");
-                       wprintf("</DIV><br />\n");
+                       wprintf("</div><br />\n");
                        return;
                }
                if ((intext == 1) && (isspace(buf[0]))) {
index f4b0ac922d286119ad76e33843112839389099a5..03aa1db3bbfbba9ba4d07838b11678b150dce9b8 100644 (file)
@@ -5,7 +5,7 @@
 <?REFRESHTAG>
 <title><?SERV_HUMANNODE></title>
 <meta http-equiv="Pragma" content="no-cache" />
-<meta http-equiv="expired" content="28-May-1971 18:10:00 GMT" />
+<meta http-equiv="expires" content="28-May-1971 18:10:00 GMT" />
 <meta name="MSSmartTagsPreventParsing" content="TRUE" />
 <link href="/static/webcit.css" rel="stylesheet" type="text/css">
 <script type="text/javascript" src="static/wclib.js"></script>
index 014a8ef661c0c652f0cd3ee33b00f4403e7f8c4f..2af086bac5784a30c99d9321c245f498ea491c48 100644 (file)
@@ -25,6 +25,22 @@ function hide_page_popup() {
                document.poppedLayer = eval('document.all[\'page_popup\']');
        else
                document.poppedLayer = eval('document.layers[\'`page_popup\']');
-document.poppedLayer.style.visibility = "hidden";
+
+       document.poppedLayer.style.visibility = "hidden";
+}
+
+function hide_imsg_popup_old() {
+       if (browserType == "gecko" )
+               document.poppedLayer = eval('document.getElementById(\'important_message\')');
+       else if (browserType == "ie")
+               document.poppedLayer = eval('document.all[\'important_message\']');
+       else
+               document.poppedLayer = eval('document.layers[\'`important_message\']');
+
+       document.poppedLayer.style.visibility = "hidden";
 }
 
+function hide_imsg_popup() {
+       new Effect.FadeTo('important_message', 0.0, 500, 5, {complete:function() { hide_imsg_popup_old();}});
+       // we still do it the old way afterwards, just in case the browser didn't dazzle us enough
+}
index 8c4ed15b321eac5fa03df2ff12c0040d5412873f..5ea2eda3355eca614e5ab8d76cf870a521b49601 100644 (file)
@@ -63,6 +63,14 @@ body {
        z-index: 2;
 }
 
+#important_message {
+       position:absolute;
+       top:150px; left:150px;
+       width:300px; height:100px;
+       background-color: #444488;
+       z-index: 2;
+}
+
 #content {
        position:fixed;
        display:block;
@@ -85,6 +93,46 @@ body {
        /* overflow-x: hidden; */
 }
 
+#message_list {
+       position:fixed;
+       display:block;
+       top: 15%;
+       left: 15%;
+       width: 85%;
+       height: 20%;
+       overflow: auto;
+}
+
+* html #message_list {
+       position:absolute;
+       display:block;
+       top: 15%;
+       left: 15%;
+       width: 85%;
+       height: 20%;
+       overflow: auto;
+}
+
+#preview_pane {
+       position:fixed;
+       display:block;
+       top: 35%;
+       left: 15%;
+       width: 85%;
+       height: 65%;
+       overflow: auto;
+}
+
+* html #preview_pane {
+       position:absolute;
+       display:block;
+       top: 35%;
+       left: 15%;
+       width: 85%;
+       height: 65%;
+       overflow: auto;
+}
+
 #fix_scrollbar_bug {
        margin-right:1px;               /* Gecko */
        width: expression('97%');       /* Only IE6 understands 'expression' and it also has the weird scrollbarbug */
@@ -292,6 +340,14 @@ var sub {
        font-style: italic;
 }
 
+.imsg {
+       color: #aaaaaa;
+       background: none;
+       font-weight: bold;
+       font-style: italic;
+       text-align: center;
+}
+
 .warning {
        color: #FF4500;
        background: none;
index adb2021de0c74f6c79a36e4b1cb5140597d33bbc..f8f90085e489b647c8f9c2c00b8303284f77bca5 100644 (file)
@@ -176,7 +176,7 @@ void wprintf(const char *format,...)
 void wDumpContent(int print_standard_html_footer)
 {
        if (print_standard_html_footer) {
-               wprintf("</DIV>\n");    /* end of "text" div */
+               wprintf("</div>\n");    /* end of "text" div */
                do_template("trailing");
        }
 
@@ -419,6 +419,16 @@ void output_headers(       int do_httpheaders,     /* 1 = output HTTP headers
                        page_popup();
                        wprintf("</div>\n");
                }
+               if (strlen(WC->ImportantMessage) > 0) {
+                       wprintf("<div id=\"important_message\">\n");
+                       wprintf("<SPAN CLASS=\"imsg\">"
+                               "%s</SPAN><br />\n", WC->ImportantMessage);
+                       wprintf("</div>\n");
+                       wprintf("<script type=\"text/javascript\">\n"
+                               "        setTimeout('hide_imsg_popup()', 2000); \n"
+                               "</script>\n");
+                       safestrncpy(WC->ImportantMessage, "", sizeof WC->ImportantMessage);
+               }
                if ( (WC->logged_in) && (!unset_cookies) ) {
                        wprintf("<div id=\"iconbar\">");
                        do_iconbar();
@@ -433,17 +443,6 @@ void output_headers(       int do_httpheaders,     /* 1 = output HTTP headers
 
        if (do_room_banner == 1) {
                wprintf("<div id=\"content\">\n");
-
-               if (strlen(WC->ImportantMessage) > 0) {
-                       wprintf("<div id=\"fix_scrollbar_bug\">\n");
-                       do_template("beginbox_nt");
-                       wprintf("<SPAN CLASS=\"errormsg\">"
-                               "%s</SPAN><br />\n", WC->ImportantMessage);
-                       do_template("endbox");
-                       wprintf("</div>\n");
-                       safestrncpy(WC->ImportantMessage, "", sizeof WC->ImportantMessage);
-               }
-
        }
 }
 
@@ -1174,6 +1173,8 @@ void session_loop(struct httprequest *req)
                readloop("readfwd");
        } else if (!strcasecmp(action, "headers")) {
                readloop("headers");
+       } else if (!strcasecmp(action, "msg")) {
+               embed_message();
        } else if (!strcasecmp(action, "display_enter")) {
                display_enter();
        } else if (!strcasecmp(action, "post")) {
index db14657589408ef0c32f47ab499e8d179371339a..1de602a8dbe496e77e19726e9fbf7ac793ac7cd2 100644 (file)
@@ -340,6 +340,7 @@ void embed_main_menu(void);
 void serv_read(char *buf, int bytes);
 int haschar(char *, char);
 void readloop(char *oper);
+void embed_message(void);
 void text_to_server(char *ptr, int convert_to_html);
 void display_enter(void);
 void post_message(void);