/file.html |
@@ -89,6 +89,12 @@ |
<button id="btn-mailto" class="btn btn-default" type="button"><i class="glyphicon glyphicon-envelope"></i></button> |
</span> |
</div> |
<div class="input-group"> |
<input id="deleteURL" type="text" class="form-control" readonly> |
<span class="input-group-btn"> |
<button id="btn-clipboard-delete" class="btn btn-default" type="button"><i class="glyphicon glyphicon-paperclip"></i></button> |
</span> |
</div> |
<strong class="error text-danger" data-dz-errormessage></strong> |
</div> |
<div> |
@@ -193,7 +199,7 @@ |
.style |
.opacity = "0"; |
}).on("success", (file, data) => { |
|
// Set the ID of the URL box. |
const boxURLID = '_' + Math |
.random() |
.toString(36) |
@@ -201,14 +207,38 @@ |
file |
.previewElement |
.querySelector("#URL") |
.value = data; |
.value = location.protocol |
.concat("//") |
.concat(window.location.hostname) |
.concat("/") |
.concat(data); |
|
file |
.previewElement |
.querySelector("#URL") |
.setAttribute('id', boxURLID) |
|
// Clipboard button. |
|
// Set the ID of the delete URL box. |
const deleteBoxURLID = '_' + Math |
.random() |
.toString(36) |
.substr(2, 9); |
file |
.previewElement |
.querySelector("#deleteURL") |
.value = location.protocol.concat("//") |
.concat(window.location.hostname) |
.concat("/") |
.concat("delete") |
.concat("/") |
.concat(data); |
|
file |
.previewElement |
.querySelector("#deleteURL") |
.setAttribute('id', deleteBoxURLID) |
|
// Set the ID of the URL clipboard button. |
const clipButtonID = '_' + Math |
.random() |
.toString(36) |
@@ -222,8 +252,27 @@ |
.previewElement |
.querySelector("#btn-clipboard") |
.setAttribute('id', clipButtonID); |
|
new Clipboard('#' + clipButtonID); |
|
// Mailto button. |
// Set the ID of the delete URL clipboard button. |
const clipButtonDeleteID = '_' + Math |
.random() |
.toString(36) |
.substr(2, 9); |
file |
.previewElement |
.querySelector("#btn-clipboard-delete") |
.setAttribute('data-clipboard-target', '#' + deleteBoxURLID) |
|
file |
.previewElement |
.querySelector("#btn-clipboard-delete") |
.setAttribute('id', clipButtonDeleteID); |
|
new Clipboard('#' + clipButtonDeleteID); |
|
// Set the ID of the mailto button. |
const mailToButtonID = '_' + Math |
.random() |
.toString(36) |
@@ -242,8 +291,6 @@ |
.previewElement |
.querySelector(".cancel") |
.setAttribute("disabled", "disabled"); |
|
new Clipboard('#' + clipButtonID); |
|
$('#' + mailToButtonID).on('click', () => { |
window.location.href = "mailto:user@domain.tld?subject="+ |