Merge pull request #2529 from cmgustavo/bug/uri-payment-01
Fix URI-payment for mobile
This commit is contained in:
commit
3007ef5d91
5 changed files with 14 additions and 6 deletions
|
|
@ -81,7 +81,7 @@ if [ ! -d $PROJECT ]; then
|
||||||
|
|
||||||
echo "${OpenColor}${Green}* Installing plugins... ${CloseColor}"
|
echo "${OpenColor}${Green}* Installing plugins... ${CloseColor}"
|
||||||
|
|
||||||
cordova plugin add https://github.com/Initsogar/cordova-webintent.git
|
cordova plugin add https://github.com/florentvaldelievre/virtualartifacts-webIntent.git
|
||||||
checkOK
|
checkOK
|
||||||
|
|
||||||
cordova plugin add https://github.com/wildabeast/BarcodeScanner.git
|
cordova plugin add https://github.com/wildabeast/BarcodeScanner.git
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,21 @@
|
||||||
<div class="row m20t" ng-controller="paymentUriController as payment">
|
<div class="row m20t payment-uri" ng-controller="paymentUriController as payment">
|
||||||
<div class="large-12 columns" ng-init="uri = payment.checkBitcoinUri()">
|
<div class="large-12 columns" ng-init="uri = payment.checkBitcoinUri()">
|
||||||
<div class="panel text-center" ng-show="!uri">
|
<div class="panel text-center" ng-show="!uri">
|
||||||
<h1 translate>Bitcoin URI is NOT valid!</h1>
|
<h1 translate>Bitcoin URI is NOT valid!</h1>
|
||||||
</div>
|
</div>
|
||||||
<div ng-show="uri">
|
<div ng-show="uri">
|
||||||
|
<h1 translate>Make a payment to</h1>
|
||||||
<div class="panel size-14">
|
<div class="panel size-14">
|
||||||
<div class="ellipsis"><b translate>Address</b>: {{uri.address.toString()}}</div>
|
<div class="ellipsis"><b translate>Address</b>: {{uri.address.toString()}}</div>
|
||||||
<div ng-show="uri.amount"><b translate>Amount</b>: {{uri.amount}}</div>
|
<div ng-show="uri.amount"><b translate>Amount</b>: {{uri.amount}}</div>
|
||||||
<div ng-show="uri.message"><b translate>Message</b>: {{uri.message}}</div>
|
<div ng-show="uri.message"><b translate>Message</b>: {{uri.message}}</div>
|
||||||
</div>
|
</div>
|
||||||
<h1 translate>Select a wallet</h1>
|
<h2 translate>Select a wallet</h2>
|
||||||
<ul class="no-bullet" ng-init="wallets = payment.getWallets()">
|
<ul class="no-bullet" ng-init="wallets = payment.getWallets()">
|
||||||
<li class="panel" ng-repeat="w in wallets">
|
<li class="panel" ng-repeat="w in wallets">
|
||||||
<a ng-click="payment.selectWallet(w.id)">
|
<a ng-click="payment.selectWallet(w.id)">
|
||||||
|
<div class="avatar-wallet"
|
||||||
|
ng-style="{'background-color':w.color}">{{(w.name || w.id) | limitTo: 1}}</div>
|
||||||
<div class="ellipsis">{{w.name || w.id}}</div>
|
<div class="ellipsis">{{w.name || w.id}}</div>
|
||||||
<div class="size-12">{{w.m}} of {{w.n}}</div>
|
<div class="size-12">{{w.m}} of {{w.n}}</div>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
||||||
|
|
@ -288,8 +288,8 @@ a.missing-copayers {
|
||||||
box-shadow: inset -1px 0px 1px 0px rgba(0,0,0,0.20);
|
box-shadow: inset -1px 0px 1px 0px rgba(0,0,0,0.20);
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar .avatar-wallet {
|
.sidebar .avatar-wallet, .payment-uri .avatar-wallet {
|
||||||
background-color: #1ABC9C;
|
background-color: #2C3E50;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
|
|
|
||||||
|
|
@ -36,12 +36,15 @@ angular.module('copayApp.controllers').controller('paymentUriController',
|
||||||
|
|
||||||
this.getWallets = function() {
|
this.getWallets = function() {
|
||||||
if (!profileService.profile) return;
|
if (!profileService.profile) return;
|
||||||
|
var config = configService.getSync();
|
||||||
|
config.colorFor = config.colorFor || {};
|
||||||
var ret = lodash.map(profileService.profile.credentials, function(c) {
|
var ret = lodash.map(profileService.profile.credentials, function(c) {
|
||||||
return {
|
return {
|
||||||
m: c.m,
|
m: c.m,
|
||||||
n: c.n,
|
n: c.n,
|
||||||
name: c.walletName,
|
name: c.walletName,
|
||||||
id: c.walletId,
|
id: c.walletId,
|
||||||
|
color: config.colorFor[c.walletId] || '#2C3E50'
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
return lodash.sortBy(ret, 'walletName');
|
return lodash.sortBy(ret, 'walletName');
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,9 @@ angular.element(document).ready(function() {
|
||||||
|
|
||||||
function handleBitcoinURI(url) {
|
function handleBitcoinURI(url) {
|
||||||
if (!url) return;
|
if (!url) return;
|
||||||
window.location = '#/uri-payment/' + url;
|
setTimeout(function() {
|
||||||
|
window.location = '#/uri-payment/' + url;
|
||||||
|
}, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
window.plugins.webintent.getUri(handleBitcoinURI);
|
window.plugins.webintent.getUri(handleBitcoinURI);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue