Bugzilla – Attachment 155758 Details for
Bug 34724
Remove use of onclick for opac-imageviewer.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34724: Remove inline onclick handler for opac-imageviewer.pl
Bug-34724-Remove-inline-onclick-handler-for-opac-i.patch (text/plain), 3.34 KB, created by
Katrin Fischer
on 2023-09-17 14:29:13 UTC
(
hide
)
Description:
Bug 34724: Remove inline onclick handler for opac-imageviewer.pl
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2023-09-17 14:29:13 UTC
Size:
3.34 KB
patch
obsolete
>From f161a93cd8cac0d12cbf0ba7fcb5e3517a7edaac Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Wed, 6 Sep 2023 06:40:21 +0000 >Subject: [PATCH] Bug 34724: Remove inline onclick handler for > opac-imageviewer.pl > >This patch moves the click handler for thumbnails for opac-imageviewer.pl >out of the inline HTML and out to an existing <script> element. > >Test plan: >0. Apply the patch (including dependent patches) >1. Go to >http://localhost:8081/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=localcover >2. Change both *LocalCoverImages sysprefs to "Show" >3. Go to >http://localhost:8081/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=AllowMultipleCovers >4. Change "AllowMultipleCovers" to "Allow" >5. Go to >http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=29 >6. Click "Images (0)" tab >7. Download or make two JPEG images >8. Upload the images >9. Go to http://localhost:8080/cgi-bin/koha/opac-imageviewer.pl?biblionumber=29 >10. See one large image in the centre and two smaller thumbnails on the right side >11. Click on the thumbnail of the image that isn't displayed in the centre >12. Note that the image changes >13. Click the other thumbnail and note that the image changes back > >PA amended patch: Added missing test plan step > >Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > .../opac-tmpl/bootstrap/en/modules/opac-imageviewer.tt | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-imageviewer.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-imageviewer.tt >index 788c25ad8a..4bc57d82b6 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-imageviewer.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-imageviewer.tt >@@ -87,7 +87,7 @@ > <div class="col-lg-3"> > <div id="thumbnails"> > [% FOREACH image IN images %] >- <a href="/cgi-bin/koha/opac-imageviewer.pl?biblionumber=[% biblionumber | url %]&imagenumber=[% image.imagenumber| uri %]" onclick="showCover([% image.imagenumber| html %]); return false;"> >+ <a class="cover_thumbnail" data-imagenumber="[% image.imagenumber| html %]" href="/cgi-bin/koha/opac-imageviewer.pl?biblionumber=[% biblionumber | url %]&imagenumber=[% image.imagenumber| uri %]"> > [% IF loop.first %] > <img class="thumbnail selected" id="[% image.imagenumber| html %]" src="/cgi-bin/koha/opac-image.pl?imagenumber=[% image.imagenumber | html %]&thumbnail=1" alt="Thumbnail"/> > [% ELSE %] >@@ -113,6 +113,13 @@ > $(document).ready(function(){ > $("#largeCoverImg").attr("src","[% interface | html %]/[% theme | html %]/images/loading.gif"); > showCover([% imagenumber | html %]); >+ $("a.cover_thumbnail").on('click',function(){ >+ let imagenumber = this.dataset.imagenumber; >+ if (imagenumber){ >+ showCover(imagenumber); >+ } >+ return false; >+ }); > }); > > function showCover(img) { >-- >2.30.2
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 34724
:
155255
|
155299
|
155300
|
155445
|
155472
| 155758 |
155759