Fixed the mini-calendar month buttons
authorArt Cancro <ajc@citadel.org>
Fri, 10 Oct 2008 19:46:04 +0000 (19:46 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 10 Oct 2008 19:46:04 +0000 (19:46 +0000)
and moved the javascript function into the trailing block

webcit/calendar_view.c

index 73fd4669c226dee371ea9b563875ce8f0049123e..cccbdc8129c6141acc9e5975b515a2216df639fe 100644 (file)
@@ -129,17 +129,16 @@ void embeddable_mini_calendar(int year, int month, char *urlformat)
                sprintf(&escaped_urlformat[i*2], "%02X", urlformat[i]);
        }
 
-       wprintf("<script type=\"text/javascript\">                                                      "
-               "       function minical_change_month(year, month) {                                    "
-               "               p = 'year=' + year + '?month=' + month                                  "
-               "                       + '&urlformat=%s&r=' + CtdlRandomString();                      "
-               "               new Ajax.Updater('%s', 'mini_calendar',                                 "
-               "                       { method: 'get', parameters: p, evalScripts: true } );          "
-               "       }                                                                               "
-               "</script>\n"
-               ,
+       StrBufAppendPrintf(WC->trailing_javascript,
+               "       function minical_change_month(year, month) {                                    \n"
+               "               p = 'year=' + year + '&month=' + month                                  \n"
+               "                       + '&urlformat=%s&r=' + CtdlRandomString();                      \n"
+               "               new Ajax.Updater('%s', 'mini_calendar',                                 \n"
+               "                       { method: 'get', parameters: p, evalScripts: true } );          \n"
+               "       }                                                                               \n"
+               "",
                escaped_urlformat, div_id
-               );
+       );
 
 }