Bug 35557: Remove LoadResultsCovers

The JS function LoadResultsCovers is not used from the Staff interface.

It is supposed to load the local cover images in JS but actually we are embedding the thumbnail in the img tag.

Test plan:
Confirm that LoadResultsCovers was called but had no effect.
Note that the selector ^local-thumbnail only exists in shelfbrowser.inc

but results.js is only used from results.tt (not shelfbrowser.inc)

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4e66aa8065)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Jonathan Druart 2023-12-13 10:32:12 +01:00 committed by Fridolin Somers
parent 39b75d3da0
commit 43fb9f9c7a
2 changed files with 0 additions and 42 deletions

View file

@ -38,42 +38,4 @@ KOHA.LocalCover = {
mydiv.append(img);
}
},
LoadResultsCovers: function(){
$("div [id^=local-thumbnail]").each(function(i) {
var mydiv = this;
var message = document.createElement("span");
$(message).attr("class","no-image thumbnail");
$(message).html( __("No cover image available") );
$(mydiv).append(message);
var img = $("<img />");
img.attr('src','/cgi-bin/koha/catalogue/image.pl?thumbnail=1&biblionumber=' + $(mydiv).attr("class"))
.addClass("thumbnail")
.load(function () {
if (!this.complete || typeof this.naturalWidth == "undefined" || this.naturalWidth <= 1) {
//IE HACK
try {
var otherCovers = $(mydiv).closest('td').find('img');
var nbCovers = otherCovers.length;
if(nbCovers > 0){
var badCovers = 0;
otherCovers.each(function(){
if(this.naturalWidth <= 1){
$(this).parent().remove();
badCovers++;
}
});
if(badCovers < nbCovers){
$(mydiv).parent().remove();
}
}
}
catch(err){
}
} else {
$(mydiv).append(img);
$(mydiv).children('.no-image').remove();
}
});
});
}
};

View file

@ -231,10 +231,6 @@ $(document).ready(function() {
}
}
if( PREF_LocalCoverImages ){
KOHA.LocalCover.LoadResultsCovers();
}
if( PREF_IntranetCoce && PREF_CoceProviders ){
KOHA.coce.getURL( CoceHost, CoceProviders );
}