[open-ils-commits] r828 - conifer/branches/rel_1_6_0/web/opac/skin/default/js (dbs)
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Mar 11 16:10:49 EST 2010
Author: dbs
Date: 2010-03-11 16:10:43 -0500 (Thu, 11 Mar 2010)
New Revision: 828
Modified:
conifer/branches/rel_1_6_0/web/opac/skin/default/js/result_common.js
Log:
First step towards linked searches to outside resources
Modified: conifer/branches/rel_1_6_0/web/opac/skin/default/js/result_common.js
===================================================================
--- conifer/branches/rel_1_6_0/web/opac/skin/default/js/result_common.js 2010-03-10 21:11:24 UTC (rev 827)
+++ conifer/branches/rel_1_6_0/web/opac/skin/default/js/result_common.js 2010-03-11 21:10:43 UTC (rev 828)
@@ -5,6 +5,8 @@
var isbnList = '';
var googleBooksLink = true;
var enableHoldsOnAvailable = false;
+var enableEbooksLowHits = false;
+var localProxyPrefix = '';
var resultFetchAllRecords = false;
var resultCompiledSearch = null;
@@ -211,6 +213,10 @@
resultSuggestSearchClass();
+ if (enableEbooksLowHits) {
+ resultSuggestEbooks();
+ }
+
if(getTerm()) resultExpandSearch(); /* advanced search */
}
@@ -250,6 +256,10 @@
showCanvas();
unHideMe($('result_low_hits'));
unHideMe($('result_zero_hits_msg'));
+
+ if (enableEbooksLowHits) {
+ resultSuggestEbooks();
+ }
//if(getTerm()) resultExpandSearch(); /* advanced search */
}
@@ -272,6 +282,19 @@
}
}
+/* For now we only generate a link to ScholarsPortal ebook platform */
+function resultSuggestEbooks() {
+ var ebook_search = localProxyPrefix + 'http://books.scholarsportal.info/search.html?searchField=All+Fields&limit=full_text&sortBy=relevance&collection=all&searchTerm=';
+ var ebook_terms = '';
+ for (var key in resultCompiledSearch.searches) {
+ ebook_search += resultCompiledSearch.searches[key].term.replace(' ', '+') + '+';
+ ebook_terms += resultCompiledSearch.searches[key].term + ' ';
+ }
+ ebook_search.replace('+$', '');
+ ebook_terms.replace(' $', '');
+ dojo.place("<div style='text-align: center; width: 100%; margin-left: auto; margin-right: auto;'><strong>Search ScholarsPortal ebooks</strong>: <a class='classic_link' href='" + ebook_search + "'>" + ebook_terms + "</a><div>", "result_low_hits", "child");
+}
+
function resultSuggestSearchClass() {
var stype = getStype();
if(stype == STYPE_KEYWORD) return;
@@ -767,4 +790,3 @@
}
}
-
More information about the open-ils-commits
mailing list