Add copy button for generated address / private key

This commit is contained in:
Ayanami 2022-05-23 03:54:54 +09:00
parent cda4559cfd
commit 06de7d3b9a
No known key found for this signature in database
GPG Key ID: 0CABDF03077D92E4
2 changed files with 8 additions and 0 deletions

View File

@ -312,6 +312,7 @@
<input id="newBitcoinAddress" type="text" class="form-control address" value="" readonly>
<span class="input-group-btn">
<button class="qrcodeBtn btn btn-default" type="button" data-toggle="modal" data-target="#modalQrcode"><span class="glyphicon glyphicon-qrcode"></span></button>
<button class="copyKey btn btn-default" type="button"><span class="glyphicon glyphicon-copy"></span></button>
</span>
</div>
@ -322,6 +323,7 @@
<input id="newPrivKey" type="password" class="form-control" value="" readonly>
<span class="input-group-btn">
<button class="showKey btn btn-default" type="button">Show</button>
<button class="copyKey btn btn-default" type="button"><span class="glyphicon glyphicon-copy"></span></button>
</span>
</div>
@ -384,6 +386,7 @@
<input id="newSegWitAddress" type="text" class="form-control address" value="" readonly>
<span class="input-group-btn">
<button class="qrcodeBtn btn btn-default" type="button" data-toggle="modal" data-target="#modalQrcode"><span class="glyphicon glyphicon-qrcode"></span></button>
<button class="copyKey btn btn-default" type="button"><span class="glyphicon glyphicon-copy"></span></button>
</span>
</div>
@ -398,6 +401,7 @@
<input id="newSegWitPrivKey" type="password" class="form-control" value="" readonly>
<span class="input-group-btn">
<button class="showKey btn btn-default" type="button">Show</button>
<button class="copyKey btn btn-default" type="button"><span class="glyphicon glyphicon-copy"></span></button>
</span>
</div>

View File

@ -1799,6 +1799,10 @@ $(document).ready(function() {
$("input[type='password']",$(this).parent().parent()).attr('type','text');
});
$(".copyKey").click(function(){
navigator.clipboard.writeText($("input",$(this).parent().parent()).val());
});
$("#homeBtn").click(function(e){
e.preventDefault();
history.pushState(null, null, '#home');