if (typeof KOHA == "undefined" || !KOHA) { var KOHA = {}; } /** * A namespace for Google related functions. */ KOHA.Google = { /** * Search all: *
* or * * and run a search with all collected isbns to Google Book Search. * The result is asynchronously returned by Google and catched by * gbsCallBack(). */ GetCoverFromIsbn: function(newWindow) { var bibkeys = []; $("[id^=gbs-thumbnail]").each(function(i) { bibkeys.push($(this).attr("class")); // id=isbn }); bibkeys = bibkeys.join(','); var scriptElement = document.createElement("script"); this.openInNewWindow=newWindow; scriptElement.setAttribute("id", "jsonScript"); scriptElement.setAttribute("src", "https://books.google.com/books?bibkeys=" + escape(bibkeys) + "&jscmd=viewapi&callback=KOHA.Google.gbsCallBack"); scriptElement.setAttribute("type", "text/javascript"); document.documentElement.firstChild.appendChild(scriptElement); }, /** * Add cover pages ' ); } } else { var message = document.createElement("span"); $(message).attr("class","no-image"); $(message).html(NO_GOOGLE_JACKET); $(this).empty().append(message); } }); } } };