Bugzilla – Attachment 156301 Details for
Bug 34936
Remove the use of event attributes from OPAC detail page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34936: Remove the use of event attributes from OPAC detail page
Bug-34936-Remove-the-use-of-event-attributes-from-.patch (text/plain), 4.72 KB, created by
Owen Leonard
on 2023-09-27 16:51:28 UTC
(
hide
)
Description:
Bug 34936: Remove the use of event attributes from OPAC detail page
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2023-09-27 16:51:28 UTC
Size:
4.72 KB
patch
obsolete
>From de6a553843bf7947d85680227b399cbffd0949c0 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Wed, 27 Sep 2023 16:26:03 +0000 >Subject: [PATCH] Bug 34936: Remove the use of event attributes from OPAC > detail page > >This patch removes the use of event attributes (onclick) from the OPAC's >bibliographic detail page template. These events are defined now along >with the other in-page JS. > >The patch also adjusts the global "Dopop" function so that the popup >window is a litte bigger. The comments form did not fit well. > >In checking for use of the "Dopop" function I found that it was being >redefined in opac-topissues.tt for no reason so I removed it. > >To test you must have the OPACComments system preference enabled. > >- Log in to the OPAC, locate a bibliographic record, and view the detail > page. >- Under the "Comments" tab, click the "Post your comments on this title" > link. It should trigger a popup window. > - Submit your comment. When the detail page reloads, return to the > "Comments" tab and click the "Edit" link on your comment. The same > popup window should be triggered. >--- > .../opac-tmpl/bootstrap/en/modules/opac-detail.tt | 11 ++++++++--- > .../opac-tmpl/bootstrap/en/modules/opac-topissues.tt | 3 --- > koha-tmpl/opac-tmpl/bootstrap/js/global.js | 2 +- > 3 files changed, 9 insertions(+), 7 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 f89db262e4..0dd9f8a5f5 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >@@ -815,7 +815,7 @@ > [% FILTER html_break %] > [% review.review | html %] > [% END %] >- <a href="#" onclick="Dopop('/cgi-bin/koha/opac-review.pl?biblionumber=[% review.biblionumber | uri %]&reviewid=[% review.reviewid | uri %]');">Edit</a> >+ <a href="/cgi-bin/koha/opac-review.pl?biblionumber=[% review.biblionumber | uri %]&reviewid=[% review.reviewid | uri %]" class="edit_comment">Edit</a> > </p> > </div> > [% ELSE %] >@@ -857,8 +857,8 @@ > [% IF ( loggedinusername ) %] > [% UNLESS ( loggedincommenter ) %] > <div id="addcomment"> >- <a href="#" onclick="Dopop('/cgi-bin/koha/opac-review.pl?biblionumber=[% biblio.biblionumber | uri %]'); return false;"> >- Post your comments on this title. >+ <a href="/cgi-bin/koha/opac-review.pl?biblionumber=[% biblio.biblionumber | uri %]" class="edit_comment"> >+ Post your comments on this title. > </a> > </div> > [% END %] >@@ -1921,6 +1921,11 @@ > }); > }()); > [% END # /IF ( OPACShelfBrowser ) %] >+ >+ $(".edit_comment").on("click", function(e){ >+ e.preventDefault(); >+ Dopop( this.href ); >+ }); > }); > > $(document).ready(function() { >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-topissues.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-topissues.tt >index 602633a9c6..f6ec596210 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-topissues.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-topissues.tt >@@ -168,8 +168,5 @@ > }, > })); > }); >- function Dopop(link) { >- newin=window.open(link,'width=500,height=400,toolbar=false,scrollbars=yes'); >- } > </script> > [% END %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/global.js b/koha-tmpl/opac-tmpl/bootstrap/js/global.js >index 30f1406c83..83b21779ae 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/js/global.js >+++ b/koha-tmpl/opac-tmpl/bootstrap/js/global.js >@@ -46,7 +46,7 @@ function confirmDelete(message) { > } > > function Dopop(link) { >- newin=window.open(link,'popup','width=500,height=400,toolbar=false,scrollbars=yes,resizable=yes'); >+ newin=window.open(link,'popup','width=660,height=450,toolbar=false,scrollbars=yes,resizable=yes'); > } > > jQuery.fn.preventDoubleFormSubmit = function() { >-- >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 34936
:
156301
|
156338
|
156389