From 7abf8f8e5b13e72128f5cce6bee2c13c34af7033 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 25 Jan 2022 12:32:28 +0000 Subject: [PATCH] Bug 29940: Phase out jquery.cookie.js in the OPAC This patch replaces the use of jquery.cookie.js in the OPAC with the newer js-cookie plugin. The patch adds the latest version of the js-cookie library and removes the old jquery.cookie plugin. To test, apply the patch and go to the advanced search page in the OPAC. - Perform a search using a number of different limits and settings, e.g. keyword, item type, and sort-by. - On the search results page you should see at the top of the results list a link to "Return to the last advanced search." - The link should take you back to the advanced search page with all the same settings filled into the form. - A search with the "More options" view enabled in the advanced search form should result in a link which returns to the "More options" view. - Searching via the "quick search" form at the top of the page should clear the cookies which were set in order to remember the advanced search. See https://developer.mozilla.org/en-US/docs/Tools/Storage_Inspector for information on viewing your browser's stored cookies. Signed-off-by: Jonathan Druart Signed-off-by: Marcel de Rooy Signed-off-by: Fridolin Somers --- .../bootstrap/en/includes/opac-bottom.inc | 8 ++++---- .../bootstrap/en/modules/opac-advsearch.tt | 20 +++++++++---------- .../lib/jquery/plugins/jquery.cookie.min.js | 2 -- .../lib/js-cookie/js.cookie-3.0.1.min.js | 2 ++ 4 files changed, 15 insertions(+), 17 deletions(-) delete mode 100644 koha-tmpl/opac-tmpl/bootstrap/lib/jquery/plugins/jquery.cookie.min.js create mode 100644 koha-tmpl/opac-tmpl/lib/js-cookie/js.cookie-3.0.1.min.js diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc index fb57e6c18d..37340e20c1 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc @@ -280,14 +280,14 @@ $.widget.bridge('uitooltip', $.ui.tooltip); [% END %] -[% Asset.js("lib/jquery/plugins/jquery.cookie.min.js") | $raw %] +[% Asset.js("lib/js-cookie/js.cookie-3.0.1.min.js") | $raw %]