Skip to content
This repository was archived by the owner on May 16, 2019. It is now read-only.

Commit 194e1cd

Browse files
committed
Code improvements.
- changed to standard themed button with translatable text - changed data to use the values set for the payment buttons
1 parent b100015 commit 194e1cd

File tree

3 files changed

+19
-14
lines changed

3 files changed

+19
-14
lines changed

js/languages/en-US.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,7 @@
686686
"OpenAddress": "Open in Local Wallet",
687687
"CopyAddress": "Copy to Clipboard",
688688
"RefreshPayment": "Refresh Payment Status",
689+
"PayWithAltCoins": "Pay with Altcoins",
689690
"summaryMsg1": "Your payment has been sent to %{recipient}",
690691
"summaryMsg2": "The expected processing time for this order is %{time}",
691692
"summaryMsg3": "You can check the status of your order on your %{purchasesPageLink}",

js/templates/buyWizard.html

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,22 @@ <h3 class="custCol-text padding30"><%= polyglot.t('CheckExchanges') %> </h3>
2323
})
2424
%>
2525
</div>
26-
<div class="txt-center row10 textSize20px custCol-text">
27-
<img class="js-buyWizardShapeshiftURL" src="https://shapeshift.io/images/shifty/xs_dark_altcoins.png" class="ss-button"></a>
28-
</div>
26+
<div class="txt-center row10">
2927
<input type="checkbox" class="textSize11px fieldItem thin" id="BuyWizardQRDetailsInput">
3028
<label for="BuyWizardQRDetailsInput" class="textSize11px custCol-text"> <%= polyglot.t('AdditionalPaymentDataInfo') %></label>
3129
</div>
3230
<a class="btn btn-txt btn-wide row10 js-buyWizardPayCopy custCol-secondary custCol-text"><i class="ion-clipboard"></i> <%= polyglot.t('buyFlow.CopyAddress') %></a>
3331
<a class="btn btn-txt btn-wide row10 js-buyWizardPayLink custCol-secondary custCol-text"><i class="ion-link"></i> <%= polyglot.t('buyFlow.OpenAddress') %></a>
34-
<a class="btn btn-txt btn-wide js-buyWizardPayCheck custCol-secondary custCol-text"><i class="ion-refresh"></i> <%= polyglot.t('buyFlow.RefreshPayment') %></a>
32+
<div class="flexRow pad">
33+
<div class="flexCol-6">
34+
<a class="btn btn-txt btn-wide js-buyWizardPayCheck custCol-secondary custCol-text"><i class="ion-refresh"></i> <%= polyglot.t('buyFlow.RefreshPayment') %></a>
35+
</div>
36+
<div class="flexCol-6">
37+
<a class="btn btn-txt btn-wide js-buyWizardShapeshiftURL custCol-secondary custCol-text ss-button">
38+
<img src="imgs/shapeshift_logo.png" height="18px" width="18px" style="position: relative; top: 4px;"> <%= polyglot.t('buyFlow.PayWithAltCoins') %>
39+
</a>
40+
</div>
41+
</div>
3542
<div class="rowTop10 txt-center note custCol-text">
3643
<%= polyglot.t('buyFlow.paymentNote') %>
3744
</div>

js/views/buyWizardVw.js

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ module.exports = baseModal.extend({
7070
this.model.set('selectedModerator', "");
7171
this.model.updateAttributes();
7272
this.cachePayData = "";
73+
this.totalBTCPrice = 0;
7374
this.partialPaymentAmount = 0;
7475

7576
//create the country select list
@@ -578,18 +579,17 @@ module.exports = baseModal.extend({
578579
throw new Error('Data must be provided to the showPayAddress function');
579580
}
580581

581-
var totalBTCPrice = 0,
582-
storeName = encodeURI(this.model.get('page').profile.name),
582+
var storeName = encodeURI(this.model.get('page').profile.name),
583583
message = encodeURI(this.model.get('vendor_offer').listing.item.title.substring(0, 20) + " "+data.order_id),
584584
payHREF = "",
585585
dataURI;
586586
this.$el.find('.js-buyWizardSpinner').addClass('hide');
587587
this.orderID = data.order_id;
588-
totalBTCPrice = data.amount - this.partialPaymentAmount;
589-
this.$el.find('.js-buyWizardDetailsTotalBTC').text(templateHelpers.intlNumFormat(totalBTCPrice, 8));
588+
this.totalBTCPrice = data.amount - this.partialPaymentAmount;
589+
this.$el.find('.js-buyWizardDetailsTotalBTC').text(templateHelpers.intlNumFormat(this.totalBTCPrice, 8));
590590
this.payURL = data.payment_address;
591591

592-
payHREF = "bitcoin:"+ data.payment_address+"?amount="+totalBTCPrice;
592+
payHREF = "bitcoin:"+ data.payment_address+"?amount="+this.totalBTCPrice;
593593
if (localStorage.getItem('AdditionalPaymentData') != "false") {
594594
payHREF += "&label="+storeName+"&message="+message;
595595
}
@@ -599,15 +599,12 @@ module.exports = baseModal.extend({
599599
dataURI = qr(payHREF, {type: 10, size: 10, level: 'M'});
600600
this.$el.find('.js-buyWizardPayQRCode').attr('src', dataURI);
601601
this.$el.find('.js-buyWizardPayPrice').text();
602-
this.$el.find('.js-buyWizardPayURL').text(data.payment_address);
602+
this.$el.find('.js-buyWizardPayURL').text(this.payURL);
603603
this.$el.find('.js-buyWizardPayLink').attr('href', payHREF);
604-
console.log(electron);
605604
},
606605

607606
openShapeshiftURL: function() {
608-
var totalBTCPrice = this.buyDetailsView.model.attributes.totalBTCDisplayPrice;
609-
var paymentAddress = this.buyRequest.responseJSON.payment_address;
610-
var shapeshiftURL = 'https://shapeshift.io/shifty.html?destination='+paymentAddress+'&amp;output=BTC&apiKey=24ad734e196c948de4608e00472ab8a4b956a298c52abc20fda74114d6cebcb632714a9c5a0f38f46cef0bc974dfd41c34488432128d65acc099b3892f92d602&amount='+totalBTCPrice;
607+
var shapeshiftURL = 'https://shapeshift.io/shifty.html?destination='+this.payURL+'&amp;output=BTC&apiKey=24ad734e196c948de4608e00472ab8a4b956a298c52abc20fda74114d6cebcb632714a9c5a0f38f46cef0bc974dfd41c34488432128d65acc099b3892f92d602&amount='+this.totalBTCPrice;
611608
var shapeshiftWin = new BrowserWindow({width: 700, height: 500, frame: true});
612609
shapeshiftWin.loadURL(shapeshiftURL);
613610
},

0 commit comments

Comments
 (0)