Lines 1-5
Link Here
|
1 |
/* global shortcut delCookie delBasket Sticky */ |
1 |
/* global shortcut delCookie delBasket Sticky */ |
2 |
/* exported paramOfUrl addBibToContext delBibToContext */ |
2 |
/* exported paramOfUrl addBibToContext delBibToContext copyToClipboard */ |
3 |
if ( KOHA === undefined ) var KOHA = {}; |
3 |
if ( KOHA === undefined ) var KOHA = {}; |
4 |
|
4 |
|
5 |
function _(s) { return s; } // dummy function for gettext |
5 |
function _(s) { return s; } // dummy function for gettext |
Lines 358-360
function saveOrClearSimpleSearchParams() {
Link Here
|
358 |
localStorage.setItem('cat_search_pulldown_selection', pulldown_selection ); |
358 |
localStorage.setItem('cat_search_pulldown_selection', pulldown_selection ); |
359 |
localStorage.setItem('searchbox_value', searchbox_value ); |
359 |
localStorage.setItem('searchbox_value', searchbox_value ); |
360 |
} |
360 |
} |
361 |
- |
361 |
|
|
|
362 |
// https://hackernoon.com/copying-text-to-clipboard-with-javascript-df4d4988697f |
363 |
function copyToClipboard( text ){ |
364 |
var el = document.createElement("textarea"); // Create a <textarea> element |
365 |
el.value = text; // Set its value to the string that you want copied |
366 |
el.setAttribute("readonly", ""); // Make it readonly to be tamper-proof |
367 |
el.style.position = "absolute"; |
368 |
el.style.left = "-9999px"; // Move outside the screen to make it invisible |
369 |
document.body.appendChild(el); // Append the <textarea> element to the HTML document |
370 |
el.select(); // Select the <textarea> content |
371 |
document.execCommand("copy"); // Copy - only works as a result of a user action (e.g. click events) |
372 |
document.body.removeChild(el); // Remove the <textarea> element |
373 |
} |