[open-ils-commits] r8988 - branches/rel_1_2/Open-ILS/web/opac/skin/default/js

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Mar 12 11:51:15 EDT 2008


Author: erickson
Date: 2008-03-12 11:17:54 -0400 (Wed, 12 Mar 2008)
New Revision: 8988

Modified:
   branches/rel_1_2/Open-ILS/web/opac/skin/default/js/mresult.js
   branches/rel_1_2/Open-ILS/web/opac/skin/default/js/result_common.js
   branches/rel_1_2/Open-ILS/web/opac/skin/default/js/rresult.js
Log:
updated low-hit spellcheck and authority check to honor multi-class search calls

Modified: branches/rel_1_2/Open-ILS/web/opac/skin/default/js/mresult.js
===================================================================
--- branches/rel_1_2/Open-ILS/web/opac/skin/default/js/mresult.js	2008-03-12 15:05:09 UTC (rev 8987)
+++ branches/rel_1_2/Open-ILS/web/opac/skin/default/js/mresult.js	2008-03-12 15:17:54 UTC (rev 8988)
@@ -47,11 +47,12 @@
 
 function mresultHandleMRIds(r) {
 	var res = r.getResultObject();
+    resultCompiledSearch = res.compiled_search;
+    cookieManager.write(COOKIE_SEARCH, js2JSON(res.compiled_search), -1);
 	if(res.count != null) {
 		if( getOffset() == 0 ) HITCOUNT = res.count;
 		runEvt('result', 'hitCountReceived');
 	} 
-    cookieManager.write(COOKIE_SEARCH, js2JSON(res.compiled_search), -1);
 	runEvt('result', 'idsReceived', res.ids);
 }
 

Modified: branches/rel_1_2/Open-ILS/web/opac/skin/default/js/result_common.js
===================================================================
--- branches/rel_1_2/Open-ILS/web/opac/skin/default/js/result_common.js	2008-03-12 15:05:09 UTC (rev 8987)
+++ branches/rel_1_2/Open-ILS/web/opac/skin/default/js/result_common.js	2008-03-12 15:17:54 UTC (rev 8988)
@@ -4,6 +4,7 @@
 var lowHitCount = 4;
 
 var resultFetchAllRecords = false;
+var resultCompiledSearch = null;
 
 /* set up the event handlers */
 if( findCurrentPage() == MRESULT || findCurrentPage() == RRESULT ) {
@@ -171,16 +172,18 @@
 	if(getHitCount() > 0)
 		unHideMe($('result_low_hits_msg'));
 
-	var sreq = new Request(CHECK_SPELL, getTerm());
+    alert(js2JSON(resultCompiledSearch));
+
+    var words = [];
+    for(var key in resultCompiledSearch.searches) 
+        words.push(resultCompiledSearch.searches[key].term);
+
+	var sreq = new Request(CHECK_SPELL, words.join(' '));
 	sreq.callback(resultSuggestSpelling);
 	sreq.send();
 
-    /* XXX patch to use the search results */
-
-	var words = getTerm().split(' ');
-	var word;
-	while( word = words.shift() ) {
-		var areq = new Request(FETCH_CROSSREF, getStype(), getTerm() );
+    for(var key in resultCompiledSearch.searches) {
+		var areq = new Request(FETCH_CROSSREF, key, resultCompiledSearch.searches[key].term);
 		areq.callback(resultLowHitXRef);
 		areq.send();
 	}

Modified: branches/rel_1_2/Open-ILS/web/opac/skin/default/js/rresult.js
===================================================================
--- branches/rel_1_2/Open-ILS/web/opac/skin/default/js/rresult.js	2008-03-12 15:05:09 UTC (rev 8987)
+++ branches/rel_1_2/Open-ILS/web/opac/skin/default/js/rresult.js	2008-03-12 15:17:54 UTC (rev 8988)
@@ -223,7 +223,7 @@
 }
 
 function _rresultHandleIds(ids, count) {
-	var json = js2JSON({ids:ids,count:count});
+	//var json = js2JSON({ids:ids,count:count});
 	/*
 	cookieManager.write(COOKIE_SRIDS, json, '+1d');
 	*/
@@ -300,6 +300,7 @@
 			ids.push(result.ids[i][0]);
 	}
 
+    resultCompiledSearch = result.compiled_search;
     cookieManager.write(COOKIE_SEARCH, js2JSON(result.compiled_search), -1);
 	_rresultHandleIds( ids, result.count );
 }



More information about the open-ils-commits mailing list