]> code.citadel.org Git - citadel.git/blobdiff - webcit/who.c
* Discovered that Prototype makes it easy to auto-refresh, so I switched
[citadel.git] / webcit / who.c
index bc8c567b9d09ca285565920bdcaab872420d3869..91fe3d5a01d90d4c2ac246ef2215105b361100d1 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-store, no-cache, must-revalidate\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"
@@ -189,20 +168,16 @@ void who(void)
        wprintf("</div>\n");
 
        /* JavaScript to make the ajax refresh happen:
-        * * See http://www.sergiopereira.com/articles/prototype.js.html for info on Ajax.Updater
-        * * It wants: 1. The div being updated
-        * *           2. The URL of the update source
-        * *           3. Other flags (such as the HTTP method)
-        *
-        * * setInterval() makes it auto-run this code every 30,000 milliseconds (30 seconds)
-        *
-        * FIXME b0rken IE is still caching it
+        * 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"
-               " setInterval(\" new Ajax.Updater('fix_scrollbar_bug', '/who_inner_html',               "
-               "                       {method: 'get'});                       \", 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);
 }
@@ -240,7 +215,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>");