On DOM Mutation, load clipboard buttons
This commit is contained in:
parent
c3ca8643ec
commit
e4775417fc
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "flosight-ui",
|
||||
"description": "An open-source frontend for the Flosight API. The Flosight API provides you with a convenient, powerful and simple way to query and broadcast data on the florincoin network and build your own services with it.",
|
||||
"version": "5.0.0-beta.68",
|
||||
"version": "5.0.0-beta.69",
|
||||
"repository": "git://github.com/bitpay/flosight-ui.git",
|
||||
"bugs": {
|
||||
"url": "https://github.com/bitpay/flosight-ui/issues"
|
||||
|
||||
@ -71,5 +71,23 @@
|
||||
<script src="js/angularjs-all.min.js"></script>
|
||||
<script src="js/clipboard.min.js"></script>
|
||||
<script src="js/main.min.js"></script>
|
||||
<script>
|
||||
var observer = new MutationObserver(function(mutations, observer) {
|
||||
console.log("DOM Mutated");
|
||||
var btns = document.querySelectorAll('.btn-copy');
|
||||
var clipboard = new ClipboardJS(btns);
|
||||
clipboard.on('success', function(e) {
|
||||
console.log(e);
|
||||
});
|
||||
clipboard.on('error', function(e) {
|
||||
console.log(e);
|
||||
});
|
||||
});
|
||||
|
||||
observer.observe(document, {
|
||||
subtree: true,
|
||||
attributes: true
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
<div class="container" data-ng-if="!hideSNavbar">
|
||||
<div class="col-md-8 text-left">
|
||||
<h3 translate>Address</h3> {{address.addrStr}}
|
||||
<button class="btn-copy" data-clipboard-text="address.addrStr"></button>
|
||||
<button class="btn-copy" data-clipboard-text="{{address.addrStr}}"></button>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<span class="txvalues txvalues-primary"><strong translate>Final Balance</strong> {{$root.currency.getConvertion(address.balance) || address.balance + ' BTC' }}</span>
|
||||
@ -25,7 +25,7 @@
|
||||
<div class="well well-sm ellipsis">
|
||||
<strong translate>Address</strong>
|
||||
<span class="text-muted">{{address.addrStr}}</span>
|
||||
<button class="btn-copy" data-clipboard-text="address.addrStr"></button>
|
||||
<button class="btn-copy" data-clipboard-text="{{address.addrStr}}"></button>
|
||||
</div>
|
||||
<h2 translate>Summary <small>confirmed</small></h2>
|
||||
<div class="row" data-ng-hide="!address.addrStr">
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
<strong>Hash</strong> {{block.hash}}
|
||||
</p>
|
||||
<div class="col-md-1 text-left">
|
||||
<button class="btn-copy" data-clipboard-text="block.hash"></button>
|
||||
<button class="btn-copy" data-clipboard-text="{{block.hash}}"></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -39,7 +39,7 @@
|
||||
<div class="well well-sm ellipsis">
|
||||
<strong>BlockHash</strong>
|
||||
<span class="txid text-muted">{{block.hash}}</span>
|
||||
<button class="btn-copy" data-clipboard-text="block.hash"></button>
|
||||
<button class="btn-copy" data-clipboard-text="{{block.hash}}"></button>
|
||||
</div>
|
||||
<h2 translate>Summary</h2>
|
||||
<div class="row">
|
||||
@ -75,7 +75,7 @@
|
||||
<td><strong>Merkle Root</strong></td>
|
||||
<td class="text-right text-muted">
|
||||
<div class="ellipsis">
|
||||
<button class="btn-copy" data-clipboard-text="block.merkleroot"></button>
|
||||
<button class="btn-copy" data-clipboard-text="{{block.merkleroot}}"></button>
|
||||
<span>{{block.merkleroot}}</span>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
<h3 translate>Transaction</h3>
|
||||
<div class="ellipsis">
|
||||
<small>{{tx.txid}}</small>
|
||||
<button class="btn-copy" data-clipboard-text="tx.txid"></button>
|
||||
<button class="btn-copy" data-clipboard-text="{{tx.txid}}"></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 col-lg-5 text-right">
|
||||
@ -43,7 +43,7 @@
|
||||
<div class="well well-sm ellipsis">
|
||||
<strong translate>Transaction</strong>
|
||||
<span class="txid text-muted">{{tx.txid}}</span>
|
||||
<button class="btn-copy" data-clipboard-text="tx.txid"></button>
|
||||
<button class="btn-copy" data-clipboard-text="{{tx.txid}}"></button>
|
||||
</div>
|
||||
<h2 translate>Summary</h2>
|
||||
<table class="table" style="table-layout: fixed">
|
||||
@ -82,7 +82,7 @@
|
||||
<td><strong>Coinbase</strong></td>
|
||||
<td class="text-muted text-right">
|
||||
<div class="ellipsis">
|
||||
<button class="btn-copy ng-isolate-scope" data-clipboard-text="tx.vin[0].coinbase"></button>
|
||||
<button class="btn-copy ng-isolate-scope" data-clipboard-text="{{tx.vin[0].coinbase}}"></button>
|
||||
<span class="ng-binding">{{tx.vin[0].coinbase}}</span>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
<span class="glyphicon glyphicon-plus-sign" data-ng-class="{'glyphicon-minus-sign': itemsExpanded}"></span>
|
||||
</a>
|
||||
<a href="tx/{{tx.txid}}">{{tx.txid}}</a>
|
||||
<button class="btn-copy" data-clipboard-text="tx.txid"></button>
|
||||
<button class="btn-copy" data-clipboard-text="{{tx.txid}}"></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-5 col-md-4 text-right text-muted">
|
||||
@ -95,7 +95,7 @@
|
||||
<p><strong>scriptSig</strong></p>
|
||||
<div data-ng-repeat="item in vin.scriptSig.asm | split:' '" class="">
|
||||
<p class="col-md-11 ellipsis text-muted">{{item}}</p>
|
||||
<button class="btn-copy" data-clipboard-text="item"></button>
|
||||
<button class="btn-copy" data-clipboard-text="{{item}}"></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -175,7 +175,7 @@
|
||||
<div class="small">
|
||||
<p><strong>scriptPubKey</strong></p>
|
||||
<span class="col-md-11 text-muted ellipsis">{{vout.scriptPubKey.asm}}</span>
|
||||
<button class="btn-copy col-md-1" data-clipboard-text="vout.scriptPubKey.asm"></button>
|
||||
<button class="btn-copy col-md-1" data-clipboard-text="{{vout.scriptPubKey.asm}}"></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -194,7 +194,7 @@
|
||||
|
||||
<div class="well well-sm bgwhite ellipsis" data-ng-if="itemsExpanded && !block.hash && tx.blockhash">
|
||||
<strong translate>Included in Block</strong> <a class="text-muted" href="block/{{tx.blockhash}}">{{tx.blockhash}}</a>
|
||||
<button class="btn-copy" data-clipboard-text="tx.blockhash"></button>
|
||||
<button class="btn-copy" data-clipboard-text="{{tx.blockhash}}"></button>
|
||||
</div>
|
||||
|
||||
<div class="line-top row" data-ng-hide="!tx">
|
||||
@ -214,7 +214,7 @@
|
||||
<div class="well well-sm" style="margin: 0px 10px">
|
||||
<strong>floData: </strong>
|
||||
<span class="text-muted ng-binding" style="word-break: break-all">{{tx.floData}}</span>
|
||||
<button class="btn-copy" data-clipboard-text="tx.floData"></button>
|
||||
<button class="btn-copy" data-clipboard-text="{{tx.floData}}"></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user