Lines 39-45
function KohaTable(id_selector, dt_parameters, table_settings, add_filters) {
Link Here
|
39 |
|
39 |
|
40 |
// Load state from URL |
40 |
// Load state from URL |
41 |
const url = new URL(window.location.href); |
41 |
const url = new URL(window.location.href); |
42 |
let state_from_url = url.searchParams.get( settings.nTable.id + '_state'); |
42 |
let state_from_url = url.searchParams.get( table_key + '_state'); |
43 |
if ( state_from_url ) { |
43 |
if ( state_from_url ) { |
44 |
settings.loaded_from_state = true; |
44 |
settings.loaded_from_state = true; |
45 |
return JSON.parse(atob(state_from_url)); |
45 |
return JSON.parse(atob(state_from_url)); |
Lines 221-231
function KohaTable(id_selector, dt_parameters, table_settings, add_filters) {
Link Here
|
221 |
titleAttr: __("Copy conditions"), |
221 |
titleAttr: __("Copy conditions"), |
222 |
text: '<i class="fa fa-lg fa-copy"></i> <span class="dt-button-text">' + __("Copy conditions") + '</span>', |
222 |
text: '<i class="fa fa-lg fa-copy"></i> <span class="dt-button-text">' + __("Copy conditions") + '</span>', |
223 |
action: function (e, dt, node, config) { |
223 |
action: function (e, dt, node, config) { |
|
|
224 |
let table_key = 'DataTables_%s_%s_%s'.format( |
225 |
table_settings.module, |
226 |
table_settings.page, |
227 |
table_settings.table); |
228 |
|
224 |
let state = JSON.stringify(dt.state()); |
229 |
let state = JSON.stringify(dt.state()); |
225 |
delete state.time; |
230 |
delete state.time; |
226 |
let searchParams = new URLSearchParams(window.location.search); |
231 |
let searchParams = new URLSearchParams(window.location.search); |
227 |
let table_id = dt.table().node().id; |
232 |
searchParams.set(table_key + '_state', btoa(state)); |
228 |
searchParams.set(table_id + '_state', btoa(state)); |
|
|
229 |
let url = window.location.origin + window.location.pathname + '?' + searchParams.toString() + window.location.hash; |
233 |
let url = window.location.origin + window.location.pathname + '?' + searchParams.toString() + window.location.hash; |
230 |
if( navigator.clipboard && navigator.clipboard.writeText){ |
234 |
if( navigator.clipboard && navigator.clipboard.writeText){ |
231 |
navigator.clipboard.writeText( url ); |
235 |
navigator.clipboard.writeText( url ); |