Skeleton code for the Global Email Aliases tab. To hell with the existing template...
authorArt Cancro <ajc@citadel.org>
Fri, 13 Aug 2021 00:25:58 +0000 (20:25 -0400)
committerArt Cancro <ajc@citadel.org>
Fri, 13 Aug 2021 00:25:58 +0000 (20:25 -0400)
webcit/static/t/aide/siteconfig/tab_aliases.html
webcit/webcit.c

index 1ea5d24..02ed6b9 100644 (file)
@@ -1,7 +1,31 @@
 <div class="conftitle"><?_("Global email aliases")></div>
+<a href="javascript:load_aliases()">&#8635;</a>
 <hr>
-<table border="0">
 
-FIXME
+<div id="wc_easterbunny77">
+</div>
 
-</table>
+<script type="text/javascript">
+
+
+function load_aliases() {
+       var request77 = new XMLHttpRequest();
+       request77.open("GET", "ajax_servcmd?g_cmd=LIST", true);
+       request77.onreadystatechange = function() {
+               populate_aliases(this.responseText);
+       };
+       request77.send();
+       request77 = null;
+}
+
+function populate_aliases(data) {
+       document.getElementById("wc_easterbunny77").innerHTML = data;
+}
+
+
+document.getElementById("wc_easterbunny77").innerHTML = "die easterbunny die easterbunny still fool";
+load_aliases();
+
+</script>
+
+<!-- This could end up being a design pattern in WebCit-NG -->
index 703bc99..a7f2ddf 100644 (file)
@@ -391,15 +391,15 @@ void end_ajax_response(void) {
 /*
  * Wraps a Citadel server command in an AJAX transaction.
  */
-void ajax_servcmd(void)
-{
+void ajax_servcmd(void) {
        int Done = 0;
        StrBuf *Buf;
        char *junk;
        size_t len;
 
-       if (verbose)
+       if (verbose) {
                syslog(LOG_DEBUG, "ajax_servcmd() g_cmd=\"%s\"", bstr("g_cmd") );
+       }
        begin_ajax_response();
        Buf = NewStrBuf();
        serv_puts(bstr("g_cmd"));