* the JavaScript code for the new BBS view has been moved out of bbs_renderer.c and...
authorArt Cancro <ajc@citadel.org>
Sat, 16 Jan 2010 05:00:19 +0000 (05:00 +0000)
committerArt Cancro <ajc@citadel.org>
Sat, 16 Jan 2010 05:00:19 +0000 (05:00 +0000)
webcit/bbsview_renderer.c
webcit/static/wclib.js

index cff04235ada69ee1c6536c2c4fc732c29d59faa2..c80fde7249c4304d859528787b2eb147ff591474 100644 (file)
@@ -134,24 +134,6 @@ int bbsview_RenderView_or_Tail(SharedMessageStatus *Stat,
        snprintf(olderdiv, sizeof olderdiv, "olderdiv%08lx%08x", time(NULL), rand());
        snprintf(newerdiv, sizeof newerdiv, "newerdiv%08lx%08x", time(NULL), rand());
 
-       /* If this is the initial page load (and not an update), supply the required JavaScript code */
-       if (!WC->is_ajax) {
-          StrBufAppendPrintf(WC->trailing_javascript,
-               "       function moremsgs(target_div, gt_or_lt, gt_or_lt_value, maxmsgs) {              \n"
-               "               $(target_div).innerHTML = '<div class=\"moreprompt\">%s ... <img src=\"static/throbber.gif\"></div>';   \n"
-               "               p = gt_or_lt + '=' + gt_or_lt_value + '&maxmsgs=' + maxmsgs             \n"
-               "                       + '&is_summary=0&is_ajax=1'                                     \n"
-               "                       + '&gt_or_lt=' + gt_or_lt                                       \n"
-               "                       + '&r=' + CtdlRandomString();                                   \n"
-               "               new Ajax.Updater(target_div, 'read' + gt_or_lt,                                 \n"
-               "                       { method: 'get', parameters: p, evalScripts: true } );          \n"
-               "       }                                                                               \n"
-               "",
-               _("Loading")
-          );
-       }
-
-
        /* Determine whether we are in the middle of a 'click for older messages' or 'click for
         * newer messages' operation.  If neither, then we are in the initial page load.
         */
index 8fd9b16bd2bb12062379b7b598503ace174e9cfd..334bf03abcc7cf190714fc14bf4872b2fdb43bdd 100644 (file)
@@ -954,3 +954,17 @@ function DeleteSMTPqueueMsg(msgnum1, msgnum2) {
                }
        );
 }
+
+/*
+ * Update function for BBS view
+ */
+function moremsgs(target_div, gt_or_lt, gt_or_lt_value, maxmsgs)
+{
+       $(target_div).innerHTML = '<div class="moreprompt"><img src="static/throbber.gif"></div>';
+       p = gt_or_lt + '=' + gt_or_lt_value + '&maxmsgs=' + maxmsgs
+               + '&is_summary=0&is_ajax=1'
+               + '&gt_or_lt=' + gt_or_lt
+               + '&r=' + CtdlRandomString();
+       new Ajax.Updater(target_div, 'read' + gt_or_lt,
+               { method: 'get', parameters: p, evalScripts: true } );
+}