Created attachment 119918 [details] [review] Bug 28180: Add Chocolat to OPAC See Bug 28179: Add the Chocolat gallery lightbox JS library Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch)
Created attachment 119919 [details] [review] Bug 28180: Add a lightbox gallery to display cover images - detail page, OPAC interface This patch is the OPAC version of Bug 28179: Add a lightbox gallery to display cover images - detail page, staff interface But there were several difficulties as the staff and OPAC code diverged a lot. First we are going to apply the different enhancements that have been made staff-side: - Display all the local cover image on the bibliographic detail pages (before this patch only the first one was displayed) - The slider functionality added by bug 25031 Test plan: All the cover images are affected, all the different sources will be tested. All the steps will be done on the same bibliographic record. 1. Local cover images a. Turn on OPACLocalCoverImages and AllowMultipleCover b. Add several local cover images to a bibliographic record c. Add several local cover images to an item d. Click on an image and confirm that it is displayed in a gallery and you can navigate see all the images attached to the bibliographic record e. Same for items 2. Adlibris a. Turn on AdlibrisCoversEnabled b. Edit the biliographic record and add an ISBN that will return a cover image for this service (9780670026623 for instance) c. Display the cover images in the gallery d. Note the link to the adlibris.com website at the bottom 3. Amazon a. Turn on OPACAmazonCoverImages b. Display the cover images in the gallery 4. Coce a. Turn on OpacCoce, set CoceHost to "http://coce.tamil.fr:8080" and select some values for CoceProviders. b. Display the cover images in the gallery 5. Custom cover images a. Turn on OPACCustomCoverImages and set CustomCoverImagesURL to https://covers.openlibrary.org/b/isbn/{isbn}-M.jpg of anything else meaningful b. Display the cover images in the gallery QA Note: Other sources have been removed by this patch but will be re-added by follow-ups Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch)
Created attachment 119920 [details] [review] Bug 28180: Reintroduce and adjust Syndetics Test plan: 1. Enable SyndeticsEnabled and SyndeticsCoverImages 2. Display the cover images in the gallery Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch)
Created attachment 119921 [details] [review] Bug 28180: Reintroduce and adjust Google Jackets Test plan: 1. Turn on GoogleJackets 2. Display the cover images in the gallery Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch)
Created attachment 119922 [details] [review] Bug 28180: Reintroduce and adjust OpenLibrary 1. Turn on OpenLibraryCovers 2. Display the cover images in the gallery Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch)
Created attachment 119923 [details] [review] Bug 28180: Reintroduce and adjust Baker and Taylor Test plan: 1. Turn on BakerTaylorEnabled and fill BakerTaylorUsername/BakerTaylorPassword (if you don't have, ask me) 2. Display the cover images in the gallery Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch)
Created attachment 119924 [details] [review] Bug 28180: Bug fix - cannot select cover-nav button when on top of the .contentblock Found a bug and ended up with this solution, suggestions welcomed! example with OpenLibrary with isbn=9780670026623, the image is a bit higher than others and then the cover-nav buttons are on top of .contentblock and cannot be clicked Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch)
Created attachment 120444 [details] [review] Bug 28180: Add Chocolat to OPAC See Bug 28179: Add the Chocolat gallery lightbox JS library Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch) Signed-off-by: joubu <jonathan.druart@bugs.koha-community.org>
Created attachment 120445 [details] [review] Bug 28180: Add a lightbox gallery to display cover images - detail page, OPAC interface This patch is the OPAC version of Bug 28179: Add a lightbox gallery to display cover images - detail page, staff interface But there were several difficulties as the staff and OPAC code diverged a lot. First we are going to apply the different enhancements that have been made staff-side: - Display all the local cover image on the bibliographic detail pages (before this patch only the first one was displayed) - The slider functionality added by bug 25031 Test plan: All the cover images are affected, all the different sources will be tested. All the steps will be done on the same bibliographic record. 1. Local cover images a. Turn on OPACLocalCoverImages and AllowMultipleCover b. Add several local cover images to a bibliographic record c. Add several local cover images to an item d. Click on an image and confirm that it is displayed in a gallery and you can navigate see all the images attached to the bibliographic record e. Same for items 2. Adlibris a. Turn on AdlibrisCoversEnabled b. Edit the biliographic record and add an ISBN that will return a cover image for this service (9780670026623 for instance) c. Display the cover images in the gallery d. Note the link to the adlibris.com website at the bottom 3. Amazon a. Turn on OPACAmazonCoverImages b. Display the cover images in the gallery 4. Coce a. Turn on OpacCoce, set CoceHost to "http://coce.tamil.fr:8080" and select some values for CoceProviders. b. Display the cover images in the gallery 5. Custom cover images a. Turn on OPACCustomCoverImages and set CustomCoverImagesURL to https://covers.openlibrary.org/b/isbn/{isbn}-M.jpg of anything else meaningful b. Display the cover images in the gallery QA Note: Other sources have been removed by this patch but will be re-added by follow-ups Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch) Signed-off-by: joubu <jonathan.druart@bugs.koha-community.org>
Created attachment 120446 [details] [review] Bug 28180: Reintroduce and adjust Syndetics Test plan: 1. Enable SyndeticsEnabled and SyndeticsCoverImages 2. Display the cover images in the gallery Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch) Signed-off-by: joubu <jonathan.druart@bugs.koha-community.org>
Created attachment 120447 [details] [review] Bug 28180: Reintroduce and adjust Google Jackets Test plan: 1. Turn on GoogleJackets 2. Display the cover images in the gallery Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch) Signed-off-by: joubu <jonathan.druart@bugs.koha-community.org>
Created attachment 120448 [details] [review] Bug 28180: Reintroduce and adjust OpenLibrary 1. Turn on OpenLibraryCovers 2. Display the cover images in the gallery Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch) Signed-off-by: joubu <jonathan.druart@bugs.koha-community.org>
Created attachment 120449 [details] [review] Bug 28180: Reintroduce and adjust Baker and Taylor Test plan: 1. Turn on BakerTaylorEnabled and fill BakerTaylorUsername/BakerTaylorPassword (if you don't have, ask me) 2. Display the cover images in the gallery Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch) Signed-off-by: joubu <jonathan.druart@bugs.koha-community.org>
Created attachment 120450 [details] [review] Bug 28180: Bug fix - cannot select cover-nav button when on top of the .contentblock Found a bug and ended up with this solution, suggestions welcomed! example with OpenLibrary with isbn=9780670026623, the image is a bit higher than others and then the cover-nav buttons are on top of .contentblock and cannot be clicked Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch) Signed-off-by: joubu <jonathan.druart@bugs.koha-community.org>
Created attachment 120464 [details] [review] Bug 28180: Add Chocolat to OPAC See Bug 28179: Add the Chocolat gallery lightbox JS library Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch) Signed-off-by: Rasmus Leißner <rasmus.leissner@solutions-factory.de>
Created attachment 120465 [details] [review] Bug 28180: Add a lightbox gallery to display cover images - detail page, OPAC interface This patch is the OPAC version of Bug 28179: Add a lightbox gallery to display cover images - detail page, staff interface But there were several difficulties as the staff and OPAC code diverged a lot. First we are going to apply the different enhancements that have been made staff-side: - Display all the local cover image on the bibliographic detail pages (before this patch only the first one was displayed) - The slider functionality added by bug 25031 Test plan: All the cover images are affected, all the different sources will be tested. All the steps will be done on the same bibliographic record. 1. Local cover images a. Turn on OPACLocalCoverImages and AllowMultipleCover b. Add several local cover images to a bibliographic record c. Add several local cover images to an item d. Click on an image and confirm that it is displayed in a gallery and you can navigate see all the images attached to the bibliographic record e. Same for items 2. Adlibris a. Turn on AdlibrisCoversEnabled b. Edit the biliographic record and add an ISBN that will return a cover image for this service (9780670026623 for instance) c. Display the cover images in the gallery d. Note the link to the adlibris.com website at the bottom 3. Amazon a. Turn on OPACAmazonCoverImages b. Display the cover images in the gallery 4. Coce a. Turn on OpacCoce, set CoceHost to "http://coce.tamil.fr:8080" and select some values for CoceProviders. b. Display the cover images in the gallery 5. Custom cover images a. Turn on OPACCustomCoverImages and set CustomCoverImagesURL to https://covers.openlibrary.org/b/isbn/{isbn}-M.jpg of anything else meaningful b. Display the cover images in the gallery QA Note: Other sources have been removed by this patch but will be re-added by follow-ups Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch) Signed-off-by: Rasmus Leißner <rasmus.leissner@solutions-factory.de>
Created attachment 120466 [details] [review] Bug 28180: Reintroduce and adjust Syndetics Test plan: 1. Enable SyndeticsEnabled and SyndeticsCoverImages 2. Display the cover images in the gallery Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch) Signed-off-by: Rasmus Leißner <rasmus.leissner@solutions-factory.de>
Created attachment 120467 [details] [review] Bug 28180: Reintroduce and adjust Google Jackets Test plan: 1. Turn on GoogleJackets 2. Display the cover images in the gallery Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch) Signed-off-by: Rasmus Leißner <rasmus.leissner@solutions-factory.de>
Created attachment 120468 [details] [review] Bug 28180: Reintroduce and adjust OpenLibrary 1. Turn on OpenLibraryCovers 2. Display the cover images in the gallery Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch) Signed-off-by: Rasmus Leißner <rasmus.leissner@solutions-factory.de>
Created attachment 120469 [details] [review] Bug 28180: Reintroduce and adjust Baker and Taylor Test plan: 1. Turn on BakerTaylorEnabled and fill BakerTaylorUsername/BakerTaylorPassword (if you don't have, ask me) 2. Display the cover images in the gallery Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch) Signed-off-by: Rasmus Leißner <rasmus.leissner@solutions-factory.de>
Created attachment 120470 [details] [review] Bug 28180: Bug fix - cannot select cover-nav button when on top of the .contentblock Found a bug and ended up with this solution, suggestions welcomed! example with OpenLibrary with isbn=9780670026623, the image is a bit higher than others and then the cover-nav buttons are on top of .contentblock and cannot be clicked Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch) Signed-off-by: Rasmus Leißner <rasmus.leissner@solutions-factory.de>
Signed-off-by patches attached on behalf of the sponsor. The sandbox's signoff process picked the name of the creator of the sandbox instead of the one filled in on the signoff form. Also, the status has not been adjusted.
I am seeing a failure in the QA script, can you please check: FAIL koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt OK filters FAIL forbidden patterns forbidden pattern: console.log (line 1754) Also and more importantly, with this patch covers on result list are broken: Uncaught ReferenceError: NO_LOCAL_JACKET is not defined GetCoverFromBibnumber http://localhost:8080/opac-tmpl/bootstrap/js/localcovers_20.1200047.js:25 jQuery 2 GetCoverFromBibnumber http://localhost:8080/opac-tmpl/bootstrap/js/localcovers_20.1200047.js:21 <anonymous> http://localhost:8080/cgi-bin/koha/opac-search.pl?idx=&q=perl&weight_search=1:3137 jQuery 2
Created attachment 120753 [details] [review] Bug 28180: (follow-up) Remove console.log
Created attachment 120754 [details] [review] Bug 28180: Restore NO_LOCAL_JACKET This is a patch to squash. No idea what it got removed previously
(In reply to Katrin Fischer from comment #23) Both fixed!
Created attachment 120805 [details] [review] Bug 28180: (follow-up) Updates to styling of lightbox controls This patch adds style changes like the ones made in Bug 28179. It also addresses a bug with the way the verify_images() function was firing. I've moved the function outside of document.ready() and added a call to it on window load, consistent with how it works in the staff client. I've removed a redundant call to verify_images() from the footer include file, opac-bottom.inc. The cosmetic changes replace the Chocolat image icons with new SVG assets based on Bootstrap Icons (https://icons.getbootstrap.com/). The color changes I think help the controls to be more visible.
Created attachment 122783 [details] [review] Bug 28180: (follow-up) Updates to styling of lightbox controls This patch adds style changes like the ones made in Bug 28179. It also addresses a bug with the way the verify_images() function was firing. I've moved the function outside of document.ready() and added a call to it on window load, consistent with how it works in the staff client. I've removed a redundant call to verify_images() from the footer include file, opac-bottom.inc. The cosmetic changes replace the Chocolat image icons with new SVG assets based on Bootstrap Icons (https://icons.getbootstrap.com/). The color changes I think help the controls to be more visible. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 122784 [details] [review] Bug 28180: CSS changes
Your follow-up is working great, Owen. Thanks!
Can you please fix the conflicts? Using index info to reconstruct a base tree... M koha-tmpl/opac-tmpl/bootstrap/css/opac-rtl.css M koha-tmpl/opac-tmpl/bootstrap/css/opac.css Falling back to patching base and 3-way merge... Auto-merging koha-tmpl/opac-tmpl/bootstrap/css/opac.css CONFLICT (content): Merge conflict in koha-tmpl/opac-tmpl/bootstrap/css/opac.css Auto-merging koha-tmpl/opac-tmpl/bootstrap/css/opac-rtl.css CONFLICT (content): Merge conflict in koha-tmpl/opac-tmpl/bootstrap/css/opac-rtl.css error: Failed to merge in the changes. Patch failed at 0001 Bug 28180: CSS changes The copy of the patch that failed is found in: .git/rebase-apply/patch When you have resolved this problem run "git bz apply --continue". If you would prefer to skip this patch, instead run "git bz apply --skip". To restore the original branch and stop patching run "git bz apply --abort".
(In reply to Katrin Fischer from comment #31) > Can you please fix the conflicts? > CONFLICT (content): Merge conflict in > koha-tmpl/opac-tmpl/bootstrap/css/opac.css > CONFLICT (content): Merge conflict in > koha-tmpl/opac-tmpl/bootstrap/css/opac-rtl.css Those are conflicts on the "Compiled CSS patch". The patch can be skipped and the patch regenerated with "yarn build && yarn build --view=opac"
Created attachment 123178 [details] [review] Bug 28180: CSS changes
You are right, I was a little too fast. But why include them in the first place?
(In reply to Katrin Fischer from comment #34) > You are right, I was a little too fast. But why include them in the first > place? To ease testing, especially for sandboxes.
(In reply to Jonathan Druart from comment #35) > (In reply to Katrin Fischer from comment #34) > > You are right, I was a little too fast. But why include them in the first > > place? > > To ease testing, especially for sandboxes. You can now do the yarn build bit on the sandboxes, but of course not everybody might know that. I was more thinking about the conflicts causing problems there. There is always something that can go wrong I guess :) I shoudl have taken a better look here at the conflict anyway.
I believe there might be some problematic constructions for translation in the JavaScript, but need to investigate further: lightbox_descriptions.push("Custom cover image"); lightbox_descriptions.push(_("Image from Google Books (<a href='%s'>see the original image</a>)").format($(img).data('link')));
One more: img.alt = "Cover image";
There is something weird, if multiple cover providers are activated: - Turn on OpenLibrary covers - Turn on Amazon covers - Search for "perl" - Most books will show 2 covers in results and in the detail pages - Example: CGI programming with Perl - Turn on Google covers - Result list shows 3 - Detail page: only Amazon
(In reply to Katrin Fischer from comment #37) > I believe there might be some problematic constructions for translation in > the JavaScript, but need to investigate further: > > lightbox_descriptions.push("Custom cover image"); > lightbox_descriptions.push(_("Image from Google Books (<a href='%s'>see the > original image</a>)").format($(img).data('link'))); They appear to work, at least seeing the strings in the po file.
Please check comment#39. Also: 1) Link to source At the bottom of the lightbox view it says: [provider] cover image (see the original image) I wonder if we could make it clearer here that we are linking to the provider's page as this is an external link where you will leave the library's website. And it won't only be the image you get to. Maybe something along the lines of: (see the original image on the [provider]'s website) A native speaker might come up with a better wording :)
(In reply to Katrin Fischer from comment #39) > There is something weird, if multiple cover providers are activated: > > - Turn on OpenLibrary covers > - Turn on Amazon covers > - Search for "perl" > - Most books will show 2 covers in results and in the detail pages > - Example: CGI programming with Perl > - Turn on Google covers > - Result list shows 3 > - Detail page: only Amazon Found it! There is 2 functions "verify_images", and one (the existing one) is coming from amazonimages.js!
Created attachment 123790 [details] [review] 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.
Created attachment 123792 [details] [review] Bug 28180: Fix some non-translatable strings
Created attachment 123793 [details] [review] 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.
It's a problem in master as well (staff-side) and highlighted at the OPAC as we have more images coming from external providers. The code to hide the non-existent images does not work as we expect. In my case, a new laptop (faster) make the problem more obvious, the JS code is processed faster than before and we remove the div that contain images from amazon, google, etc. because the images are not loaded yet. I think we should fix that on a separate bug report to fix the staff side at the same time. And obviously this new enhancement won't be pushed until it's fixed. You can continue testing with the following (non optimal) patch: 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..93b3c682f61 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -1620,7 +1620,7 @@ } } } else { - div.remove(); + //div.remove(); } });
Created attachment 123794 [details] [review] 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.
I think this patch is the way to go.
Patches still apply, CSS changes need to be rebuilt with `yarn build --view=opac`
Patches still apply, but something has been broken since my last test run. What I did so far: - Made sure master was current - restart_all, ran database updates - Applied patches, no conflicts - restart_all again - yarn build --view opac 1) Turned on Adlibris covers. Instead of the covers, only a link shows in the result list and detail pages. 2) Additionally activated Google covers. The covers show, but not within the lightbox display. 3) Added Amazon covers Now I see up to 2 covers, but next to each other, still no lightbox. Did a patch get lost here? :(
Hm, I later realized that this was not meant to change results, but only the detail page. Previous comments apply to the results list. On the detail page for me none of the 3 mentioned cover services covers show :( Example: search for "perl" > Programming Perl - 2 covers and the adlibris link on results - no cover at all on detail page Switch back to master, git stash, restart_all: - Adlibris still broken on results - covers show on results and detail page
Created attachment 124819 [details] [review] Bug 28180: Fix bug with AdLibris If Adlibris is first and there is no image
Hi Katrin, thanks! You found a bug in a very specific combination. AdLibris is loaded first but there is no image there (is the service broken currently?). The code copied from staff is broken. As we have much more cover services OPAC side the bugs are easier to catch. I think this last patch is improving the situation but I cannot guarantee it will always work. To be honest I've always tested with local cover images (as it's why this enhancement has been sponsored), and it was always working when a cover image is attached.
Created attachment 125666 [details] [review] Bug 28180: Fix bug with AdLibris If Adlibris is first and there is no image
Finally back to this.
I am very sorry, but I think I found another inconsistency: CustomCoverImages LocalCoverImages AllowMultipleCovers GoogleJackets 1) On the results page: CustomCover (a random image url), local cover and Google cover. 2) Switch to detail page: Only custom and local cover show. 3) Reload page with F5: Google cover appears. Same test plan applies to results without a local cover.
Same behaviour when using the "next" button for navigating between the results, initial page load is always without the Google cover. Requires an explicit refresh.
Hi Katrin, I don't recreate the problem you have. I've create a sandbox with your settings: https://opac-bz28180.sandboxes.biblibre.eu/cgi-bin/koha/opac-search.pl?idx=&q=perl&weight_search=1 "Perl DBI" has a local cover image (biblionumber=13).
What you describe make me think the JS cache was not cleared. With this change we have a problem when there is no custom image (for instance), as we don't longer test the height of the images. When the custom image won't exist, the cover slider will display an empty slide for the custom image. But this won't be easy to fix (we cannot have the previous patch "Bug 28180: Fix bug with AdLibris" AND keep the current behavior). It works for the staff interface because we don't have all those services, but the code is not working correctly for OPAC. I would not consider it a blocker. But what you describe is not expected.
I am not sure I fully understand your comment, but I think this is a real regression that will get unhappy comments. Google images are supposedly widely used and they disappear from the detail pages now :( In my test case there always was a custom image - do you mean local? It happened for the record with the local image too - I had 3 shown in results and only 2 missing Google) in the detail page. So not sure that's the issue.
Created attachment 126041 [details] [review] 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. Note that the img.naturalHeight check is not working for google jackets and is actually not needed (test with a bib record with and without google jacket and confirm that it's working as expected).
Created attachment 126042 [details] [review] Bug 28180: Fix bug with AdLibris If Adlibris is first and there is no image
(In reply to Katrin Fischer from comment #60) > I am not sure I fully understand your comment, but I think this is a real > regression that will get unhappy comments. Google images are supposedly > widely used and they disappear from the detail pages now :( > > In my test case there always was a custom image - do you mean local? It > happened for the record with the local image too - I had 3 shown in results > and only 2 missing Google) in the detail page. So not sure that's the issue. I did recreate on Firefox, not chrome (usually using Firefox, but the cache didn't want to clear correctly this morning when I tried). That should be fixed now!
Created attachment 126506 [details] [review] Bug 28180: Add Chocolat to OPAC See Bug 28179: Add the Chocolat gallery lightbox JS library Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch) Signed-off-by: Rasmus Leißner <rasmus.leissner@solutions-factory.de>
Created attachment 126507 [details] [review] Bug 28180: Add a lightbox gallery to display cover images - detail page, OPAC interface This patch is the OPAC version of Bug 28179: Add a lightbox gallery to display cover images - detail page, staff interface But there were several difficulties as the staff and OPAC code diverged a lot. First we are going to apply the different enhancements that have been made staff-side: - Display all the local cover image on the bibliographic detail pages (before this patch only the first one was displayed) - The slider functionality added by bug 25031 Test plan: All the cover images are affected, all the different sources will be tested. All the steps will be done on the same bibliographic record. 1. Local cover images a. Turn on OPACLocalCoverImages and AllowMultipleCover b. Add several local cover images to a bibliographic record c. Add several local cover images to an item d. Click on an image and confirm that it is displayed in a gallery and you can navigate see all the images attached to the bibliographic record e. Same for items 2. Adlibris a. Turn on AdlibrisCoversEnabled b. Edit the biliographic record and add an ISBN that will return a cover image for this service (9780670026623 for instance) c. Display the cover images in the gallery d. Note the link to the adlibris.com website at the bottom 3. Amazon a. Turn on OPACAmazonCoverImages b. Display the cover images in the gallery 4. Coce a. Turn on OpacCoce, set CoceHost to "http://coce.tamil.fr:8080" and select some values for CoceProviders. b. Display the cover images in the gallery 5. Custom cover images a. Turn on OPACCustomCoverImages and set CustomCoverImagesURL to https://covers.openlibrary.org/b/isbn/{isbn}-M.jpg of anything else meaningful b. Display the cover images in the gallery QA Note: Other sources have been removed by this patch but will be re-added by follow-ups Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch) Signed-off-by: Rasmus Leißner <rasmus.leissner@solutions-factory.de>
Created attachment 126508 [details] [review] Bug 28180: Reintroduce and adjust Syndetics Test plan: 1. Enable SyndeticsEnabled and SyndeticsCoverImages 2. Display the cover images in the gallery Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch) Signed-off-by: Rasmus Leißner <rasmus.leissner@solutions-factory.de>
Created attachment 126509 [details] [review] Bug 28180: Reintroduce and adjust Google Jackets Test plan: 1. Turn on GoogleJackets 2. Display the cover images in the gallery Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch) Signed-off-by: Rasmus Leißner <rasmus.leissner@solutions-factory.de>
Created attachment 126510 [details] [review] Bug 28180: Reintroduce and adjust OpenLibrary 1. Turn on OpenLibraryCovers 2. Display the cover images in the gallery Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch) Signed-off-by: Rasmus Leißner <rasmus.leissner@solutions-factory.de>
Created attachment 126511 [details] [review] Bug 28180: Reintroduce and adjust Baker and Taylor Test plan: 1. Turn on BakerTaylorEnabled and fill BakerTaylorUsername/BakerTaylorPassword (if you don't have, ask me) 2. Display the cover images in the gallery Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch) Signed-off-by: Rasmus Leißner <rasmus.leissner@solutions-factory.de>
Created attachment 126512 [details] [review] Bug 28180: Bug fix - cannot select cover-nav button when on top of the .contentblock Found a bug and ended up with this solution, suggestions welcomed! example with OpenLibrary with isbn=9780670026623, the image is a bit higher than others and then the cover-nav buttons are on top of .contentblock and cannot be clicked Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch) Signed-off-by: Rasmus Leißner <rasmus.leissner@solutions-factory.de>
Created attachment 126513 [details] [review] Bug 28180: (follow-up) Remove console.log
Created attachment 126514 [details] [review] Bug 28180: Restore NO_LOCAL_JACKET This is a patch to squash. No idea what it got removed previously
Created attachment 126515 [details] [review] Bug 28180: (follow-up) Updates to styling of lightbox controls This patch adds style changes like the ones made in Bug 28179. It also addresses a bug with the way the verify_images() function was firing. I've moved the function outside of document.ready() and added a call to it on window load, consistent with how it works in the staff client. I've removed a redundant call to verify_images() from the footer include file, opac-bottom.inc. The cosmetic changes replace the Chocolat image icons with new SVG assets based on Bootstrap Icons (https://icons.getbootstrap.com/). The color changes I think help the controls to be more visible. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 126516 [details] [review] Bug 28180: Fix some non-translatable strings
Created attachment 126517 [details] [review] 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.
Created attachment 126518 [details] [review] 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. Note that the img.naturalHeight check is not working for google jackets and is actually not needed (test with a bib record with and without google jacket and confirm that it's working as expected).
Created attachment 126519 [details] [review] Bug 28180: Fix bug with first image does not exist This was first written for Adlibris, before its removal from the codebase. But this patch maybe still be useful for other services (if first and no image).
Created attachment 126520 [details] [review] Bug 28180: Remove adlibris conflict Can be squashed when pushed
Rebased on top of bug 29200.
Created attachment 126596 [details] [review] Bug 28180: Add Chocolat to OPAC See Bug 28179: Add the Chocolat gallery lightbox JS library Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch) Signed-off-by: Rasmus Leißner <rasmus.leissner@solutions-factory.de> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 126597 [details] [review] Bug 28180: Add a lightbox gallery to display cover images - detail page, OPAC interface This patch is the OPAC version of Bug 28179: Add a lightbox gallery to display cover images - detail page, staff interface But there were several difficulties as the staff and OPAC code diverged a lot. First we are going to apply the different enhancements that have been made staff-side: - Display all the local cover image on the bibliographic detail pages (before this patch only the first one was displayed) - The slider functionality added by bug 25031 Test plan: All the cover images are affected, all the different sources will be tested. All the steps will be done on the same bibliographic record. 1. Local cover images a. Turn on OPACLocalCoverImages and AllowMultipleCover b. Add several local cover images to a bibliographic record c. Add several local cover images to an item d. Click on an image and confirm that it is displayed in a gallery and you can navigate see all the images attached to the bibliographic record e. Same for items 2. Adlibris a. Turn on AdlibrisCoversEnabled b. Edit the biliographic record and add an ISBN that will return a cover image for this service (9780670026623 for instance) c. Display the cover images in the gallery d. Note the link to the adlibris.com website at the bottom 3. Amazon a. Turn on OPACAmazonCoverImages b. Display the cover images in the gallery 4. Coce a. Turn on OpacCoce, set CoceHost to "http://coce.tamil.fr:8080" and select some values for CoceProviders. b. Display the cover images in the gallery 5. Custom cover images a. Turn on OPACCustomCoverImages and set CustomCoverImagesURL to https://covers.openlibrary.org/b/isbn/{isbn}-M.jpg of anything else meaningful b. Display the cover images in the gallery QA Note: Other sources have been removed by this patch but will be re-added by follow-ups Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch) Signed-off-by: Rasmus Leißner <rasmus.leissner@solutions-factory.de> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 126598 [details] [review] Bug 28180: Reintroduce and adjust Syndetics Test plan: 1. Enable SyndeticsEnabled and SyndeticsCoverImages 2. Display the cover images in the gallery Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch) Signed-off-by: Rasmus Leißner <rasmus.leissner@solutions-factory.de> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 126599 [details] [review] Bug 28180: Reintroduce and adjust Google Jackets Test plan: 1. Turn on GoogleJackets 2. Display the cover images in the gallery Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch) Signed-off-by: Rasmus Leißner <rasmus.leissner@solutions-factory.de> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 126600 [details] [review] Bug 28180: Reintroduce and adjust OpenLibrary 1. Turn on OpenLibraryCovers 2. Display the cover images in the gallery Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch) Signed-off-by: Rasmus Leißner <rasmus.leissner@solutions-factory.de> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 126601 [details] [review] Bug 28180: Reintroduce and adjust Baker and Taylor Test plan: 1. Turn on BakerTaylorEnabled and fill BakerTaylorUsername/BakerTaylorPassword (if you don't have, ask me) 2. Display the cover images in the gallery Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch) Signed-off-by: Rasmus Leißner <rasmus.leissner@solutions-factory.de> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 126602 [details] [review] Bug 28180: Bug fix - cannot select cover-nav button when on top of the .contentblock Found a bug and ended up with this solution, suggestions welcomed! example with OpenLibrary with isbn=9780670026623, the image is a bit higher than others and then the cover-nav buttons are on top of .contentblock and cannot be clicked Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch) Signed-off-by: Rasmus Leißner <rasmus.leissner@solutions-factory.de> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 126603 [details] [review] Bug 28180: (follow-up) Remove console.log Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 126604 [details] [review] Bug 28180: Restore NO_LOCAL_JACKET This is a patch to squash. No idea what it got removed previously Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 126605 [details] [review] Bug 28180: (follow-up) Updates to styling of lightbox controls This patch adds style changes like the ones made in Bug 28179. It also addresses a bug with the way the verify_images() function was firing. I've moved the function outside of document.ready() and added a call to it on window load, consistent with how it works in the staff client. I've removed a redundant call to verify_images() from the footer include file, opac-bottom.inc. The cosmetic changes replace the Chocolat image icons with new SVG assets based on Bootstrap Icons (https://icons.getbootstrap.com/). The color changes I think help the controls to be more visible. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 126606 [details] [review] Bug 28180: Fix some non-translatable strings Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 126607 [details] [review] 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 <katrin.fischer.83@web.de>
Created attachment 126608 [details] [review] 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. Note that the img.naturalHeight check is not working for google jackets and is actually not needed (test with a bib record with and without google jacket and confirm that it's working as expected). Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 126609 [details] [review] Bug 28180: Fix bug with first image does not exist This was first written for Adlibris, before its removal from the codebase. But this patch maybe still be useful for other services (if first and no image). Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 126610 [details] [review] Bug 28180: Remove adlibris conflict Can be squashed when pushed Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Pushed to master for 21.11, thanks to everybody involved!
Maybe another candidate for 'new feature'?
*** Bug 7709 has been marked as a duplicate of this bug. ***
*** Bug 7187 has been marked as a duplicate of this bug. ***