From 523c1b0f7a3002c6aaa3eb833b55eb0cf07674ff Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Sun, 18 Sep 2005 15:02:30 +0000 Subject: [PATCH] * 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. :) --- webcit/ChangeLog | 11 +++++++ webcit/auth.c | 8 ++--- webcit/autocompletion.c | 2 +- webcit/calendar.c | 8 ++--- webcit/event.c | 2 +- webcit/floors.c | 2 +- webcit/graphics.c | 4 +-- webcit/iconbar.c | 4 +-- webcit/inetconf.c | 2 +- webcit/mainmenu.c | 10 +++--- webcit/messages.c | 12 ++++---- webcit/netconf.c | 10 +++--- webcit/paging.c | 8 ++--- webcit/preferences.c | 2 +- webcit/roomops.c | 14 ++++----- webcit/setup_wizard.c | 2 +- webcit/siteconfig.c | 2 +- webcit/summary.c | 68 ++++++++++++++++++++++++++--------------- webcit/sysmsgs.c | 4 +-- webcit/useredit.c | 4 +-- webcit/userlist.c | 4 +-- webcit/vcard_edit.c | 2 +- webcit/webcit.c | 52 +++++++++++++++++++------------ webcit/webcit.h | 6 ++-- webcit/who.c | 27 ++-------------- 25 files changed, 147 insertions(+), 123 deletions(-) diff --git a/webcit/ChangeLog b/webcit/ChangeLog index 7355a4ffa..6d9cee370 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -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 1998-12-03 Nathan Bryant * webserver.c: warning fix + diff --git a/webcit/auth.c b/webcit/auth.c index 075e1da9c..94182798b 100644 --- a/webcit/auth.c +++ b/webcit/auth.c @@ -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("
\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("
"); 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("
\n" "
" ""); @@ -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("
\n" "
" ""); diff --git a/webcit/autocompletion.c b/webcit/autocompletion.c index 43904bdec..6d68edd43 100644 --- a/webcit/autocompletion.c +++ b/webcit/autocompletion.c @@ -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" diff --git a/webcit/calendar.c b/webcit/calendar.c index 49e572a90..effd9aea1 100644 --- a/webcit/calendar.c +++ b/webcit/calendar.c @@ -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("
\n"); wprintf("
" @@ -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("
\n"); wprintf("
" @@ -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("
\n" "" "" @@ -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]); diff --git a/webcit/event.c b/webcit/event.c index dfd3478d4..3fe8a01af 100644 --- a/webcit/event.c +++ b/webcit/event.c @@ -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("
\n" "
" ""); diff --git a/webcit/floors.c b/webcit/floors.c index 5d1ba0ce4..7f63dfb05 100644 --- a/webcit/floors.c +++ b/webcit/floors.c @@ -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("
\n" "
" ""); diff --git a/webcit/graphics.c b/webcit/graphics.c index 5a0fa4e55..99173463a 100644 --- a/webcit/graphics.c +++ b/webcit/graphics.c @@ -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("
\n" "
" ""); diff --git a/webcit/iconbar.c b/webcit/iconbar.c index bd1e4ac0e..0df8c349d 100644 --- a/webcit/iconbar.c +++ b/webcit/iconbar.c @@ -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("
\n" "
" ""); @@ -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( "
" "" diff --git a/webcit/inetconf.c b/webcit/inetconf.c index b5569b796..69d8e6a05 100644 --- a/webcit/inetconf.c +++ b/webcit/inetconf.c @@ -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("
\n"); wprintf("
"); wprintf(""); diff --git a/webcit/mainmenu.c b/webcit/mainmenu.c index 8afd567d0..fcde57aed 100644 --- a/webcit/mainmenu.c +++ b/webcit/mainmenu.c @@ -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("
" "" @@ -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("
\n" "
" ""); @@ -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("
\n" "
" ""); @@ -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("\n" "\n" "MenuBar\n" diff --git a/webcit/messages.c b/webcit/messages.c index 86df84f58..5f1191618 100644 --- a/webcit/messages.c +++ b/webcit/messages.c @@ -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(""); @@ -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("
\n"); embed_room_banner(NULL, navbar_none); wprintf("
\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("
" "
"); @@ -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")); diff --git a/webcit/netconf.c b/webcit/netconf.c index a72d51b05..49836b2f3 100644 --- a/webcit/netconf.c +++ b/webcit/netconf.c @@ -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("
\n"); wprintf("
"); wprintf(""); @@ -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("
\n"); wprintf("
"); wprintf(""); @@ -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("
\n"); wprintf("
"); wprintf(""); @@ -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("
\n"); wprintf("
"); wprintf(""); @@ -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(""); wprintf(_("Back to menu")); diff --git a/webcit/paging.c b/webcit/paging.c index c244070b2..6e200f6b2 100644 --- a/webcit/paging.c +++ b/webcit/paging.c @@ -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("
\n" "
" ""); @@ -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("
\n" "
" ""); @@ -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("" diff --git a/webcit/preferences.c b/webcit/preferences.c index d7939c998..335274b11 100644 --- a/webcit/preferences.c +++ b/webcit/preferences.c @@ -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("
\n"); diff --git a/webcit/roomops.c b/webcit/roomops.c index fbcbb7592..ccc29e5a3 100644 --- a/webcit/roomops.c +++ b/webcit/roomops.c @@ -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("
" @@ -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("
\n" "
" ""); @@ -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("
\n" "
" ""); @@ -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("
\n"); wprintf("
"); @@ -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 */ diff --git a/webcit/setup_wizard.c b/webcit/setup_wizard.c index ce7878b4f..d28addbf9 100644 --- a/webcit/setup_wizard.c +++ b/webcit/setup_wizard.c @@ -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("
\n"); wprintf("
"); diff --git a/webcit/siteconfig.c b/webcit/siteconfig.c index 81fc952f0..9f7229145 100644 --- a/webcit/siteconfig.c +++ b/webcit/siteconfig.c @@ -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("
\n" "
" ""); diff --git a/webcit/summary.c b/webcit/summary.c index 1c7848611..e22bfa1d9 100644 --- a/webcit/summary.c +++ b/webcit/summary.c @@ -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("
\n"); - wprintf("" - "
" - "" - ); - - snprintf(title, sizeof title, _("Summary page for %s"), WC->wc_username); - escputs(title); - wprintf("\n"); - wprintf(""); - output_date(); - wprintf("
"); - offer_start_page(); - wprintf("
\n"); - wprintf("
\n
\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("
\n"); + wprintf("
"); +} + + +/* + * Display this user's summary page + */ +void summary(void) { + char title[256]; + + output_headers(1, 1, 2, 0, 0, 0); + wprintf("
\n"); + wprintf("" + "
" + "" + ); + + snprintf(title, sizeof title, _("Summary page for %s"), WC->wc_username); + escputs(title); + wprintf("\n"); + wprintf(""); + output_date(); + wprintf("
"); + offer_start_page(); + wprintf("
\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("
\n
\n"); + summary_inner_div(); + wprintf("
\n"); + + wprintf( + " \n" + ); + wDumpContent(1); } diff --git a/webcit/sysmsgs.c b/webcit/sysmsgs.c index d377a899a..b995327c7 100644 --- a/webcit/sysmsgs.c +++ b/webcit/sysmsgs.c @@ -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); diff --git a/webcit/useredit.c b/webcit/useredit.c index 604dbf24b..b0ccd1a2a 100644 --- a/webcit/useredit.c +++ b/webcit/useredit.c @@ -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("
\n"); wprintf("" "
" @@ -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("
\n"); wprintf("
"); wprintf(""); diff --git a/webcit/userlist.c b/webcit/userlist.c index 788c6c93b..ecea95ff0 100644 --- a/webcit/userlist.c +++ b/webcit/userlist.c @@ -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("
\n" "
" ""); @@ -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("
\n" "" "" diff --git a/webcit/vcard_edit.c b/webcit/vcard_edit.c index d3d8a8f67..2f31bffe7 100644 --- a/webcit/vcard_edit.c +++ b/webcit/vcard_edit.c @@ -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("
\n" "
" "" diff --git a/webcit/webcit.c b/webcit/webcit.c index 399187f90..3b842d5a8 100644 --- a/webcit/webcit.c +++ b/webcit/webcit.c @@ -336,7 +336,6 @@ void output_headers( int do_httpheaders, /* 1 = output HTTP headers /*
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", - "\n"); - } - else { - svprintf("REFRESHTAG", WCS_STRING, "%s", - "\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("
\n"); wprintf("
", titlebarcolor); wprintf("%s\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
\n", WC->wc_session); wprintf("Command:
\n");
 		escputs(cmd);
diff --git a/webcit/webcit.h b/webcit/webcit.h
index 6d9b56da7..6506edffe 100644
--- a/webcit/webcit.h
+++ b/webcit/webcit.h
@@ -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);
diff --git a/webcit/who.c b/webcit/who.c
index 05c22ba0c..984fd4ac5 100644
--- a/webcit/who.c
+++ b/webcit/who.c
@@ -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("										\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("
\n"); wprintf("
"); -- 2.30.2