Bugzilla – Attachment 178699 Details for
Bug 35134
cn_browser.pl pop-up size should be configurable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35134: Use localStorage instead of a cookie
Bug-35134-Use-localStorage-instead-of-a-cookie.patch (text/plain), 2.48 KB, created by
Lucas Gass (lukeg)
on 2025-02-25 23:22:46 UTC
(
hide
)
Description:
Bug 35134: Use localStorage instead of a cookie
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2025-02-25 23:22:46 UTC
Size:
2.48 KB
patch
obsolete
>From cf8bec4041d9052447cd25a133c5819556444d43 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Tue, 25 Feb 2025 23:22:14 +0000 >Subject: [PATCH] Bug 35134: Use localStorage instead of a cookie > >--- > cataloguing/value_builder/cn_browser.pl | 10 +++++----- > koha-tmpl/intranet-tmpl/prog/js/staff-global.js | 2 ++ > 2 files changed, 7 insertions(+), 5 deletions(-) > >diff --git a/cataloguing/value_builder/cn_browser.pl b/cataloguing/value_builder/cn_browser.pl >index 0a0ca0669b9..5619a68a3c3 100755 >--- a/cataloguing/value_builder/cn_browser.pl >+++ b/cataloguing/value_builder/cn_browser.pl >@@ -39,16 +39,16 @@ function Click$function_name(ev) { > let window_height = screen.height; > q = document.getElementById(ev.data.id); > >- if(Cookies.get(\"popup_window_height\") && Cookies.get(\"popup_window_width\")){ >- window_width = Cookies.get(\"popup_window_width\"); >- window_height = Cookies.get(\"popup_window_height\"); >+ if(localStorage.getItem(\"popup_window_height\") && localStorage.getItem(\"popup_window_width\")){ >+ window_width = localStorage.getItem(\"popup_window_width\"); >+ window_height = localStorage.getItem(\"popup_window_height\"); > } > > var windowref = window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=cn_browser.pl&popup&q=\"+encodeURIComponent(q.value),\"cnbrowser\",\"width=\"+window_width+\"\,height=\"+window_height+\"\,toolbar=false,scrollbars=yes\"); > > windowref.onresize = function(){ >- Cookies.set(\"popup_window_height\", windowref.innerHeight, { path: '/', sameSite: 'Lax' }); >- Cookies.set(\"popup_window_width\", windowref.innerWidth, { path: '/', sameSite: 'Lax' }); >+ localStorage.setItem(\"popup_window_height\", windowref.innerHeight); >+ localStorage.setItem(\"popup_window_width\", windowref.innerWidth); > } > } > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >index ff9f29b371c..f1e7515bf36 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >@@ -504,6 +504,8 @@ function logOut() { > localStorage.removeItem("patron_search_selections"); > localStorage.removeItem("item_search_selections"); > localStorage.removeItem("copiedPermissions"); >+ localStorage.removeItem("popup_window_width"); >+ localStorage.removeItem("popup_window_height"); > > // Remove DataTables states > Object.keys(localStorage).forEach(k => { >-- >2.39.5
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 35134
:
159169
|
159171
|
165381
|
167261
|
167262
|
178699
|
179138
|
179139
|
179140