Merge pull request #6 from vbaranov/master

Keys copy button
This commit is contained in:
Victor 2017-08-16 18:17:06 +03:00 committed by GitHub
commit cb9dce8723
6 changed files with 38 additions and 16 deletions

File diff suppressed because one or more lines are too long

View File

@ -261,9 +261,17 @@ function startDapp(web3, isOraclesNetwork) {
$("#copyPayoutPass").attr("data-clipboard-text", keys.payoutKey.password);
$("#copyVotingPass").attr("data-clipboard-text", keys.votingKey.password);
buildCopyPassControl("copyMiningPass");
buildCopyPassControl("copyPayoutPass");
buildCopyPassControl("copyVotingPass");
buildCopyControl("copyMiningPass", "Mining key password copied");
buildCopyControl("copyPayoutPass", "Payout key password copied");
buildCopyControl("copyVotingPass", "Voting key password copied");
$("#copyMiningKey").attr("data-clipboard-text", keys.miningKey.miningKeyObject.address);
$("#copyPayoutKey").attr("data-clipboard-text", keys.payoutKey.payoutKeyObject.address);
$("#copyVotingKey").attr("data-clipboard-text", keys.votingKey.votingKeyObject.address);
buildCopyControl("copyMiningKey", "Mining key copied");
buildCopyControl("copyPayoutKey", "Payout key copied");
buildCopyControl("copyVotingKey", "Voting key copied");
$("#miningKeyDownload").click(function() {
download("mining_key_" + keys.miningKey.miningKeyObject.address, JSON.stringify(keys.miningKey.miningKeyObject));
@ -287,12 +295,12 @@ function startDapp(web3, isOraclesNetwork) {
$(".content").show();
}
function buildCopyPassControl(id) {
function buildCopyControl(id, msg) {
var el = document.getElementById(id);
var clipboard = new Clipboard( el );
clipboard.on( "success", function( event ) {
toastr.success('Password copied');
toastr.success(msg);
});
}
});

File diff suppressed because one or more lines are too long

View File

@ -37,6 +37,11 @@
color: #6d2eae;
line-height: 16px;
font-size: 12px;
display: table-cell;
}
&-hash-container {
display: table;
}
&-description {

View File

@ -79,7 +79,7 @@
</div>
</footer>
<script src="./assets/javascripts/sweetalert2.min.js" type="text/javascript"></script>
<script src="./assets/javascripts/application.js?v=1.33" type="text/javascript"></script>
<script src="./assets/javascripts/application.js?v=1.34" type="text/javascript"></script>
<script src="./assets/javascripts/keythereum.min.js" type="text/javascript"></script>
<script src="./assets/javascripts/toastr.min.js" type="text/javascript"></script>
</body>

View File

@ -2,7 +2,10 @@
<div class="keys">
<div class="keys-i">
<p class="keys-title">Mining key</p>
<p class="keys-hash" id="miningKey"></p>
<div class="keys-hash-container">
<p class="keys-hash" id="miningKey"></p>
<span id="copyMiningKey" class="copy"></span>
</div>
<p class="keys-hash">
<span class="password-label">Password: </span>
<span id="miningKeyPass" class="pass"></span>
@ -19,7 +22,10 @@
</div>
<div class="keys-i">
<p class="keys-title">Payout key</p>
<p class="keys-hash" id="payoutKey"></span></p>
<div class="keys-hash-container">
<p class="keys-hash" id="payoutKey"></p>
<span id="copyPayoutKey" class="copy"></span>
</div>
<p class="keys-hash">
<span class="password-label">Password: </span>
<span id="payoutKeyPass" class="pass"></span>
@ -35,7 +41,10 @@
</div>
<div class="keys-i">
<p class="keys-title">Voting key</p>
<p class="keys-hash" id="votingKey"></span></p>
<div class="keys-hash-container">
<p class="keys-hash" id="votingKey"></p>
<span id="copyVotingKey" class="copy"></span>
</div>
<p class="keys-hash">
<span class="password-label">Password: </span>
<span id="votingKeyPass" class="pass"></span>