From a54257955eeed7d8d7052bc28d88fc9fa36fa1dd Mon Sep 17 00:00:00 2001 From: erickson Date: Fri, 3 Mar 2006 17:10:23 +0000 Subject: [PATCH] added 'dbg' url param to turn on debugging, in particular this enables request debugging which spits out srfsh-style requests to the console fixed bug where the authority searches were fired off before the final copy count request was fired git-svn-id: svn://svn.open-ils.org/ILS/trunk@3247 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/opac/common/js/config.js | 2 ++ Open-ILS/web/opac/common/js/opac_utils.js | 18 +++++++++++++++++- Open-ILS/web/opac/skin/default/js/mresult.js | 4 ++++ .../web/opac/skin/default/js/result_common.js | 7 ++----- Open-ILS/web/opac/skin/default/js/rresult.js | 2 ++ 5 files changed, 27 insertions(+), 6 deletions(-) diff --git a/Open-ILS/web/opac/common/js/config.js b/Open-ILS/web/opac/common/js/config.js index e6ce3ea7e9..c8b8dec6ce 100644 --- a/Open-ILS/web/opac/common/js/config.js +++ b/Open-ILS/web/opac/common/js/config.js @@ -20,6 +20,7 @@ var PARAM_ADVTYPE = "adt"; /* the advanced search type */ var PARAM_RTYPE = "rt"; var PARAM_SORT = "s"; var PARAM_SORT_DIR = "sd"; +var PARAM_DEBUG = "dbg"; /* URL param values (see comments above) */ var TERM; @@ -42,6 +43,7 @@ var RTYPE; var SORT; var SORT_DIR; var RLIST; +var DEBUG; /* cookie values */ var SBEXTRAS; diff --git a/Open-ILS/web/opac/common/js/opac_utils.js b/Open-ILS/web/opac/common/js/opac_utils.js index a6ec981452..9315cedd88 100644 --- a/Open-ILS/web/opac/common/js/opac_utils.js +++ b/Open-ILS/web/opac/common/js/opac_utils.js @@ -8,11 +8,25 @@ var cookieManager = new HTTP.Cookies(); var __ilsEvent; /* the last event the occurred */ function Request(type) { + var s = type.split(":"); if(s[2] == "1" && isXUL()) s[1] += ".staff"; this.request = new RemoteRequest(s[0], s[1]); - for( var x = 1; x!= arguments.length; x++ ) + var p = []; + + for( var x = 1; x!= arguments.length; x++ ) { + p.push(arguments[x]); this.request.addParam(arguments[x]); + } + + if( getDebug() ) { + var str = ""; + for( var i = 0; i != p.length; i++ ) { + if( i > 0 ) str += ", " + str += js2JSON(p[i]); + } + _debug('request ' + s[0] + ' ' + s[1] + ' ' + str ); + } } Request.prototype.callback = function(cal) {this.request.setCompleteCallback(cal);} @@ -87,6 +101,7 @@ function initParams() { RTYPE = cgi.param(PARAM_RTYPE); SORT = cgi.param(PARAM_SORT); SORT_DIR = cgi.param(PARAM_SORT_DIR); + DEBUG = cgi.param(PARAM_DEBUG); /* set up some sane defaults */ if(isNaN(LOCATION)) LOCATION = 1; @@ -129,6 +144,7 @@ function getAdvType(){return ADVTYPE;} function getRtype(){return RTYPE;} function getSort(){return SORT;} function getSortDir(){return SORT_DIR;} +function getDebug(){return DEBUG;} function findBasePath() { diff --git a/Open-ILS/web/opac/skin/default/js/mresult.js b/Open-ILS/web/opac/skin/default/js/mresult.js index cac31b58b7..76cbdce928 100644 --- a/Open-ILS/web/opac/skin/default/js/mresult.js +++ b/Open-ILS/web/opac/skin/default/js/mresult.js @@ -182,6 +182,10 @@ function mresultHandleMods(r) { var pagePosition = r.userdata; runEvt('result', 'recordReceived', rec, pagePosition, true); resultCollectCopyCounts(rec, pagePosition, FETCH_MR_COPY_COUNTS); + if(resultPageIsDone()) + runEvt('result', 'allRecordsReceived', recordsCache); } + + diff --git a/Open-ILS/web/opac/skin/default/js/result_common.js b/Open-ILS/web/opac/skin/default/js/result_common.js index a2b63488c3..a6de30cf78 100644 --- a/Open-ILS/web/opac/skin/default/js/result_common.js +++ b/Open-ILS/web/opac/skin/default/js/result_common.js @@ -314,14 +314,11 @@ function resultDisplayRecord(rec, pos, is_mr) { runEvt("result", "recordDrawn", rec.doc_id(), title_link); + /* if(resultPageIsDone()) { - //showCanvas(); - /* hide the 'now loading...' message */ - /* - hideMe(G.ui.common.loading); - */ runEvt('result', 'allRecordsReceived', recordsCache); } + */ } function _resultFindRec(id) { diff --git a/Open-ILS/web/opac/skin/default/js/rresult.js b/Open-ILS/web/opac/skin/default/js/rresult.js index 8732803912..95b9c49810 100644 --- a/Open-ILS/web/opac/skin/default/js/rresult.js +++ b/Open-ILS/web/opac/skin/default/js/rresult.js @@ -80,6 +80,8 @@ function rresultHandleMods(r) { var rec = r.getResultObject(); runEvt('result', 'recordReceived', rec, r.userdata, false); resultCollectCopyCounts(rec, r.userdata, FETCH_R_COPY_COUNTS); + if(resultPageIsDone()) + runEvt('result', 'allRecordsReceived', recordsCache); } -- 2.43.2