Bugzilla – Attachment 120467 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 Google Jackets
Bug-28180-Reintroduce-and-adjust-Google-Jackets.patch (text/plain), 5.74 KB, created by
Jonathan Druart
on 2021-05-04 13:39:57 UTC
(
hide
)
Description:
Bug 28180: Reintroduce and adjust Google Jackets
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-05-04 13:39:57 UTC
Size:
5.74 KB
patch
obsolete
>From 149011039171a58d4ad856bf480ef0759ca1bf37 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 20 Apr 2021 14:08:01 +0200 >Subject: [PATCH] Bug 28180: Reintroduce and adjust Google Jackets >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >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> >--- > .../bootstrap/en/modules/opac-detail.tt | 13 +++++++ > .../opac-tmpl/bootstrap/js/google-jackets.js | 38 +++++++++++-------- > 2 files changed, 36 insertions(+), 15 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 5822c4927be..ad74cb647cd 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >@@ -104,6 +104,13 @@ > [% END %] > [% END %] > >+ [% IF ( GoogleJackets ) %] >+ <div class="cover-image" id="googlejacket-coverimg"> >+ <div title="[% img_title | html %]" class="[% normalized_isbn | html %]" id="gbs-thumbnail-preview" data-use-data-link="1"></div> >+ <div class="hint">Image from Google Jackets</div> >+ </div> >+ [% END %] >+ > [% IF ( Koha.Preference('OPACCoce') && Koha.Preference('CoceProviders') && normalized_isbn ) %] > [% coce_id = normalized_ean || normalized_isbn %] > <div class="cover-image" id="coce-coverimg"> >@@ -1647,6 +1654,10 @@ > [% END %] > [% END %] > >+ [% IF ( GoogleJackets ) %] >+ KOHA.Google.GetCoverFromIsbn([% covernewwindow | html %]); >+ [% END %] >+ > [% IF ( Koha.Preference('OpacCoce') && Koha.Preference('CoceProviders') ) %] > KOHA.coce.getURL('[% Koha.Preference('CoceHost') | html %]', '[% Koha.Preference('CoceProviders') | html %]',[% covernewwindow | html %]); > [% END %] >@@ -1690,6 +1701,8 @@ > } > } else if( div.attr("id") == "syndetics-coverimg" ){ > 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") == "coce-coverimg" ){ > // Identify which service's image is being loaded by Coce > var coce_description; >diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/google-jackets.js b/koha-tmpl/opac-tmpl/bootstrap/js/google-jackets.js >index 85592cd6596..ad1fd638a41 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/js/google-jackets.js >+++ b/koha-tmpl/opac-tmpl/bootstrap/js/google-jackets.js >@@ -46,22 +46,30 @@ KOHA.Google = { > for (id in booksInfo) { > var book = booksInfo[id]; > $("[id^=gbs-thumbnail]."+book.bib_key).each(function() { >- var a = document.createElement("a"); >- a.href = book.info_url; > if (typeof(book.thumbnail_url) != "undefined") { >- var img = document.createElement("img"); >- img.src = book.thumbnail_url; >- $(this).empty().append(img); >- var re = /^gbs-thumbnail-preview/; >- if ( re.exec($(this).attr("id")) ) { >- $(this).append( >- '<div class="google-books-preview">' + >- '<a '+target+'href="' + >- book.info_url + >- '"><img src="' + >- 'https://books.google.com/intl/en/googlebooks/images/gbs_preview_sticker1.gif' + >- '"></a></div>' >- ); >+ if ( $(this).data('use-data-link') ) { >+ var a = document.createElement("a"); >+ a.href = book.thumbnail_url; >+ var img = document.createElement("img"); >+ img.src = book.thumbnail_url; >+ img.setAttribute('data-link', book.info_url); >+ a.append(img) >+ $(this).empty().append(a); >+ } else { >+ var img = document.createElement("img"); >+ img.src = book.thumbnail_url; >+ $(this).empty().append(img); >+ var re = /^gbs-thumbnail-preview/; >+ if ( re.exec($(this).attr("id")) ) { >+ $(this).append( >+ '<div class="google-books-preview">' + >+ '<a '+target+'href="' + >+ book.info_url + >+ '"><img src="' + >+ 'https://books.google.com/intl/en/googlebooks/images/gbs_preview_sticker1.gif' + >+ '"></a></div>' >+ ); >+ } > } > } else { > var message = document.createElement("span"); >-- >2.20.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