From 413afed3d449bf61e753d8ff7464089be9da5a03 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. --- 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 4f7589697a7..619733cc54a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -1033,7 +1033,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 = []; @@ -1310,7 +1310,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 785817c0976..d5416387b48 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 f6c8daeca48..c103f0ec4cf 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc @@ -214,6 +214,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 43747817fda..03f41fe8317 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -1554,7 +1554,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 = []; @@ -1682,7 +1682,7 @@ } /* /verify_images */ $(window).load(function() { - verify_images(); + verify_cover_images(); }); $(document).ready(function() { -- 2.25.1