Bug 28180: Fix collision with existing verify_images
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 11 Aug 2021 11:58:54 +0000 (13:58 +0200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 21 Oct 2021 10:24:04 +0000 (12:24 +0200)
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 <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt
koha-tmpl/intranet-tmpl/prog/js/pages/results.js
koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt

index 7aec8b8..8726c3b 100644 (file)
@@ -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();
         });
     </script>
     [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && ( normalized_isbn || normalized_upc ) ) %]
index c1bd815..070a8c4 100644 (file)
@@ -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;
index 86b835a..e4aaccf 100644 (file)
@@ -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;
index 487864c..d23a042 100644 (file)
             }
         [% 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 = [];
         } /* /verify_images */
 
         $(window).load(function() {
-            verify_images();
+            verify_cover_images();
         });
 
         $(document).ready(function() {