aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarvin Borner2019-05-04 22:09:31 +0200
committerMarvin Borner2019-05-04 22:09:31 +0200
commit5081b240b07f08e21ad124da8bddf0e11471792d (patch)
tree2d41a29261c026f64fc2cf82ce19c0bb642a2f4e
parente5cf2266d703e84873c008604874d88954c2bb2a (diff)
Fixed copying of URL in firefox
Co-authored-by: LarsVomMars <lars@kroenner.eu>
-rw-r--r--src/main/resources/js/files.js10
1 files changed, 2 insertions, 8 deletions
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.");
}