Bugzilla – Attachment 129858 Details for
Bug 29932
Phase out jquery.cookie.js: bibs_selected (Browse selected records)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29932: Use localStorage instead of cookie for bibs_selected
Bug-29932-Use-localStorage-instead-of-cookie-for-b.patch (text/plain), 2.51 KB, created by
Jonathan Druart
on 2022-01-27 10:17:59 UTC
(
hide
)
Description:
Bug 29932: Use localStorage instead of cookie for bibs_selected
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-01-27 10:17:59 UTC
Size:
2.51 KB
patch
obsolete
>From afafdd51c6395bad6bb7f0e5aeaabc3bfe087f9d Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 21 Jan 2022 13:05:40 +0000 >Subject: [PATCH] Bug 29932: Use localStorage instead of cookie for > bibs_selected > >This patch replaces the use of the jquery.cookie.js plugin in the >"Browse selected records" feature. The feature is modified to use >localStorage instead of cookies. > >To test, apply the patch and go to Administration -> System preferences. > > - Enable the "BrowseResultSelection" system preference. > - Perform a catalog search which will return multiple results. > - On the search results page, check the checkbox for a number of > titles. > - Click the "Browse selected biblios" button in the toolbar. > - You should be directed to the detail page for the first title you > checked. > - Clicking the right-arrow in the sidebar should take you > through each one of your selected titles. > - When you click the "Results" link in the sidebar you should be > returned to the same search results set and the same titles should be > checked. > _ If you uncheck those titles and reload the page the checkboxes should > remain unchecked. > - If you log out of the staff interface the "bibs_selected" item in > localStorage should be deleted. See, for example, > https://developer.mozilla.org/en-US/docs/Tools/Storage_Inspector for > information about viewing local storage. > >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > koha-tmpl/intranet-tmpl/prog/js/staff-global.js | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >index c62a037e523..ad7d932fca5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >@@ -205,6 +205,7 @@ function logOut(){ > removeLastBorrower(); > localStorage.removeItem("sql_reports_activetab"); > localStorage.removeItem("searches"); >+ localStorage.removeItem("bibs_selected"); > } > > function openHelp(){ >@@ -320,11 +321,11 @@ function delBibToContext( bibnum ) { > } > > function setContextBiblioNumbers( bibnums ) { >- $.cookie('bibs_selected', JSON.stringify( bibnums )); >+ localStorage.setItem('bibs_selected', JSON.stringify( bibnums ) ); > } > > function getContextBiblioNumbers() { >- var r = $.cookie('bibs_selected'); >+ var r = localStorage.getItem('bibs_selected'); > if ( r ) { > return JSON.parse(r); > } >-- >2.25.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 29932
:
129734
|
129809
| 129858