added copy url button closes #112

This commit is contained in:
Christian Haschek
2022-03-08 22:23:57 +01:00
parent ef1a1ecaff
commit 6f540ad27e
3 changed files with 9 additions and 6 deletions

View File

@@ -14,7 +14,7 @@ $(function() {
{
var o = JSON.parse(response);
if(o.status=='ok')
$("#uploadinfo").append("<div class='alert alert-success' role='alert'><strong>"+file.name+"</strong> uploaded as <a target='_blank' href='/"+o.hash+"'>"+o.hash+"</a><br/>URL: <a target='_blank' href='"+o.url+"'>"+o.url+"</a></div>")
$("#uploadinfo").append("<div class='alert alert-success' role='alert'><strong>"+file.name+"</strong> uploaded as <a target='_blank' href='/"+o.hash+"'>"+o.hash+"</a><br/>URL: <a target='_blank' href='"+o.url+"'>"+o.url+"</a> <button class='btn btn-xs' onClick='navigator.clipboard.writeText(\""+o.url+"\");'>Copy URL</button></div>")
else if(o.status=='err')
$("#uploadinfo").append("<div class='alert alert-danger' role='alert'><strong>Error uploading "+file.name+"</strong><br/>Reason: "+o.reason+"</div>")
console.log(o)