Fix URI-payment for mobile

This commit is contained in:
Gustavo Maximiliano Cortez 2015-04-16 16:56:15 -03:00
parent 014390665a
commit c2f2ad95ca
5 changed files with 14 additions and 6 deletions

View File

@ -81,7 +81,7 @@ if [ ! -d $PROJECT ]; then
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
cordova plugin add https://github.com/wildabeast/BarcodeScanner.git

View File

@ -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="panel text-center" ng-show="!uri">
<h1 translate>Bitcoin URI is NOT valid!</h1>
</div>
<div ng-show="uri">
<h1 translate>Make a payment to</h1>
<div class="panel size-14">
<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.message"><b translate>Message</b>: {{uri.message}}</div>
</div>
<h1 translate>Select a wallet</h1>
<h2 translate>Select a wallet</h2>
<ul class="no-bullet" ng-init="wallets = payment.getWallets()">
<li class="panel" ng-repeat="w in wallets">
<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="size-12">{{w.m}} of {{w.n}}</div>
</a>

View File

@ -288,8 +288,8 @@ a.missing-copayers {
box-shadow: inset -1px 0px 1px 0px rgba(0,0,0,0.20);
}
.sidebar .avatar-wallet {
background-color: #1ABC9C;
.sidebar .avatar-wallet, .payment-uri .avatar-wallet {
background-color: #2C3E50;
color: #fff;
font-size: 20px;
font-weight: 700;

View File

@ -36,12 +36,15 @@ angular.module('copayApp.controllers').controller('paymentUriController',
this.getWallets = function() {
if (!profileService.profile) return;
var config = configService.getSync();
config.colorFor = config.colorFor || {};
var ret = lodash.map(profileService.profile.credentials, function(c) {
return {
m: c.m,
n: c.n,
name: c.walletName,
id: c.walletId,
color: config.colorFor[c.walletId] || '#2C3E50'
};
});
return lodash.sortBy(ret, 'walletName');

View File

@ -57,7 +57,9 @@ angular.element(document).ready(function() {
function handleBitcoinURI(url) {
if (!url) return;
window.location = '#/uri-payment/' + url;
setTimeout(function() {
window.location = '#/uri-payment/' + url;
}, 1000);
}
window.plugins.webintent.getUri(handleBitcoinURI);