View | Details | Raw Unified | Return to bug 27594
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt (-1 / +3 lines)
Lines 438-444 Link Here
438
438
439
            $(".get-file").on("click", function(e){
439
            $(".get-file").on("click", function(e){
440
                e.preventDefault();
440
                e.preventDefault();
441
                copyToClipboard( $(this).attr("href") );
441
                if( navigator.clipboard ){
442
                    navigator.clipboard.writeText( $(this).attr("href") );
443
                }
442
                $(this).attr("data-original-title", _( "Link copied to the clipboard" ) )
444
                $(this).attr("data-original-title", _( "Link copied to the clipboard" ) )
443
                    .tooltip("show");
445
                    .tooltip("show");
444
            });
446
            });
(-)a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js (-14 lines)
Lines 358-373 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
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
}
374
- 

Return to bug 27594