' + (claimClass == 'success' ? 'This address will now be referred to as ' + (removedClaim ? $('input#address').val() : displayAsText($('#message').val())) + ' throughout the website' : warnMsg) + '.
');
+ $('#claimAlert').html(generateAlertHTML(claimClass, true, (claimClass == 'success' ? (removedClaim ? 'Address claim removed successfully' : 'Address claimed successfully') : (claimClass == 'danger' ? 'Failed to claim address' : 'Required field missing')), (claimClass == 'success' ? '' + $('input#address').val() + ' will now be referred to as ' + (removedClaim ? $('input#address').val() : displayAsText($('#message').val())) + ' throughout the website' : warnMsg) + '.'));
+ fixFooterHeightAndPosition();
}
-
+ $('#claimInstructions').on('show.bs.collapse', function () {
+ $('#showClaimInstructions').html('Hide claim instructions');
+ }).on('hide.bs.collapse', function () {
+ $('#showClaimInstructions').html('Show claim instructions');
+ }).on('shown.bs.collapse', function () {
+ fixFooterHeightAndPosition();
+ }).on('hidden.bs.collapse', function () {
+ fixFooterHeightAndPosition();
+ });
$('#claimForm').on('submit', function (e) {
e.preventDefault();
var address = $('input#address').val();
var message = $('input#message').val();
var signature = $('input#signature').val();
- var url = '/address/'+address+'/claim';
+ var url = '/claim';
- if (signature == null || signature.trim().length == 0) {
+ if (address == null || address.trim().length == 0) {
+ showClaimAlert('warning', 'Please enter the wallet address you wish to claim', false);
+ $('input#address').focus();
+ } else if (signature == null || signature.trim().length == 0) {
showClaimAlert('warning', 'Please enter the signature value from your wallet software', false);
- $('input#signature').focus();
+ $('input#signature').focus();
} else {
$.ajax({
type: 'post',
@@ -37,85 +59,35 @@ block content
});
}
});
+ if ('!{hash}' != 'null' && '!{hash}' != '') {
+ $('').insertBefore('#claimForm');
+ $('#claimAlert').html(generateAlertHTML('info', true, ('!{claim_name}' == '' ? 'Unc' : 'C') + 'laimed address', '!{hash} is currently ' + ('!{claim_name}' == '' ? 'un' : '') + 'claimed' + ('!{claim_name}' == '' ? '' : ' as ' + displayAsText('!{claim_name}') + '.')));
+ }
});
- - var balance = Number((address.received - address.sent) / 100000000).toLocaleString('en',{'minimumFractionDigits':2,'maximumFractionDigits':8,'useGrouping':true});
- - var balanceParts = balance.split('.');
- - var sent = Number(address.sent /100000000).toLocaleString('en',{'minimumFractionDigits':2,'maximumFractionDigits':8,'useGrouping':true});
- - var sentParts = sent.split('.');
- - var received = Number(address.received / 100000000).toLocaleString('en',{'minimumFractionDigits':2,'maximumFractionDigits':8,'useGrouping':true});
- - var receivedParts = received.split('.');
- if address.a_id !== 'coinbase' || settings.show_sent_received == true
- script.
- $(document).ready(function() {
- $('.summary-table').dataTable({
- info: false,
- paging: false,
- searching: false,
- ordering: false,
- responsive: true,
- scrollX: true,
- fnDrawCallback: function(settings) {
- fixDataTableColumns();
- }
- })
- });
- .col-xs-12.col-md-12.cardSpacer
- if address.a_id !== 'coinbase' || settings.show_sent_received == true
- .card.card-default.border-0.card-address-summary.cardSpacer
- .card-header(style='position:relative;')
- if typeof address.name == null || address.name == ''
- strong #{address.a_id}
- else
- strong #{address.name}
- include ./includes/rl_labels.pug
- table.table.table-bordered.table-striped.summary-table.mobile-border-right(style='border-top:0;margin-top:0 !important;')
- - var theadClasses = [];
- if settings.display.table_header_bgcolor != null && settings.display.table_header_bgcolor != ''
- - theadClasses.push('thead-' + settings.display.table_header_bgcolor);
- thead(class=theadClasses)
- tr
- if address.a_id !== 'coinbase'
- th.text-center #{settings.locale.rl_balance}
- span.small (#{settings.symbol})
- if settings.show_sent_received == true
- th.text-center #{settings.locale.total_sent}
- span.small (#{settings.symbol})
- if address.a_id !== 'coinbase' && settings.show_sent_received == true
- th.text-center #{settings.locale.total_received}
- span.small (#{settings.symbol})
- if address.a_id !== 'coinbase'
- th.text-center #{settings.locale.a_qr}
- tbody
- tr
- if address.a_id !== 'coinbase'
- td.text-center.addr-summary #{balanceParts[0]}.
- span.decimal #{balanceParts[1]}
- if settings.show_sent_received == true
- td.text-center.addr-summary #{sentParts[0]}.
- span.decimal #{sentParts[1]}
- if address.a_id !== 'coinbase' && settings.show_sent_received == true
- td.text-center.addr-summary #{receivedParts[0]}.
- span.decimal #{receivedParts[1]}
- if address.a_id !== 'coinbase'
- td.text-center.addr-summary
- img.qrcode(src='/qr/' + address.a_id)
+ .col-xs-12.col-md-12
.card.card-default.border-0.cardSpacer
.card-header
- strong Claim this Address
+ strong Claim Wallet Address
.card-body
- div.alert.alert-primary
+ a#showClaimInstructions.badge.badge-info(href='#claimInstructions', style='font-size:100%;margin-bottom:15px;', data-toggle='collapse' role='button' aria-expanded='false' aria-controls='claimInstructions')
+ i.fas.fa-angle-up(style='margin-right:5px;')
+ span Show claim instructions
+ div#claimInstructions.alert.alert-primary.collapse
div
- span You can use the
+ span Use the
span.font-weight-bold Sign Message
span feature from your
span.font-weight-bold #{settings.coin}
- span wallet to verify ownership of this address.
+ span wallet to verify ownership of a wallet address that belongs to you.
br
div Enter the following data into the wallet software:
br
div
span.font-weight-bold Address:
- span #{address.a_id}
+ if hash == null || hash == ''
+ span=' '
+ else
+ span #{hash}
div
span.font-weight-bold Message:
span=' '
@@ -125,11 +97,11 @@ block content
span.font-weight-bold Sign Message
span button in the wallet, and copy/paste the resulting
span.font-weight-bold Signature
- span in the form below.
+ span at the bottom of this form.
br
div
span Finally, click the
- span.font-weight-bold Submit
+ span.font-weight-bold Claim
span button below to claim your address, which will display your custom display name instead of the default wallet address on this site.
br
div
@@ -139,7 +111,10 @@ block content
.form-group
fieldset.entryField
label(for='address') Wallet Address
- input#address.form-control(type='text' value=address.a_id readonly="")
+ if hash == null || hash == ''
+ input#address.form-control(type='text', maxlength='70')
+ else
+ input#address.form-control(type='text', value=hash, readonly='readonly', maxlength='70')
.form-group
fieldset.entryField
label(for='message') Display Name
@@ -148,4 +123,4 @@ block content
fieldset.entryField
label(for='signature') Signature
input#signature.form-control(type='text', placeholder='Signature', maxlength='100')
- button.btn.btn-primary(type='submit') Submit
\ No newline at end of file
+ button.btn.btn-success(type='submit') Claim
\ No newline at end of file
diff --git a/views/layout.pug b/views/layout.pug
index 316c5ef..68dfa39 100644
--- a/views/layout.pug
+++ b/views/layout.pug
@@ -345,6 +345,11 @@ html(lang='en')
a.nav-link(href='/info')
span.fa.fa-info-circle
span.margin-left-5 #{settings.locale.menu_api}
+ if settings.display.claim_address_header_menu == true && settings.display.claim_address == true
+ li#claim-address
+ a.nav-link.loading(href='/claim')
+ span.far.fa-address-card
+ span.margin-left-5 #{settings.locale.menu_claim_address}
div#body-container(style='margin-top:' + (settings.sticky_header == true ? '80px;' : '20px'))
if showSync != null && showSync == true
.col-lg-12