* summary.c: summary screen is now updated using ajax instead of refreshing
authorArt Cancro <ajc@citadel.org>
Sun, 18 Sep 2005 15:02:30 +0000 (15:02 +0000)
committerArt Cancro <ajc@citadel.org>
Sun, 18 Sep 2005 15:02:30 +0000 (15:02 +0000)
  the whole page.  Not only does this look cleaner, but it also has the
  happy side effect of not reloading all of the images.
* webcit.c: new API calls begin_ajax_response() and end_ajax_response() for
  wrapping inner div's
* webcit.c: removed the "refresh30" parameter from output_headers() and
  from all code that calls it.  We don't need it anymore; refreshing the
  entire page is, like, sooooo 2004.  :)

25 files changed:
webcit/ChangeLog
webcit/auth.c
webcit/autocompletion.c
webcit/calendar.c
webcit/event.c
webcit/floors.c
webcit/graphics.c
webcit/iconbar.c
webcit/inetconf.c
webcit/mainmenu.c
webcit/messages.c
webcit/netconf.c
webcit/paging.c
webcit/preferences.c
webcit/roomops.c
webcit/setup_wizard.c
webcit/siteconfig.c
webcit/summary.c
webcit/sysmsgs.c
webcit/useredit.c
webcit/userlist.c
webcit/vcard_edit.c
webcit/webcit.c
webcit/webcit.h
webcit/who.c

index 7355a4ffa72bf62c334b2bafa02b6b18a631317a..6d9cee370c9cff6172e7cd635c040f175ff64e9d 100644 (file)
@@ -1,4 +1,14 @@
 $Log$
+Revision 625.13  2005/09/18 15:02:29  ajc
+* summary.c: summary screen is now updated using ajax instead of refreshing
+  the whole page.  Not only does this look cleaner, but it also has the
+  happy side effect of not reloading all of the images.
+* webcit.c: new API calls begin_ajax_response() and end_ajax_response() for
+  wrapping inner div's
+* webcit.c: removed the "refresh30" parameter from output_headers() and
+  from all code that calls it.  We don't need it anymore; refreshing the
+  entire page is, like, sooooo 2004.  :)
+
 Revision 625.12  2005/09/18 14:30:05  ajc
 * Added a "random number" parameter to the wholist ajax refresh request,
   because b0rken MSIE still insists on fetching from its cache even though
@@ -3004,3 +3014,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 075e1da9cb78a41f3c27eef415a8d2b2232712eb..94182798b024c7b9dcdcecdaef6417646a7eeb1a 100644 (file)
@@ -25,7 +25,7 @@ void display_login(char *mesg)
 {
        char buf[SIZ];
 
-       output_headers(1, 1, 2, 0, 0, 0, 0);
+       output_headers(1, 1, 2, 0, 0, 0);
        wprintf("<div style=\"position:absolute; top:20px; left:20px; right:20px\">\n");
 
        if (mesg != NULL) if (strlen(mesg) > 0) {
@@ -221,7 +221,7 @@ void do_logout(void)
        safestrncpy(WC->wc_roomname, "", sizeof WC->wc_roomname);
 
        /* Calling output_headers() this way causes the cookies to be un-set */
-       output_headers(1, 1, 0, 1, 0, 0, 0);
+       output_headers(1, 1, 0, 1, 0, 0);
 
        wprintf("<center>");
        serv_puts("MESG goodbye");
@@ -260,7 +260,7 @@ void validate(void)
        char buf[SIZ];
        int a;
 
-       output_headers(1, 1, 2, 0, 0, 0, 0);
+       output_headers(1, 1, 2, 0, 0, 0);
        wprintf("<div id=\"banner\">\n"
                "<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
                "<SPAN CLASS=\"titlebar\">");
@@ -381,7 +381,7 @@ void display_changepw(void)
 {
        char buf[SIZ];
 
-       output_headers(1, 1, 2, 0, 0, 0, 0);
+       output_headers(1, 1, 2, 0, 0, 0);
        wprintf("<div id=\"banner\">\n"
                "<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
                "<SPAN CLASS=\"titlebar\">");
index 43904bdecc9645a3238c02299e81f0cff3c1ba8b..6d68edd43f82415a666673f31c8675c8b36b4327 100644 (file)
@@ -13,7 +13,7 @@ void recp_autocomplete(char *partial) {
        char buf[1024];
        char name[128];
 
-       output_headers(0, 0, 0, 0, 0, 0, 0);
+       output_headers(0, 0, 0, 0, 0, 0);
 
        wprintf("Content-type: text/html\r\n"
                "Server: %s\r\n"
index 49e572a90206c22bc0d30f22595a746ac472c3c8..effd9aea1b51c4586d9a452447774b699fcbf846 100644 (file)
@@ -328,7 +328,7 @@ void cal_process_attachment(char *part_source, long msgnum, char *cal_partnum) {
 void respond_to_request(void) {
        char buf[SIZ];
 
-       output_headers(1, 1, 2, 0, 0, 0, 0);
+       output_headers(1, 1, 2, 0, 0, 0);
 
        wprintf("<div id=\"banner\">\n");
        wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
@@ -389,7 +389,7 @@ void respond_to_request(void) {
 void handle_rsvp(void) {
        char buf[SIZ];
 
-       output_headers(1, 1, 2, 0, 0, 0, 0);
+       output_headers(1, 1, 2, 0, 0, 0);
 
        wprintf("<div id=\"banner\">\n");
        wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
@@ -502,7 +502,7 @@ void display_edit_individual_task(icalcomponent *supplied_vtodo, long msgnum) {
                created_new_vtodo = 1;
        }
 
-       output_headers(1, 1, 2, 0, 0, 0, 0);
+       output_headers(1, 1, 2, 0, 0, 0);
        wprintf("<div id=\"banner\">\n"
                "<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR>"
                "<TD><IMG SRC=\"/static/taskmanag_48x.gif\"></TD>"
@@ -925,7 +925,7 @@ void do_freebusy(char *req) {
 
        if (buf[0] != '1') {
                wprintf("HTTP/1.0 404 %s\n", &buf[4]);
-               output_headers(0, 0, 0, 0, 0, 0, 0);
+               output_headers(0, 0, 0, 0, 0, 0);
                wprintf("Content-Type: text/plain\r\n");
                wprintf("\r\n");
                wprintf("%s\n", &buf[4]);
index dfd3478d4b9f9542d17fc119305d48ac19b89de2..3fe8a01af39db991c2a97dd603a44510a104f4fd 100644 (file)
@@ -65,7 +65,7 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum)
        }
 
        /* Begin output */
-       output_headers(1, 1, 2, 0, 0, 0, 0);
+       output_headers(1, 1, 2, 0, 0, 0);
        wprintf("<div id=\"banner\">\n"
                "<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
                "<SPAN CLASS=\"titlebar\">");
index 5d1ba0ce42278554ff4a5029107cd4ea93c3e838..7f63dfb056085a5db2e899b0dd2c530555f231bf 100644 (file)
@@ -24,7 +24,7 @@ void display_floorconfig(char *prepend_html)
        char floorname[SIZ];
        int refcount;
 
-        output_headers(1, 1, 2, 0, 0, 0, 0);
+        output_headers(1, 1, 2, 0, 0, 0);
         wprintf("<div id=\"banner\">\n"
                 "<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
                 "<SPAN CLASS=\"titlebar\">");
index 5a0fa4e55b2b25694e0a9565c04ce0da3fe323e9..99173463a8a03db1f9009522da21181fcdb9d756 100644 (file)
@@ -17,9 +17,9 @@ void display_graphics_upload(char *description, char *check_cmd, char *uplurl)
                display_main_menu();
                return;
        }
-       output_headers(1, 1, 0, 0, 0, 0, 0);
+       output_headers(1, 1, 0, 0, 0, 0);
 
-       output_headers(1, 1, 2, 0, 0, 0, 0);
+       output_headers(1, 1, 2, 0, 0, 0);
        wprintf("<div id=\"banner\">\n"
                "<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
                "<SPAN CLASS=\"titlebar\">");
index bd1e4ac0ed8d187c46801d909be27fb228e82270..0df8c349d3830371b6b964df6bc4cb58028049db 100644 (file)
@@ -352,7 +352,7 @@ void display_customize_iconbar(void) {
                if (!strcasecmp(key, "ib_citadel")) ib_citadel = atoi(value);
        }
 
-       output_headers(1, 1, 2, 0, 0, 0, 0);
+       output_headers(1, 1, 2, 0, 0, 0);
        wprintf("<div id=\"banner\">\n"
                "<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
                "<SPAN CLASS=\"titlebar\">");
@@ -634,7 +634,7 @@ void commit_iconbar(void) {
 
        set_preference("iconbar", iconbar, 1);
 
-       output_headers(1, 1, 0, 0, 0, 0, 0);
+       output_headers(1, 1, 0, 0, 0, 0);
        wprintf(
                "<center><table border=1 bgcolor=\"#ffffff\"><tr><td>"
                "<IMG SRC=\"/static/advanpage2_48x.gif\">"
index b5569b796ac0c351751324e5ac654be75835a043..69d8e6a0521b7791d57f4314b0c6185d7fc9fe8b 100644 (file)
@@ -84,7 +84,7 @@ void display_inetconf(void)
 
        }
 
-       output_headers(1, 1, 2, 0, 0, 0, 0);
+       output_headers(1, 1, 2, 0, 0, 0);
        wprintf("<div id=\"banner\">\n");
        wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>");
        wprintf("<SPAN CLASS=\"titlebar\">");
index 8afd567d024aa50627404ced54a16329244fd40b..fcde57aedf55a78359239c3435d42662d176005e 100644 (file)
@@ -12,7 +12,7 @@
  */
 void display_main_menu(void)
 {
-       output_headers(1, 1, 1, 0, 0, 0, 0);
+       output_headers(1, 1, 1, 0, 0, 0);
 
        wprintf("<div id=\"fix_scrollbar_bug\">"
                "<TABLE WIDTH=100%%>"
@@ -191,7 +191,7 @@ void display_main_menu(void)
  */
 void display_aide_menu(void)
 {
-       output_headers(1, 1, 2, 0, 0, 0, 0);
+       output_headers(1, 1, 2, 0, 0, 0);
        wprintf("<div id=\"banner\">\n"
                "<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
                "<SPAN CLASS=\"titlebar\">");
@@ -264,7 +264,7 @@ void display_aide_menu(void)
  */
 void display_generic(void)
 {
-       output_headers(1, 1, 2, 0, 0, 0, 0);
+       output_headers(1, 1, 2, 0, 0, 0);
        wprintf("<div id=\"banner\">\n"
                "<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
                "<SPAN CLASS=\"titlebar\">");
@@ -314,7 +314,7 @@ void do_generic(void)
                return;
        }
 
-       output_headers(1, 1, 0, 0, 0, 0, 0);
+       output_headers(1, 1, 0, 0, 0, 0);
 
        serv_printf("%s", bstr("g_cmd"));
        serv_getln(buf, sizeof buf);
@@ -373,7 +373,7 @@ void do_generic(void)
 void display_menubar(int as_single_page) {
 
        if (as_single_page) {
-               output_headers(0, 0, 0, 0, 0, 0, 0);
+               output_headers(0, 0, 0, 0, 0, 0);
                wprintf("<HTML>\n"
                        "<HEAD>\n"
                        "<TITLE>MenuBar</TITLE>\n"
index 86df84f58d28600dd1ddc26500361902a537e429..5f11916181b900c4f152af3f1ff15acb803fef27 100644 (file)
@@ -924,7 +924,7 @@ void embed_message(void) {
        targetdiv = bstr("targetdiv");
        print_it = bstr("print_it");
 
-       output_headers(1, 0, 0, 0, 0, 1, 0);
+       output_headers(1, 0, 0, 0, 1, 0);
        begin_burst();
 
        wprintf("<html><head>");
@@ -1766,7 +1766,7 @@ void readloop(char *oper)
        if (strlen(sortby) == 0) sortby = sortpref_value;
        if (strlen(sortby) == 0) sortby = "msgid";
 
-       output_headers(1, 1, 1, 0, 0, 0, 0);
+       output_headers(1, 1, 1, 0, 0, 0);
 
        /* When in summary mode, always show ALL messages instead of just
         * new or old.  Otherwise, show what the user asked for.
@@ -2376,7 +2376,7 @@ void display_enter(void)
         * Otherwise proceed normally.
         * Do a custom room banner with no navbar...
         */
-       output_headers(1, 1, 2, 0, 0, 0, 0);
+       output_headers(1, 1, 2, 0, 0, 0);
        wprintf("<div id=\"banner\">\n");
        embed_room_banner(NULL, navbar_none);
        wprintf("</div>\n");
@@ -2575,7 +2575,7 @@ void delete_msg(void)
 
        msgid = atol(bstr("msgid"));
 
-       output_headers(1, 1, 1, 0, 0, 0, 0);
+       output_headers(1, 1, 1, 0, 0, 0);
 
        sprintf(buf, "DELE %ld", msgid);
        serv_puts(buf);
@@ -2599,7 +2599,7 @@ void confirm_move_msg(void)
 
        msgid = atol(bstr("msgid"));
 
-       output_headers(1, 1, 1, 0, 0, 0, 0);
+       output_headers(1, 1, 1, 0, 0, 0);
 
        wprintf("<div id=\"fix_scrollbar_bug\">"
                "<table width=100%% border=0 bgcolor=\"#444455\"><tr><td>");
@@ -2651,7 +2651,7 @@ void move_msg(void)
 
        msgid = atol(bstr("msgid"));
 
-       output_headers(1, 1, 1, 0, 0, 0, 0);
+       output_headers(1, 1, 1, 0, 0, 0);
 
        if (strlen(bstr("move_button")) > 0) {
                sprintf(buf, "MOVE %ld|%s", msgid, bstr("target_room"));
index a72d51b05dbb7a2782ab0c96dc383dddb38f4f08..49836b2f3994b7ef1f2edde43bb3ac544a74d858 100644 (file)
@@ -54,7 +54,7 @@ void edit_node(void) {
 
 void display_add_node(void)
 {
-       output_headers(1, 1, 2, 0, 0, 0, 0);
+       output_headers(1, 1, 2, 0, 0, 0);
        wprintf("<div id=\"banner\">\n");
        wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>");
        wprintf("<SPAN CLASS=\"titlebar\">");
@@ -93,7 +93,7 @@ void display_edit_node(void)
 
        strcpy(node, bstr("node"));
 
-       output_headers(1, 1, 2, 0, 0, 0, 0);
+       output_headers(1, 1, 2, 0, 0, 0);
        wprintf("<div id=\"banner\">\n");
        wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>");
        wprintf("<SPAN CLASS=\"titlebar\">");
@@ -157,7 +157,7 @@ void display_netconf(void)
        char buf[SIZ];
        char node[SIZ];
 
-       output_headers(1, 1, 2, 0, 0, 0, 0);
+       output_headers(1, 1, 2, 0, 0, 0);
        wprintf("<div id=\"banner\">\n");
        wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>");
        wprintf("<SPAN CLASS=\"titlebar\">");
@@ -208,7 +208,7 @@ void display_confirm_delete_node(void)
 {
        char node[SIZ];
 
-       output_headers(1, 1, 2, 0, 0, 0, 0);
+       output_headers(1, 1, 2, 0, 0, 0);
        wprintf("<div id=\"banner\">\n");
        wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>");
        wprintf("<SPAN CLASS=\"titlebar\">");
@@ -285,7 +285,7 @@ void add_node(void)
                serv_puts(buf);
                serv_getln(buf, sizeof buf);
                if (buf[0] == '1') {
-                       output_headers(1, 1, 0, 0, 0, 0, 0);
+                       output_headers(1, 1, 0, 0, 0, 0);
                        server_to_text();
                        wprintf("<A HREF=\"/display_netconf\">");
                        wprintf(_("Back to menu"));
index c244070b2d5217b09d22248852f12309b817f71e..6e200f6b2f5c66f239090a71b9ea74a7eb578851 100644 (file)
@@ -15,7 +15,7 @@ void display_page(void)
 
        strcpy(recp, bstr("recp"));
 
-        output_headers(1, 1, 2, 0, 0, 0, 0);
+        output_headers(1, 1, 2, 0, 0, 0);
         wprintf("<div id=\"banner\">\n"
                 "<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
                 "<SPAN CLASS=\"titlebar\">");
@@ -69,7 +69,7 @@ void page_user(void)
        char buf[SIZ];
        char closewin[SIZ];
 
-        output_headers(1, 1, 2, 0, 0, 0, 0);
+        output_headers(1, 1, 2, 0, 0, 0);
         wprintf("<div id=\"banner\">\n"
                 "<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
                 "<SPAN CLASS=\"titlebar\">");
@@ -257,7 +257,7 @@ void chat_recv(void) {
        char cl_text[SIZ];
        char *output_data = NULL;
 
-       output_headers(0, 0, 0, 0, 0, 0, 0);
+       output_headers(0, 0, 0, 0, 0, 0);
 
        wprintf("Content-type: text/html; charset=utf-8\n");
        wprintf("\n");
@@ -405,7 +405,7 @@ void chat_send(void) {
        char send_this[SIZ];
        char buf[SIZ];
 
-       output_headers(0, 0, 0, 0, 0, 0, 0);
+       output_headers(0, 0, 0, 0, 0, 0);
        wprintf("Content-type: text/html; charset=utf-8\n");
        wprintf("\n");
        wprintf("<HTML>"
index d7939c9981da4e6f45ec292a9707a60d423d00ef..335274b110f2e92b0c0de24ff944ad6a67bda277 100644 (file)
@@ -172,7 +172,7 @@ void set_preference(char *key, char *value, int save_to_server) {
  */
 void display_preferences(void)
 {
-       output_headers(1, 1, 2, 0, 0, 0, 0);
+       output_headers(1, 1, 2, 0, 0, 0);
        char buf[256];
 
        wprintf("<div id=\"banner\">\n");
index fbcbb75920d8529e47116c138f6376d09c55c4ec..ccc29e5a306b1916b9ed7d349fd54296137952e7 100644 (file)
@@ -206,7 +206,7 @@ void listrms(char *variety)
  */
 void zapped_list(void)
 {
-       output_headers(1, 1, 0, 0, 0, 0, 0);
+       output_headers(1, 1, 0, 0, 0, 0);
 
        svprintf("BOXTITLE", WCS_STRING, _("Zapped (forgotten) rooms"));
        do_template("beginbox");
@@ -886,7 +886,7 @@ void display_editroom(void)
        er_flags = extract_int(&buf[4], 3);
        er_floor = extract_int(&buf[4], 4);
 
-       output_headers(1, 1, 1, 0, 0, 0, 0);
+       output_headers(1, 1, 1, 0, 0, 0);
 
        /* print the tabbed dialog */
        wprintf("<br />"
@@ -1835,7 +1835,7 @@ void display_entroom(void)
                return;
        }
 
-       output_headers(1, 1, 2, 0, 0, 0, 0);
+       output_headers(1, 1, 2, 0, 0, 0);
        wprintf("<div id=\"banner\">\n"
                "<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
                "<SPAN CLASS=\"titlebar\">");
@@ -2044,7 +2044,7 @@ void entroom(void)
  */
 void display_private(char *rname, int req_pass)
 {
-       output_headers(1, 1, 2, 0, 0, 0, 0);
+       output_headers(1, 1, 2, 0, 0, 0);
        wprintf("<div id=\"banner\">\n"
                "<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
                "<SPAN CLASS=\"titlebar\">");
@@ -2123,7 +2123,7 @@ void goto_private(void)
                display_private(bstr("gr_name"), 1);
                return;
        }
-       output_headers(1, 1, 1, 0, 0, 0, 0);
+       output_headers(1, 1, 1, 0, 0, 0);
        wprintf("%s\n", &buf[4]);
        wDumpContent(1);
        return;
@@ -2135,7 +2135,7 @@ void goto_private(void)
  */
 void display_zap(void)
 {
-       output_headers(1, 1, 2, 0, 0, 0, 0);
+       output_headers(1, 1, 2, 0, 0, 0);
 
        wprintf("<div id=\"banner\">\n");
        wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#770000\"><TR><TD>");
@@ -2660,7 +2660,7 @@ void list_all_rooms_by_floor(char *viewpref) {
 void knrooms() {
        char listviewpref[SIZ];
 
-       output_headers(1, 1, 2, 0, 0, 0, 0);
+       output_headers(1, 1, 2, 0, 0, 0);
        load_floorlist();
 
        /* Determine whether the user is trying to change views */
index ce7878b4fd52a7470316ae08fb68ce9065acb7fd..d28addbf9b7eb83b5a59cd3d66a8afcac92fa810 100644 (file)
@@ -26,7 +26,7 @@ void do_setup_wizard(void)
                return;
        }
 
-       output_headers(1, 1, 2, 0, 1, 0, 0);
+       output_headers(1, 1, 2, 0, 0, 0);
 
        wprintf("<div id=\"banner\">\n");
        wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>");
index 81fc952f062660efdc5c8c7af82d5083af819a71..9f72291453d1097b633505cd60e11f11eab081ab 100644 (file)
@@ -21,7 +21,7 @@ void display_siteconfig(void)
        int mboxpolicy = 0;
        int mboxvalue = 0;
 
-       output_headers(1, 1, 2, 0, 0, 0, 0);
+       output_headers(1, 1, 2, 0, 0, 0);
        wprintf("<div id=\"banner\">\n"
                "<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
                "<SPAN CLASS=\"titlebar\">");
index 1c784861192130e41af52ed0024aa99d4c1c8d85..e22bfa1d928f4f7e80eec76e92f116677b3406a3 100644 (file)
@@ -224,30 +224,7 @@ void server_info_section(void) {
        do_template("endbox");
 }
 
-
-/*
- * Display this user's summary page
- */
-void summary(void) {
-       char title[256];
-
-       output_headers(1, 1, 2, 0, 1, 0, 0);
-       wprintf("<div id=\"banner\">\n");
-       wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=#444455><TR>"
-               "<TD><IMG SRC=\"/static/summscreen_48x.gif\"></TD><TD>"
-               "<SPAN CLASS=\"titlebar\">"
-       );
-
-       snprintf(title, sizeof title, _("Summary page for %s"), WC->wc_username);
-       escputs(title);
-       wprintf("</SPAN></TD><TD>\n");
-       wprintf("</TD><TD ALIGN=RIGHT><SPAN CLASS=\"titlebar\">");
-       output_date();
-       wprintf("</SPAN><br />");
-       offer_start_page();
-       wprintf("</TD></TR></TABLE>\n");
-       wprintf("</div>\n<div id=\"content\">\n");
-
+void summary_inner_div(void) {
        /*
         * Now let's do three columns of crap.  All portals and all groupware
         * clients seem to want to do three columns, so we'll do three
@@ -284,6 +261,47 @@ void summary(void) {
        /*
         * End of columns
         */
-       wprintf("</td></tr></table></div>\n");
+       wprintf("</td></tr></table>");
+}
+
+
+/*
+ * Display this user's summary page
+ */
+void summary(void) {
+       char title[256];
+
+       output_headers(1, 1, 2, 0, 0, 0);
+       wprintf("<div id=\"banner\">\n");
+       wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=#444455><TR>"
+               "<TD><IMG SRC=\"/static/summscreen_48x.gif\"></TD><TD>"
+               "<SPAN CLASS=\"titlebar\">"
+       );
+
+       snprintf(title, sizeof title, _("Summary page for %s"), WC->wc_username);
+       escputs(title);
+       wprintf("</SPAN></TD><TD>\n");
+       wprintf("</TD><TD ALIGN=RIGHT><SPAN CLASS=\"titlebar\">");
+       output_date();
+       wprintf("</SPAN><br />");
+       offer_start_page();
+       wprintf("</TD></TR></TABLE>\n");
+
+       /*
+        * You guessed it ... we're going to refresh using ajax.
+        * In the future we might consider updating individual sections of the summary
+        * instead of the whole thing.
+        */
+       wprintf("</div>\n<div id=\"content\">\n");
+       summary_inner_div();
+       wprintf("</div>\n");
+
+       wprintf(
+               "<script type=\"text/javascript\">                                                      \n"
+               " setInterval(\" new Ajax.Updater('content', '/summary_inner_div',                      "
+               "               {method: 'get', parameters: Math.random() });   \", 60000);             \n"
+               "</script>                                                                              \n"
+       );
+
        wDumpContent(1);
 }
index d377a899a466630165161268e6a6439c3866c1db..b995327c724d242ff33cadabf24f4b51ef7514d0 100644 (file)
@@ -24,10 +24,10 @@ void display_edit(char *description, char *check_cmd,
                return;
        }
        if (with_room_banner) {
-               output_headers(1, 1, 1, 0, 0, 0, 0);
+               output_headers(1, 1, 1, 0, 0, 0);
        }
        else {
-               output_headers(1, 1, 0, 0, 0, 0, 0);
+               output_headers(1, 1, 0, 0, 0, 0);
        }
 
        svprintf("BOXTITLE", WCS_STRING, _("Edit %s"), description);
index 604dbf24b956794c4dac3d8d3b6c593159bad3c9..b0ccd1a2aad1e4102b538e1ff1f79a099de579c0 100644 (file)
@@ -15,7 +15,7 @@ void select_user_to_edit(char *message, char *preselect)
        char buf[SIZ];
        char username[SIZ];
 
-       output_headers(1, 1, 2, 0, 1, 0, 0);
+       output_headers(1, 1, 2, 0, 0, 0);
        wprintf("<div id=\"banner\">\n");
        wprintf("<table width=100%% border=0 bgcolor=#444455><tr>"
                "<td>"
@@ -261,7 +261,7 @@ void display_edituser(char *supplied_username, int is_new) {
                return;
        }
 
-       output_headers(1, 1, 2, 0, 0, 0, 0);
+       output_headers(1, 1, 2, 0, 0, 0);
        wprintf("<div id=\"banner\">\n");
        wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>");
        wprintf("<SPAN CLASS=\"titlebar\">");
index 788c6c93bad31e448bdf51b467218aadc569313c..ecea95ff0ffb3306ab4c807a9158502ef97241d5 100644 (file)
@@ -36,7 +36,7 @@ void userlist(void)
                        strcpy(bptr->name, buf);
                        bio = bptr;
                }
-       output_headers(1, 1, 2, 0, 0, 0, 0);
+       output_headers(1, 1, 2, 0, 0, 0);
        wprintf("<div id=\"banner\">\n"
                "<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
                "<SPAN CLASS=\"titlebar\">");
@@ -110,7 +110,7 @@ void showuser(void)
 
        strcpy(who, bstr("who"));
 
-       output_headers(1, 1, 2, 0, 0, 0, 0);
+       output_headers(1, 1, 2, 0, 0, 0);
        wprintf("<div id=\"banner\">\n"
                "<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR>"
                "<TD><IMG SRC=\"/static/usermanag_48x.gif\"></TD>"
index d3d8a8f67942cc40a961536cf68d89065eeee6b3..2f31bffe77b1fade15c1db2b7d734bf984bbf6a8 100644 (file)
@@ -165,7 +165,7 @@ void do_edit_vcard(long msgnum, char *partnum, char *return_to) {
        }
 
        /* Display the form */
-       output_headers(1, 1, 2, 0, 0, 0, 0);
+       output_headers(1, 1, 2, 0, 0, 0);
        wprintf("<div id=\"banner\">\n"
                "<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
                "<SPAN CLASS=\"titlebar\">"
index 399187f9091b849de6556459cec6e2b71591014c..3b842d5a835ea1d7de1c377462e98d7649920570 100644 (file)
@@ -336,7 +336,6 @@ void output_headers(        int do_httpheaders,     /* 1 = output HTTP headers
                                                /*     <div id="content"> either.                   */
 
                        int unset_cookies,      /* 1 = session is terminating, so unset the cookies */
-                       int refresh30,          /* 1 = automatically refresh page every 30 seconds  */
                        int suppress_check,     /* 1 = suppress check for instant messages          */
                        int cache               /* 1 = allow browser to cache this page             */
 ) {
@@ -382,16 +381,6 @@ void output_headers(       int do_httpheaders,     /* 1 = output HTTP headers
        if (do_htmlhead) {
                /* wprintf("\n"); */
                begin_burst();
-
-               if (refresh30) {
-                       svprintf("REFRESHTAG", WCS_STRING, "%s",
-                               "<meta http-equiv=\"refresh\" content=\"30\" />\n");
-               }
-               else {
-                       svprintf("REFRESHTAG", WCS_STRING, "%s",
-                               "<meta http-equiv=\"refresh\" content=\"500363689;\" />\n");
-               }
-
                do_template("head");
        }
 
@@ -464,7 +453,7 @@ void check_for_instant_messages()
 void http_transmit_thing(char *thing, size_t length, char *content_type,
                         int is_static) {
 
-       output_headers(0, 0, 0, 0, 0, 0, is_static);
+       output_headers(0, 0, 0, 0, 0, is_static);
 
        wprintf("Content-type: %s\r\n"
                "Server: %s\r\n"
@@ -624,7 +613,7 @@ void output_mimepart()
                bytes = extract_long(&buf[4], 0);
                content = malloc(bytes + 2);
                extract_token(content_type, &buf[4], 3, '|', sizeof content_type);
-               output_headers(0, 0, 0, 0, 0, 0, 0);
+               output_headers(0, 0, 0, 0, 0, 0);
                read_server_binary(content, bytes);
                serv_puts("CLOS");
                serv_getln(buf, sizeof buf);
@@ -632,7 +621,7 @@ void output_mimepart()
                free(content);
        } else {
                wprintf("HTTP/1.0 404 %s\n", &buf[4]);
-               output_headers(0, 0, 0, 0, 0, 0, 0);
+               output_headers(0, 0, 0, 0, 0, 0);
                wprintf("Content-Type: text/plain\r\n");
                wprintf("\r\n");
                wprintf(_("An error occurred while retrieving this part: %s\n"), &buf[4]);
@@ -678,7 +667,7 @@ char *load_mimepart(long msgnum, char *partnum)
 void convenience_page(char *titlebarcolor, char *titlebarmsg, char *messagetext)
 {
        wprintf("HTTP/1.0 200 OK\n");
-       output_headers(1, 1, 2, 0, 0, 0, 0);
+       output_headers(1, 1, 2, 0, 0, 0);
        wprintf("<div id=\"banner\">\n");
        wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#%s\"><TR><TD>", titlebarcolor);
        wprintf("<SPAN CLASS=\"titlebar\">%s</SPAN>\n", titlebarmsg);
@@ -695,7 +684,7 @@ void convenience_page(char *titlebarcolor, char *titlebarmsg, char *messagetext)
  * Display a blank page.
  */
 void blank_page(void) {
-       output_headers(1, 1, 0, 0, 1, 0, 0);
+       output_headers(1, 1, 0, 0, 0, 0);
        wDumpContent(2);
 }
 
@@ -741,7 +730,7 @@ void change_start_page(void) {
 
        set_preference("startpage", bstr("startpage"), 1);
 
-       output_headers(1, 1, 0, 0, 0, 0, 0);
+       output_headers(1, 1, 0, 0, 0, 0);
        do_template("newstartpage");
        wDumpContent(1);
 }
@@ -809,6 +798,25 @@ void upload_handler(char *name, char *filename, char *partnum, char *disp,
 
 }
 
+/*
+ * Convenience functions to wrap around asynchronous ajax responses
+ */
+void begin_ajax_response(void) {
+        output_headers(0, 0, 0, 0, 0, 0);
+
+        wprintf("Content-type: text/html; charset=UTF-8\r\n"
+                "Server: %s\r\n"
+                "Connection: close\r\n"
+                "Pragma: no-cache\r\n"
+                "Cache-Control: no-cache\r\n",
+                SERVER);
+        begin_burst();
+}
+
+void end_ajax_response(void) {
+        wprintf("\r\n");
+        wDumpContent(0);
+}
 
 
 
@@ -1148,7 +1156,9 @@ void session_loop(struct httprequest *req)
        } else if (!strcasecmp(action, "who")) {
                who();
        } else if (!strcasecmp(action, "who_inner_html")) {
-               who_inner_html();
+               begin_ajax_response();
+               who_inner_div();
+               end_ajax_response();
        } else if (!strcasecmp(action, "knrooms")) {
                knrooms();
        } else if (!strcasecmp(action, "gotonext")) {
@@ -1341,6 +1351,10 @@ void session_loop(struct httprequest *req)
 #endif
        } else if (!strcasecmp(action, "summary")) {
                summary();
+       } else if (!strcasecmp(action, "summary_inner_div")) {
+               begin_ajax_response();
+               summary_inner_div();
+               end_ajax_response();
        } else if (!strcasecmp(action, "iconbar")) {
                do_iconbar();
        } else if (!strcasecmp(action, "display_customize_iconbar")) {
@@ -1366,7 +1380,7 @@ void session_loop(struct httprequest *req)
        } else if (!strcasecmp(action, "bcc_autocomplete")) {
                recp_autocomplete(bstr("bcc"));
        } else if (!strcasecmp(action, "diagnostics")) {
-               output_headers(1, 1, 1, 0, 0, 0, 0);
+               output_headers(1, 1, 1, 0, 0, 0);
                wprintf("Session: %d<hr />\n", WC->wc_session);
                wprintf("Command: <br /><PRE>\n");
                escputs(cmd);
index 6d9b56da71f3e54f08ae4712c6babca4494ca214..6506edffe4159471d06b880be84f92425e93c9c4 100644 (file)
@@ -354,7 +354,7 @@ int tcp_connectsock(char *, char *);
 void serv_getln(char *strbuf, int bufsize);
 void serv_puts(char *string);
 void who(void);
-void who_inner_html(void);
+void who_inner_div(void);
 void fmout(char *align);
 void pullquote_fmout(void);
 void wDumpContent(int);
@@ -368,7 +368,6 @@ void output_headers(    int do_httpheaders,
                        int do_htmlhead,
                        int do_room_banner,
                        int unset_cookies,
-                       int refresh30,
                        int suppress_check,
                        int cache);
 void wprintf(const char *format,...);
@@ -502,6 +501,7 @@ void rename_floor(void);
 void do_listsub(void);
 void toggle_self_service(void);
 void summary(void);
+void summary_inner_div(void);
 ssize_t write(int fd, const void *buf, size_t count);
 void cal_process_attachment(char *part_source, long msgnum, char *cal_partnum);
 void display_calendar(long msgnum);
@@ -522,6 +522,8 @@ void generate_uuid(char *);
 void display_preferences(void);
 void set_preferences(void);
 void recp_autocomplete(char *);
+void begin_ajax_response(void);
+void end_ajax_response(void);
 
 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
 void display_edit_task(void);
index 05c22ba0c478ceb6441a4004fd3c65007bfeb89a..984fd4ac575fca185e016fff890386442351de1d 100644 (file)
@@ -123,27 +123,6 @@ void who_inner_div(void) {
 }
 
 
-/*
- * AJAX-response version of wholist inner html
- */
-void who_inner_html(void) {
-       output_headers(0, 0, 0, 0, 0, 0, 0);
-
-       wprintf("Content-type: text/html; charset=UTF-8\r\n"
-               "Server: %s\r\n"
-               "Connection: close\r\n"
-               "Pragma: no-cache\r\n"
-               "Cache-Control: no-cache\r\n",
-               SERVER);
-       begin_burst();
-
-       who_inner_div();
-
-       wprintf("\r\n");
-       wDumpContent(0);
-}
-
-
 /*
  * who is on?
  */
@@ -151,7 +130,7 @@ void who(void)
 {
        char title[256];
 
-       output_headers(1, 1, 2, 0, 0, 0, 0);
+       output_headers(1, 1, 2, 0, 0, 0);
 
        wprintf("<script type=\"text/javascript\">\n"
                "function ConfirmKill() { \n"
@@ -203,7 +182,7 @@ void who(void)
        wprintf(
                "<script type=\"text/javascript\">                                                      \n"
                " setInterval(\" new Ajax.Updater('fix_scrollbar_bug', '/who_inner_html',               "
-               "               {method: 'get', parameters: Math.random() });   \", 3000);              \n"
+               "               {method: 'get', parameters: Math.random() });   \", 30000);             \n"
                "</script>                                                                              \n"
        );
        wDumpContent(1);
@@ -242,7 +221,7 @@ void edit_me(void)
        } else if (strlen(bstr("cancel_button")) > 0) {
                http_redirect("/who");
        } else {
-               output_headers(1, 1, 0, 0, 0, 0, 0);
+               output_headers(1, 1, 0, 0, 0, 0);
 
                wprintf("<div id=\"banner\">\n");
                wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>");