more trailing_javascript
authorArt Cancro <ajc@citadel.org>
Fri, 3 Oct 2008 15:06:36 +0000 (15:06 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 3 Oct 2008 15:06:36 +0000 (15:06 +0000)
webcit/calendar_tools.c

index 7c47b0d3f129713014f87eee754e447b7c034bc4..a2d23b4fbc649b2e988181e5d4b6a1449beddf6a 100644 (file)
@@ -68,11 +68,10 @@ void display_icaltimetype_as_webform(struct icaltimetype *t, char *prefix, int d
        wc_strftime(timebuf, 32, "%Y-%m-%d", &tm);
        wprintf(timebuf);
        wprintf("\">");
-       wprintf("<script type=\"text/javascript\">");
-       wprintf("attachDatePicker('");
-       wprintf(prefix);
-       wprintf("', '%s');\n", get_selected_language());
-       wprintf("</script>");
+
+       StrBufAppendPrintf(WC->trailing_javascript, "attachDatePicker('");
+       StrBufAppendPrintf(WC->trailing_javascript, prefix);
+       StrBufAppendPrintf(WC->trailing_javascript, "', '%s');\n", get_selected_language());
 
        /* If we're editing a date only, we still generate the time boxes, but we hide them.
         * This keeps the data model consistent.