}
-/*
- * XML-encapsulated version of wholist inner html
- */
-void who_inner_html(void) {
- output_headers(0, 0, 0, 0, 0, 0, 0);
-
- wprintf("Content-type: text/xml;charset=UTF-8\r\n"
- "Server: %s\r\n"
- "Connection: close\r\n"
- "Pragma: no-cache\r\n"
- "Cache-Control: no-store\r\n",
- SERVER);
- begin_burst();
-
- wprintf("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
- "<ajax-response>\r\n"
- "<response type=\"element\" id=\"fix_scrollbar_bug\">\r\n"
- );
-
- who_inner_div();
-
- wprintf("</response>\r\n"
- "</ajax-response>\r\n"
- "\r\n"
- );
-
- wDumpContent(0);
-}
-
-
/*
* who is on?
*/
{
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"
wprintf("<IMG SRC=\"/static/usermanag_48x.gif\" ALT=\" \" "
"ALIGN=MIDDLE "
">");
- /* "onLoad=\"javascript:bodyOnLoad()\" " */
wprintf("<SPAN CLASS=\"titlebar\"> ");
snprintf(title, sizeof title, _("Users currently on %s"), serv_info.serv_humannode);
wprintf("<div id=\"content\">\n");
wprintf("<div style=\"display:inline\" id=\"fix_scrollbar_bug\">");
- who_inner_div(); /* Actual data handled by another function */
+ who_inner_div();
wprintf("</div>\n");
wprintf("<div id=\"instructions\" align=center>");
wprintf("</div>\n");
/* JavaScript to make the ajax refresh happen:
- * 1. Register the request 'getWholist' which calls the WebCit action 'who_inner_html'
- * 2. Register the 'fix_scrollbar_bug' div as one we're interested in ajaxifying
- * 3. setInterval to make the ajax refresh happen every 30 seconds. The random number
- * in the request is there to prevent the eternally moronic Internet Explorer from
- * caching the XML even though it's been told not to.
+ * See http://www.sergiopereira.com/articles/prototype.js.html for info on Ajax.PeriodicalUpdater
+ * It wants: 1. The div being updated
+ * 2. The URL of the update source
+ * 3. Other flags (such as the HTTP method and the refresh frequency)
*/
wprintf(
- "<script type=\"text/javascript\"> \n"
- " ajaxEngine.registerRequest('getWholist', 'who_inner_html'); \n"
- " ajaxEngine.registerAjaxElement('fix_scrollbar_bug'); \n"
- " setInterval(\"ajaxEngine.sendRequest('getWholist', 'junk='+Math.random());\", 30000); \n"
- "</script> \n"
+ "<script type=\"text/javascript\"> "
+ " new Ajax.PeriodicalUpdater('fix_scrollbar_bug', '/who_inner_html', "
+ " { method: 'get', frequency: 30 } ); "
+ "</script> \n"
);
-
wDumpContent(1);
}
} 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>");