+ added toast messages

+ transaction sent message
+ copy address to clipboard
This commit is contained in:
Taegus
2018-12-16 20:05:53 +01:00
parent ef8a261d4b
commit c66da997cd
8 changed files with 45 additions and 2 deletions

6
assets/scripts/iziToast.min.js vendored Normal file

File diff suppressed because one or more lines are too long

6
assets/styles/iziToast.min.css vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -315,3 +315,7 @@ div.noWalletsWrapper {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.btnCopyWalletAddress {
margin-right: 10px;
}

View File

@@ -18,7 +18,7 @@
<tr> <tr>
<th scope="row" class="colEdit"><button type="button" class="btn btn-etho btnChangWalletName" data-wallet="{{address}}" data-name="{{name}}">Edit</button></th> <th scope="row" class="colEdit"><button type="button" class="btn btn-etho btnChangWalletName" data-wallet="{{address}}" data-name="{{name}}">Edit</button></th>
<td>{{name}}</td> <td>{{name}}</td>
<td>{{address}}</td> <td><button type="button" class="btn btn-etho btnCopyWalletAddress" data-wallet="{{address}}"><i class="far fa-copy"></i></button><span class="textAddress">{{address}}</span></td>
<td>{{balance}}</td> <td>{{balance}}</td>
</tr> </tr>
{{/addressData}} {{/addressData}}

View File

@@ -6,6 +6,7 @@
<link rel="stylesheet" href="./assets/styles/materialize.min.css"> <link rel="stylesheet" href="./assets/styles/materialize.min.css">
<link rel="stylesheet" href="./assets/styles/datatables.min.css"> <link rel="stylesheet" href="./assets/styles/datatables.min.css">
<link rel="stylesheet" href="./assets/styles/iziModal.min.css"> <link rel="stylesheet" href="./assets/styles/iziModal.min.css">
<link rel="stylesheet" href="./assets/styles/iziToast.min.css">
<link rel="stylesheet" href="./assets/styles/transactions.css"> <link rel="stylesheet" href="./assets/styles/transactions.css">
<link rel="stylesheet" href="./assets/styles/please-wait.css"> <link rel="stylesheet" href="./assets/styles/please-wait.css">
<link rel="stylesheet" href="./assets/styles/all.min.css"> <link rel="stylesheet" href="./assets/styles/all.min.css">
@@ -23,6 +24,7 @@
<script src="./assets/scripts/materialize.min.js"></script> <script src="./assets/scripts/materialize.min.js"></script>
<script src="./assets/scripts/datatables.min.js"></script> <script src="./assets/scripts/datatables.min.js"></script>
<script src="./assets/scripts/iziModal.min.js"></script> <script src="./assets/scripts/iziModal.min.js"></script>
<script src="./assets/scripts/iziToast.min.js"></script>
<script src="./assets/scripts/progressbar.min.js"></script> <script src="./assets/scripts/progressbar.min.js"></script>
<script src="./assets/scripts/sprintf.min.js"></script> <script src="./assets/scripts/sprintf.min.js"></script>
<script src="./assets/scripts/please-wait.js "></script> <script src="./assets/scripts/please-wait.js "></script>

View File

@@ -49,6 +49,14 @@ class MainGUI {
$("#mainContent").empty(); $("#mainContent").empty();
$("#mainContent").html(template(data)); $("#mainContent").html(template(data));
} }
copyToClipboard(text) {
var $temp = $("<input>");
$("body").append($temp);
$temp.val(text).select();
document.execCommand("copy");
$temp.remove();
}
} }
$("#mainNavBtnTransactions").click(function() { $("#mainNavBtnTransactions").click(function() {

View File

@@ -148,7 +148,13 @@ $(document).on("render_send", function() {
}, },
function(data) { function(data) {
EthoSend.resetSendForm(); EthoSend.resetSendForm();
// use the transaction hash
iziToast.success({
title: 'Sent',
message: 'Transaction was succesfully sent to the chain',
position: 'topRight',
timeout: 5000
});
} }
); );
} }

View File

@@ -141,6 +141,17 @@ $(document).on("render_wallets", function() {
} }
}); });
}); });
$(".btnCopyWalletAddress").off('click').on('click', function() {
EthoMainGUI.copyToClipboard($(this).attr('data-wallet'));
iziToast.success({
title: 'Copied',
message: 'Address was copied to clipboard',
position: 'topRight',
timeout: 2000
});
});
}); });
// event that tells us that geth is ready and up // event that tells us that geth is ready and up