From c2f2ad95ca43409d000fc05c8b8e9093458b041c Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Thu, 16 Apr 2015 16:56:15 -0300 Subject: [PATCH] Fix URI-payment for mobile --- cordova/build.sh | 2 +- public/views/paymentUri.html | 7 +++++-- src/css/mobile.css | 4 ++-- src/js/controllers/paymentUri.js | 3 +++ src/js/init.js | 4 +++- 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/cordova/build.sh b/cordova/build.sh index 6ae36addc..060775d79 100755 --- a/cordova/build.sh +++ b/cordova/build.sh @@ -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 diff --git a/public/views/paymentUri.html b/public/views/paymentUri.html index 6ab90bc55..8c201128f 100644 --- a/public/views/paymentUri.html +++ b/public/views/paymentUri.html @@ -1,18 +1,21 @@ -
+

Bitcoin URI is NOT valid!

+

Make a payment to

Address: {{uri.address.toString()}}
Amount: {{uri.amount}}
Message: {{uri.message}}
-

Select a wallet

+

Select a wallet

  • +
    {{(w.name || w.id) | limitTo: 1}}
    {{w.name || w.id}}
    {{w.m}} of {{w.n}}
    diff --git a/src/css/mobile.css b/src/css/mobile.css index aaf0f0948..ccacf8922 100644 --- a/src/css/mobile.css +++ b/src/css/mobile.css @@ -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; diff --git a/src/js/controllers/paymentUri.js b/src/js/controllers/paymentUri.js index 969f2c75d..974e966ca 100644 --- a/src/js/controllers/paymentUri.js +++ b/src/js/controllers/paymentUri.js @@ -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'); diff --git a/src/js/init.js b/src/js/init.js index 339aa0f7e..aee1a4841 100644 --- a/src/js/init.js +++ b/src/js/init.js @@ -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);