From 693af4982d00293fbde6f046b0d6066c9932c74a Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 11 Aug 2021 13:58:54 +0200 Subject: [PATCH] Bug 28180: Fix collision with existing verify_images At the OPAC we already had a verify_images JS function in amazonimages.js It's preferable to use another function name. This patch replace our verify_images with verify_cover_images and apply the change to the staff code as well. Signed-off-by: Katrin Fischer --- koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt | 4 ++-- koha-tmpl/intranet-tmpl/prog/js/pages/results.js | 4 ++-- koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc | 5 +++++ koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt | 4 ++-- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index 7aec8b8881..8726c3b531 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -1018,7 +1018,7 @@ Note that permanent location is a code, and location may be an authval. var interface = "[% interface | html %]"; var theme = "[% theme | html %]"; // http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html - function verify_images() { + function verify_cover_images() { // Loop over each container in the template which contains covers $(".cover-slider").each(function(){ var lightbox_descriptions = []; @@ -1293,7 +1293,7 @@ Note that permanent location is a code, and location may be an authval. }); $(window).load(function() { - verify_images(); + verify_cover_images(); }); [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && ( normalized_isbn || normalized_upc ) ) %] diff --git a/koha-tmpl/intranet-tmpl/prog/js/pages/results.js b/koha-tmpl/intranet-tmpl/prog/js/pages/results.js index c1bd815cea..070a8c473d 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/pages/results.js +++ b/koha-tmpl/intranet-tmpl/prog/js/pages/results.js @@ -1,6 +1,6 @@ /* global KOHA biblionumber new_results_browser addMultiple vShelfAdd openWindow search_result SEARCH_RESULTS PREF_LocalCoverImages PREF_IntranetCoce PREF_CoceProviders CoceHost CoceProviders addRecord delSingleRecord PREF_BrowseResultSelection resetSearchContext addBibToContext delBibToContext getContextBiblioNumbers holdfor_cardnumber holdforclub strQuery PREF_NotHighlightedWords __ */ -function verify_images() { +function verify_cover_images() { /* Loop over each container in the template which contains covers */ var coverSlides = $(".cover-slides"); /* One coverSlides for each search result */ coverSlides.each( function( index ){ @@ -101,7 +101,7 @@ function verify_images() { } $(window).load(function() { - verify_images(); + verify_cover_images(); }); var Sticky; diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc index 86b835a52d..e4aaccf54a 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc @@ -205,6 +205,11 @@ $.widget.bridge('uitooltip', $.ui.tooltip); var query_cgi = "[% query_cgi | html %]"; [% END %] + [% IF ( OPACAmazonCoverImages || SyndeticsCoverImages ) %] + $(window).load(function() { + verify_images(); + }); + [% END %] $(".print-large").on("click",function(){ window.print(); return false; diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt index 487864c5b7..d23a0420c0 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -1388,7 +1388,7 @@ } [% END # /IF OpacHighlightedWords %] - function verify_images() { + function verify_cover_images() { // Loop over each container in the template which contains covers $(".cover-slider").each(function( index ){ var lightbox_descriptions = []; @@ -1516,7 +1516,7 @@ } /* /verify_images */ $(window).load(function() { - verify_images(); + verify_cover_images(); }); $(document).ready(function() { -- 2.11.0