if (typeof KOHA == "undefined" || !KOHA) { var KOHA = {}; } /** * A namespace for local cover related functions. */ KOHA.LocalCover = { /** * Search all: *
* or * * and run a search with all collected isbns to Open Library Book Search. * The result is asynchronously returned by OpenLibrary and catched by * olCallBack(). */ GetCoverFromBibnumber: function(uselink) { $("div [id^=local-thumbnail]").each(function(i) { var mydiv = this; var message = document.createElement("span"); $(message).attr("class","no-image"); $(message).html(NO_LOCAL_JACKET); $(mydiv).append(message); var img = $("").attr('src', '/cgi-bin/koha/catalogue/image.pl?thumbnail=1&biblionumber=' + $(mydiv).attr("class")) .load(function () { if (!this.complete || typeof this.naturalWidth == "undefined" || this.naturalWidth == 0) { } else { if (uselink) { var a = $("").attr('href', '/cgi-bin/koha/catalogue/imageviewer.pl?biblionumber=' + $(mydiv).attr("class")); $(a).append(img); $(mydiv).append(a); } else { $(mydiv).append(img); } $(mydiv).children('.no-image').remove(); } }) }); } };