Bugzilla – Attachment 112297 Details for
Bug 26805
Remove remaining instances of jquery.checkboxes plugin from the OPAC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26805: Remove remaining instances of jquery.checkboxes plugin from the OPAC
Bug-26805-Remove-remaining-instances-of-jquerychec.patch (text/plain), 10.29 KB, created by
Owen Leonard
on 2020-10-23 18:33:43 UTC
(
hide
)
Description:
Bug 26805: Remove remaining instances of jquery.checkboxes plugin from the OPAC
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2020-10-23 18:33:43 UTC
Size:
10.29 KB
patch
obsolete
>From 241de7e77a1f5009f9e0b21d86199829b55d995c Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 23 Oct 2020 18:14:34 +0000 >Subject: [PATCH] Bug 26805: Remove remaining instances of jquery.checkboxes > plugin from the OPAC > >This patch removes the use of the jquery.checkboxes plugin from the 5 >templates in the OPAC which still use it. The plugin itself is removed. > >To test, apply the patch and test the "Select all" and "Clear all" links >work to select and deselect checkboxes on the following pages: > >- The catalog search results page: The controls should also enable > and disable the "Select titles to..." menu. >- The list contents page: The controls should also enable > and disable the "Select titles to..." links. >- The suggestions page: The controls should also enable > and disable the "Select suggestions to..." link. >- The search history page: The controls should affect only the > corresponding table ("Current" or "Previous") and should enable and > disable the "Select searches to..." link. > >This patch also modifies the template for grouped search results, as >enabled by the OpacGroupResults system preference, but I don't know how >to test it. >--- > .../bootstrap/en/modules/opac-results-grouped.tt | 13 ++++++------- > .../opac-tmpl/bootstrap/en/modules/opac-results.tt | 17 ++++++++++------- > .../bootstrap/en/modules/opac-search-history.tt | 4 ++-- > .../opac-tmpl/bootstrap/en/modules/opac-shelves.tt | 17 ++++++++++------- > .../opac-tmpl/bootstrap/en/modules/opac-suggestions.tt | 17 ++++++++++------- > .../lib/jquery/plugins/jquery.checkboxes.min.js | 13 ------------- > 6 files changed, 38 insertions(+), 43 deletions(-) > delete mode 100644 koha-tmpl/opac-tmpl/bootstrap/lib/jquery/plugins/jquery.checkboxes.min.js > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results-grouped.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results-grouped.tt >index afe486811d..c976070934 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results-grouped.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results-grouped.tt >@@ -290,7 +290,6 @@ > > [% INCLUDE 'opac-bottom.inc' %] > [% BLOCK jsinclude %] >- [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %] > <script> > var q_array = new Array(); // will hold the search terms, if possible > $(document).ready(function(){ >@@ -331,13 +330,13 @@ > return false; > } > } >- $("#CheckAll").click(function(){ >- $("#bookbag_form").checkCheckboxes(); >- return false; >+ $("#CheckAll").on("click", function(e){ >+ e.preventDefault(); >+ $("#bookbag_form").find("input:checkbox").prop("checked", true); > }); >- $("#CheckNone").click(function(){ >- $("#bookbag_form").unCheckCheckboxes(); >- return false; >+ $("#CheckNone").on("click", function(e){ >+ e.preventDefault(); >+ $("#bookbag_form").find("input:checkbox").prop("checked", true); > }); > [% IF ( query_desc ) %] > var query_desc = "[% query_desc |replace("'", "\'") |replace('\n', '\\n') |replace('\r', '\\r') | html %]"; >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >index 7843add315..07892efc2e 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >@@ -625,7 +625,6 @@ > [% END %] > [% IF ( OverDriveEnabled ) %][% Asset.js("js/overdrive.js") | $raw %][% END %] > [% IF ( RecordedBooksEnabled ) %][% Asset.js("js/recordedbooks.js") | $raw %][% END %] >- [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %] > [% Asset.js("js/authtoresults.js") | $raw %] > [% Asset.js("lib/hc-sticky.js") | $raw %] > [% IF ( OpacHighlightedWords ) %] >@@ -879,15 +878,19 @@ > return false; > } > } >- $("#CheckAll").click(function(){ >- $("#bookbag_form").checkCheckboxes(); >+ $("#CheckAll").on("click",function(e){ >+ e.preventDefault(); >+ $(".cb").each(function(){ >+ $(this).prop("checked", true); >+ }); > enableCheckboxActions(); >- return false; > }); >- $("#CheckNone").click(function(){ >- $("#bookbag_form").unCheckCheckboxes(); >+ $("#CheckNone").on("click",function(e){ >+ e.preventDefault(); >+ $(".cb").each(function(){ >+ $(this).prop("checked", false); >+ }); > enableCheckboxActions(); >- return false; > }); > > [% IF ( ( Koha.Preference( 'RequestOnOpac' ) == 1 ) && ( Koha.Preference( 'opacuserlogin' ) == 1 ) && DisplayMultiPlaceHold ) %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-search-history.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-search-history.tt >index 5eb404b3cb..4494b861f0 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-search-history.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-search-history.tt >@@ -261,13 +261,13 @@ > $(".CheckNone").click(function(e){ > e.preventDefault(); > var form = $(this).parents("form").get(0); >- $(form).unCheckCheckboxes(); >+ $(form).find("input:checkbox").prop("checked", false); > enableCheckboxActions(form); > }); > $(".CheckAll").click(function(e){ > e.preventDefault(); > var form = $(this).parents("form").get(0); >- $(form).checkCheckboxes(); >+ $(form).find("input:checkbox").prop("checked", true); > enableCheckboxActions(form); > }); > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt >index bf42a7072f..3526088806 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt >@@ -798,7 +798,6 @@ > > [% INCLUDE 'opac-bottom.inc' %] > [% BLOCK jsinclude %] >-[% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %] > [% Asset.js("lib/hc-sticky.js") | $raw %] > [% IF OpenLibraryCovers || OpenLibrarySearch %] > [% Asset.js("js/openlibrary.js") | $raw %] >@@ -893,15 +892,19 @@ $(function() { > }); > [% END %] > >- $("#CheckAll").click(function(){ >- $(".checkboxed").checkCheckboxes(); >+ $("#CheckAll").on("click",function(e){ >+ e.preventDefault(); >+ $(".cb").each(function(){ >+ $(this).prop("checked", true); >+ }); > enableCheckboxActions(); >- return false; > }); >- $("#CheckNone").click(function(){ >- $(".checkboxed").unCheckCheckboxes(); >+ $("#CheckNone").on("click",function(e){ >+ e.preventDefault(); >+ $(".cb").each(function(){ >+ $(this).prop("checked", false); >+ }); > enableCheckboxActions(); >- return false; > }); > > $(".cb").click(function(){ >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt >index 956a254805..53e5833d00 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt >@@ -465,7 +465,6 @@ > > [% INCLUDE 'opac-bottom.inc' %] > [% BLOCK jsinclude %] >-[% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %] > [% INCLUDE 'datatables.inc' %] > <script> > [% IF ( loggedinusername ) %] >@@ -501,15 +500,19 @@ > })); > [% IF ( loggedinusername ) %]$("span.clearall").html("<a id=\"CheckNone\" class=\"btn btn-link btn-sm\" href=\"#\">"+_("Clear all")+"<\/a>"); > $("span.checkall").html("<a id=\"CheckAll\" class=\"btn btn-link btn-sm\" href=\"#\">"+_("Select all")+"<\/a>"); >- $("#CheckAll").click(function(){ >- $(".checkboxed").checkCheckboxes(); >+ $("#CheckAll").on("click",function(e){ >+ e.preventDefault(); >+ $(".cb").each(function(){ >+ $(this).prop("checked", true); >+ }); > enableCheckboxActions(); >- return false; > }); >- $("#CheckNone").click(function(){ >- $(".checkboxed").unCheckCheckboxes(); >+ $("#CheckNone").on("click",function(e){ >+ e.preventDefault(); >+ $(".cb").each(function(){ >+ $(this).prop("checked", false); >+ }); > enableCheckboxActions(); >- return false; > }); > $(".cb").click(function(){ > enableCheckboxActions(); >diff --git a/koha-tmpl/opac-tmpl/bootstrap/lib/jquery/plugins/jquery.checkboxes.min.js b/koha-tmpl/opac-tmpl/bootstrap/lib/jquery/plugins/jquery.checkboxes.min.js >deleted file mode 100644 >index 8595324fa0..0000000000 >--- a/koha-tmpl/opac-tmpl/bootstrap/lib/jquery/plugins/jquery.checkboxes.min.js >+++ /dev/null >@@ -1,13 +0,0 @@ >-/* >- * >- * Copyright (c) 2006-2008 Sam Collett (http://www.texotela.co.uk) >- * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) >- * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. >- * >- * Version 2.1 >- * Demo: http://www.texotela.co.uk/code/jquery/checkboxes/ >- * >- * $LastChangedDate$ >- * $Rev$ >- */ >-;(function(d){d.fn.toggleCheckboxes=function(a,b){a=a||"*";b=b||false;var c=d([]);this.each(function(){var e=d("input[type=checkbox]",this).filter(a).each(function(){this.checked=!this.checked}).filter(":checked");c=e});if(!b){c=this}return c};d.fn.checkCheckboxes=function(a,b){a=a||"*";b=b||false;var c=d([]);this.each(function(){var e=d("input[type=checkbox]",this).filter(a).each(function(){this.checked=true}).filter(":checked");c=e});if(!b){c=this}return c};d.fn.unCheckCheckboxes=function(a,b){a=a||"*";b=b||false;var c=d([]);this.each(function(){var e=d("input[type=checkbox]",this).filter(a).each(function(){this.checked=false}).filter(":not(:checked)");c=e});if(!b){c=this}return c};d.radioCheckboxGroup=function(e,a){a=a||"*";var b="input[type=checkbox]";if(e){b+="[name="+e+"]"}var c=d(b).filter(a);c.click(function(){c.not(this).each(function(){this.checked=false}).end()})}})(jQuery); >\ No newline at end of file >-- >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 26805
:
112297
|
112308
|
112348
|
112349
|
112568
|
112594
|
112799