From: Art Cancro Date: Sat, 16 Jan 2010 05:00:19 +0000 (+0000) Subject: * the JavaScript code for the new BBS view has been moved out of bbs_renderer.c and... X-Git-Tag: v7.86~498 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=41838efd9f15dcb1a6fd38f579444802f5a16d88 * the JavaScript code for the new BBS view has been moved out of bbs_renderer.c and into static/wclib.js where it belongs. --- diff --git a/webcit/bbsview_renderer.c b/webcit/bbsview_renderer.c index cff04235a..c80fde724 100644 --- a/webcit/bbsview_renderer.c +++ b/webcit/bbsview_renderer.c @@ -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 = '
%s ...
'; \n" - " p = gt_or_lt + '=' + gt_or_lt_value + '&maxmsgs=' + maxmsgs \n" - " + '&is_summary=0&is_ajax=1' \n" - " + '>_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. */ diff --git a/webcit/static/wclib.js b/webcit/static/wclib.js index 8fd9b16bd..334bf03ab 100644 --- a/webcit/static/wclib.js +++ b/webcit/static/wclib.js @@ -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 = '
'; + p = gt_or_lt + '=' + gt_or_lt_value + '&maxmsgs=' + maxmsgs + + '&is_summary=0&is_ajax=1' + + '>_or_lt=' + gt_or_lt + + '&r=' + CtdlRandomString(); + new Ajax.Updater(target_div, 'read' + gt_or_lt, + { method: 'get', parameters: p, evalScripts: true } ); +}