From 5081b240b07f08e21ad124da8bddf0e11471792d Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sat, 4 May 2019 22:09:31 +0200 Subject: Fixed copying of URL in firefox Co-authored-by: LarsVomMars --- src/main/resources/js/files.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/main') diff --git a/src/main/resources/js/files.js b/src/main/resources/js/files.js index 2225aa0..a79cac3 100644 --- a/src/main/resources/js/files.js +++ b/src/main/resources/js/files.js @@ -236,14 +236,8 @@ function setListeners() { request.open("POST", `/share/${path}/${filename}?type=${type}`.clean()); request.onload = () => { if (request.readyState === 4) { - if (request.status === 200) { // TODO: fix clipboard in Firefox - const input = document.createElement('input'); - input.setAttribute('value', request.responseText); - document.body.appendChild(input); - input.select(); - document.execCommand('copy'); - document.body.removeChild(input); - alert(`Copied url to clipboard!\n${request.responseText}`); + if (request.status === 200) { + window.prompt("Copy with Ctrl+C", request.responseText); } else { alert("Something went wrong."); } -- cgit v1.2.3