Update app.js

Added copy function
This commit is contained in:
Arc 2019-12-16 21:48:27 +00:00 committed by GitHub
parent 8d06f2f402
commit f87da0fb44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -248,9 +248,9 @@ function scanQRsend() {
'<br/>Memo: ' +
outmemo +
'</h3>' +
"<h4 style='word-wrap: break-word;'>" +
JSON.stringify(code.data) +
'</h4>' +
"<div class='input-group input-group-sm'><input type='text' id='invoiceinput' class='form-control' value='" +
JSON.stringify(code.data) +
"'><span class='input-group-btn'><button class='btn btn-info btn-flat' type='button' onclick='copyfunc()'>Copy</button></span></div></br/>" +
"<button type='submit' class='btn btn-primary' onclick='sendfunds(" +
JSON.stringify(code.data) +
")'>Send funds</button>" +
@ -266,6 +266,14 @@ function scanQRsend() {
}
}
function copyfunc(){
var copyText = document.getElementById("invoiceinput");
copyText.select();
copyText.setSelectionRange(0, 99999);
document.execCommand("copy");
}
function deletewallet() {
var url = 'deletewallet?wal=' + wallet.id + '&usr=' + user
window.location.href = url