Add copy button for generated / signed transaction

This commit is contained in:
Ayanami 2022-05-24 14:33:39 +09:00
parent 06de7d3b9a
commit a8be1f4fb9
No known key found for this signature in database
GPG Key ID: 0CABDF03077D92E4
2 changed files with 13 additions and 3 deletions

View File

@ -780,11 +780,12 @@
<div id="transactionCreate" class="alert alert-success hidden">
<label>Transaction</label>
<button class="copyGenerated btn btn-default" type="button" style="float:right;"><span class="glyphicon glyphicon-copy"></span></button>
<button class="qrcodeBtn btn btn-default" type="button" data-toggle="modal" data-target="#modalQrcode" style="float:right;"><span class="glyphicon glyphicon-qrcode"></span></button>
<p>The transaction below has been generated and encoded. It can be broadcasted once it has been signed.</p>
<br>
<textarea class="form-control" style="height:150px" readonly></textarea>
<textarea class="form-control" style="height:150px" id="generated-transaction" readonly></textarea>
<p class="text-muted">Size: <span class="txSize">0</span> <i>bytes</i></p>
</div>
@ -1327,11 +1328,12 @@
<div class="alert alert-success hidden" id="signedData">
<label>Signed transaction</label>
<button class="copySigned btn btn-default" type="button" style="float:right;"><span class="glyphicon glyphicon-copy"></span></button>
<button class="qrcodeBtn btn btn-default" type="button" data-toggle="modal" data-target="#modalQrcode" style="float:right;"><span class="glyphicon glyphicon-qrcode"></span></button>
<p>The above transaction has been signed:</p>
<textarea class="form-control script" style="height:160px" readonly></textarea>
<textarea class="form-control script" style="height:160px" id="signed-transaction" readonly></textarea>
<p class="text-muted">Size: <span class="txSize">0</span> <i>bytes</i></p>
</div>

View File

@ -1803,6 +1803,14 @@ $(document).ready(function() {
navigator.clipboard.writeText($("input",$(this).parent().parent()).val());
});
$(".copyGenerated").click(function(){
navigator.clipboard.writeText($("#generated-transaction").val());
});
$(".copySigned").click(function(){
navigator.clipboard.writeText($("#signed-transaction").val());
});
$("#homeBtn").click(function(e){
e.preventDefault();
history.pushState(null, null, '#home');