Bugzilla – Attachment 123794 Details for
Bug 28180
Use a lightbox gallery to display the images on the detail pages in OPAC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28180: Correctly guess if images have been loaded
Bug-28180-Correctly-guess-if-images-have-been-load.patch (text/plain), 3.62 KB, created by
Jonathan Druart
on 2021-08-11 14:37:41 UTC
(
hide
)
Description:
Bug 28180: Correctly guess if images have been loaded
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-08-11 14:37:41 UTC
Size:
3.62 KB
patch
obsolete
>From dee7f7fe9daaec572b47bcf29ca2fba7a81195ef Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 11 Aug 2021 16:35:42 +0200 >Subject: [PATCH] Bug 28180: Correctly guess if images have been loaded > >window.load won't assure us that the images loaded using JS code are >correctly loaded. > >This patch adds a flag to the different providers when the images are >fully loaded. >--- > .../bootstrap/en/modules/opac-detail.tt | 34 +++++++++++++++++++ > koha-tmpl/opac-tmpl/bootstrap/js/coce.js | 1 + > .../opac-tmpl/bootstrap/js/google-jackets.js | 2 +- > .../opac-tmpl/bootstrap/js/localcovers.js | 1 + > .../opac-tmpl/bootstrap/js/openlibrary.js | 1 + > 5 files changed, 38 insertions(+), 1 deletion(-) > >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 03f41fe8317..4e94969fa27 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >@@ -1681,7 +1681,41 @@ > }); > } /* /verify_images */ > >+ function wait_for_images(){ >+ >+ var loaded = 1; >+ >+ [% IF GoogleJackets %] >+ if ( loaded ) { >+ loaded = KOHA.Google.done; >+ } >+ [% END %] >+ >+ [% IF OpenLibraryCovers %] >+ if ( loaded ) { >+ loaded = KOHA.OpenLibrary.done; >+ } >+ [% END %] >+ >+ [% IF ( Koha.Preference('OpacCoce') && Koha.Preference('CoceProviders') ) %] >+ if ( loaded ) { >+ loaded = KOHA.coce.done; >+ } >+ [% END %] >+ >+ [% IF OPACLocalCoverImages %] >+ if ( loaded ) { >+ loaded = KOHA.LocalCover.done; >+ } >+ [% END %] >+ >+ if (!loaded) { >+ window.setTimeout(wait_for_images, 100); >+ } >+ } >+ > $(window).load(function() { >+ wait_for_images(); > verify_cover_images(); > }); > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/coce.js b/koha-tmpl/opac-tmpl/bootstrap/js/coce.js >index a56ca61fefc..607cb89921b 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/js/coce.js >+++ b/koha-tmpl/opac-tmpl/bootstrap/js/coce.js >@@ -46,6 +46,7 @@ KOHA.coce = { > }, > > }); >+ this.done = 1; > } > > }; >diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/google-jackets.js b/koha-tmpl/opac-tmpl/bootstrap/js/google-jackets.js >index ad1fd638a41..1cca395a95e 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/js/google-jackets.js >+++ b/koha-tmpl/opac-tmpl/bootstrap/js/google-jackets.js >@@ -79,6 +79,6 @@ KOHA.Google = { > } > }); > } >- >+ this.done = 1; > } > }; >diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/localcovers.js b/koha-tmpl/opac-tmpl/bootstrap/js/localcovers.js >index 21ffaf872fe..c558c7139e0 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/js/localcovers.js >+++ b/koha-tmpl/opac-tmpl/bootstrap/js/localcovers.js >@@ -78,5 +78,6 @@ KOHA.LocalCover = { > } > }) > }); >+ this.done = 1; > }, > }; >diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/openlibrary.js b/koha-tmpl/opac-tmpl/bootstrap/js/openlibrary.js >index 8537165e726..41dcfb9fab3 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/js/openlibrary.js >+++ b/koha-tmpl/opac-tmpl/bootstrap/js/openlibrary.js >@@ -65,6 +65,7 @@ KOHA.OpenLibrary = new function() { > } > }); > } >+ this.done = 1; > } > > var search_url = 'https://openlibrary.org/search?'; >-- >2.25.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 28180
:
119918
|
119919
|
119920
|
119921
|
119922
|
119923
|
119924
|
120444
|
120445
|
120446
|
120447
|
120448
|
120449
|
120450
|
120464
|
120465
|
120466
|
120467
|
120468
|
120469
|
120470
|
120753
|
120754
|
120805
|
122783
|
122784
|
123178
|
123790
|
123792
|
123793
|
123794
|
124819
|
125666
|
126041
|
126042
|
126506
|
126507
|
126508
|
126509
|
126510
|
126511
|
126512
|
126513
|
126514
|
126515
|
126516
|
126517
|
126518
|
126519
|
126520
|
126596
|
126597
|
126598
|
126599
|
126600
|
126601
|
126602
|
126603
|
126604
|
126605
|
126606
|
126607
|
126608
|
126609
|
126610