1 if (typeof KOHA == "undefined" || !KOHA) {
6 * A namespace for local cover related functions.
13 * <div title="biblionumber" id="isbn" class="openlibrary-thumbnail"></div>
15 * <div title="biblionumber" id="isbn" class="openlibrary-thumbnail-preview"></div>
16 * and run a search with all collected isbns to Open Library Book Search.
17 * The result is asynchronously returned by OpenLibrary and catched by
20 GetCoverFromBibnumber: function(uselink) {
21 $("div [id^=local-thumbnail]").each(function(i) {
23 var message = document.createElement("span");
24 $(message).attr("class","no-image");
25 $(message).html(NO_LOCAL_JACKET);
26 $(mydiv).parent().find('.no-image').remove();
27 $(mydiv).append(message);
28 var img = $("<img />").attr('src',
29 '/cgi-bin/koha/catalogue/image.pl?thumbnail=1&biblionumber=' + $(mydiv).attr("class"))
31 if (!this.complete || typeof this.naturalWidth == "undefined" || this.naturalWidth <= 1) {
40 var a = $("<a />").attr('href', '/cgi-bin/koha/catalogue/imageviewer.pl?biblionumber=' + $(mydiv).attr("class"));
46 $(mydiv).children('.no-image').remove();
51 LoadResultsCovers: function(){
52 $("div [id^=local-thumbnail]").each(function(i) {
54 var message = document.createElement("span");
55 $(message).attr("class","no-image thumbnail");
56 $(message).html(NO_LOCAL_JACKET);
57 $(mydiv).append(message);
58 var img = $("<img />");
59 img.attr('src','/cgi-bin/koha/catalogue/image.pl?thumbnail=1&biblionumber=' + $(mydiv).attr("class"))
60 .addClass("thumbnail")
62 if (!this.complete || typeof this.naturalWidth == "undefined" || this.naturalWidth <= 1) {
65 var otherCovers = $(mydiv).closest('td').find('img');
66 var nbCovers = otherCovers.length;
69 otherCovers.each(function(){
70 if(this.naturalWidth <= 1){
71 $(this).parent().remove();
75 if(badCovers < nbCovers){
76 $(mydiv).parent().remove();
84 $(mydiv).children('.no-image').remove();