Finished the trailing_javascript API and moved a few things to it
authorArt Cancro <ajc@citadel.org>
Fri, 3 Oct 2008 14:38:30 +0000 (14:38 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 3 Oct 2008 14:38:30 +0000 (14:38 +0000)
webcit/addressbook_popup.c
webcit/event.c
webcit/static/t/trailing.html
webcit/webcit.c
webcit/webcit.h
webcit/who.c

index 5609c68aef980557dbe7d5c25523a6d9d4aa90ff..b8be3e77aef133608ee40476287ec737ea748c66 100644 (file)
@@ -88,9 +88,8 @@ void display_address_book_middle_div(void) {
                "><img src=\"static/closewindow.gif\">");
        wprintf("</td></tr></table>");
 
-       wprintf("<script type=\"text/javascript\">"
-               "PopulateAddressBookInnerDiv($('which_addr_book').value,'%s');"
-               "</script>\n",
+       StrBufAppendPrintf(WC->trailing_javascript,
+               "PopulateAddressBookInnerDiv($('which_addr_book').value,'%s');",
                bstr("target_input")
        );
 
index 3bf04f86164160a29c5d25efcff91c571d631c12..54cf9e1cc89cc9fa4a336a407510d4ba268c5624 100644 (file)
@@ -562,10 +562,9 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum,
 
        wprintf("</div>\n");
 
-       wprintf("<script type=\"text/javascript\">      \n"
+       StrBufAppendPrintf(WC->trailing_javascript,
                "eventEditAllDay();     \n"
                "RecurrenceShowHide();  \n"
-               "</script>      \n"
        );
        address_book_popup();
        wDumpContent(1);
index e69a7c0f284ed2f33b071f1c890de03e7b0efa9a..5d1f0e0ec408118a93805803238493fb28d1a49b 100644 (file)
@@ -1,5 +1,6 @@
 <!-- start trailing.html -->
 <script type="text/javascript">
+<?TRAILING_JAVASCRIPT>
  Rounded("div.box", "big transparent top bottom");
  Rounded("form.box", "big transparent top bottom");
  Rounded("div.boxlabel", "big transparent top");
index 2ce352ee7ecfdc8a41a1b0747f3a0af863797b59..6be92d017e03f751404335982f36bb0aed206e66 100644 (file)
@@ -382,7 +382,9 @@ void hprintf(const char *format,...)
 }
 
 
-
+void put_trailing_javascript(void) {
+       wprintf("%s", ChrPtr(WC->trailing_javascript));
+}
 
 /*
  * wrap up an HTTP session, closes tags, etc.
@@ -396,8 +398,7 @@ void wDumpContent(int print_standard_html_footer)
 {
        if (print_standard_html_footer) {
                wprintf("</div>\n");    /* end of "text" div */
-               wprintf("<script type=\"text/javascript\">\n%s\n</script>\n",
-                       ChrPtr(WC->trailing_javascript));
+               svcallback("TRAILING_JAVASCRIPT", put_trailing_javascript);
                do_template("trailing", NULL);
        }
 
index 3a3e0c333fb628aa880440a18252ffa83e9e26b3..265e6f0254361b8bcdf756ad2863e6544cc79715 100644 (file)
@@ -282,7 +282,7 @@ typedef struct _TemplateToken {
        TemplateParam *Params[MAXPARAM];
 } WCTemplateToken;
 
-typedef void (*WCHandlerFunc)(StrBuf *Target, int nArgs, WCTemplateToken *Token, void *Context, int ContextType);
+typedef void (*WCHandlerFunc)();
 
 
 /**
index 02f3630e90e716aa982ecd07950fecfa762a26a3..a2ecd9a3ce09074a8cdb38a132db5d4ef45d270e 100644 (file)
@@ -231,6 +231,7 @@ void who_inner_div(void) {
 */
 
 
+#if 0
 /*
  * Display a list of users currently logged in to the system
  * /
@@ -246,6 +247,7 @@ void who(void)
                "}\n"
                "</script>\n", _("Do you really want to kill this session?")
        );
+#endif
 
        wprintf("<div id=\"banner\">\n");
        wprintf("<div class=\"room_banner\">");
@@ -294,6 +296,7 @@ void who(void)
        wDumpContent(1);
 }
 */
+#endif
 
 /*
  * end session