Bugzilla – Attachment 126600 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: Reintroduce and adjust OpenLibrary
Bug-28180-Reintroduce-and-adjust-OpenLibrary.patch (text/plain), 4.79 KB, created by
Katrin Fischer
on 2021-10-20 20:42:04 UTC
(
hide
)
Description:
Bug 28180: Reintroduce and adjust OpenLibrary
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2021-10-20 20:42:04 UTC
Size:
4.79 KB
patch
obsolete
>From 1442ca4ca783afc84a27473241d23653e73fb015 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 20 Apr 2021 14:41:34 +0200 >Subject: [PATCH] Bug 28180: Reintroduce and adjust OpenLibrary >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >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> >--- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt | 13 +++++++++++++ > koha-tmpl/opac-tmpl/bootstrap/js/openlibrary.js | 14 +++++++++----- > 2 files changed, 22 insertions(+), 5 deletions(-) > >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 54e50d1e42..6887dec331 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >@@ -110,6 +110,13 @@ > </div> > [% END %] > >+ [% IF OpenLibraryCovers %] >+ <div class="cover-image" id="openlibrary-coverimg"> >+ <div title="[% img_title | html %]" class="[% normalized_isbn | html %]" id="openlibrary-thumbnail-preview" data-use-data-link="1"></div> >+ <div class="hint">Image from OpenLibrary</div> >+ </div> >+ [% END %] >+ > [% IF Koha.Preference('OPACCustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %] > [% SET custom_cover_image_url = biblio.custom_cover_image_url %] > [% IF custom_cover_image_url %] >@@ -1502,6 +1509,10 @@ > KOHA.coce.getURL('[% Koha.Preference('CoceHost') | html %]', '[% Koha.Preference('CoceProviders') | html %]',[% covernewwindow | html %]); > [% END %] > >+ [% IF OpenLibraryCovers %] >+ KOHA.OpenLibrary.GetCoverFromIsbn(); >+ [% END %] >+ > function verify_images() { > // Loop over each container in the template which contains covers > $(".cover-slider").each(function(){ >@@ -1543,6 +1554,8 @@ > lightbox_descriptions.push("Image from Syndetics") > } else if( div.attr("id") == "googlejacket-coverimg" ){ > lightbox_descriptions.push(_("Image from Google Jacket (<a href='%s'>see the original image</a>)").format($(img).data('link'))); >+ } else if( div.attr("id") == "openlibrary-coverimg" ){ >+ lightbox_descriptions.push(_("Image from OpenLibrary (<a href='%s'>see the original image</a>)").format($(img).data('link'))); > } else if( div.attr("id") == "coce-coverimg" ){ > // Identify which service's image is being loaded by Coce > var coce_description; >diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/openlibrary.js b/koha-tmpl/opac-tmpl/bootstrap/js/openlibrary.js >index 9ca62cb17b..8537165e72 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/js/openlibrary.js >+++ b/koha-tmpl/opac-tmpl/bootstrap/js/openlibrary.js >@@ -40,15 +40,19 @@ KOHA.OpenLibrary = new function() { > var book = booksInfo[id]; > var isbn = id.substring(5); > $("[id^=openlibrary-thumbnail]."+isbn).each(function() { >- var is_opacdetail = /openlibrary-thumbnail-preview/.exec($(this).attr("id")); > var a = document.createElement("a"); > a.href = booksInfo.url; > if (book.cover) { >- var img = document.createElement("img"); >- if (is_opacdetail) { >- img.src = book.cover.medium; >- $(this).empty().append(img); >+ if ( $(this).data('use-data-link') ) { >+ var a = document.createElement("a"); >+ a.href = book.cover.large; >+ var img = document.createElement("img"); >+ img.src = book.cover.medium; >+ img.setAttribute('data-link', book.cover.large); >+ a.append(img) >+ $(this).empty().append(a); > } else { >+ var img = document.createElement("img"); > img.src = book.cover.medium; > img.height = '110'; > $(this).append(img); >-- >2.11.0
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