* address list addresses always in uppercase
+ copy address list address to clipboard + show address names under the addresses in the send screen
This commit is contained in:
@@ -391,3 +391,8 @@ div.noAddressWrapper {
|
|||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#sendFromAddressName,
|
||||||
|
#sendToAddressName {
|
||||||
|
font-size: 95%;
|
||||||
|
}
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
{{#addressData}}
|
{{#addressData}}
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row" class="colEdit"><button type="button" class="btn btn-etho btnSelectToAddress" data-wallet="{{address}}">Select</button></th>
|
<th scope="row" class="colEdit"><button type="button" class="btn btn-etho btnSelectToAddress" data-wallet="{{address}}" data-name="{{name}}"">Select</button></th>
|
||||||
<td>{{name}}</td>
|
<td>{{name}}</td>
|
||||||
<td><span class="textAddress">{{address}}</span></td>
|
<td><span class="textAddress">{{address}}</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -10,12 +10,16 @@
|
|||||||
{{/addressData}}
|
{{/addressData}}
|
||||||
</select>
|
</select>
|
||||||
<label for="sendFromAddress">From address:</label>
|
<label for="sendFromAddress">From address:</label>
|
||||||
|
<small id="sendFromAddressName" class="form-text text-muted"></small>
|
||||||
</div>
|
</div>
|
||||||
<div class="input-field col s6 addressInputWrapper">
|
<div class="input-field col s6">
|
||||||
<input id="sendToAddress" placeholder="recipient address" type="text">
|
|
||||||
<label for="sendToAddress" class="active">To address:</label>
|
<label for="sendToAddress" class="active">To address:</label>
|
||||||
<button type="button" class="btn btn-etho btnSendToolButton" id="btnAddToAddressBook"><i class="fas fa-plus"></i></button>
|
<div class="addressInputWrapper">
|
||||||
<button type="button" class="btn btn-etho btnSendToolButton" id="btnLookForToAddress"><i class="fas fa-search"></i></button>
|
<input id="sendToAddress" placeholder="recipient address" type="text">
|
||||||
|
<button type="button" class="btn btn-etho btnSendToolButton" id="btnAddToAddressBook"><i class="fas fa-plus"></i></button>
|
||||||
|
<button type="button" class="btn btn-etho btnSendToolButton" id="btnLookForToAddress"><i class="fas fa-search"></i></button>
|
||||||
|
</div>
|
||||||
|
<small id="sendToAddressName" class="form-text text-muted"></small>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|||||||
@@ -8,14 +8,14 @@ class AddressBook {
|
|||||||
var addressBook = EthoDatatabse.getAddresses();
|
var addressBook = EthoDatatabse.getAddresses();
|
||||||
|
|
||||||
// set the wallet name from the dialog box
|
// set the wallet name from the dialog box
|
||||||
addressBook.names[address] = name;
|
addressBook.names[address.toUpperCase()] = name;
|
||||||
EthoDatatabse.setAddresses(addressBook);
|
EthoDatatabse.setAddresses(addressBook);
|
||||||
}
|
}
|
||||||
|
|
||||||
getAddressName(address) {
|
getAddressName(address) {
|
||||||
var addressBook = EthoDatatabse.getAddresses();
|
var addressBook = EthoDatatabse.getAddresses();
|
||||||
// set the wallet name from the dialog box
|
// set the wallet name from the dialog box
|
||||||
return addressBook.names[address] || "";
|
return addressBook.names[address.toUpperCase()] || "";
|
||||||
}
|
}
|
||||||
|
|
||||||
getAddressList() {
|
getAddressList() {
|
||||||
@@ -131,6 +131,17 @@ $(document).on("render_addressBook", function() {
|
|||||||
EthoAddressBook.renderAddressBook();
|
EthoAddressBook.renderAddressBook();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$(".textAddress").off('click').on('click', function() {
|
||||||
|
EthoMainGUI.copyToClipboard($(this).html());
|
||||||
|
|
||||||
|
iziToast.success({
|
||||||
|
title: 'Copied',
|
||||||
|
message: 'Address was copied to clipboard',
|
||||||
|
position: 'topRight',
|
||||||
|
timeout: 2000
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
EthoAddressBook = new AddressBook();
|
EthoAddressBook = new AddressBook();
|
||||||
@@ -52,6 +52,7 @@ class SendTransaction {
|
|||||||
|
|
||||||
resetSendForm() {
|
resetSendForm() {
|
||||||
if (EthoMainGUI.getAppState() == "send") {
|
if (EthoMainGUI.getAppState() == "send") {
|
||||||
|
$("#sendToAddressName").html("");
|
||||||
$("#sendToAddress").val("");
|
$("#sendToAddress").val("");
|
||||||
$("#sendAmmount").val(0);
|
$("#sendAmmount").val(0);
|
||||||
}
|
}
|
||||||
@@ -72,6 +73,26 @@ $(document).on("render_send", function() {
|
|||||||
$("#sendAmmount").val($("#sendMaxAmmount").html());
|
$("#sendAmmount").val($("#sendMaxAmmount").html());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("#sendToAddress").off('input').on('input', function() {
|
||||||
|
var addressName = null;
|
||||||
|
$("#sendToAddressName").html("");
|
||||||
|
addressName = EthoAddressBook.getAddressName($("#sendToAddress").val());
|
||||||
|
|
||||||
|
if (!addressName) {
|
||||||
|
var wallets = EthoDatatabse.getWallets();
|
||||||
|
addressName = wallets.names[$("#sendToAddress").val()];
|
||||||
|
}
|
||||||
|
$("#sendToAddressName").html(addressName);
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#sendFromAddress").off('change').on('change', function() {
|
||||||
|
var optionText = $(this).find("option:selected").text();
|
||||||
|
var addrName = optionText.substr(0, optionText.indexOf('-'));
|
||||||
|
var addrValue = optionText.substr(optionText.indexOf("-") + 1);
|
||||||
|
$(".fromAddressSelect input").val(addrValue.trim());
|
||||||
|
$("#sendFromAddressName").html(addrName.trim());
|
||||||
|
});
|
||||||
|
|
||||||
$("#btnLookForToAddress").off('click').on('click', function() {
|
$("#btnLookForToAddress").off('click').on('click', function() {
|
||||||
EthoBlockchain.getAddressListData(
|
EthoBlockchain.getAddressListData(
|
||||||
function(error) {
|
function(error) {
|
||||||
@@ -94,6 +115,7 @@ $(document).on("render_send", function() {
|
|||||||
$('#dlgAddressList').iziModal('open');
|
$('#dlgAddressList').iziModal('open');
|
||||||
|
|
||||||
$(".btnSelectToAddress").off('click').on('click', function() {
|
$(".btnSelectToAddress").off('click').on('click', function() {
|
||||||
|
$("#sendToAddressName").html($(this).attr('data-name'));
|
||||||
$("#sendToAddress").val($(this).attr('data-wallet'));
|
$("#sendToAddress").val($(this).attr('data-wallet'));
|
||||||
$('#dlgAddressList').iziModal('close');
|
$('#dlgAddressList').iziModal('close');
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user