var recordsHandled = 0;
var recordsCache = [];
var lowHitCount = 4;
+var isbnList = '';
+var googleBooks = false;
var resultFetchAllRecords = false;
var resultCompiledSearch = null;
);
}
+function unhideGoogleBooks (data) {
+ for ( var i in data ) {
+ if (data[i].preview == 'noview') continue;
+
+ var gbspan = $n('googleBooks-' + i);
+ var gba = $n("googleBooks-link",gbspan)
+
+ gba..setAttribute(
+ 'href',
+ data[i].info_url
+ );
+ removeCSSClass( gbspan, 'hide_me' );
+ }
+}
+
/* display the record info in the record display table 'pos' is the
zero based position the record should have in the display table */
function resultDisplayRecord(rec, pos, is_mr) {
recordsCache.push(rec);
var r = table.rows[pos + 1];
+ var currentISBN = cleanISBN(rec.isbn());
+
+ if (googleBooks) {
+ var gbspan = $n(r, "googleBooks");
+ if (currentISBN) {
+ gbspan.setAttribute(
+ 'name',
+ gbspan.getAttribute('name') + '-' + currentISBN
+ );
+
+ if (isbnList) isbnList += ', ';
+ isbnList += currentISBN;
+ }
+ }
-
try {
var rank = parseFloat(ranks[pos + getOffset()]);
rank = parseInt( rank * 100 );
} catch(e){ }
var pic = $n(r, config.names.result.item_jacket);
- pic.setAttribute("src", buildISBNSrc(cleanISBN(rec.isbn())));
+ pic.setAttribute("src", buildISBNSrc(currentISBN));
var title_link = $n(r, config.names.result.item_title);
var author_link = $n(r, config.names.result.item_author);
function resultPageIsDone(pos) {
+
+ if (isbnList && googleBooks) {
+ var scriptElement = document.createElement("script");
+ scriptElement.setAttribute("id", "jsonScript");
+ scriptElement.setAttribute("src",
+ "http://books.google.com/books?bibkeys=" +
+ escape(isbnList) + "&jscmd=viewapi&callback=unhideGoogleBooks");
+ scriptElement.setAttribute("type", "text/javascript");
+ // make the request to Google Book Search
+ document.documentElement.firstChild.appendChild(scriptElement);
+ }
+
return (recordsHandled == getDisplayCount()
|| recordsHandled + getOffset() == getHitCount());
}
</span>
<span class='hide_me' name='place_hold_span'>
- <a style='padding-left: 8px; padding-right: 10px;' href='javascript:void(0);'
+ <a style='padding-left: 8px;' href='javascript:void(0);'
class='classic_link' name='place_hold_link'>&opac.holds.placeHold;</a>
</span>
<!-- Empty span used for creating unAPI links -->
- <abbr name="unapi" class="unapi-id">
+ <abbr style='padding-left: 8px;' name="unapi" class="unapi-id">
<!-- unAPI URI goes here -->
</abbr>
+ <!-- Empty span used for creating unAPI links -->
+ <span name="googleBooks" class="hide_me">
+ <a style='padding-left: 8px;' class='classic_link' name="googleBooks-link">&result.googleBooks.browse;</a>
+ </span>
+
+
</td>
</tr>