From 236a93d69d9780b94ec04173d021f7c7806b630c Mon Sep 17 00:00:00 2001 From: Sebastiaan Pasma Date: Mon, 16 Jul 2018 17:21:15 +0200 Subject: [PATCH 01/65] share transaction after sending on mobile + share explorer url on desktop. --- i18n/po/template.pot | 1 + src/js/controllers/confirm.js | 14 ++++++- src/js/directives/slideToAcceptSuccess.js | 11 ++++-- .../views/includes/slideToAcceptSuccess.scss | 38 +++++++++++++------ www/img/icon-share-white.svg | 17 +++++++++ www/views/confirm.html | 1 + www/views/includes/slideToAcceptSuccess.html | 7 +++- 7 files changed, 71 insertions(+), 18 deletions(-) create mode 100644 www/img/icon-share-white.svg diff --git a/i18n/po/template.pot b/i18n/po/template.pot index 66a2e7ca8..2ee53ec78 100644 --- a/i18n/po/template.pot +++ b/i18n/po/template.pot @@ -648,6 +648,7 @@ msgstr "" #: src/js/controllers/copayers.js:79 #: src/js/controllers/export.js:193 +#: src/js/controllers/confirm.js:41 #: www/views/includes/copyToClipboard.html:4 msgid "Copied to clipboard" msgstr "" diff --git a/src/js/controllers/confirm.js b/src/js/controllers/confirm.js index 03af26fd1..c8c889263 100644 --- a/src/js/controllers/confirm.js +++ b/src/js/controllers/confirm.js @@ -1,11 +1,12 @@ 'use strict'; -angular.module('copayApp.controllers').controller('confirmController', function($rootScope, $scope, $interval, $filter, $timeout, $ionicScrollDelegate, gettextCatalog, walletService, platformInfo, lodash, configService, $stateParams, $window, $state, $log, profileService, bitcore, bitcoreCash, txFormatService, ongoingProcess, $ionicModal, popupService, $ionicHistory, $ionicConfig, payproService, feeService, bwcError, txConfirmNotification, externalLinkService, firebaseEventsService, soundService) { +angular.module('copayApp.controllers').controller('confirmController', function($rootScope, $scope, $interval, $filter, $timeout, $ionicScrollDelegate, ionicToast, gettextCatalog, walletService, platformInfo, lodash, configService, $stateParams, $window, $state, $log, profileService, bitcore, bitcoreCash, txFormatService, ongoingProcess, $ionicModal, popupService, $ionicHistory, $ionicConfig, payproService, feeService, bwcError, txConfirmNotification, externalLinkService, firebaseEventsService, soundService, clipboardService) { var countDown = null; var FEE_TOO_HIGH_LIMIT_PER = 15; var tx = {}; + var lastTxId = ""; // Config Related values var config = configService.getSync(); @@ -31,6 +32,16 @@ angular.module('copayApp.controllers').controller('confirmController', function( }, 10); } + $scope.shareTransaction = function() { + var explorerTxUrl = 'https://explorer.bitcoin.com/'+tx.coin+'/tx/'+lastTxId; + if (platformInfo.isCordova) { + var text = 'Take a look at this Bitcoin transaction here: '+explorerTxUrl; + window.plugins.socialsharing.share(text, null, null, null); + } else { + ionicToast.show(gettextCatalog.getString('Copied to clipboard'), 'bottom', false, 3000); + clipboardService.copyToClipboard(explorerTxUrl); + } + }; $scope.showWalletSelector = function() { $scope.walletSelector = true; @@ -612,6 +623,7 @@ angular.module('copayApp.controllers').controller('confirmController', function( txConfirmNotification.subscribe(wallet, { txid: txp.txid }); + lastTxId = txp.txid; } }, onSendStatusChange); }; diff --git a/src/js/directives/slideToAcceptSuccess.js b/src/js/directives/slideToAcceptSuccess.js index fbd588bfe..ec6321b95 100644 --- a/src/js/directives/slideToAcceptSuccess.js +++ b/src/js/directives/slideToAcceptSuccess.js @@ -9,12 +9,12 @@ angular.module('copayApp.directives') scope: { isShown: '=slideSuccessShow', onConfirm: '&slideSuccessOnConfirm', - hideOnConfirm: '=slideSuccessHideOnConfirm' + hideOnConfirm: '=slideSuccessHideOnConfirm', + onShare: '=slideSuccessOnShare', }, link: function(scope, element, attrs) { - - scope.isWindowsPhoneApp = platformInfo.isCordova && platformInfo.isWP; - + scope.isCordova = platformInfo.isCordova; + scope.hasShareFunction = typeof scope.onShare === 'function'; var elm = element[0]; elm.style.display = 'none'; scope.$watch('isShown', function() { @@ -32,6 +32,9 @@ angular.module('copayApp.directives') elm.style.display = 'none'; } }; + scope.onShareButtonClick = function() { + scope.onShare(); + } } }; }); diff --git a/src/sass/views/includes/slideToAcceptSuccess.scss b/src/sass/views/includes/slideToAcceptSuccess.scss index 68312c7a4..724363b0d 100644 --- a/src/sass/views/includes/slideToAcceptSuccess.scss +++ b/src/sass/views/includes/slideToAcceptSuccess.scss @@ -12,12 +12,6 @@ slide-to-accept-success { .slide-success { $duration: 400ms; - &__windows-background { - background: $v-success-bg-color; - height: 100%; - width: 100%; - position: fixed; - } &__background { $start-radius: 5; $scale-factor: 20; @@ -40,9 +34,11 @@ slide-to-accept-success { &__content { position: relative; z-index: 1; - margin-top: -20vh; + margin-top: -10vh; > img { + width: 45vw; + max-width: 166px; margin-bottom: 1.8rem; -webkit-transform: translateY(5rem); transform: translateY(5rem); @@ -59,7 +55,7 @@ slide-to-accept-success { &__header { color: #FFFFFF; - font-size: 26px; + font-size: 29px; -webkit-transform: translateY(5rem); transform: translateY(5rem); opacity: 0; @@ -72,6 +68,26 @@ slide-to-accept-success { opacity: 1; } } + &__share { + transition: transform $duration ease, opacity $duration ease; + transition-delay: 1000ms; + opacity: 0; + margin-top: 15vh; + span { + color: #FFF; + font-size: 22px; + height: 28px; + } + img { + height: 28px; + width: auto; + vertical-align: bottom; + margin-right: 4px; + } + &.reveal { + opacity: 0.79; + } + } } &__footer { @@ -98,11 +114,11 @@ slide-to-accept-success { &__btn { display: block; color: #FFFFFF; - font-size: 18px; + font-size: 22px; font-weight: 600; letter-spacing: 2.86px; - padding: 1rem 0 1.1rem; - border-top: 1px solid rgba(255, 255, 255, .45); + padding: 2rem 0 2.1rem; + border-top: 1px solid rgba(255, 255, 255, 0.25); cursor: pointer; } } diff --git a/www/img/icon-share-white.svg b/www/img/icon-share-white.svg new file mode 100644 index 000000000..eeb3e7b6b --- /dev/null +++ b/www/img/icon-share-white.svg @@ -0,0 +1,17 @@ + + + + + + + + + + diff --git a/www/views/confirm.html b/www/views/confirm.html index e54837f34..afc8f9e40 100644 --- a/www/views/confirm.html +++ b/www/views/confirm.html @@ -120,6 +120,7 @@ Payment Sent Proposal Created diff --git a/www/views/includes/slideToAcceptSuccess.html b/www/views/includes/slideToAcceptSuccess.html index 923eab25c..ed4ebfa77 100644 --- a/www/views/includes/slideToAcceptSuccess.html +++ b/www/views/includes/slideToAcceptSuccess.html @@ -1,13 +1,16 @@
+ ng-class="{'fill-screen': fillScreen}">
- +
Payment Sent
+
+
+
+
+ Receive +
+
+
+
+ Buy Bitcoin +
+
+ Send +
+
+
+
From cc907251f75493d0ab0f5536a1fd9f924e56322b Mon Sep 17 00:00:00 2001 From: Brendon Duncan Date: Wed, 18 Jul 2018 17:20:59 +1200 Subject: [PATCH 04/65] Removing unused services, and making string translatable. --- i18n/po/template.pot | 4 ++++ src/js/controllers/amount.js | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/i18n/po/template.pot b/i18n/po/template.pot index a23e5dbae..45a4fbd44 100644 --- a/i18n/po/template.pot +++ b/i18n/po/template.pot @@ -3699,3 +3699,7 @@ msgstr "" #: www/views/includes/walletInfo.html:18 msgid "{{wallet.m}}-of-{{wallet.n}}" msgstr "" + +#: src/js/controllers/amount.js:49 +msgid "Address doesn\'t contain currency information, please make sure you are sending the correct currency." +msgstr "" \ No newline at end of file diff --git a/src/js/controllers/amount.js b/src/js/controllers/amount.js index 52695e829..1c91baf97 100644 --- a/src/js/controllers/amount.js +++ b/src/js/controllers/amount.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.controllers').controller('amountController', function($scope, $filter, $timeout, $ionicModal, $ionicScrollDelegate, $ionicHistory, storageService, walletService, gettextCatalog, platformInfo, lodash, configService, rateService, $stateParams, $window, $state, $log, txFormatService, ongoingProcess, popupService, bwcError, payproService, profileService, bitcore, amazonService, nodeWebkitService) { +angular.module('copayApp.controllers').controller('amountController', function($scope, $filter, $timeout, $ionicModal, $ionicScrollDelegate, $ionicHistory, walletService, gettextCatalog, platformInfo, lodash, configService, rateService, $stateParams, $window, $state, $log, txFormatService, ongoingProcess, popupService, profileService, nodeWebkitService) { var _id; var unitToSatoshi; @@ -46,7 +46,7 @@ angular.module('copayApp.controllers').controller('amountController', function($ if (data.stateParams.noPrefix) { $scope.showWarningMessage = data.stateParams.noPrefix != 0; if ($scope.showWarningMessage) { - var message = 'Address doesn\'t contain currency information, please make sure you are sending the correct currency.'; + var message = gettextCatalog.getString('Address doesn\'t contain currency information, please make sure you are sending the correct currency.'); popupService.showAlert('', message, function() {}, 'Ok'); } } From 0db57f997a6d8e374544a445ce050be5734a1508 Mon Sep 17 00:00:00 2001 From: Brendon Duncan Date: Wed, 18 Jul 2018 18:24:49 +1200 Subject: [PATCH 05/65] First successful test, instantiating an amountController. --- src/js/controllers/amount.spec.js | 55 ++++++++++++++++++++ src/js/services/secureStorageService.spec.js | 6 +-- src/js/services/storageService.spec.js | 4 +- test/karma.conf.js | 2 + 4 files changed, 62 insertions(+), 5 deletions(-) create mode 100644 src/js/controllers/amount.spec.js diff --git a/src/js/controllers/amount.spec.js b/src/js/controllers/amount.spec.js new file mode 100644 index 000000000..1e5342cd9 --- /dev/null +++ b/src/js/controllers/amount.spec.js @@ -0,0 +1,55 @@ +fdescribe('amountController', function(){ + var $controller, + $rootScope, + platformInfo, + $stateParams; + + + + beforeEach(function(){ + module('ngLodash'); + module('copayApp.controllers'); + + platformInfo = { + isChromeApp: false, + isAndroid: false, + isIos: true + }; + + $stateParams = {}; + + inject(function(_$controller_, _$rootScope_){ + // The injector unwraps the underscores (_) from around the parameter names when matching + $controller = _$controller_; + $rootScope = _$rootScope_; + }); + + + + }); + + it('something', function() { + var $scope = $rootScope.$new(); + var amountController = $controller('amountController', { + configService: {}, + gettextCatalog: {}, + $ionicHistory: {}, + $ionicModal: {}, + $ionicScrollDelegate: {}, + nodeWebkitService: {}, + ongoingProcess: {}, + platformInfo: platformInfo, + profileService: {}, + popupService: {}, + rateService: {}, + $scope: $scope, + $state: {}, + $stateParams: $stateParams, + txFormatService: {}, + walletService: {} + }); + + expect(true).toBe(true); + }); + +}); \ No newline at end of file diff --git a/src/js/services/secureStorageService.spec.js b/src/js/services/secureStorageService.spec.js index abfa5d947..8d2842a6a 100644 --- a/src/js/services/secureStorageService.spec.js +++ b/src/js/services/secureStorageService.spec.js @@ -1,4 +1,4 @@ -describe('secureStorageService in browser', function(){ +xdescribe('secureStorageService in browser', function(){ var localStorage, sss; @@ -100,7 +100,7 @@ describe('secureStorageService in browser', function(){ }); -describe('secureStorageService on desktop', function(){ +xdescribe('secureStorageService on desktop', function(){ var desktopSss, sss; @@ -202,7 +202,7 @@ describe('secureStorageService on desktop', function(){ }); -describe('secureStorageService on mobile', function(){ +xdescribe('secureStorageService on mobile', function(){ var mobileSss, sss; diff --git a/src/js/services/storageService.spec.js b/src/js/services/storageService.spec.js index 493678b97..cc3ad285d 100644 --- a/src/js/services/storageService.spec.js +++ b/src/js/services/storageService.spec.js @@ -414,7 +414,7 @@ xdescribe('storageService on desktop', function(){ }); -describe('storageService on desktop using local storage', function(){ +xdescribe('storageService on desktop using local storage', function(){ var appConfig, localStorageServiceMock, log, @@ -614,7 +614,7 @@ describe('storageService on desktop using local storage', function(){ }); -describe('storageService on mobile', function(){ +xdescribe('storageService on mobile', function(){ var appConfig, expectedOldProfileSavedToSecure, expectedOldProfileMergedWithSecure, diff --git a/test/karma.conf.js b/test/karma.conf.js index 002d40c91..b4f64af73 100644 --- a/test/karma.conf.js +++ b/test/karma.conf.js @@ -17,6 +17,8 @@ module.exports = function(config) { files: [ 'node_modules/angular/angular.js', + 'bitanalytics/bitanalytics-0.1.0.js', + // From Gruntfile.js 'bower_components/qrcode-generator/js/qrcode.js', 'bower_components/qrcode-generator/js/qrcode_UTF8.js', From 8725adb959f38d971cfecf05bbd067b6baf3186b Mon Sep 17 00:00:00 2001 From: Sebastiaan Pasma Date: Wed, 18 Jul 2018 09:02:52 +0200 Subject: [PATCH 06/65] sent-successful svg --- www/img/icon-sent-successful.svg | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 www/img/icon-sent-successful.svg diff --git a/www/img/icon-sent-successful.svg b/www/img/icon-sent-successful.svg new file mode 100644 index 000000000..070357ddf --- /dev/null +++ b/www/img/icon-sent-successful.svg @@ -0,0 +1,10 @@ + + + + + + From 3df28360819870a3ab62a858f9866f1407aafe8a Mon Sep 17 00:00:00 2001 From: Brendon Duncan Date: Wed, 18 Jul 2018 20:26:20 +1200 Subject: [PATCH 07/65] Successful test with amountController, using beforeEnter. --- src/js/controllers/amount.spec.js | 62 +++++++++++++++++++++++++++---- 1 file changed, 54 insertions(+), 8 deletions(-) diff --git a/src/js/controllers/amount.spec.js b/src/js/controllers/amount.spec.js index 1e5342cd9..ed64da836 100644 --- a/src/js/controllers/amount.spec.js +++ b/src/js/controllers/amount.spec.js @@ -1,7 +1,12 @@ -fdescribe('amountController', function(){ - var $controller, +describe('amountController', function(){ + var configCache, + configService, + $controller, + $ionicHistory, $rootScope, platformInfo, + profileService, + rateService, $stateParams; @@ -10,12 +15,34 @@ fdescribe('amountController', function(){ module('ngLodash'); module('copayApp.controllers'); + configCache = { + wallet: { + settings: { + + } + } + }; + + + configService = jasmine.createSpyObj(['getDefaults','getSync']); + configService.getDefaults.and.returnValue({ + bitcoinCashAlias: 'bch', + bitcoinAlias: 'btc' + }); + configService.getSync.and.returnValue(configCache); + + $ionicHistory = jasmine.createSpyObj(['backView']); + platformInfo = { isChromeApp: false, isAndroid: false, isIos: true }; + profileService = jasmine.createSpyObj(['getWallets']); + + rateService = jasmine.createSpyObj(['fromFiat', 'whenAvailable']); + $stateParams = {}; inject(function(_$controller_, _$rootScope_){ @@ -28,20 +55,30 @@ fdescribe('amountController', function(){ }); - it('something', function() { + it('receives fromWalletId and toAddress.', function() { + + var backView = { + stateName: 'ignoreme' + }; + $ionicHistory.backView.and.returnValue(backView); + profileService.getWallets.and.returnValue([{}]); + rateService.fromFiat.and.returnValue(12); // satoshis or coins? + var $scope = $rootScope.$new(); + + var amountController = $controller('amountController', { - configService: {}, + configService: configService, gettextCatalog: {}, - $ionicHistory: {}, + $ionicHistory: $ionicHistory, $ionicModal: {}, $ionicScrollDelegate: {}, nodeWebkitService: {}, ongoingProcess: {}, platformInfo: platformInfo, - profileService: {}, + profileService: profileService, popupService: {}, - rateService: {}, + rateService: rateService, $scope: $scope, $state: {}, $stateParams: $stateParams, @@ -49,7 +86,16 @@ fdescribe('amountController', function(){ walletService: {} }); - expect(true).toBe(true); + var data = { + stateParams: { + fromWalletId: 'fd56c1e7-e3ac-4fd9-8afc-27b9c1b3718b', + toAddress: 'qrup46avn8t466xxwlzs4qelht7cnwvesv2e29wf7s' + } + }; + $scope.$emit('$ionicView.beforeEnter', data); + + expect($scope.fromWalletId).toBe('fd56c1e7-e3ac-4fd9-8afc-27b9c1b3718b'); + expect($scope.toAddress).toBe('qrup46avn8t466xxwlzs4qelht7cnwvesv2e29wf7s'); }); }); \ No newline at end of file From 8c124fba196e611f486bdd0d3ae10fa6ef0637a0 Mon Sep 17 00:00:00 2001 From: Sebastiaan Pasma Date: Wed, 18 Jul 2018 11:29:03 +0200 Subject: [PATCH 08/65] price display translation --- i18n/po/template.pot | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/i18n/po/template.pot b/i18n/po/template.pot index a23e5dbae..df01cecec 100644 --- a/i18n/po/template.pot +++ b/i18n/po/template.pot @@ -197,6 +197,10 @@ msgstr "" msgid "Alternative Currency" msgstr "" +#: www/views/tab-settings.html:75 +msgid "Price Display" +msgstr "" + #: src/js/controllers/buyAmazon.js:98 msgid "Amazon.com is not available at this moment. Please try back later." msgstr "" From 450b80b03fd6ab9701a481b383cedeadd658cdd4 Mon Sep 17 00:00:00 2001 From: Sebastiaan Pasma Date: Wed, 18 Jul 2018 16:30:54 +0200 Subject: [PATCH 09/65] send/receive buttons on walletDetails + currencySymbolService --- src/js/controllers/walletDetails.js | 24 ++- src/js/services/currencySymbolService.js | 194 +++++++++++++++++++++++ src/sass/shame.scss | 4 + src/sass/views/walletDetails.scss | 24 ++- www/views/tab-home.html | 26 +-- www/views/walletDetails.html | 42 +++-- 6 files changed, 280 insertions(+), 34 deletions(-) create mode 100644 src/js/services/currencySymbolService.js diff --git a/src/js/controllers/walletDetails.js b/src/js/controllers/walletDetails.js index 24237f6c9..24e4a5a20 100644 --- a/src/js/controllers/walletDetails.js +++ b/src/js/controllers/walletDetails.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.controllers').controller('walletDetailsController', function($scope, $rootScope, $interval, $timeout, $filter, $log, $ionicModal, $ionicPopover, $state, $stateParams, $ionicHistory, profileService, lodash, configService, platformInfo, walletService, txpModalService, externalLinkService, popupService, addressbookService, storageService, $ionicScrollDelegate, $window, bwcError, gettextCatalog, timeService, feeService, appConfigService, rateService) { +angular.module('copayApp.controllers').controller('walletDetailsController', function($scope, $rootScope, $interval, $timeout, $filter, $log, $ionicModal, $ionicPopover, $state, $stateParams, $ionicHistory, profileService, lodash, configService, currencySymbolService, platformInfo, walletService, txpModalService, externalLinkService, popupService, addressbookService, storageService, $ionicScrollDelegate, $window, bwcError, gettextCatalog, timeService, feeService, appConfigService, rateService) { var HISTORY_SHOW_LIMIT = 10; var currentTxHistoryPage = 0; @@ -12,6 +12,13 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun $scope.isAndroid = platformInfo.isAndroid; $scope.isIOS = platformInfo.isIOS; + $scope.currencySymbols = { + 'EUR': '€', + 'GBP': '£', + 'USD': '$', + 'YEN' : '' + }; + var channel = "firebase"; if (platformInfo.isNW) { channel = "ga"; @@ -256,6 +263,11 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun return !tx.confirmations || tx.confirmations === 0; }; + $scope.currencySymbol = function(code) { + var symbol = currencySymbolService.getCurrencySymbol(code); + return symbol?symbol:""; + }; + $scope.showMore = function() { $timeout(function() { currentTxHistoryPage++; @@ -315,16 +327,16 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun } scrollPos = scrollPos || 0; - var amountHeight = 210 - scrollPos; + var amountHeight = 230 - scrollPos; if (amountHeight < 80) { amountHeight = 80; } var contentMargin = amountHeight; - if (contentMargin > 210) { - contentMargin = 210; + if (contentMargin > 230) { + contentMargin = 230; } - var amountScale = (amountHeight / 210); + var amountScale = (amountHeight / 230); if (amountScale < 0.5) { amountScale = 0.5; } @@ -342,7 +354,7 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun top = TOP_BALANCE_BUTTON; } - var amountTop = ((amountScale - 0.7) / 0.7) * top; + var amountTop = ((amountScale - 0.85) / 0.85) * top; if (amountTop < -10) { amountTop = -10; } diff --git a/src/js/services/currencySymbolService.js b/src/js/services/currencySymbolService.js new file mode 100644 index 000000000..b4cf0c2ac --- /dev/null +++ b/src/js/services/currencySymbolService.js @@ -0,0 +1,194 @@ +'use strict'; + +angular.module('copayApp.services').factory('currencySymbolService', function($log) { + var root = {}; + root.currencySymbols = { + 'AED': 'د.إ', + 'AFN': '؋', + 'ALL': 'L', + 'AMD': '֏', + 'ANG': 'ƒ', + 'AOA': 'Kz', + 'ARS': '$', + 'AUD': '$', + 'AWG': 'ƒ', + 'AZN': '₼', + 'BAM': 'KM', + 'BBD': '$', + 'BDT': '৳', + 'BGN': 'лв', + 'BHD': '.د.ب', + 'BIF': 'FBu', + 'BMD': '$', + 'BND': '$', + 'BOB': '$b', + 'BRL': 'R$', + 'BSD': '$', + 'BTC': '฿', + 'BTN': 'Nu.', + 'BWP': 'P', + 'BYR': 'Br', + 'BYN': 'Br', + 'BZD': 'BZ$', + 'CAD': '$', + 'CDF': 'FC', + 'CHF': 'CHF', + 'CLP': '$', + 'CNY': '¥', + 'COP': '$', + 'CRC': '₡', + 'CUC': '$', + 'CUP': '₱', + 'CVE': '$', + 'CZK': 'Kč', + 'DJF': 'Fdj', + 'DKK': 'kr', + 'DOP': 'RD$', + 'DZD': 'دج', + 'EEK': 'kr', + 'EGP': '£', + 'ERN': 'Nfk', + 'ETB': 'Br', + 'ETH': 'Ξ', + 'EUR': '€', + 'FJD': '$', + 'FKP': '£', + 'GBP': '£', + 'GEL': '₾', + 'GGP': '£', + 'GHC': '₵', + 'GHS': 'GH₵', + 'GIP': '£', + 'GMD': 'D', + 'GNF': 'FG', + 'GTQ': 'Q', + 'GYD': '$', + 'HKD': '$', + 'HNL': 'L', + 'HRK': 'kn', + 'HTG': 'G', + 'HUF': 'Ft', + 'IDR': 'Rp', + 'ILS': '₪', + 'IMP': '£', + 'INR': '₹', + 'IQD': 'ع.د', + 'IRR': '﷼', + 'ISK': 'kr', + 'JEP': '£', + 'JMD': 'J$', + 'JOD': 'JD', + 'JPY': '¥', + 'KES': 'KSh', + 'KGS': 'лв', + 'KHR': '៛', + 'KMF': 'CF', + 'KPW': '₩', + 'KRW': '₩', + 'KWD': 'KD', + 'KYD': '$', + 'KZT': 'лв', + 'LAK': '₭', + 'LBP': '£', + 'LKR': '₨', + 'LRD': '$', + 'LSL': 'M', + 'LTC': 'Ł', + 'LTL': 'Lt', + 'LVL': 'Ls', + 'LYD': 'LD', + 'MAD': 'MAD', + 'MDL': 'lei', + 'MGA': 'Ar', + 'MKD': 'ден', + 'MMK': 'K', + 'MNT': '₮', + 'MOP': 'MOP$', + 'MRO': 'UM', + 'MRU': 'UM', + 'MUR': '₨', + 'MVR': 'Rf', + 'MWK': 'MK', + 'MXN': '$', + 'MYR': 'RM', + 'MZN': 'MT', + 'NAD': '$', + 'NGN': '₦', + 'NIO': 'C$', + 'NOK': 'kr', + 'NPR': '₨', + 'NZD': '$', + 'OMR': '﷼', + 'PAB': 'B/.', + 'PEN': 'S/.', + 'PGK': 'K', + 'PHP': '₱', + 'PKR': '₨', + 'PLN': 'zł', + 'PYG': 'Gs', + 'QAR': '﷼', + 'RMB': '¥', + 'RON': 'lei', + 'RSD': 'Дин.', + 'RUB': '₽', + 'RWF': 'R₣', + 'SAR': '﷼', + 'SBD': '$', + 'SCR': '₨', + 'SDG': 'ج.س.', + 'SEK': 'kr', + 'SGD': '$', + 'SHP': '£', + 'SLL': 'Le', + 'SOS': 'S', + 'SRD': '$', + 'SSP': '£', + 'STD': 'Db', + 'STN': 'Db', + 'SVC': '$', + 'SYP': '£', + 'SZL': 'E', + 'THB': '฿', + 'TJS': 'SM', + 'TMT': 'T', + 'TND': 'د.ت', + 'TOP': 'T$', + 'TRL': '₤', + 'TRY': '₺', + 'TTD': 'TT$', + 'TVD': '$', + 'TWD': 'NT$', + 'TZS': 'TSh', + 'UAH': '₴', + 'UGX': 'USh', + 'USD': '$', + 'UYU': '$U', + 'UZS': 'лв', + 'VEF': 'Bs', + 'VND': '₫', + 'VUV': 'VT', + 'WST': 'WS$', + 'XAF': 'FCFA', + 'XBT': 'Ƀ', + 'XCD': '$', + 'XOF': 'CFA', + 'XPF': '₣', + 'YER': '﷼', + 'ZAR': 'R', + 'ZWD': 'Z$' + }; + + root.getCurrencySymbol = function(code) { + code = code.toUpperCase(); + + if (root.currencySymbols[code]) { + $log.debug("Currency symbol for "+code+" found"); + return root.currencySymbols[code]; + } + $log.debug("Currency symbol for "+code+" not found"); + return false; + }; + + return root; + +}); \ No newline at end of file diff --git a/src/sass/shame.scss b/src/sass/shame.scss index 07ac2dedf..5a17c5f1f 100644 --- a/src/sass/shame.scss +++ b/src/sass/shame.scss @@ -233,6 +233,10 @@ input[type=number] { font-size: 24px; } +.size-25 { + font-size: 25px; +} + .size-28 { font-size: 28px; } diff --git a/src/sass/views/walletDetails.scss b/src/sass/views/walletDetails.scss index 9e651f871..2d1aa1343 100644 --- a/src/sass/views/walletDetails.scss +++ b/src/sass/views/walletDetails.scss @@ -153,7 +153,7 @@ ion-content { &.collapsible { - margin-top: 210px; + margin-top: 230px; } padding-top: 0; @@ -190,12 +190,32 @@ transform: translateY(100px); } } + + .buttons { + margin-bottom: 0; + margin-top: 6px; + >.col { + padding: 5px 10px; + margin-bottom: 0; + } + .button { + border: 2px solid; + border-radius: 47px; + padding: 0 15px 0 15px; + text-align: center; + width: 100%; + font-size: 19px; + font-weight: bolder; + min-height: 45px; + line-height: 45px; + } + } } .amount { width: 100%; text-align: center; color: #fff; - height: 210px; + height: 230px; padding-top: 40px; display: block; align-items: center; diff --git a/www/views/tab-home.html b/www/views/tab-home.html index 85b7692f7..618f2e128 100644 --- a/www/views/tab-home.html +++ b/www/views/tab-home.html @@ -23,20 +23,22 @@
-
-
- Receive -
-
-
-
- Buy Bitcoin -
-
- Send -
+
+
+ Receive
+
+
+ Buy Bitcoin +
+
+ Send +
+
+
diff --git a/www/views/walletDetails.html b/www/views/walletDetails.html index 0f9e4961c..820930a95 100644 --- a/www/views/walletDetails.html +++ b/www/views/walletDetails.html @@ -34,7 +34,7 @@ on-hold="hideToggle()" ng-style="{'transform': amountScale}" ng-class="{amount__balance: amountIsCollapsible}"> - {{status.totalBalanceAlternative}} {{status.alternativeIsoCode}} + {{currencySymbol(status.alternativeIsoCode)}} {{status.totalBalanceAlternative}} {{status.alternativeIsoCode}}
- {{status.totalBalanceStr}} + {{status.totalBalanceStr}}
- {{status.totalBalanceAlternative}} {{status.alternativeIsoCode}} + {{currencySymbol(status.alternativeIsoCode)}} {{status.totalBalanceAlternative}} {{status.alternativeIsoCode}}
@@ -86,11 +86,25 @@   - {{status.spendableBalanceAlternative}} {{status.alternativeIsoCode}} + {{currencySymbol(status.alternativeIsoCode)}} {{status.spendableBalanceAlternative}} {{status.alternativeIsoCode}}
- +
+
+
+ Receive +
+
+
+
+ Buy Bitcoin +
+
+ Send +
+
+
@@ -127,12 +141,12 @@ on-hold="hideToggle()" ng-style="{'transform': amountScale}" ng-class="{amount__balance: amountIsCollapsible}"> - {{status.totalBalanceStr}} + {{status.totalBalanceStr}}
- {{status.totalBalanceAlternative}} {{status.alternativeIsoCode}} + {{currencySymbol(status.alternativeIsoCode)}} {{status.totalBalanceAlternative}} {{status.alternativeIsoCode}}
@@ -142,9 +156,9 @@ on-hold="hideToggle()" ng-style="{'transform': amountScale}" ng-class="{amount__balance: amountIsCollapsible}"> - {{status.totalBalanceAlternative}} {{status.alternativeIsoCode}} + {{currencySymbol(status.alternativeIsoCode)}} {{status.totalBalanceAlternative}} {{status.alternativeIsoCode}}
{{status.totalBalanceStr}} @@ -156,7 +170,7 @@ ng-show="!updateStatusError && wallet.balanceHidden && !wallet.scanning" on-hold="hideToggle()"> [Balance Hidden] -
+
Tap and hold to show
@@ -166,7 +180,7 @@ class="amount__balance" ng-show="!updateStatusError && wallet.scanning"> [Scanning Funds] -
+
Please wait
@@ -180,7 +194,7 @@   - {{status.spendableBalanceAlternative}} {{status.alternativeIsoCode}} + {{currencySymbol(status.alternativeIsoCode)}} {{status.spendableBalanceAlternative}} {{status.alternativeIsoCode}}
@@ -189,7 +203,7 @@
From 3cedfa5146d0e732f66eb21ef48ada651f625286 Mon Sep 17 00:00:00 2001 From: Brendon Duncan Date: Thu, 19 Jul 2018 12:19:08 +1200 Subject: [PATCH 10/65] Added $scope.fundsAreInsufficient for triggering UI. --- src/js/controllers/amount.js | 52 +++++++++++++++++++++++++++++++----- 1 file changed, 46 insertions(+), 6 deletions(-) diff --git a/src/js/controllers/amount.js b/src/js/controllers/amount.js index 1c91baf97..3d8422447 100644 --- a/src/js/controllers/amount.js +++ b/src/js/controllers/amount.js @@ -7,6 +7,8 @@ angular.module('copayApp.controllers').controller('amountController', function($ var satToUnit; var unitDecimals; var satToBtc; + var spendableAmountInSatoshis = null; + var SMALL_FONT_SIZE_LIMIT = 10; var LENGTH_EXPRESSION_LIMIT = 19; var LENGTH_BEFORE_COMMA_EXPRESSION_LIMIT = 8; @@ -22,6 +24,10 @@ angular.module('copayApp.controllers').controller('amountController', function($ $scope.amountModel = { amount: 0 }; + // Use insufficient for logic, as when the amount is invalid, funds being + // either sufficent or insufficient doesn't make sense. + $scope.fundsAreInsufficient = false; + $scope.isChromeApp = platformInfo.isChromeApp; $scope.isAndroid = platformInfo.isAndroid; $scope.isIos = platformInfo.isIOS; @@ -134,6 +140,12 @@ angular.module('copayApp.controllers').controller('amountController', function($ }); altUnitIndex = 0; + + if ($scope.fromWalletId) { + var fromWallet = profileService.getWallet($scope.fromWalletId); + console.log('got fromWallet.'); + updateSpendableAmountInSatoshisFromWallet(fromWallet); + } }; // Go to... @@ -387,24 +399,41 @@ angular.module('copayApp.controllers').controller('amountController', function($ var a = fromFiat(result); if (a) { - $scope.alternativeAmount = txFormatService.formatAmount(a * unitToSatoshi, true); - $scope.allowSend = lodash.isNumber(a) && a > 0 + var amountInSatoshis = a * unitToSatoshi; + $scope.fundsAreInsufficient = !!$scope.fromWalletId + && spendableAmountInSatoshis !== null + && spendableAmountInSatoshis < amountInSatoshis; + + $scope.alternativeAmount = txFormatService.formatAmount(amountInSatoshis, true); + $scope.allowSend = lodash.isNumber(a) + && a > 0 && (!$scope.shapeshiftOrderId - || (a >= $scope.minShapeshiftAmount && a <= $scope.maxShapeshiftAmount)); + || (a >= $scope.minShapeshiftAmount && a <= $scope.maxShapeshiftAmount)) + && !$scope.fundsAreInsufficient; } else { if (result) { $scope.alternativeAmount = 'N/A'; } else { $scope.alternativeAmount = null; } + $scope.fundsAreInsufficient = false; $scope.allowSend = false; } } else { + $scope.fundsAreInsufficient = !!$scope.fromWalletId + && spendableAmountInSatoshis !== null + && spendableAmountInSatoshis < result * unitToSatoshi; + $scope.alternativeAmount = $filter('formatFiatAmount')(toFiat(result)); - $scope.allowSend = lodash.isNumber(result) && result > 0 + $scope.allowSend = lodash.isNumber(result) + && result > 0 && (!$scope.shapeshiftOrderId - || (result >= $scope.minShapeshiftAmount && result <= $scope.maxShapeshiftAmount)); + || (result >= $scope.minShapeshiftAmount && result <= $scope.maxShapeshiftAmount)) + && !$scope.fundsAreInsufficient; } + + } else { + $scope.fundsAreInsufficient = false; } }; @@ -584,6 +613,7 @@ angular.module('copayApp.controllers').controller('amountController', function($ $timeout(function() { $scope.$apply(); }); + rateService.updateRates(); }); } @@ -632,5 +662,15 @@ angular.module('copayApp.controllers').controller('amountController', function($ updateUnitUI(); $scope.close(); }); - }; + }; + + function updateSpendableAmountInSatoshisFromWallet(wallet) { + if (wallet.status) { + spendableAmountInSatoshis = wallet.status.spendableAmount; + } else if (fromWallet.cachedStatus) { + spendableAmountInSatoshis = wallet.cachedStatus.spendableAmount; + } else { + spendableAmountInSatoshis = null; + } + } }); From 61f1603bbffb90bd7661a31990821af9b77a1e13 Mon Sep 17 00:00:00 2001 From: Brendon Duncan Date: Thu, 19 Jul 2018 12:52:37 +1200 Subject: [PATCH 11/65] Added $scope.availableFunds. --- src/js/controllers/amount.js | 51 +++++++++++++++++++++++++++--------- 1 file changed, 39 insertions(+), 12 deletions(-) diff --git a/src/js/controllers/amount.js b/src/js/controllers/amount.js index 3d8422447..1ea8f3104 100644 --- a/src/js/controllers/amount.js +++ b/src/js/controllers/amount.js @@ -3,11 +3,14 @@ angular.module('copayApp.controllers').controller('amountController', function($scope, $filter, $timeout, $ionicModal, $ionicScrollDelegate, $ionicHistory, walletService, gettextCatalog, platformInfo, lodash, configService, rateService, $stateParams, $window, $state, $log, txFormatService, ongoingProcess, popupService, profileService, nodeWebkitService) { var _id; + var availableFundsInCrypto = ''; + var availableFundsInFiat = ''; + var availableSatoshis = null; var unitToSatoshi; var satToUnit; var unitDecimals; var satToBtc; - var spendableAmountInSatoshis = null; + var SMALL_FONT_SIZE_LIMIT = 10; var LENGTH_EXPRESSION_LIMIT = 19; @@ -23,6 +26,8 @@ angular.module('copayApp.controllers').controller('amountController', function($ var fixedUnit; $scope.amountModel = { amount: 0 }; + $scope.availableFunds = ''; + // Use insufficient for logic, as when the amount is invalid, funds being // either sufficent or insufficient doesn't make sense. @@ -143,8 +148,7 @@ angular.module('copayApp.controllers').controller('amountController', function($ if ($scope.fromWalletId) { var fromWallet = profileService.getWallet($scope.fromWalletId); - console.log('got fromWallet.'); - updateSpendableAmountInSatoshisFromWallet(fromWallet); + updateAvailableFundsFromWallet(fromWallet); } }; @@ -281,12 +285,15 @@ angular.module('copayApp.controllers').controller('amountController', function($ if (availableUnits[unitIndex].isFiat) { altUnitIndex = altUnitIndex == 0 && availableUnits.length > 2 ? 1 : 0; + $scope.availableFunds = availableFundsInFiat || availableFundsInCrypto; } else { altUnitIndex = lodash.findIndex(availableUnits, { isFiat: true }); + $scope.availableFunds = availableFundsInCrypto; } + console.log('availableFunds: ' + $scope.availableFunds); updateUnitUI(); }; @@ -401,8 +408,8 @@ angular.module('copayApp.controllers').controller('amountController', function($ if (a) { var amountInSatoshis = a * unitToSatoshi; $scope.fundsAreInsufficient = !!$scope.fromWalletId - && spendableAmountInSatoshis !== null - && spendableAmountInSatoshis < amountInSatoshis; + && availableSatoshis !== null + && availableSatoshis < amountInSatoshis; $scope.alternativeAmount = txFormatService.formatAmount(amountInSatoshis, true); $scope.allowSend = lodash.isNumber(a) @@ -421,8 +428,8 @@ angular.module('copayApp.controllers').controller('amountController', function($ } } else { $scope.fundsAreInsufficient = !!$scope.fromWalletId - && spendableAmountInSatoshis !== null - && spendableAmountInSatoshis < result * unitToSatoshi; + && availableSatoshis !== null + && availableSatoshis < result * unitToSatoshi; $scope.alternativeAmount = $filter('formatFiatAmount')(toFiat(result)); $scope.allowSend = lodash.isNumber(result) @@ -664,13 +671,33 @@ angular.module('copayApp.controllers').controller('amountController', function($ }); }; - function updateSpendableAmountInSatoshisFromWallet(wallet) { + function updateAvailableFundsFromWallet(wallet) { if (wallet.status) { - spendableAmountInSatoshis = wallet.status.spendableAmount; - } else if (fromWallet.cachedStatus) { - spendableAmountInSatoshis = wallet.cachedStatus.spendableAmount; + availableFundsInCrypto = wallet.status.spendableBalanceStr; + availableSatoshis = wallet.status.spendableAmount; + if (wallet.status.alternativeBalanceAvailable) { + availableFundsInFiat = wallet.status.spendableBalanceAlternative + ' ' + wallet.status.alternativeIsoCode; + } else { + availableFundsInFiat = ''; + } + + } else if (wallet.cachedStatus) { + + if (wallet.cachedStatus.alternativeBalanceAvailable) { + availableFundsInFiat = wallet.cachedStatus.spendableBalanceAlternative + ' ' + wallet.cachedStatus.alternativeIsoCode; + } else { + availableFundsInFiat = ''; + } + availableFundsInCrypto = wallet.cachedStatus.spendableBalanceStr; + availableSatoshis = wallet.cachedStatus.spendableAmount; + } else { - spendableAmountInSatoshis = null; + + availableFundsInFiat = ''; + availableFundsInCrypto = ''; + availableSatoshis = null; } + + } }); From 9e7566b171fb7c46876b1a2adcb9bb705170147f Mon Sep 17 00:00:00 2001 From: Brendon Duncan Date: Thu, 19 Jul 2018 12:58:17 +1200 Subject: [PATCH 12/65] Removing log statements. --- src/js/controllers/amount.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/js/controllers/amount.js b/src/js/controllers/amount.js index 1ea8f3104..92d54c281 100644 --- a/src/js/controllers/amount.js +++ b/src/js/controllers/amount.js @@ -293,7 +293,6 @@ angular.module('copayApp.controllers').controller('amountController', function($ $scope.availableFunds = availableFundsInCrypto; } - console.log('availableFunds: ' + $scope.availableFunds); updateUnitUI(); }; @@ -697,7 +696,5 @@ angular.module('copayApp.controllers').controller('amountController', function($ availableFundsInCrypto = ''; availableSatoshis = null; } - - } }); From d2d1511e61ed4cad15add697488d7d9c37ff766b Mon Sep 17 00:00:00 2001 From: Brendon Duncan Date: Thu, 19 Jul 2018 13:03:29 +1200 Subject: [PATCH 13/65] Added some additional validation checks on wallet status. --- src/js/controllers/amount.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/controllers/amount.js b/src/js/controllers/amount.js index 92d54c281..7684aaac6 100644 --- a/src/js/controllers/amount.js +++ b/src/js/controllers/amount.js @@ -671,7 +671,7 @@ angular.module('copayApp.controllers').controller('amountController', function($ }; function updateAvailableFundsFromWallet(wallet) { - if (wallet.status) { + if (wallet.status && wallet.status.isValid) { availableFundsInCrypto = wallet.status.spendableBalanceStr; availableSatoshis = wallet.status.spendableAmount; if (wallet.status.alternativeBalanceAvailable) { @@ -680,7 +680,7 @@ angular.module('copayApp.controllers').controller('amountController', function($ availableFundsInFiat = ''; } - } else if (wallet.cachedStatus) { + } else if (wallet.cachedStatus && wallet.status.isValid) { if (wallet.cachedStatus.alternativeBalanceAvailable) { availableFundsInFiat = wallet.cachedStatus.spendableBalanceAlternative + ' ' + wallet.cachedStatus.alternativeIsoCode; From 19bec8a09aac2079abc632db721a1f4cdeaf5632 Mon Sep 17 00:00:00 2001 From: Brendon Duncan Date: Thu, 19 Jul 2018 15:34:53 +1200 Subject: [PATCH 14/65] Fixed update of available funds text. --- src/js/controllers/amount.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/js/controllers/amount.js b/src/js/controllers/amount.js index 7684aaac6..40a5f63ce 100644 --- a/src/js/controllers/amount.js +++ b/src/js/controllers/amount.js @@ -696,5 +696,12 @@ angular.module('copayApp.controllers').controller('amountController', function($ availableFundsInCrypto = ''; availableSatoshis = null; } + + if (availableUnits[unitIndex].isFiat) { + $scope.availableFunds = availableFundsInFiat || availableFundsInCrypto; + } else { + $scope.availableFunds = availableFundsInCrypto; + } + } }); From 0076ff26e6c637a553991ea0d109cb72dcccb1b0 Mon Sep 17 00:00:00 2001 From: Brendon Duncan Date: Thu, 19 Jul 2018 16:24:24 +1200 Subject: [PATCH 15/65] Currency of available funds changes when the currency of the amount is changed. --- src/js/controllers/amount.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/js/controllers/amount.js b/src/js/controllers/amount.js index 40a5f63ce..c705dc24b 100644 --- a/src/js/controllers/amount.js +++ b/src/js/controllers/amount.js @@ -665,11 +665,31 @@ angular.module('copayApp.controllers').controller('amountController', function($ availableUnits[altUnitIndex].name = newAltCurrency.isoCode; availableUnits[altUnitIndex].shortName = newAltCurrency.isoCode; fiatCode = newAltCurrency.isoCode; + updateAvailableFiatIfNeeded(); updateUnitUI(); $scope.close(); }); }; + + function updateAvailableFiatIfNeeded() { + if ($scope.fromWalletId && availableSatoshis !== null) { + availableFundsInFiat = ''; + $scope.availableFunds = availableFundsInCrypto; + var coin = availableUnits[altUnitIndex].isFiat ? availableUnits[unitIndex].id : availableUnits[altUnitIndex].id; + txFormatService.formatAlternativeStr(coin, availableSatoshis, function formatCallback(formatted){ + if (formatted) { + availableFundsInFiat = formatted; + if (availableUnits[unitIndex].isFiat) { + $scope.availableFunds = availableFundsInFiat; + } else { + $scope.availableFunds = availableFundsInCrypto; + } + } + }); + } + } + function updateAvailableFundsFromWallet(wallet) { if (wallet.status && wallet.status.isValid) { availableFundsInCrypto = wallet.status.spendableBalanceStr; From 0a96ae0dbedb9b421114283c6f847af2a4024dd2 Mon Sep 17 00:00:00 2001 From: Brendon Duncan Date: Thu, 19 Jul 2018 17:06:53 +1200 Subject: [PATCH 16/65] Added $scope.isRequestingSpecifcAmount. --- src/js/controllers/amount.js | 4 ++++ www/index.html | 7 +++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/js/controllers/amount.js b/src/js/controllers/amount.js index 52695e829..f4e789436 100644 --- a/src/js/controllers/amount.js +++ b/src/js/controllers/amount.js @@ -26,6 +26,8 @@ angular.module('copayApp.controllers').controller('amountController', function($ $scope.isAndroid = platformInfo.isAndroid; $scope.isIos = platformInfo.isIOS; + $scope.isRequestingSpecificAmount = false; + $scope.$on('$ionicView.leave', function() { angular.element($window).off('keydown'); }); @@ -51,6 +53,8 @@ angular.module('copayApp.controllers').controller('amountController', function($ } } + $scope.isRequestingSpecificAmount = !!data.stateParams.id; + var config = configService.getSync().wallet.settings; function setAvailableUnits() { diff --git a/www/index.html b/www/index.html index 4c73317e3..ecc2d923c 100644 --- a/www/index.html +++ b/www/index.html @@ -11,9 +11,8 @@ - Bitcoin.com Wallet - Bitcoin.com Wallet - - + Bitcoin.com Wallet + @@ -31,7 +30,7 @@ - + From 4f4bee27f1c53eef16b541542bae2c8fac586fe5 Mon Sep 17 00:00:00 2001 From: Sebastiaan Pasma Date: Thu, 19 Jul 2018 09:59:56 +0200 Subject: [PATCH 17/65] Options also translatable --- i18n/po/template.pot | 10 ++++++++++ src/js/controllers/tab-settings.js | 2 +- www/views/preferencesPriceDisplay.html | 6 +++--- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/i18n/po/template.pot b/i18n/po/template.pot index df01cecec..aed2220fd 100644 --- a/i18n/po/template.pot +++ b/i18n/po/template.pot @@ -201,6 +201,16 @@ msgstr "" msgid "Price Display" msgstr "" +#: src/js/controllers/tab-settings.js:19 +#: www/views/preferencesPriceDisplay.html:12 +msgid "Fiat" +msgstr "" + +#: src/js/controllers/tab-settings.js:19 +#: www/views/preferencesPriceDisplay.html:15 +msgid "Cryptocurrency" +msgstr "" + #: src/js/controllers/buyAmazon.js:98 msgid "Amazon.com is not available at this moment. Please try back later." msgstr "" diff --git a/src/js/controllers/tab-settings.js b/src/js/controllers/tab-settings.js index 4d0636d53..494d63cc5 100644 --- a/src/js/controllers/tab-settings.js +++ b/src/js/controllers/tab-settings.js @@ -16,7 +16,7 @@ angular.module('copayApp.controllers').controller('tabSettingsController', funct isoCode: config.wallet.settings.alternativeIsoCode }; - $scope.selectedPriceDisplay = config.wallet.settings.priceDisplay; + $scope.selectedPriceDisplay = config.wallet.settings.priceDisplay === 'crypto' ? gettextCatalog.getString('Cryptocurrency') : gettextCatalog.getString('Fiat'); // TODO move this to a generic service bitpayAccountService.getAccounts(function(err, data) { diff --git a/www/views/preferencesPriceDisplay.html b/www/views/preferencesPriceDisplay.html index a4c12d273..31a9eb9b9 100644 --- a/www/views/preferencesPriceDisplay.html +++ b/www/views/preferencesPriceDisplay.html @@ -1,7 +1,7 @@ - {{'Price display'|translate}} + {{'Price Display'|translate}} @@ -9,10 +9,10 @@
- fiat + Fiat - cryptocurrency + Cryptocurrency
From 54478a4848619d538f694f04eabf862e8b19397f Mon Sep 17 00:00:00 2001 From: Sebastiaan Pasma Date: Thu, 19 Jul 2018 10:23:10 +0200 Subject: [PATCH 18/65] translation + faster transition --- i18n/po/template.pot | 4 ++++ src/sass/views/includes/slideToAcceptSuccess.scss | 2 +- www/views/includes/slideToAcceptSuccess.html | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/i18n/po/template.pot b/i18n/po/template.pot index 4bab9ff2e..33616a9c5 100644 --- a/i18n/po/template.pot +++ b/i18n/po/template.pot @@ -2159,6 +2159,10 @@ msgstr "" msgid "Payment Sent" msgstr "" +#: www/views/includes/slideToAcceptSuccess.html:12 +msgid "Share this transaction" +msgstr "" + #: www/views/modals/txp-details.html:32 msgid "Payment accepted, but not yet broadcasted" msgstr "" diff --git a/src/sass/views/includes/slideToAcceptSuccess.scss b/src/sass/views/includes/slideToAcceptSuccess.scss index 724363b0d..f64dd6154 100644 --- a/src/sass/views/includes/slideToAcceptSuccess.scss +++ b/src/sass/views/includes/slideToAcceptSuccess.scss @@ -70,7 +70,7 @@ slide-to-accept-success { } &__share { transition: transform $duration ease, opacity $duration ease; - transition-delay: 1000ms; + transition-delay: 600ms; opacity: 0; margin-top: 15vh; span { diff --git a/www/views/includes/slideToAcceptSuccess.html b/www/views/includes/slideToAcceptSuccess.html index ed4ebfa77..9995001ae 100644 --- a/www/views/includes/slideToAcceptSuccess.html +++ b/www/views/includes/slideToAcceptSuccess.html @@ -9,7 +9,7 @@ Payment Sent
From b1befb1e7335c200541dd74f352517db78be60d2 Mon Sep 17 00:00:00 2001 From: Sebastiaan Pasma Date: Thu, 19 Jul 2018 13:10:25 +0200 Subject: [PATCH 19/65] wallet Details buttons --- src/js/controllers/walletDetails.js | 2 ++ src/sass/views/walletDetails.scss | 16 ++++++++-------- www/views/walletDetails.html | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/js/controllers/walletDetails.js b/src/js/controllers/walletDetails.js index 24e4a5a20..b3fea717e 100644 --- a/src/js/controllers/walletDetails.js +++ b/src/js/controllers/walletDetails.js @@ -365,6 +365,8 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun var t = amountTop; $scope.altAmountOpacity = (amountHeight - 100) / 80; + + $scope.buttonsOpacity = (amountHeight - 150)/80; $window.requestAnimationFrame(function() { $scope.amountHeight = amountHeight + 'px'; $scope.contentMargin = contentMargin + 'px'; diff --git a/src/sass/views/walletDetails.scss b/src/sass/views/walletDetails.scss index 2d1aa1343..6be9e6cf2 100644 --- a/src/sass/views/walletDetails.scss +++ b/src/sass/views/walletDetails.scss @@ -147,13 +147,13 @@ background-color: transparent; } } - .nav-bar-block, .bar { - background-color: inherit !important; - } + //.nav-bar-block, .bar { + //background-color: inherit !important; + //} ion-content { &.collapsible { - margin-top: 230px; + margin-top: 210px; } padding-top: 0; @@ -193,7 +193,7 @@ .buttons { margin-bottom: 0; - margin-top: 6px; + margin-top: 30px; >.col { padding: 5px 10px; margin-bottom: 0; @@ -206,8 +206,8 @@ width: 100%; font-size: 19px; font-weight: bolder; - min-height: 45px; - line-height: 45px; + min-height: 40px; + line-height: 40px; } } } @@ -215,7 +215,7 @@ width: 100%; text-align: center; color: #fff; - height: 230px; + height: 210px; padding-top: 40px; display: block; align-items: center; diff --git a/www/views/walletDetails.html b/www/views/walletDetails.html index 820930a95..e2c0f7342 100644 --- a/www/views/walletDetails.html +++ b/www/views/walletDetails.html @@ -90,7 +90,7 @@ -
+
Receive From 700d2c8a2398e4a38b476030e5b693756a7b23db Mon Sep 17 00:00:00 2001 From: Sebastiaan Pasma Date: Thu, 19 Jul 2018 13:19:56 +0200 Subject: [PATCH 20/65] currency symbol --- src/js/services/currencySymbolService.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/js/services/currencySymbolService.js b/src/js/services/currencySymbolService.js index b4cf0c2ac..14565a1a5 100644 --- a/src/js/services/currencySymbolService.js +++ b/src/js/services/currencySymbolService.js @@ -179,10 +179,11 @@ angular.module('copayApp.services').factory('currencySymbolService', function($l }; root.getCurrencySymbol = function(code) { + if (!code) + return false; code = code.toUpperCase(); if (root.currencySymbols[code]) { - $log.debug("Currency symbol for "+code+" found"); return root.currencySymbols[code]; } $log.debug("Currency symbol for "+code+" not found"); From 442f6ba4dffc247696975e884265964ad5e54448 Mon Sep 17 00:00:00 2001 From: Sebastiaan Pasma Date: Thu, 19 Jul 2018 13:20:38 +0200 Subject: [PATCH 21/65] currency symbol --- src/js/services/currencySymbolService.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/services/currencySymbolService.js b/src/js/services/currencySymbolService.js index 14565a1a5..029cd9eb2 100644 --- a/src/js/services/currencySymbolService.js +++ b/src/js/services/currencySymbolService.js @@ -179,8 +179,8 @@ angular.module('copayApp.services').factory('currencySymbolService', function($l }; root.getCurrencySymbol = function(code) { - if (!code) - return false; + if (!code) return false; + code = code.toUpperCase(); if (root.currencySymbols[code]) { From 8ddfffd56b4dca5458545e5421cb467cdeb45be4 Mon Sep 17 00:00:00 2001 From: Sebastiaan Pasma Date: Thu, 19 Jul 2018 15:21:27 +0200 Subject: [PATCH 22/65] amount on custom amount screen --- src/js/controllers/customAmount.js | 10 ++++++- src/sass/views/custom-amount.scss | 43 +++++++++++++++++++++++------- www/views/customAmount.html | 34 ++++++++++++++++++----- 3 files changed, 69 insertions(+), 18 deletions(-) diff --git a/src/js/controllers/customAmount.js b/src/js/controllers/customAmount.js index f6b96c22c..86bfa250f 100644 --- a/src/js/controllers/customAmount.js +++ b/src/js/controllers/customAmount.js @@ -64,6 +64,14 @@ angular.module('copayApp.controllers').controller('customAmountController', func var currency = parsedAmount.currency; $scope.amountUnitStr = parsedAmount.amountUnitStr; + configService.whenAvailable(function (config) { + $scope.selectedPriceDisplay = config.wallet.settings.priceDisplay; + + $timeout(function () { + $scope.$apply(); + }); + }); + if (currency != 'BTC' && currency != 'BCH') { // Convert to BTC or BCH var config = configService.getSync().wallet.settings; @@ -71,7 +79,7 @@ angular.module('copayApp.controllers').controller('customAmountController', func var btcParsedAmount = txFormatService.parseAmount($scope.wallet.coin, amountUnit, $scope.wallet.coin); $scope.amountBtc = btcParsedAmount.amount; - $scope.altAmountStr = btcParsedAmount.amountUnitStr; + $scope.altAmountStr = btcParsedAmount.amountUnitStr.toUpperCase(); } else { $scope.amountBtc = amount; // BTC or BCH $scope.altAmountStr = txFormatService.formatAlternativeStr($scope.wallet.coin, parsedAmount.amountSat); diff --git a/src/sass/views/custom-amount.scss b/src/sass/views/custom-amount.scss index b9bf65459..17973101d 100644 --- a/src/sass/views/custom-amount.scss +++ b/src/sass/views/custom-amount.scss @@ -26,16 +26,10 @@ height: 100%; .qr-code { text-align: center; - margin-top: 24vh; - margin-bottom: 7vh; - @media(max-height: 800px) { - margin-top: 18vh; - } - @media(max-height: 700px) { - margin-top: 14vh; - } - @media(max-height: 600px) { - margin-top: 8vh; + margin-top: 6px; + qrcode canvas { + height: 30vh; + max-height: 220px; } } .info { @@ -91,5 +85,34 @@ .address-types { text-align: center; } + + .amount { + margin-top: 20vh; + margin-bottom: 4vh; + @media(max-height: 800px) { + margin-top: 12vh; + margin-bottom: 6vh; + } + @media(max-height: 700px) { + margin-top: 10vh; + margin-bottom: 4vh; + } + @media(max-height: 600px) { + margin-top: 6vh; + margin-bottom: 2vh; + + } + width: 100%; + text-align: center; + //padding-top: 30px; + display: block; + align-items: center; + justify-content: center; + + &-alternative { + line-height: 36px; + } + } + } } diff --git a/www/views/customAmount.html b/www/views/customAmount.html index a4f2d57c9..73f107d82 100644 --- a/www/views/customAmount.html +++ b/www/views/customAmount.html @@ -11,7 +11,7 @@
-
-
-
+
Address {{address}} From 95faffa7698347a323cbaa53cdafa0c0dea25929 Mon Sep 17 00:00:00 2001 From: Sebastiaan Pasma Date: Thu, 19 Jul 2018 15:30:29 +0200 Subject: [PATCH 23/65] remove bold font style --- www/views/customAmount.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/views/customAmount.html b/www/views/customAmount.html index 73f107d82..cac2bbc7d 100644 --- a/www/views/customAmount.html +++ b/www/views/customAmount.html @@ -34,13 +34,13 @@
- {{amountUnitStr}} + {{amountUnitStr}}
{{altAmountStr}}
- {{altAmountStr}} + {{altAmountStr}}
{{amountUnitStr}}
From 00ca5cded6f082052f6edbb34a0fc54cf6e211e5 Mon Sep 17 00:00:00 2001 From: Sebastiaan Pasma Date: Thu, 19 Jul 2018 15:41:06 +0200 Subject: [PATCH 24/65] uppercase pipes --- src/js/controllers/customAmount.js | 2 +- www/views/customAmount.html | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/js/controllers/customAmount.js b/src/js/controllers/customAmount.js index 86bfa250f..a3916a2d4 100644 --- a/src/js/controllers/customAmount.js +++ b/src/js/controllers/customAmount.js @@ -79,7 +79,7 @@ angular.module('copayApp.controllers').controller('customAmountController', func var btcParsedAmount = txFormatService.parseAmount($scope.wallet.coin, amountUnit, $scope.wallet.coin); $scope.amountBtc = btcParsedAmount.amount; - $scope.altAmountStr = btcParsedAmount.amountUnitStr.toUpperCase(); + $scope.altAmountStr = btcParsedAmount.amountUnitStr; } else { $scope.amountBtc = amount; // BTC or BCH $scope.altAmountStr = txFormatService.formatAlternativeStr($scope.wallet.coin, parsedAmount.amountSat); diff --git a/www/views/customAmount.html b/www/views/customAmount.html index cac2bbc7d..849487735 100644 --- a/www/views/customAmount.html +++ b/www/views/customAmount.html @@ -36,11 +36,11 @@
{{amountUnitStr}}
- {{altAmountStr}} + {{altAmountStr | uppercase}}
- {{altAmountStr}} + {{altAmountStr | uppercase}}
{{amountUnitStr}}
@@ -80,7 +80,7 @@
Amount - {{amountUnitStr}} - {{altAmountStr}} + {{amountUnitStr}} - {{altAmountStr | uppercase}}
From a0b4f10ca9a91f91389752efcc7ef8bc9041ceab Mon Sep 17 00:00:00 2001 From: Sebastiaan Pasma Date: Thu, 19 Jul 2018 15:43:32 +0200 Subject: [PATCH 25/65] reverted IDE spacings --- www/views/customAmount.html | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/www/views/customAmount.html b/www/views/customAmount.html index 849487735..a71a60202 100644 --- a/www/views/customAmount.html +++ b/www/views/customAmount.html @@ -11,7 +11,7 @@
-
-
-
+
Address {{address}} From 3952df634324176ccdbdb7652ac1992a48264dea Mon Sep 17 00:00:00 2001 From: Sebastiaan Pasma Date: Thu, 19 Jul 2018 17:07:30 +0200 Subject: [PATCH 26/65] forked the cordova media plugin to remove unused permissions --- app-template/config-template.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app-template/config-template.xml b/app-template/config-template.xml index 1c7f5a30a..2f8e3db04 100644 --- a/app-template/config-template.xml +++ b/app-template/config-template.xml @@ -72,7 +72,7 @@ - + From 713bbf71ca4efd4f04e6e551f0c005c070b26003 Mon Sep 17 00:00:00 2001 From: Sebastiaan Pasma Date: Fri, 20 Jul 2018 10:06:59 +0200 Subject: [PATCH 27/65] currency format service + remove bottom amount in request amount screen --- src/js/services/txFormatService.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/services/txFormatService.js b/src/js/services/txFormatService.js index ebcb3886a..1932ebd2a 100644 --- a/src/js/services/txFormatService.js +++ b/src/js/services/txFormatService.js @@ -201,7 +201,7 @@ angular.module('copayApp.services').factory('txFormatService', function($filter, var alternativeIsoCode = config.alternativeIsoCode; // If fiat currency - if (currency != 'BCH' && currency != 'BTC' && currency != 'sat') { + if (currency && currency.toUpperCase() != 'BCH' && currency.toUpperCase() != 'BTC' && currency != 'sat') { amountUnitStr = $filter('formatFiatAmount')(amount) + ' ' + currency; amountSat = rateService.fromFiat(amount, currency, coin).toFixed(0); } else if (currency == 'sat') { From 1153830d05724322aa89444273c70a23e072ba77 Mon Sep 17 00:00:00 2001 From: Sebastiaan Pasma Date: Fri, 20 Jul 2018 10:41:09 +0200 Subject: [PATCH 28/65] custom amount screen --- www/views/customAmount.html | 6 ------ 1 file changed, 6 deletions(-) diff --git a/www/views/customAmount.html b/www/views/customAmount.html index a71a60202..d6a474d1a 100644 --- a/www/views/customAmount.html +++ b/www/views/customAmount.html @@ -71,12 +71,6 @@ {{address}}
-
- Amount - - {{amountUnitStr}} - {{altAmountStr | uppercase}} - -
From ac91282c13ac419f15513106df9eb1f52adc114c Mon Sep 17 00:00:00 2001 From: Brendon Duncan Date: Mon, 23 Jul 2018 12:02:04 -0700 Subject: [PATCH 29/65] Indicative change for view. --- www/views/amount.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/views/amount.html b/www/views/amount.html index af4e9d55c..8361dcd73 100644 --- a/www/views/amount.html +++ b/www/views/amount.html @@ -27,7 +27,7 @@
-
-
- +
From 91dac0f54c460fb7d41cb8c5a523847454df7050 Mon Sep 17 00:00:00 2001 From: Brendon Duncan Date: Tue, 24 Jul 2018 12:37:51 -0700 Subject: [PATCH 32/65] Refactored Enter Amount controller to follow latest Angular 1 guidelines. --- src/js/controllers/amount.js | 471 +++++++++++++++--------------- src/js/routes.js | 7 + www/views/amount.html | 50 ++-- www/views/modals/altCurrency.html | 18 +- 4 files changed, 276 insertions(+), 270 deletions(-) diff --git a/src/js/controllers/amount.js b/src/js/controllers/amount.js index f4e789436..1bc492136 100644 --- a/src/js/controllers/amount.js +++ b/src/js/controllers/amount.js @@ -1,62 +1,166 @@ 'use strict'; -angular.module('copayApp.controllers').controller('amountController', function($scope, $filter, $timeout, $ionicModal, $ionicScrollDelegate, $ionicHistory, storageService, walletService, gettextCatalog, platformInfo, lodash, configService, rateService, $stateParams, $window, $state, $log, txFormatService, ongoingProcess, popupService, bwcError, payproService, profileService, bitcore, amazonService, nodeWebkitService) { +angular.module('copayApp.controllers').controller('amountController', amountController); + +function amountController(configService, $filter, $ionicHistory, $ionicModal, $ionicScrollDelegate, lodash, $log, nodeWebkitService, rateService, $scope, $state, $stateParams, $timeout, txFormatService, platformInfo, popupService, profileService, walletService, $window) { + var vm = this; + + vm.allowSend = false; + vm.altCurrencyList = []; + vm.alternativeAmount = ''; + vm.alternativeUnit = ''; + vm.amountModel = { amount: 0 }; + vm.fromWalletId = ''; + vm.globalResult = ''; + vm.isRequestingSpecificAmount = false; + vm.listComplete = false; + vm.lastUsedPopularList = []; + vm.maxShapeshiftAmount = 0; + vm.minShapeshiftAmount = 0; + vm.shapeshiftOrderId = ''; + vm.unit = ''; + + vm.changeUnit = changeUnit; + vm.close = close; + vm.findCurrency = findCurrency; + vm.finish = finish; + vm.goBack = goBack; + vm.loadMore = loadMore; + vm.openPopup = openPopup; + vm.pushDigit = pushDigit; + vm.removeDigit = removeDigit; + vm.save = save; + vm.sendMax = sendMax; + + $scope.$on('$ionicView.beforeEnter', onBeforeEnter); + $scope.$on('$ionicView.leave', onLeave); - var _id; - var unitToSatoshi; - var satToUnit; - var unitDecimals; - var satToBtc; - var SMALL_FONT_SIZE_LIMIT = 10; var LENGTH_EXPRESSION_LIMIT = 19; var LENGTH_BEFORE_COMMA_EXPRESSION_LIMIT = 8; var LENGTH_AFTER_COMMA_EXPRESSION_LIMIT = 8; - var isNW = platformInfo.isNW; - var unitIndex = 0; + var _id; + var altCurrencyModal = null; var altUnitIndex = 0; var availableUnits = []; + var displayAddress = null; var fiatCode; - var fixedUnit; + var hasMaxAmount = true; + var isNW = platformInfo.isNW; + var isAndroid = platformInfo.isAndroid; + var isIos = platformInfo.isIOS; + var lastUsedAltCurrencyList = []; + var nextStep = null; + var unitToSatoshi; + var recipientType = null; + var satToUnit; + var showMenu = false; + var showWarningMessage = false; + var toAddress = ''; + var toColor = null; + var toEmail = null; + var toName = null; + var unitDecimals; + var unitIndex = 0; + var useSendMax = false; - $scope.amountModel = { amount: 0 }; - - $scope.isChromeApp = platformInfo.isChromeApp; - $scope.isAndroid = platformInfo.isAndroid; - $scope.isIos = platformInfo.isIOS; - - $scope.isRequestingSpecificAmount = false; - - $scope.$on('$ionicView.leave', function() { + function onLeave() { angular.element($window).off('keydown'); - }); - - $scope.$on("$ionicView.beforeEnter", function(event, data) { + } + function onBeforeEnter(event, data) { + initCurrencies(); if (data.stateParams.shapeshiftOrderId && data.stateParams.shapeshiftOrderId.length > 0) { - $scope.minShapeshiftAmount = parseFloat(data.stateParams.minShapeshiftAmount); - $scope.maxShapeshiftAmount = parseFloat(data.stateParams.maxShapeshiftAmount); - $scope.shapeshiftOrderId = data.stateParams.shapeshiftOrderId; + vm.minShapeshiftAmount = parseFloat(data.stateParams.minShapeshiftAmount); + vm.maxShapeshiftAmount = parseFloat(data.stateParams.maxShapeshiftAmount); + vm.shapeshiftOrderId = data.stateParams.shapeshiftOrderId; } // To get the wallet from with the new flow - $scope.fromWalletId = data.stateParams.fromWalletId; + vm.fromWalletId = data.stateParams.fromWalletId; if (data.stateParams.noPrefix) { - $scope.showWarningMessage = data.stateParams.noPrefix != 0; - if ($scope.showWarningMessage) { + showWarningMessage = data.stateParams.noPrefix != 0; + if (showWarningMessage) { var message = 'Address doesn\'t contain currency information, please make sure you are sending the correct currency.'; popupService.showAlert('', message, function() {}, 'Ok'); } } - $scope.isRequestingSpecificAmount = !!data.stateParams.id; - + vm.isRequestingSpecificAmount = !!data.stateParams.id; var config = configService.getSync().wallet.settings; + // Go to... + _id = data.stateParams.id; // Optional (BitPay Card ID or Wallet ID) + nextStep = data.stateParams.nextStep; + + setAvailableUnits(); + updateUnitUI(); + + if ($ionicHistory.backView().stateName == 'tabs.receive') { + hasMaxAmount = false; + } + + showMenu = $ionicHistory.backView() && ($ionicHistory.backView().stateName == 'tabs.send' || $ionicHistory.backView().stateName == 'tabs.bitpayCard'); + recipientType = data.stateParams.recipientType || null; + toAddress = data.stateParams.toAddress; + displayAddress = data.stateParams.displayAddress; + toName = data.stateParams.toName; + toEmail = data.stateParams.toEmail; + toColor = data.stateParams.toColor; + + if (!nextStep && !data.stateParams.toAddress) { + $log.error('Bad params at amount') + throw ('bad params'); + } + + var reNr = /^[1234567890\.]$/; + var reOp = /^[\*\+\-\/]$/; + + if (!isAndroid && !isIos) { + var disableKeys = angular.element($window).on('keydown', function(e) { + if (!e.key) return; + if (e.which === 8) { // you can add others here inside brackets. + if (!altCurrencyModal) { + e.preventDefault(); + vm.removeDigit(); + } + } + + if (e.key.match(reNr)) { + vm.pushDigit(e.key); + } else if (e.key.match(reOp)) { + pushOperator(e.key); + } else if (e.keyCode === 86) { + if (e.ctrlKey || e.metaKey) processClipboard(); + } else if (e.keyCode === 13) vm.finish(); + + $timeout(function() { + $scope.$apply(); + }); + }); + } + + unitToSatoshi = config.unitToSatoshi; + satToUnit = 1 / unitToSatoshi; + unitDecimals = config.unitDecimals; + + resetAmount(); + + // in SAT ALWAYS + if ($stateParams.toAmount) { + vm.amountModel.amount = (($stateParams.toAmount) * satToUnit).toFixed(unitDecimals); + } + + processAmount(); + + $timeout(function() { + $ionicScrollDelegate.resize(); + }, 10); + function setAvailableUnits() { var defaults = configService.getDefaults(); var configCache = configService.getSync(); @@ -139,82 +243,10 @@ angular.module('copayApp.controllers').controller('amountController', function($ altUnitIndex = 0; }; + }; - // Go to... - _id = data.stateParams.id; // Optional (BitPay Card ID or Wallet ID) - $scope.nextStep = data.stateParams.nextStep; - - setAvailableUnits(); - updateUnitUI(); - - $scope.hasMaxAmount = true; - if ($ionicHistory.backView().stateName == 'tabs.receive') { - $scope.hasMaxAmount = false; - } - - $scope.showMenu = $ionicHistory.backView() && ($ionicHistory.backView().stateName == 'tabs.send' || $ionicHistory.backView().stateName == 'tabs.bitpayCard'); - $scope.recipientType = data.stateParams.recipientType || null; - $scope.toAddress = data.stateParams.toAddress; - $scope.displayAddress = data.stateParams.displayAddress; - $scope.toName = data.stateParams.toName; - $scope.toEmail = data.stateParams.toEmail; - $scope.toColor = data.stateParams.toColor; - - if (!$scope.nextStep && !data.stateParams.toAddress) { - $log.error('Bad params at amount') - throw ('bad params'); - } - - var reNr = /^[1234567890\.]$/; - var reOp = /^[\*\+\-\/]$/; - - if (!$scope.isAndroid && !$scope.isIos) { - var disableKeys = angular.element($window).on('keydown', function(e) { - if (!e.key) return; - if (e.which === 8) { // you can add others here inside brackets. - if (!$scope.altCurrencyModal) { - e.preventDefault(); - $scope.removeDigit(); - } - } - - if (e.key.match(reNr)) { - $scope.pushDigit(e.key); - } else if (e.key.match(reOp)) { - $scope.pushOperator(e.key); - } else if (e.keyCode === 86) { - if (e.ctrlKey || e.metaKey) processClipboard(); - } else if (e.keyCode === 13) $scope.finish(); - - $timeout(function() { - $scope.$apply(); - }); - }); - } - - $scope.specificAmount = $scope.specificAlternativeAmount = ''; - $scope.isCordova = platformInfo.isCordova; - unitToSatoshi = config.unitToSatoshi; - satToUnit = 1 / unitToSatoshi; - satToBtc = 1 / 100000000; - unitDecimals = config.unitDecimals; - - $scope.resetAmount(); - - // in SAT ALWAYS - if ($stateParams.toAmount) { - $scope.amountModel.amount = (($stateParams.toAmount) * satToUnit).toFixed(unitDecimals); - } - - $scope.processAmount(); - - $timeout(function() { - $ionicScrollDelegate.resize(); - }, 10); - }); - - $scope.goBack = function() { - if ($scope.shapeshiftOrderId) { + function goBack() { + if (vm.shapeshiftOrderId) { $state.go('tabs.send').then(function() { $ionicHistory.clearHistory(); $state.go('tabs.home').then(function() { @@ -227,8 +259,8 @@ angular.module('copayApp.controllers').controller('amountController', function($ } function paste(value) { - $scope.amountModel.amount = value; - $scope.processAmount(); + vm.amountModel.amount = value; + processAmount(); $timeout(function() { $scope.$apply(); }); @@ -240,29 +272,22 @@ angular.module('copayApp.controllers').controller('amountController', function($ if (value && evaluate(value) > 0) paste(evaluate(value)); }; - $scope.sendMax = function() { - $scope.useSendMax = true; - $scope.finish(); - }; - - $scope.toggleAlternative = function() { - if ($scope.amountModel.amount && isExpression($scope.amountModel.amount)) { - var amount = evaluate(format($scope.amountModel.amount)); - $scope.globalResult = '= ' + processResult(amount); - } + function sendMax() { + useSendMax = true; + finish(); }; function updateUnitUI() { - $scope.unit = availableUnits[unitIndex].shortName; - $scope.alternativeUnit = availableUnits[altUnitIndex].shortName; + vm.unit = availableUnits[unitIndex].shortName; + vm.alternativeUnit = availableUnits[altUnitIndex].shortName; - $scope.processAmount(); - $log.debug('Update unit coin @amount unit:' + $scope.unit + " alternativeUnit:" + $scope.alternativeUnit); + processAmount(); + $log.debug('Update unit coin @amount unit:' + vm.unit + " alternativeUnit:" + vm.alternativeUnit); }; - $scope.changeUnit = function() { + function changeUnit() { - $scope.amountModel.amount = '0'; + vm.amountModel.amount = '0'; if (fixedUnit) return; @@ -282,59 +307,35 @@ angular.module('copayApp.controllers').controller('amountController', function($ updateUnitUI(); }; - - $scope.changeAlternativeUnit = function() { - - // Do nothing is fiat is not main unit - if (!availableUnits[unitIndex].isFiat) return; - - var nextCoin = lodash.findIndex(availableUnits, function(x) { - if (x.isFiat) return false; - if (x.id == availableUnits[altUnitIndex].id) return false; - return true; - }); - - if (nextCoin >= 0) { - altUnitIndex = nextCoin; - updateUnitUI(); - } - }; - - function checkFontSize() { - if ($scope.amountModel.amount && $scope.amountModel.amount.length >= SMALL_FONT_SIZE_LIMIT) $scope.smallFont = true; - else $scope.smallFont = false; - }; - - $scope.pushDigit = function(digit) { - if ($scope.amountModel.amount && digit != '.') { - var amountSplitByComma = $scope.amountModel.amount.split('.'); + function pushDigit(digit) { + if (vm.amountModel.amount && digit != '.') { + var amountSplitByComma = vm.amountModel.amount.split('.'); if (amountSplitByComma.length > 1 && amountSplitByComma[1].length >= LENGTH_AFTER_COMMA_EXPRESSION_LIMIT) return; if (amountSplitByComma.length == 1 && amountSplitByComma[0].length >= LENGTH_BEFORE_COMMA_EXPRESSION_LIMIT) return; } - if ($scope.amountModel.amount && $scope.amountModel.amount.length >= LENGTH_EXPRESSION_LIMIT) return; - if ($scope.amountModel.amount.indexOf('.') > -1 && digit == '.') return; - if ($scope.amountModel.amount == '0' && digit == '0') return; - if (availableUnits[unitIndex].isFiat && $scope.amountModel.amount.indexOf('.') > -1 && $scope.amountModel.amount[$scope.amountModel.amount.indexOf('.') + 2]) return; + if (vm.amountModel.amount && vm.amountModel.amount.length >= LENGTH_EXPRESSION_LIMIT) return; + if (vm.amountModel.amount.indexOf('.') > -1 && digit == '.') return; + if (vm.amountModel.amount == '0' && digit == '0') return; + if (availableUnits[unitIndex].isFiat && vm.amountModel.amount.indexOf('.') > -1 && vm.amountModel.amount[vm.amountModel.amount.indexOf('.') + 2]) return; - if ($scope.amountModel.amount == '0' && digit != '.') { - $scope.amountModel.amount = ''; + if (vm.amountModel.amount == '0' && digit != '.') { + vm.amountModel.amount = ''; } - if ($scope.amountModel.amount == '' && digit == '.') { - $scope.amountModel.amount = '0'; + if (vm.amountModel.amount == '' && digit == '.') { + vm.amountModel.amount = '0'; } - $scope.amountModel.amount = ($scope.amountModel.amount + digit).replace('..', '.'); - checkFontSize(); - $scope.processAmount(); + vm.amountModel.amount = (vm.amountModel.amount + digit).replace('..', '.'); + processAmount(); }; - $scope.pushOperator = function(operator) { - if (!$scope.amountModel.amount || $scope.amountModel.amount.length == 0) return; - $scope.amountModel.amount = _pushOperator($scope.amountModel.amount); + function pushOperator(operator) { + if (!vm.amountModel.amount || vm.amountModel.amount.length == 0) return; + vm.amountModel.amount = pushOperator(vm.amountModel.amount); - function _pushOperator(val) { + function pushOperator(val) { if (!isOperator(lodash.last(val))) { return val + operator; } else { @@ -353,61 +354,59 @@ angular.module('copayApp.controllers').controller('amountController', function($ return regex.test(val); }; - $scope.removeDigit = function() { - $scope.amountModel.amount = ($scope.amountModel.amount).toString().slice(0, -1); - $scope.processAmount(); - checkFontSize(); - }; + function removeDigit() { + vm.amountModel.amount = (vm.amountModel.amount).toString().slice(0, -1); + processAmount(); + } - $scope.resetAmount = function() { - $scope.amountModel.amount = $scope.alternativeAmount = $scope.globalResult = ''; - $scope.allowSend = false; - checkFontSize(); - }; + function resetAmount() { + vm.amountModel.amount = vm.alternativeAmount = vm.globalResult = ''; + vm.allowSend = false; + } - $scope.openPopup = function() { + function openPopup() { $ionicModal.fromTemplateUrl('views/modals/altCurrency.html', { scope: $scope }).then(function(modal) { - $scope.altCurrencyModal = modal; - $scope.altCurrencyModal.show(); + altCurrencyModal = modal; + altCurrencyModal.show(); }); + } + + function close() { + altCurrencyModal.remove(); + altCurrencyModal = null; }; - $scope.close = function() { - $scope.altCurrencyModal.remove(); - $scope.altCurrencyModal = false; - }; - - $scope.processAmount = function() { - var formatedValue = format($scope.amountModel.amount); + function processAmount() { + var formatedValue = format(vm.amountModel.amount); var result = evaluate(formatedValue); if (lodash.isNumber(result)) { - $scope.globalResult = isExpression($scope.amountModel.amount) ? '= ' + processResult(result) : ''; + vm.globalResult = isExpression(vm.amountModel.amount) ? '= ' + processResult(result) : ''; if (availableUnits[unitIndex].isFiat) { var a = fromFiat(result); if (a) { - $scope.alternativeAmount = txFormatService.formatAmount(a * unitToSatoshi, true); - $scope.allowSend = lodash.isNumber(a) && a > 0 - && (!$scope.shapeshiftOrderId - || (a >= $scope.minShapeshiftAmount && a <= $scope.maxShapeshiftAmount)); + vm.alternativeAmount = txFormatService.formatAmount(a * unitToSatoshi, true); + vm.allowSend = lodash.isNumber(a) && a > 0 + && (!vm.shapeshiftOrderId + || (a >= vm.minShapeshiftAmount && a <= vm.maxShapeshiftAmount)); } else { if (result) { - $scope.alternativeAmount = 'N/A'; + vm.alternativeAmount = 'N/A'; } else { - $scope.alternativeAmount = null; + vm.alternativeAmount = null; } - $scope.allowSend = false; + vm.allowSend = false; } } else { - $scope.alternativeAmount = $filter('formatFiatAmount')(toFiat(result)); - $scope.allowSend = lodash.isNumber(result) && result > 0 - && (!$scope.shapeshiftOrderId - || (result >= $scope.minShapeshiftAmount && result <= $scope.maxShapeshiftAmount)); + vm.alternativeAmount = $filter('formatFiatAmount')(toFiat(result)); + vm.allowSend = lodash.isNumber(result) && result > 0 + && (!vm.shapeshiftOrderId + || (result >= vm.minShapeshiftAmount && result <= vm.maxShapeshiftAmount)); } } }; @@ -448,24 +447,24 @@ angular.module('copayApp.controllers').controller('amountController', function($ return result.replace('x', '*'); }; - $scope.finish = function() { + function finish() { function finish() { var unit = availableUnits[unitIndex]; - var _amount = evaluate(format($scope.amountModel.amount)); + var _amount = evaluate(format(vm.amountModel.amount)); var coin = unit.id; if (unit.isFiat) { coin = availableUnits[altUnitIndex].id; } - if ($scope.nextStep) { - $state.transitionTo($scope.nextStep, { + if (nextStep) { + $state.transitionTo(nextStep, { id: _id, - amount: $scope.useSendMax ? null : _amount, + amount: useSendMax ? null : _amount, currency: unit.id.toUpperCase(), coin: coin, - useSendMax: $scope.useSendMax, - fromWalletId: $scope.fromWalletId + useSendMax: useSendMax, + fromWalletId: vm.fromWalletId }); } else { var amount = _amount; @@ -477,52 +476,52 @@ angular.module('copayApp.controllers').controller('amountController', function($ } var confirmData = { - recipientType: $scope.recipientType, + recipientType: recipientType, toAmount: amount, - toAddress: $scope.toAddress, - displayAddress: $scope.displayAddress || $scope.toAddress, - toName: $scope.toName, - toEmail: $scope.toEmail, - toColor: $scope.toColor, + toAddress: toAddress, + displayAddress: displayAddress || toAddress, + toName: toName, + toEmail: toEmail, + toColor: toColor, coin: coin, - useSendMax: $scope.useSendMax, - fromWalletId: $scope.fromWalletId + useSendMax: useSendMax, + fromWalletId: vm.fromWalletId }; - if ($scope.shapeshiftOrderId) { + if (vm.shapeshiftOrderId) { var shapeshiftOrderUrl = 'https://www.shapeshift.io/#/status/'; - shapeshiftOrderUrl += $scope.shapeshiftOrderId; + shapeshiftOrderUrl += vm.shapeshiftOrderId; confirmData.description = shapeshiftOrderUrl; - confirmData.fromWalletId = $scope.fromWalletId; + confirmData.fromWalletId = vm.fromWalletId; if (confirmData.useSendMax) { var wallet = lodash.find(profileService.getWallets({ coin: coin }), function(w) { - return w.id == $scope.fromWalletId; + return w.id == vm.fromWalletId; }); var balance = parseFloat(wallet.cachedBalance.substring(0, wallet.cachedBalance.length-4)); - if (balance < $scope.minShapeshiftAmount * 1.04) { + if (balance < vm.minShapeshiftAmount * 1.04) { confirmData.useSendMax = false; - confirmData.toAmount = $scope.minShapeshiftAmount * unitToSatoshi; - } else if (balance > $scope.maxShapeshiftAmount) { + confirmData.toAmount = vm.minShapeshiftAmount * unitToSatoshi; + } else if (balance > vm.maxShapeshiftAmount) { confirmData.useSendMax = false; - confirmData.toAmount = $scope.maxShapeshiftAmount * unitToSatoshi * 0.99; + confirmData.toAmount = vm.maxShapeshiftAmount * unitToSatoshi * 0.99; } } } $state.transitionTo('tabs.send.confirm', confirmData); } - $scope.useSendMax = null; + useSendMax = null; } - if ($scope.showWarningMessage) { - var u = $scope.unit == 'BCH' || $scope.unit == 'BTC' ? $scope.unit : $scope.alternativeUnit; + if (showWarningMessage) { + var u = vm.unit == 'BCH' || vm.unit == 'BTC' ? vm.unit : vm.alternativeUnit; var message = 'Are you sure you want to send ' + u.toUpperCase() + '?'; popupService.showConfirm(message, '', 'Yes', 'No', function(res) { if (!res) { - $scope.useSendMax = null; + useSendMax = null; return; }; finish(); @@ -566,10 +565,10 @@ angular.module('copayApp.controllers').controller('amountController', function($ }]; rateService.whenAvailable(function() { - $scope.listComplete = false; + vm.listComplete = false; var idx = lodash.indexBy(unusedCurrencyList, 'isoCode'); - var idx2 = lodash.indexBy($scope.lastUsedAltCurrencyList, 'isoCode'); + var idx2 = lodash.indexBy(lastUsedAltCurrencyList, 'isoCode'); var idx3 = lodash.indexBy(popularCurrencyList, 'isoCode'); var alternatives = rateService.listAlternatives(true); @@ -582,8 +581,8 @@ angular.module('copayApp.controllers').controller('amountController', function($ } }); - $scope.altCurrencyList = completeAlternativeList.slice(0, 10); - $scope.lastUsedPopularList = lodash.unique(lodash.union($scope.lastUsedAltCurrencyList, popularCurrencyList), 'isoCode'); + vm.altCurrencyList = completeAlternativeList.slice(0, 10); + vm.lastUsedPopularList = lodash.unique(lodash.union(lastUsedAltCurrencyList, popularCurrencyList), 'isoCode'); $timeout(function() { $scope.$apply(); @@ -591,19 +590,19 @@ angular.module('copayApp.controllers').controller('amountController', function($ }); } - $scope.loadMore = function() { + function loadMore() { $timeout(function() { - $scope.altCurrencyList = completeAlternativeList.slice(0, next); + vm.altCurrencyList = completeAlternativeList.slice(0, next); next += 10; - $scope.listComplete = $scope.altCurrencyList.length >= completeAlternativeList.length; + vm.listComplete = vm.altCurrencyList.length >= completeAlternativeList.length; $scope.$broadcast('scroll.infiniteScrollComplete'); }, 100); }; - $scope.findCurrency = function(search) { + function findCurrency(search) { if (!search) initCurrencies(); - var list = lodash.unique(lodash.union(completeAlternativeList, lodash.union($scope.lastUsedAltCurrencyList, popularCurrencyList)), 'isoCode'); - $scope.altCurrencyList = lodash.filter(list, function(item) { + var list = lodash.unique(lodash.union(completeAlternativeList, lodash.union(lastUsedAltCurrencyList, popularCurrencyList)), 'isoCode'); + vm.altCurrencyList = lodash.filter(list, function(item) { var val = item.name var val2 = item.isoCode; return lodash.includes(val.toLowerCase(), search.toLowerCase()) || lodash.includes(val2.toLowerCase(), search.toLowerCase()); @@ -613,7 +612,7 @@ angular.module('copayApp.controllers').controller('amountController', function($ }); }; - $scope.save = function(newAltCurrency) { + function save(newAltCurrency) { var opts = { wallet: { settings: { @@ -634,7 +633,7 @@ angular.module('copayApp.controllers').controller('amountController', function($ availableUnits[altUnitIndex].shortName = newAltCurrency.isoCode; fiatCode = newAltCurrency.isoCode; updateUnitUI(); - $scope.close(); + close(); }); }; -}); +} diff --git a/src/js/routes.js b/src/js/routes.js index 8277314e5..286b27ab1 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -291,6 +291,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr views: { 'tab-send@tabs': { controller: 'amountController', + controllerAs: 'vm', templateUrl: 'views/amount.html' } } @@ -699,6 +700,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr views: { 'tab-receive@tabs': { controller: 'amountController', + controllerAs: 'vm', templateUrl: 'views/amount.html' } } @@ -845,6 +847,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr views: { 'tab-home@tabs': { controller: 'amountController', + controllerAs: 'vm', templateUrl: 'views/amount.html' } } @@ -910,6 +913,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr views: { 'tab-home@tabs': { controller: 'amountController', + controllerAs: 'vm', templateUrl: 'views/amount.html' } } @@ -1029,6 +1033,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr views: { 'tab-home@tabs': { controller: 'amountController', + controllerAs: 'vm', templateUrl: 'views/amount.html' } }, @@ -1081,6 +1086,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr views: { 'tab-home@tabs': { controller: 'amountController', + controllerAs: 'vm', templateUrl: 'views/amount.html' } }, @@ -1137,6 +1143,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr views: { 'tab-home@tabs': { controller: 'amountController', + controllerAs: 'vm', templateUrl: 'views/amount.html' } } diff --git a/www/views/amount.html b/www/views/amount.html index e803ffc10..90187ef59 100644 --- a/www/views/amount.html +++ b/www/views/amount.html @@ -3,37 +3,37 @@ {{'Enter amount' | translate}} - +
-
- Minimum amount: {{minShapeshiftAmount}}
- Maximum amount: {{maxShapeshiftAmount}}
+
+ Minimum amount: {{vm.minShapeshiftAmount}}
+ Maximum amount: {{vm.maxShapeshiftAmount}}
- {{ amountModel.amount || 0 }}{{unit}} + ng-class="{long: vm.amountModel.amount.length > 5, 'very-long': vm.amountModel.amount.length > 10}"> + {{ vm.amountModel.amount || 0 }}{{vm.unit}}
- {{globalResult}} {{unit}} + {{vm.globalResult}} {{vm.unit}}
- {{alternativeAmount || '0.00'}} {{alternativeUnit}} + {{vm.alternativeAmount || '0.00'}} {{vm.alternativeUnit}}
-
+
- -
@@ -11,23 +11,23 @@
-
- {{lastUsedAltCurrency.name}} {{lastUsedAltCurrency.isoCode}} +
+ {{lastUsedAltCurrency.name}} {{lastUsedAltCurrency.isoCode}}
-
{{altCurrency.name}} {{altCurrency.isoCode}} +
{{altCurrency.name}} {{altCurrency.isoCode}}
From bba85794ac3599127b6627f11baaf6d435ee30a5 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Dominguez Date: Wed, 25 Jul 2018 16:17:42 +0900 Subject: [PATCH 33/65] BitAnalytics 0.2.1 with GA --- Gruntfile.js | 2 +- ...{bitanalytics-0.1.0.js => bitanalytics.js} | 260 +++++++++++++++--- src/js/controllers/addressbookAdd.js | 6 +- src/js/controllers/confirm.js | 6 +- .../controllers/preferencesNotifications.js | 6 +- src/js/controllers/tab-receive.js | 6 +- src/js/controllers/walletDetails.js | 6 +- src/js/routes.js | 6 +- src/js/services/profileService.js | 6 +- www/index.html | 7 +- 10 files changed, 245 insertions(+), 66 deletions(-) rename bitanalytics/{bitanalytics-0.1.0.js => bitanalytics.js} (97%) diff --git a/Gruntfile.js b/Gruntfile.js index 342cc85e7..eb4bb2eb0 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -163,7 +163,7 @@ module.exports = function(grunt) { }, bitanalytics: { src: [ - 'bitanalytics/bitanalytics-0.1.0.js' + 'bitanalytics/bitanalytics.js' ], dest: 'www/lib/bitanalytics.js' }, diff --git a/bitanalytics/bitanalytics-0.1.0.js b/bitanalytics/bitanalytics.js similarity index 97% rename from bitanalytics/bitanalytics-0.1.0.js rename to bitanalytics/bitanalytics.js index db149e481..c8c0d8870 100644 --- a/bitanalytics/bitanalytics-0.1.0.js +++ b/bitanalytics/bitanalytics.js @@ -6276,7 +6276,7 @@ var ClickAction = /** @class */ (function (_super) { }(action_1.default)); exports.default = ClickAction; -},{"../action":4,"../log-event":15,"../log-event-handlers":14}],6:[function(require,module,exports){ +},{"../action":4,"../log-event":16,"../log-event-handlers":15}],6:[function(require,module,exports){ "use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; @@ -6315,7 +6315,7 @@ var BitAnalytics = /** @class */ (function () { exports.default = BitAnalytics; BitAnalytics.main(); -},{"./action-factory":2,"./action-handlers":3,"./channels/adjust-channel":9,"./channels/mixpanel-channel":12,"./log-event":15,"./log-event-handlers":14}],7:[function(require,module,exports){ +},{"./action-factory":2,"./action-handlers":3,"./channels/adjust-channel":9,"./channels/mixpanel-channel":12,"./log-event":16,"./log-event-handlers":15}],7:[function(require,module,exports){ "use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; @@ -6560,11 +6560,10 @@ var FirebaseChannel = /** @class */ (function (_super) { var keys = Object.keys(params); var keysLength = keys.length; var sanitized = {}; - for (var i = 0; i < keysLength; i++) { - var key = keys[i]; + keys.map(function (key) { var cleanKey = key.replace('-', '_').replace(/[\W]+/g, ''); sanitized[cleanKey] = params[key]; - } + }); return sanitized; }; return FirebaseChannel; @@ -6588,13 +6587,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); var channel_1 = __importDefault(require("../channel")); +var ga_1 = __importDefault(require("../external-libs/ga")); var GoogleAnalyticsChannel = /** @class */ (function (_super) { __extends(GoogleAnalyticsChannel, _super); function GoogleAnalyticsChannel(name, config) { var _this = _super.call(this, name) || this; - _this.dataLayer = null; _this.gaInstance = null; - _this.trackingId = ''; _this.eventLabels = ['id']; if (!config.trackingId) { throw new Error('[BitAnalytics] Google Analytics config is missing tracking ID.'); @@ -6602,8 +6600,12 @@ var GoogleAnalyticsChannel = /** @class */ (function (_super) { if (config.eventLabels) { _this.eventLabels = config.eventLabels; } - _this.trackingId = config.trackingId; - _this.setUpGa(); + _this.gaInstance = new ga_1.default({ + trackID: config.trackingId, + appVersion: config.appVersion, + appName: config.appName || 'App' + }); + _this.isReady = true; return _this; } /** @@ -6612,49 +6614,26 @@ var GoogleAnalyticsChannel = /** @class */ (function (_super) { * */ GoogleAnalyticsChannel.prototype.postEvent = function (name, params) { - // Default Google Analytics Events - // https://developers.google.com/analytics/devguides/collection/gtagjs/events - // Useful to convert to these, or start with these? if (this.isReady) { - params.event_category = name; + var category = name; + var action = name; + var label = name; + var value = params['value'] || ''; for (var _i = 0, _a = this.eventLabels; _i < _a.length; _i++) { var eventLabel = _a[_i]; if (params[eventLabel]) { - params.event_label = params[eventLabel]; + label = params[eventLabel]; break; } } - this.gtag('event', name, params); + this.gaInstance.event(category, action, label, value); } }; - /** - * - * Private methods - * - */ - /** - * Mimics function in the tracking snippet - */ - GoogleAnalyticsChannel.prototype.gtag = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - console.log(arguments); - window.dataLayer.push(arguments); - }; - GoogleAnalyticsChannel.prototype.setUpGa = function () { - // From what GA recommends to insert into page - window.dataLayer = window.dataLayer || []; - this.gtag('js', new Date()); - this.gtag('config', this.trackingId); - this.isReady = true; - }; return GoogleAnalyticsChannel; }(channel_1.default)); exports.default = GoogleAnalyticsChannel; -},{"../channel":8}],12:[function(require,module,exports){ +},{"../channel":8,"../external-libs/ga":14}],12:[function(require,module,exports){ "use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || @@ -6746,6 +6725,207 @@ exports.default = MixpanelChannel; },{}],14:[function(require,module,exports){ "use strict"; +/* + * name: nwjs-analytics -Node-Webkit Google Analytics integration + * version: 1.0.2 + * github: https://github.com/Daaru00/nwjs-analytics + */ +function GA(opt) { + this.apiVersion = opt.apiVersion || '1'; + this.trackID = opt.trackID || 'UA-XXXXXXXX-X'; + this.clientID = opt.clientID || null; + this.userID = opt.userID || null; + this.appName = opt.appName || 'App'; + this.appVersion = opt.appVersion || '1.0.0'; + this.debug = opt.debug || false; + this.performanceTracking = opt.performanceTracking || true; + this.errorTracking = opt.errorTracking || true; + this.userLanguage = opt.userLanguage || "en"; + this.currency = opt.currency || "EUR"; + this.lastScreenName = opt.lastScreenName || ''; +} +GA.prototype.sendRequest = function (data, callback) { + var ga = this; + if (!this.clientID || this.clientID == null) + this.clientID = this.generateClientID(); + if (!this.userID || this.userID == null) + this.userID = this.generateClientID(); + var postData = "v=" + this.apiVersion + + "&an=" + this.appName + + "&av=" + this.appVersion + + "&tid=" + this.trackID + + "&cid=" + this.clientID + + "&sr=" + this.getScreenResolution() + + "&vp=" + this.getViewportSize(); + Object.keys(data).forEach(function (key) { + var val = data[key]; + if (typeof val != "undefined") + postData += "&" + key + "=" + val; + }); + var http = new XMLHttpRequest(); + var url = "https://www.google-analytics.com"; + if (!this.debug) + url += "/collect"; + else + url += "/debug/collect"; + http.open("GET", url + "?" + postData, true); + http.onreadystatechange = function () { + if (ga.debug) + console.log(http.response); + if (http.readyState == 4 && http.status == 200) { + if (callback) + callback(true); + } + else { + if (callback) + callback(false); + } + }; + http.send(); +}; +GA.prototype.generateClientID = function () { + var id = ""; + var possibilities = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; + for (var i = 0; i < 5; i++) + id += possibilities.charAt(Math.floor(Math.random() * possibilities.length)); + return id; +}; +GA.prototype.getScreenResolution = function () { + return screen.width + "x" + screen.height; +}; +GA.prototype.getColorDept = function () { + return screen.colorDepth + "-bits"; +}; +GA.prototype.getUserAgent = function () { + return navigator.userAgent; +}; +GA.prototype.getViewportSize = function () { + return window.screen.availWidth + "x" + window.screen.availHeight; +}; +/* + * Measurement Protocol + * [https://developers.google.com/analytics/devguides/collection/protocol/v1/devguide] + */ +GA.prototype.screenView = function (screename) { + var data = { + 't': 'screenview', + 'cd': screename + }; + this.sendRequest(data); + this.lastScreenName = screename; +}; +GA.prototype.event = function (category, action, label, value) { + var data = { + 't': 'event', + 'ec': category, + 'ea': action, + }; + if (label) { + data['el'] = label; + } + if (value) { + data['ev'] = value; + } + if (this.lastScreenName) { + data['cd'] = this.lastScreenName; + } + this.sendRequest(data); +}; +GA.prototype.exception = function (msg, fatal) { + var data = { + 't': 'exception', + 'exd': msg, + 'exf': fatal || 0 + }; + this.sendRequest(data); +}; +GA.prototype.timing = function (category, variable, time, label) { + var data = { + 't': 'timing', + 'utc': category, + 'utv': variable, + 'utt': time, + 'utl': label, + }; + this.sendRequest(data); +}, + GA.prototype.ecommerce = { + transactionID: false, + generateTransactionID: function () { + var id = ""; + var possibilities = "0123456789"; + for (var i = 0; i < 5; i++) + id += possibilities.charAt(Math.floor(Math.random() * possibilities.length)); + return id; + }, + transaction: function (total, items) { + var t_id = ""; + if (!this.ecommerce.transactionID) + t_id = this.ecommerce.generateTransactionID(); + else + t_id = this.ecommerce.transactionID; + var data = { + 't': 'transaction', + 'ti': t_id, + 'tr': total, + 'cu': this.currency, + }; + this.sendRequest(data); + items.forEach(function (item) { + var data = { + 't': 'item', + 'ti': t_id, + 'in': item.name, + 'ip': item.price, + 'iq': item.qty, + 'ic': item.id, + 'cu': this.currency + }; + this.sendRequest(data); + }); + } + }, + GA.prototype.custom = function (data) { + this.sendRequest(data); + }; +module.exports = GA; +/* + * Performance Tracking + */ +/*window.addEventListener("load", function() { + + if(ga.performanceTracking) { + setTimeout(function() { + var timing = window.performance.timing; + var userTime = timing.loadEventEnd - timing.navigationStart; + ga.timing("performance", "pageload", userTime); + }, 0); + } + +}, false);*/ +/* + * Error Reporting + */ +/*window.onerror = function (msg, url, lineNo, columnNo, error) { + var message = [ + 'Message: ' + msg, + 'Line: ' + lineNo, + 'Column: ' + columnNo, + 'Error object: ' + JSON.stringify(error) + ].join(' - '); + + if(ga.errorTracking) + { + setTimeout(function() { + ga.exception(message.toString()); + }, 0); + } + + return false; +};*/ + +},{}],15:[function(require,module,exports){ +"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; @@ -6865,7 +7045,7 @@ var LogEventHandlers = /** @class */ (function () { }()); exports.default = LogEventHandlers; -},{"./channel-factory":7}],15:[function(require,module,exports){ +},{"./channel-factory":7}],16:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var LogEvent = /** @class */ (function () { diff --git a/src/js/controllers/addressbookAdd.js b/src/js/controllers/addressbookAdd.js index 9529d943e..e33f85725 100644 --- a/src/js/controllers/addressbookAdd.js +++ b/src/js/controllers/addressbookAdd.js @@ -36,9 +36,9 @@ angular.module('copayApp.controllers').controller('addressbookAddController', fu addressbook.address = translated.legacy; } - var channel = "firebase"; - if (platformInfo.isNW) { - channel = "ga"; + var channel = "ga"; + if (platformInfo.isCordova) { + channel = "firebase"; } var log = new window.BitAnalytics.LogEvent("contact_created", [{ "coin": $scope.addressbookEntry.coin diff --git a/src/js/controllers/confirm.js b/src/js/controllers/confirm.js index 03af26fd1..3c0465891 100644 --- a/src/js/controllers/confirm.js +++ b/src/js/controllers/confirm.js @@ -643,9 +643,9 @@ angular.module('copayApp.controllers').controller('confirmController', function( soundService.play('misc/payment_sent.mp3'); } - var channel = "firebase"; - if (platformInfo.isNW) { - channel = "ga"; + var channel = "ga"; + if (platformInfo.isCordova) { + channel = "firebase"; } var log = new window.BitAnalytics.LogEvent("transfer_success", [{ "coin": $scope.wallet.coin, diff --git a/src/js/controllers/preferencesNotifications.js b/src/js/controllers/preferencesNotifications.js index edfb983b5..a9a833ff7 100644 --- a/src/js/controllers/preferencesNotifications.js +++ b/src/js/controllers/preferencesNotifications.js @@ -76,9 +76,9 @@ angular.module('copayApp.controllers').controller('preferencesNotificationsContr emailService.updateEmail(opts); - var channel = "firebase"; - if (platformInfo.isNW) { - channel = "ga"; + var channel = "ga"; + if (platformInfo.isCordova) { + channel = "firebase"; } var log = new window.BitAnalytics.LogEvent("settings_email_notification_toggle", [{ "toggle": $scope.emailNotifications.value diff --git a/src/js/controllers/tab-receive.js b/src/js/controllers/tab-receive.js index 8f25412ec..29acb10d8 100644 --- a/src/js/controllers/tab-receive.js +++ b/src/js/controllers/tab-receive.js @@ -145,9 +145,9 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi } $scope.paymentReceivedCoin = $scope.wallet.coin; - var channel = "firebase"; - if (platformInfo.isNW) { - channel = "ga"; + var channel = "ga"; + if (platformInfo.isCordova) { + channel = "firebase"; } var log = new window.BitAnalytics.LogEvent("transfer_success", [{ "coin": $scope.wallet.coin, diff --git a/src/js/controllers/walletDetails.js b/src/js/controllers/walletDetails.js index 24237f6c9..241bbce89 100644 --- a/src/js/controllers/walletDetails.js +++ b/src/js/controllers/walletDetails.js @@ -12,9 +12,9 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun $scope.isAndroid = platformInfo.isAndroid; $scope.isIOS = platformInfo.isIOS; - var channel = "firebase"; - if (platformInfo.isNW) { - channel = "ga"; + var channel = "ga"; + if (platformInfo.isCordova) { + channel = "firebase"; } var log = new window.BitAnalytics.LogEvent("wallet_details_open", [], [channel]); window.BitAnalytics.LogEventHandlers.postEvent(log); diff --git a/src/js/routes.js b/src/js/routes.js index 8277314e5..665294b9b 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -1184,9 +1184,9 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr } }); - var channel = "firebase"; - if (platformInfo.isNW) { - channel = "ga"; + var channel = "ga"; + if (platformInfo.isCordova) { + channel = "firebase"; } // Send a log to test diff --git a/src/js/services/profileService.js b/src/js/services/profileService.js index 4f8710c28..e79b809f6 100644 --- a/src/js/services/profileService.js +++ b/src/js/services/profileService.js @@ -427,9 +427,9 @@ angular.module('copayApp.services') }, function(err, secret) { if (err) return bwcError.cb(err, gettextCatalog.getString('Error creating wallet'), cb); - var channel = "firebase"; - if (platformInfo.isNW) { - channel = "ga"; + var channel = "ga"; + if (platformInfo.isCordova) { + channel = "firebase"; } var log = new window.BitAnalytics.LogEvent("wallet_created", [{ "coin": opts.coin diff --git a/www/index.html b/www/index.html index 4c73317e3..ecc2d923c 100644 --- a/www/index.html +++ b/www/index.html @@ -11,9 +11,8 @@ - Bitcoin.com Wallet - Bitcoin.com Wallet - - + Bitcoin.com Wallet + @@ -31,7 +30,7 @@ - + From 029ac7dd39379b565668e6b6e4db1fbf57810842 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Dominguez Date: Wed, 25 Jul 2018 16:26:06 +0900 Subject: [PATCH 34/65] Fix the QRCode scan. --- src/js/controllers/addressbookAdd.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/js/controllers/addressbookAdd.js b/src/js/controllers/addressbookAdd.js index 9529d943e..89d648b46 100644 --- a/src/js/controllers/addressbookAdd.js +++ b/src/js/controllers/addressbookAdd.js @@ -21,6 +21,9 @@ angular.module('copayApp.controllers').controller('addressbookAddController', fu $timeout(function() { var form = addressbookForm; if (data && form) { + if (data.result) { + data = data.result; + } data = data.replace(/^bitcoin(cash)?:/, ''); form.address.$setViewValue(data); form.address.$isValid = true; From 75edb6279948e56685ac69030c93a0051a378757 Mon Sep 17 00:00:00 2001 From: Sebastiaan Pasma Date: Wed, 25 Jul 2018 15:24:44 +0200 Subject: [PATCH 35/65] removed capitalized-class --- www/views/preferencesPriceDisplay.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/views/preferencesPriceDisplay.html b/www/views/preferencesPriceDisplay.html index 31a9eb9b9..885f0bce1 100644 --- a/www/views/preferencesPriceDisplay.html +++ b/www/views/preferencesPriceDisplay.html @@ -8,10 +8,10 @@
- + Fiat - + Cryptocurrency
From decd0a123e1931aaea4ad2763e9fdd10f5701024 Mon Sep 17 00:00:00 2001 From: Brendon Duncan Date: Wed, 25 Jul 2018 16:43:45 -0700 Subject: [PATCH 36/65] Buttons on keypad have correct colour in new Enter Amount screen. --- src/js/routes.js | 2 +- src/sass/views/amountNew.scss | 484 ++++++++++++++++++++++++++++++++++ src/sass/views/views.scss | 1 + www/views/amountNew.html | 85 ++++++ 4 files changed, 571 insertions(+), 1 deletion(-) create mode 100644 src/sass/views/amountNew.scss create mode 100644 www/views/amountNew.html diff --git a/src/js/routes.js b/src/js/routes.js index 286b27ab1..5900b88da 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -701,7 +701,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr 'tab-receive@tabs': { controller: 'amountController', controllerAs: 'vm', - templateUrl: 'views/amount.html' + templateUrl: 'views/amountNew.html' } } }) diff --git a/src/sass/views/amountNew.scss b/src/sass/views/amountNew.scss new file mode 100644 index 000000000..cbffe4929 --- /dev/null +++ b/src/sass/views/amountNew.scss @@ -0,0 +1,484 @@ +#view-amount-new { + @extend .deflash-blue; + .recipient-label { + font-size: 14px; + padding-bottom: 0; + color: $v-mid-gray; + } + .item-no-bottom-border + .item { + border-top: 0; + } + .icon-bitpay-card { + background-image: url("../img/icon-bitpay.svg"); + } + .icon-amazon { + background-image: url("../img/icon-amazon.svg"); + } + @media(max-width: 480px) { + .bitcoin-address { + .icon { + left: 8px; + font-size: 24px; + } + .big-icon-svg { + left:5px; + & > .bg{ + width:30px; + height:30px; + box-shadow: none; + } + } + font-size: 13px; + padding-left: 48px; + } + } + @media(max-width: 320px) { + .bitcoin-address { + & > span:last-child { + margin-left: -2px; + } + } + } + .send-gravatar { + left: 11px; + position: absolute; + top: 10px; + } + .amount span input { + display: inline; + width: 120px; + } + .amount-pane-recipient { + position: absolute; + top: 95px; + bottom: 0; + width: 100%; + background-color: #fff; + padding: 0 16px; + + .amount-bar { + padding: 24px 0; + font-size: 18px; + @media(max-height: 480px) { + padding: 0px; + } + @media(max-width: 320px) { + padding: 0px; + } + .title { + float: left; + padding-top: 10px; + color: $v-dark-gray; + font-weight: bold; + @media(max-height: 480px) { + padding: 0px; + } + } + @media(max-height: 480px) { + padding-top: 3px; + } + } + .amount { + display: flex; + flex-direction: column; + justify-content: center; + flex-grow: 1; + position: absolute; + bottom: 254px; + top: 66px; + .light { + color: $v-light-gray; + } + @media(max-height: 480px) { + top: 45px; + } + @media(max-width: 320px) { + bottom: 276px; + top: 60px; + & > div { + display: inline-block; + } + & > div:first-child { + display: inherit; + } + } + } + } + .amount-pane-no-recipient { + position: absolute; + top: 0; + bottom: 0; + width: 100%; + background-color: #fff; + padding: 0 16px; + + .amount-bar { + padding: 24px 0; + font-size: 18px; + .title { + padding-top: 10px; + color: $v-dark-gray; + font-weight: bold; + .limits { + margin-top: 10px; + color: $v-light-gray; + font-size: 12px; + } + .select { + margin: 10px 1px; + } + } + } + .amount { + display: flex; + flex-direction: column; + justify-content: center; + flex-grow: 1; + position: absolute; + bottom: 254px; + top: 66px; + .light { + color: $v-light-gray; + } + } + } + .amount { + padding-top: 10px; + padding-bottom: 10px; + .icon-toggle { + font-size: 1.2em; + width: auto; + margin: 0.8em auto; + border: 1px solid $v-subtle-gray; + color: $v-dark-gray; + border-radius: 3px; + padding: 0 10px; + cursor: pointer; + @media(max-height: 280px) { + margin: 0.1em auto; + } + } + &__editable { + &--minimize { + font-size: 22px; + } + &--standard { + font-size: 42px; + @media(max-height: 480px) { + font-size: 26px; + padding-top: 10px; + } + } + &--placeholder { + color: $v-light-gray; + } + } + &__number { + color: $v-dark-gray; + } + &__currency-toggle { + border: 1px solid $v-subtle-gray; + color: $v-dark-gray; + border-radius: 3px; + padding: 0 10px; + cursor: pointer; + font-size: .6em; + position: relative; + top: -3px; + line-height: 1; + @media(max-width: 320px) { + line-height: 30px; + height: 30px; + } + } + &__currency-toggle-mobile { + border: 1px solid $v-subtle-gray; + color: $v-dark-gray; + border-radius: 3px; + cursor: pointer; + position: relative; + line-height: 1; + @media(max-width: 320px) { + line-height: 30px; + height: 30px; + } + } + &__results { + &--minimize { + font-size: 12px; + } + &--standard { + font-size: 18px; + padding: 10px 0; + } + &--placeholder { + color: $v-light-gray; + } + } + &__result { + color: $v-light-gray; + font-size: .9em; + //margin-bottom: -.9em; TODO matias + line-height: 1; + @media(max-height: 480px) { + margin-bottom: 0; + } + } + &__result-equiv { + color: $v-mid-gray; + font-size: 1.2em; + @media(max-height: 480px) { + margin-top: 0; + font-size: 16px; + } + } + } + + .scroll-content { + display: flex; + flex-direction: column; + + .send-amount { + flex: 1 1 auto; + display: flex; + flex-direction: column; + justify-content: center; + + .send-amount-tool { + flex: 0 1 auto; + + .send-amount-tool-input { + text-align: center; + position: relative; + padding: 10px 30px; + + .text-selectable { + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; + } + + .primary-amount { + input, .unit, .primary-amount-display { + font-size: 1.8em; + + @media (min-width: 375px) { + font-size: 2.1em; + } + + @media (min-width: 414px) { + font-size: 2.4em; + } + } + + &.long { + input, .unit, .primary-amount-display { + font-size: 1.6em; + + @media (min-width: 375px) { + font-size: 1.8em; + } + + @media (min-width: 414px) { + font-size: 2em; + } + } + } + + &.very-long { + input, .unit, .primary-amount-display { + font-size: 0.9em; + + @media (min-width: 375px) { + font-size: 1.3em; + } + + @media (min-width: 414px) { + font-size: 1.4em; + } + } + } + + + input { + border:0; + padding:0; + white-space:normal; + background:none; + line-height:1; + box-sizing:content-box; + display: inline-block; + vertical-align: middle; + margin: 0; + height: 1em; + margin-right: 5px; + font-family: 'ProximaNova'; + + @media (min-width: 375px) { + } + + @media (min-width: 414px) { + } + } + + .unit, + .primary-amount-display { + display: inline-block; + vertical-align: middle; + line-height: 1em; + } + + .unit { + font-weight: bold; + } + + .primary-amount-display { + margin-right: 5px; + word-break: break-all; + } + } + + .switch-currencies { + position: absolute; + right: 0; + top: 50%; + transform: translate(0, -50%); + padding: 15px; + + img { + width: 18px; + } + } + } + + .send-amount-actions { + margin-top: 15px; + display: flex; + align-items: center; + justify-content: center; + + .button { + flex: 1 1 auto; + line-height: 1.2em; + + + .button { + margin-left: 10px; + } + + span { + display: flex; + align-items: center; + justify-content: center; + } + } + } + } + } + + .button { + &.no-margin { + margin: 0; + } + } + + .notification-warning { + display: block; + padding: .75rem 1.25rem; + color: #856404; + background-color: #fff3cd; + border: 1px solid #ffeeba; + line-height: 1.4em; + margin-bottom: 20px; + } + + .keypad-container { + position: relative; + //flex: 0 1 196px; + + @media (min-height: 667px) { + //flex: 0 1 224px; + } + + .keypad { + text-align: center; + font-size: 18px; + font-weight: lighter; + position: absolute; + bottom: 0; + width: 100%; + color: $v-text-primary-color; + + @media (min-height: 667px) { + font-size: 24px; + } + + .row { + padding: 0 !important; + margin: 0 !important; + } + + .col { + line-height: 38px; + + @media (min-height: 667px) { + line-height: 45px; + } + } + + .row { + &:last-child { + .col { + padding-bottom: 10px; + } + } + } + + .operator { + background-color: $v-subtle-gray; + font-weight: normal; + cursor: pointer; + + &:active { + background-color: $v-light-gray; + } + } + + .operator-send { + font-weight: bolder; + color: #fff; + background-color: $positive; + font-size: 36px; + cursor: pointer; + + &:active { + background-color: #eaeaea; + } + } + + .digit{ + cursor: pointer; + background-color: #000; + border: 1px solid #262424; + transition: all 0.1s ease; + + + &:active { + background-color: $v-dark-gray; + } + } + + @media(max-height: 480px) { + font-size: 12px; + + } + } + } + } + background: #494949; + + ion-content { + margin-bottom: constant(safe-area-inset-bottom); /* iOS 11.0 */ + margin-bottom: env(safe-area-inset-bottom); /* iOS 11.2 */ + } +} \ No newline at end of file diff --git a/src/sass/views/views.scss b/src/sass/views/views.scss index d4ed735ed..387b68597 100644 --- a/src/sass/views/views.scss +++ b/src/sass/views/views.scss @@ -1,6 +1,7 @@ @import "tabs"; @import "add"; @import "amount"; +@import "amountNew"; @import "confirm"; @import "copayers"; @import "starting"; diff --git a/www/views/amountNew.html b/www/views/amountNew.html new file mode 100644 index 000000000..6fe58eb9b --- /dev/null +++ b/www/views/amountNew.html @@ -0,0 +1,85 @@ + + + + {{'Enter amount (New)' | translate}} + + + + + +
+ +
+
+ Minimum amount: {{vm.minShapeshiftAmount}}
+ Maximum amount: {{vm.maxShapeshiftAmount}}
+
+
+
+
+ {{ vm.amountModel.amount || 0 }}{{vm.unit}} +
+ {{vm.globalResult}} {{vm.unit}} +
+ {{vm.alternativeAmount || '0.00'}} {{vm.alternativeUnit}} +
+
+
+
+ + +
+
+
+
+ +
+
+ +
+
7
+
8
+
9
+
+ +
+
4
+
5
+
6
+
+ +
+
1
+
2
+
3
+
+ +
+
.
+
0
+
+
+
+
+ + +
+
\ No newline at end of file From e539f0e713bb095dfa8f0869e983ba575df49a99 Mon Sep 17 00:00:00 2001 From: Brendon Duncan Date: Wed, 25 Jul 2018 17:32:07 -0700 Subject: [PATCH 37/65] Space around amount, and added "Not Enough Funds" warning. --- src/sass/views/amountNew.scss | 9 +++++++ www/views/amountNew.html | 45 ++++++++++++++++++++--------------- 2 files changed, 35 insertions(+), 19 deletions(-) diff --git a/src/sass/views/amountNew.scss b/src/sass/views/amountNew.scss index cbffe4929..0d1798e25 100644 --- a/src/sass/views/amountNew.scss +++ b/src/sass/views/amountNew.scss @@ -244,6 +244,15 @@ flex-direction: column; justify-content: center; + .send-amount-header-footer { + flex: 1 1 auto; + min-height: 10px; + + .warning { + text-align:center; + } + } + .send-amount-tool { flex: 0 1 auto; diff --git a/www/views/amountNew.html b/www/views/amountNew.html index 6fe58eb9b..e6b11750c 100644 --- a/www/views/amountNew.html +++ b/www/views/amountNew.html @@ -1,7 +1,7 @@ - {{'Enter amount (New)' | translate}} + {{'Enter Amount' | translate}} @@ -9,10 +9,12 @@
-
-
- Minimum amount: {{vm.minShapeshiftAmount}}
- Maximum amount: {{vm.maxShapeshiftAmount}}
+
+
@@ -26,21 +28,26 @@
-
- - + -
+
+
+
+ +
From 91daae9f7a8fbe046b65218c3d3e364512cfbbc2 Mon Sep 17 00:00:00 2001 From: Brendon Duncan Date: Wed, 25 Jul 2018 18:19:21 -0700 Subject: [PATCH 38/65] Improved amount card layout. Darker background under card. --- src/sass/views/amountNew.scss | 19 ++++++++++++------- www/views/amountNew.html | 2 +- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/sass/views/amountNew.scss b/src/sass/views/amountNew.scss index 0d1798e25..894135725 100644 --- a/src/sass/views/amountNew.scss +++ b/src/sass/views/amountNew.scss @@ -246,10 +246,14 @@ .send-amount-header-footer { flex: 1 1 auto; - min-height: 10px; + min-height: 20px; .warning { - text-align:center; + color: #b7664d; + font-family: 'ProximaNova-Semibold'; + font-size: 12pt; + padding: 0 6px 6px 6px; + text-align: center; } } @@ -269,6 +273,8 @@ } .primary-amount { + color: #333; + font-family: 'ProximaNova-Semibold'; input, .unit, .primary-amount-display { font-size: 1.8em; @@ -338,16 +344,15 @@ line-height: 1em; } - .unit { - font-weight: bold; - } - .primary-amount-display { margin-right: 5px; word-break: break-all; } } + .alternative-amount { + color: #6F6F70; + } .switch-currencies { position: absolute; right: 0; @@ -484,7 +489,7 @@ } } } - background: #494949; + background: #f2f2f2; ion-content { margin-bottom: constant(safe-area-inset-bottom); /* iOS 11.0 */ diff --git a/www/views/amountNew.html b/www/views/amountNew.html index e6b11750c..b9b6c08b2 100644 --- a/www/views/amountNew.html +++ b/www/views/amountNew.html @@ -5,7 +5,7 @@ - +
From 507fb21862c4a1b0eb95742fb5e6d537275efc94 Mon Sep 17 00:00:00 2001 From: Brendon Duncan Date: Wed, 25 Jul 2018 18:46:42 -0700 Subject: [PATCH 39/65] Available funds. --- src/js/controllers/amount.js | 2 ++ src/sass/views/amountNew.scss | 42 +++++++++++++++++++++-------------- www/views/amountNew.html | 20 ++++++++++------- 3 files changed, 39 insertions(+), 25 deletions(-) diff --git a/src/js/controllers/amount.js b/src/js/controllers/amount.js index 1bc492136..1d4cb41f1 100644 --- a/src/js/controllers/amount.js +++ b/src/js/controllers/amount.js @@ -10,6 +10,7 @@ function amountController(configService, $filter, $ionicHistory, $ionicModal, $i vm.alternativeAmount = ''; vm.alternativeUnit = ''; vm.amountModel = { amount: 0 }; + vm.availableFunds = '251.00 USD'; vm.fromWalletId = ''; vm.globalResult = ''; vm.isRequestingSpecificAmount = false; @@ -409,6 +410,7 @@ function amountController(configService, $filter, $ionicHistory, $ionicModal, $i || (result >= vm.minShapeshiftAmount && result <= vm.maxShapeshiftAmount)); } } + console.log('allowSend: ', vm.allowSend); }; function processResult(val) { diff --git a/src/sass/views/amountNew.scss b/src/sass/views/amountNew.scss index 894135725..37de78665 100644 --- a/src/sass/views/amountNew.scss +++ b/src/sass/views/amountNew.scss @@ -365,27 +365,35 @@ } } } + } + } - .send-amount-actions { - margin-top: 15px; + .send-amount-extras { + display: flex; + flex: 0 0 auto; + flex-direction: row-reverse; + align-items: center; + justify-content: space-between; + margin: 0 14px; + + .extra { + display: inline-block; + flex: 0 1 auto; + font-size: 12pt; + } + + .button { + flex: 0 1 auto; + line-height: 1.2em; + + + .button { + margin-left: 10px; + } + + span { display: flex; align-items: center; justify-content: center; - - .button { - flex: 1 1 auto; - line-height: 1.2em; - - + .button { - margin-left: 10px; - } - - span { - display: flex; - align-items: center; - justify-content: center; - } - } } } } diff --git a/www/views/amountNew.html b/www/views/amountNew.html index b9b6c08b2..9d44e9e8d 100644 --- a/www/views/amountNew.html +++ b/www/views/amountNew.html @@ -35,20 +35,24 @@
-
- - +
+ Available Funds: {{vm.availableFunds}} +
+
+
From d87c2e65f75c3ab8bb97a0e916d5ba1576f12875 Mon Sep 17 00:00:00 2001 From: Sebastiaan Pasma Date: Thu, 26 Jul 2018 15:04:42 +0200 Subject: [PATCH 40/65] Wallet buttons max width + Receive in viewing wallet. --- src/js/controllers/tab-receive.js | 10 +++++++--- src/js/controllers/walletDetails.js | 11 +++++++++++ src/js/routes.js | 2 +- src/sass/views/tab-home.scss | 4 ++-- src/sass/views/walletDetails.scss | 4 ++-- www/views/walletDetails.html | 2 +- 6 files changed, 24 insertions(+), 9 deletions(-) diff --git a/src/js/controllers/tab-receive.js b/src/js/controllers/tab-receive.js index 8f25412ec..dcb2d1166 100644 --- a/src/js/controllers/tab-receive.js +++ b/src/js/controllers/tab-receive.js @@ -233,10 +233,14 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi if (!$scope.wallets[0]) return; - // select first wallet if no wallet selected previously - var selectedWallet = checkSelectedWallet($scope.wallet, $scope.wallets); + var selectedWallet = null; + if (data.stateParams.walletId) { // from walletDetails + selectedWallet = checkSelectedWallet(profileService.getWallet(data.stateParams.walletId), $scope.wallets); + } else { + // select first wallet if no wallet selected previously + selectedWallet = checkSelectedWallet($scope.wallet, $scope.wallets); + } $scope.onWalletSelect(selectedWallet); - $scope.showShareButton = platformInfo.isCordova ? (platformInfo.isIOS ? 'iOS' : 'Android') : null; listeners = [ diff --git a/src/js/controllers/walletDetails.js b/src/js/controllers/walletDetails.js index b3fea717e..2436da730 100644 --- a/src/js/controllers/walletDetails.js +++ b/src/js/controllers/walletDetails.js @@ -483,4 +483,15 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun function rgbToHex(r, g, b) { return "#" + componentToHex(r) + componentToHex(g) + componentToHex(b); } + + $scope.goToReceive = function() { + $state.go('tabs.home', { + walletId: $scope.wallet.id + }).then(function () { + $ionicHistory.clearHistory(); + $state.go('tabs.receive', { + walletId: $scope.wallet.id + }); + }); + }; }); diff --git a/src/js/routes.js b/src/js/routes.js index 8277314e5..f00679727 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -236,7 +236,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr } }) .state('tabs.receive', { - url: '/receive', + url: '/receive/:walletId', views: { 'tab-receive': { controller: 'tabReceiveController', diff --git a/src/sass/views/tab-home.scss b/src/sass/views/tab-home.scss index 69cdfde4d..680738a3b 100644 --- a/src/sass/views/tab-home.scss +++ b/src/sass/views/tab-home.scss @@ -70,8 +70,8 @@ } } .buttons { - margin-bottom: 0; - margin-top: 6px; + margin: 6px auto 0px; + max-width: 600px; >.col { padding: 5px 10px; margin-bottom: 0; diff --git a/src/sass/views/walletDetails.scss b/src/sass/views/walletDetails.scss index 6be9e6cf2..d03530cbb 100644 --- a/src/sass/views/walletDetails.scss +++ b/src/sass/views/walletDetails.scss @@ -192,8 +192,8 @@ } .buttons { - margin-bottom: 0; - margin-top: 30px; + max-width: 600px; + margin: 30px auto 0; >.col { padding: 5px 10px; margin-bottom: 0; diff --git a/www/views/walletDetails.html b/www/views/walletDetails.html index e2c0f7342..2da69fb6e 100644 --- a/www/views/walletDetails.html +++ b/www/views/walletDetails.html @@ -92,7 +92,7 @@
-
+
Receive
From b2ed16bf2198e48a6eb0ce9c85e4ba4d1b5b0858 Mon Sep 17 00:00:00 2001 From: Sebastiaan Pasma Date: Thu, 26 Jul 2018 19:38:29 +0200 Subject: [PATCH 41/65] mobile support for send/receive buttons and some refactors to fix the navigation flow. --- src/js/controllers/walletDetails.js | 17 ++++++++++++++++- src/sass/views/tab-home.scss | 6 +++--- src/sass/views/walletDetails.scss | 12 ++++-------- www/views/walletDetails.html | 24 +++++++++++++++++++++--- 4 files changed, 44 insertions(+), 15 deletions(-) diff --git a/src/js/controllers/walletDetails.js b/src/js/controllers/walletDetails.js index 2436da730..c824cbfda 100644 --- a/src/js/controllers/walletDetails.js +++ b/src/js/controllers/walletDetails.js @@ -483,7 +483,14 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun function rgbToHex(r, g, b) { return "#" + componentToHex(r) + componentToHex(g) + componentToHex(b); } - + $scope.goToSend = function() { + $state.go('tabs.home', { + walletId: $scope.wallet.id + }).then(function () { + $ionicHistory.clearHistory(); + $state.go('tabs.send'); + }); + }; $scope.goToReceive = function() { $state.go('tabs.home', { walletId: $scope.wallet.id @@ -494,4 +501,12 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun }); }); }; + $scope.goToBuy = function() { + $state.go('tabs.home', { + walletId: $scope.wallet.id + }).then(function () { + $ionicHistory.clearHistory(); + $state.go('tabs.buyandsell'); + }); + }; }); diff --git a/src/sass/views/tab-home.scss b/src/sass/views/tab-home.scss index 680738a3b..708ff4fad 100644 --- a/src/sass/views/tab-home.scss +++ b/src/sass/views/tab-home.scss @@ -70,7 +70,7 @@ } } .buttons { - margin: 6px auto 0px; + margin: 6px auto -12px; max-width: 600px; >.col { padding: 5px 10px; @@ -84,8 +84,8 @@ width: 100%; font-size: 19px; font-weight: bolder; - min-height: 45px; - line-height: 45px; + min-height: auto; + line-height: 36px; } } .wallet-coin-logo { diff --git a/src/sass/views/walletDetails.scss b/src/sass/views/walletDetails.scss index d03530cbb..0536a5735 100644 --- a/src/sass/views/walletDetails.scss +++ b/src/sass/views/walletDetails.scss @@ -132,10 +132,6 @@ position: relative; height: 100%; height: calc(100% - env(safe-area-inset-bottom) * 2); - - &.status-bar { - margin-top: 20px; - } } .bar-header { border: 0; @@ -191,9 +187,9 @@ } } - .buttons { + .send-receive-buttons { max-width: 600px; - margin: 30px auto 0; + margin: 45px auto 0; >.col { padding: 5px 10px; margin-bottom: 0; @@ -206,8 +202,8 @@ width: 100%; font-size: 19px; font-weight: bolder; - min-height: 40px; - line-height: 40px; + min-height: auto; + line-height: 36px; } } } diff --git a/www/views/walletDetails.html b/www/views/walletDetails.html index 2da69fb6e..85aace8fc 100644 --- a/www/views/walletDetails.html +++ b/www/views/walletDetails.html @@ -90,21 +90,23 @@
-
+ +
Receive
-
+
Buy Bitcoin
-
+
Send
+
@@ -212,6 +214,22 @@
+
+
+
+ Receive +
+
+
+
+ Buy Bitcoin +
+
+ Send +
+
+
+
From 8fd0b76a44d5acaeeedae7261a2d073f87b292a9 Mon Sep 17 00:00:00 2001 From: Brendon Duncan Date: Thu, 26 Jul 2018 13:09:16 -0700 Subject: [PATCH 42/65] Change Currency button appearance. --- src/sass/views/amountNew.scss | 34 +++++++++++++++------ www/img/icon-alternative-currency-black.svg | 22 +++++++++++++ www/views/amountNew.html | 10 +++--- 3 files changed, 52 insertions(+), 14 deletions(-) create mode 100644 www/img/icon-alternative-currency-black.svg diff --git a/src/sass/views/amountNew.scss b/src/sass/views/amountNew.scss index 37de78665..5229f9b56 100644 --- a/src/sass/views/amountNew.scss +++ b/src/sass/views/amountNew.scss @@ -251,7 +251,7 @@ .warning { color: #b7664d; font-family: 'ProximaNova-Semibold'; - font-size: 12pt; + font-size: 12px; padding: 0 6px 6px 6px; text-align: center; } @@ -371,24 +371,38 @@ .send-amount-extras { display: flex; flex: 0 0 auto; + /* So that if only one item is present, it appears on the right. */ flex-direction: row-reverse; + font-size: 12px; align-items: center; justify-content: space-between; margin: 0 14px; - .extra { - display: inline-block; + .extra, + button.extra { + color: #000; + display: flex; flex: 0 1 auto; - font-size: 12pt; } - .button { - flex: 0 1 auto; - line-height: 1.2em; + button.extra { + background: none; + border: none; + font-family: 'ProximaNova'; + font-size: 14px; + line-height: normal; + min-height: auto; + min-width: auto; + padding: 0; + } - + .button { - margin-left: 10px; - } + .button .icon:before { + font-size: 14px; + line-height: normal; + } + + + .button { span { display: flex; diff --git a/www/img/icon-alternative-currency-black.svg b/www/img/icon-alternative-currency-black.svg new file mode 100644 index 000000000..e9b175256 --- /dev/null +++ b/www/img/icon-alternative-currency-black.svg @@ -0,0 +1,22 @@ + + + + 3A719124-019D-470F-908A-5D61F117A295 + Created with sketchtool. + + + + + + + + + + + + + + + + + diff --git a/www/views/amountNew.html b/www/views/amountNew.html index 9d44e9e8d..753074e54 100644 --- a/www/views/amountNew.html +++ b/www/views/amountNew.html @@ -35,18 +35,20 @@
+
-
Available Funds: {{vm.availableFunds}} -
- +
+ -
- Available Funds: {{vm.availableFunds}} +
+ Available Funds: {{vm.availableFunds}}
From 81e9f527ff05dbca5977c3bf7aff5c519cf6a6aa Mon Sep 17 00:00:00 2001 From: Brendon Duncan Date: Sat, 28 Jul 2018 13:04:04 -0700 Subject: [PATCH 44/65] Route for send amount. --- src/js/routes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/routes.js b/src/js/routes.js index 5900b88da..5b0b59d77 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -292,7 +292,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr 'tab-send@tabs': { controller: 'amountController', controllerAs: 'vm', - templateUrl: 'views/amount.html' + templateUrl: 'views/amountNew.html' } } }) From 0ba1ea1f423435b7ce3e74a84750ca374dec2b03 Mon Sep 17 00:00:00 2001 From: Brendon Duncan Date: Sat, 28 Jul 2018 15:36:23 -0700 Subject: [PATCH 45/65] Use All Available Funds button. --- src/sass/variables.scss | 4 +++ src/sass/views/amountNew.scss | 60 +++++++++++++++++++++++------------ www/views/amountNew.html | 16 ++++++---- 3 files changed, 53 insertions(+), 27 deletions(-) diff --git a/src/sass/variables.scss b/src/sass/variables.scss index cb21c030a..c2ab16254 100644 --- a/src/sass/variables.scss +++ b/src/sass/variables.scss @@ -9,6 +9,7 @@ $v-font-family-light: "Roboto-Light", sans-serif- /* Colors */ $v-bitcoin-orange: #fab915 !default; +$v-off-black: #262424; $v-dark-gray: #445 !default; $v-mid-gray: #667 !default; $v-light-gray: #9b9bab !default; @@ -24,8 +25,11 @@ $v-text-accent-color: #647ce8 !default; $v-success-color: #13e5b6 !default; $v-warning-color: #ffa500 !default; +$v-warning-color-2: #b7664d; $v-error-color: #ef473a !default; +$v-background-under-card: #f2f2f2; + $v-wallet-color-map: ( 0: (color: #dd4b39, name: 'Cinnabar'), 1: (color: #f38f12, name: 'Carrot Orange'), diff --git a/src/sass/views/amountNew.scss b/src/sass/views/amountNew.scss index 5f27361b3..eb29d9ee4 100644 --- a/src/sass/views/amountNew.scss +++ b/src/sass/views/amountNew.scss @@ -249,7 +249,6 @@ min-height: 20px; .warning { - color: #b7664d; font-family: 'ProximaNova-Semibold'; font-size: 12px; padding: 0 6px 6px 6px; @@ -433,37 +432,59 @@ .keypad-container { position: relative; + font-size: 18px; + line-height: 2em; //flex: 0 1 196px; + @media (min-height: 667px) { + font-size: 24px; + } + + @media(max-height: 480px) { + font-size: 12px; + } + @media (min-height: 667px) { //flex: 0 1 224px; } + .sendmax { + background: $v-off-black; + + .button { + color: white; + background: black; + border: 1px solid $v-off-black; + border-radius: 0; + font-size: 0.8em; + line-height: 2em; + margin-bottom: 1.618em; + width: 100%; + + .available-funds-amount { + color: #C9C9C9; + } + + &:active { + background-color: $v-dark-gray; + } + } + } + .keypad { text-align: center; - font-size: 18px; font-weight: lighter; position: absolute; bottom: 0; width: 100%; color: $v-text-primary-color; - @media (min-height: 667px) { - font-size: 24px; - } + .row { padding: 0 !important; margin: 0 !important; } - - .col { - line-height: 38px; - - @media (min-height: 667px) { - line-height: 45px; - } - } .row { &:last-child { @@ -498,23 +519,22 @@ .digit{ cursor: pointer; background-color: #000; - border: 1px solid #262424; + border: 1px solid $v-off-black; transition: all 0.1s ease; - &:active { background-color: $v-dark-gray; } } - @media(max-height: 480px) { - font-size: 12px; - - } } } } - background: #f2f2f2; + + .warning { + color: $v-warning-color-2; + } + background: $v-background-under-card; ion-content { margin-bottom: constant(safe-area-inset-bottom); /* iOS 11.0 */ diff --git a/www/views/amountNew.html b/www/views/amountNew.html index 1b29f6e44..9449c361d 100644 --- a/www/views/amountNew.html +++ b/www/views/amountNew.html @@ -48,16 +48,18 @@ Available Funds: {{vm.availableFunds}}
- -
+
+ +
+
From 72a5b3cabd57396947d08fe329362ac59c3e690d Mon Sep 17 00:00:00 2001 From: Brendon Duncan Date: Sat, 28 Jul 2018 17:18:52 -0700 Subject: [PATCH 46/65] Primary ("Next") button. --- src/sass/variables.scss | 1 + src/sass/views/amountNew.scss | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/src/sass/variables.scss b/src/sass/variables.scss index c2ab16254..67d5a044b 100644 --- a/src/sass/variables.scss +++ b/src/sass/variables.scss @@ -81,6 +81,7 @@ $v-button-primary-active-bg: darken($v-accent-color, 10% $v-button-primary-active-border: transparent !default; $v-button-primary-clear-bg: none !default; $v-button-primary-clear-color: $v-accent-color !default; +$v-button-primary-disabled-bg: $v-mid-gray; $v-button-primary-outline-bg: transparent !default; $v-button-primary-outline-border: $v-accent-color !default; $v-button-primary-outline-color: $v-accent-color !default; diff --git a/src/sass/views/amountNew.scss b/src/sass/views/amountNew.scss index eb29d9ee4..bbca0f5a2 100644 --- a/src/sass/views/amountNew.scss +++ b/src/sass/views/amountNew.scss @@ -529,6 +529,16 @@ } } + + .button-primary { + background-color: $v-primary-color; + border-radius: 0; + font-family: 'ProximaNova-Semibold'; + } + + .button-primary[disabled] { + background-color: $v-button-primary-disabled-bg; + } } .warning { From 9781f90f2b21095d2ab34468c3336cf663bad3b4 Mon Sep 17 00:00:00 2001 From: Brendon Duncan Date: Sat, 28 Jul 2018 19:20:12 -0700 Subject: [PATCH 47/65] Warning colour for insufficient funds. --- src/js/controllers/amount.js | 1 + src/sass/views/amountNew.scss | 6 +++++- www/views/amountNew.html | 8 ++++---- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/js/controllers/amount.js b/src/js/controllers/amount.js index 1d4cb41f1..a4c8171a4 100644 --- a/src/js/controllers/amount.js +++ b/src/js/controllers/amount.js @@ -12,6 +12,7 @@ function amountController(configService, $filter, $ionicHistory, $ionicModal, $i vm.amountModel = { amount: 0 }; vm.availableFunds = '251.00 USD'; vm.fromWalletId = ''; + vm.fundsAreInsufficient = true; vm.globalResult = ''; vm.isRequestingSpecificAmount = false; vm.listComplete = false; diff --git a/src/sass/views/amountNew.scss b/src/sass/views/amountNew.scss index bbca0f5a2..9dad8b045 100644 --- a/src/sass/views/amountNew.scss +++ b/src/sass/views/amountNew.scss @@ -377,10 +377,14 @@ justify-content: space-between; margin: 0 14px; - .availableFunds { + .available-funds { color: #6F6F70; } + .warning { + color: $v-warning-color-2; + } + .extra, button.extra { display: flex; diff --git a/www/views/amountNew.html b/www/views/amountNew.html index 9449c361d..b23a34fbf 100644 --- a/www/views/amountNew.html +++ b/www/views/amountNew.html @@ -29,7 +29,7 @@
-
- -
- Available Funds: {{vm.availableFunds}} +
+ Available Funds:{{vm.availableFunds}}
From 3732d21728b92993771ab51aefc114b31a84d5bb Mon Sep 17 00:00:00 2001 From: Sebastiaan Pasma Date: Mon, 30 Jul 2018 09:37:14 +0200 Subject: [PATCH 50/65] send/receive iPhoneX fixes --- src/js/controllers/walletDetails.js | 14 +++++++------- src/sass/views/walletDetails.scss | 19 ++++++++++++------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/js/controllers/walletDetails.js b/src/js/controllers/walletDetails.js index c824cbfda..f4f2d2488 100644 --- a/src/js/controllers/walletDetails.js +++ b/src/js/controllers/walletDetails.js @@ -327,16 +327,16 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun } scrollPos = scrollPos || 0; - var amountHeight = 230 - scrollPos; + var amountHeight = 210 - scrollPos; if (amountHeight < 80) { amountHeight = 80; } var contentMargin = amountHeight; - if (contentMargin > 230) { - contentMargin = 230; + if (contentMargin > 210) { + contentMargin = 210; } - var amountScale = (amountHeight / 230); + var amountScale = (amountHeight / 210); if (amountScale < 0.5) { amountScale = 0.5; } @@ -354,9 +354,9 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun top = TOP_BALANCE_BUTTON; } - var amountTop = ((amountScale - 0.85) / 0.85) * top; - if (amountTop < -10) { - amountTop = -10; + var amountTop = ((amountScale - 0.80) / 0.80) * top; //0.85 + if (amountTop < -2) { + amountTop = -2; } if (amountTop > top) { amountTop = top; diff --git a/src/sass/views/walletDetails.scss b/src/sass/views/walletDetails.scss index 0536a5735..8d6972f09 100644 --- a/src/sass/views/walletDetails.scss +++ b/src/sass/views/walletDetails.scss @@ -132,10 +132,15 @@ position: relative; height: 100%; height: calc(100% - env(safe-area-inset-bottom) * 2); + + &.status-bar { + margin-top: 20px; + margin-top: env(safe-area-inset-top); + } } .bar-header { border: 0; - background: none; + background: rgb(238, 182, 64); .title, .button { color: #fff; } @@ -143,13 +148,13 @@ background-color: transparent; } } - //.nav-bar-block, .bar { - //background-color: inherit !important; - //} + .nav-bar-block, .bar { + background-color: inherit !important; + } ion-content { &.collapsible { - margin-top: 210px; + margin-top: 230px; } padding-top: 0; @@ -189,7 +194,7 @@ .send-receive-buttons { max-width: 600px; - margin: 45px auto 0; + margin: 25px auto 0; >.col { padding: 5px 10px; margin-bottom: 0; @@ -211,7 +216,7 @@ width: 100%; text-align: center; color: #fff; - height: 210px; + height: 230px; padding-top: 40px; display: block; align-items: center; From e1d65bc5572818d19f22acfc494f14636f2cfc15 Mon Sep 17 00:00:00 2001 From: Sam Cheng Hung Date: Mon, 30 Jul 2018 16:49:57 +0800 Subject: [PATCH 51/65] Adds amount directive --- src/js/directives/amount.js | 76 ++ src/sass/components/amount.scss | 27 + src/sass/components/components.scss | 1 + src/sass/main.scss | 1 + www/css/main.css | 1183 ++++++++++++++------------- www/index.html | 7 +- 6 files changed, 734 insertions(+), 561 deletions(-) create mode 100644 src/js/directives/amount.js create mode 100644 src/sass/components/amount.scss create mode 100644 src/sass/components/components.scss diff --git a/src/js/directives/amount.js b/src/js/directives/amount.js new file mode 100644 index 000000000..bf519c0d0 --- /dev/null +++ b/src/js/directives/amount.js @@ -0,0 +1,76 @@ +'use strict'; + +/** + * @desc amount directive that can be used to display formatted financial values + * @example + */ +angular.module('bitcoincom.directives') + .directive('amount', [ + '$timeout', + function($timeout) { + return { + restrict: 'E', + scope: { + value: '=', + currency: '=' + }, + templateUrl: 'views/includes/amount.html', + controller: ['$scope', function($scope) { + var decimalPlaces = { + '0': ['BIF', 'CLP', 'DJF', 'GNF', 'ILS', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF'], + '3': ['BHD', 'IQD', 'JOD', 'KWD', 'OMR', 'TND'], + '8': ['BCH', 'BTC'] + }; + + var numberWithCommas = function(x) { + return parseFloat(x).toLocaleString(); + }; + + var buildAmount = function(start, middle, end) { + $scope.start = start; + $scope.middle = middle; + $scope.end = end; + }; + + var getDecimalPlaces = function(currency) { + if (decimalPlaces['0'].indexOf($scope.currency.toUpperCase()) > -1) return '0'; + if (decimalPlaces['3'].indexOf($scope.currency.toUpperCase()) > -1) return '3'; + if (decimalPlaces['8'].indexOf($scope.currency.toUpperCase()) > -1) return '8'; + return '2'; + }; + + switch (getDecimalPlaces($scope.currency)) { + case '0': + var valueFormatted = numberWithCommas(Math.round(parseFloat($scope.value))); + buildAmount(valueFormatted, '', ''); + break; + + case '2': + var valueProcessing = parseFloat(parseFloat($scope.value).toFixed(2)); + var valueFormatted = numberWithCommas(valueProcessing); + buildAmount(valueFormatted, '', ''); + break; + + case '3': + var valueProcessing = parseFloat(parseFloat($scope.value).toFixed(3)); + var valueFormatted = numberWithCommas(valueProcessing); + buildAmount(valueFormatted, '', ''); + break; + + case '8': + var valueFormatted = parseFloat($scope.value).toFixed(8); + if (parseFloat($scope.value) == 0) { + buildAmount('0', '', ''); + } else { + buildAmount(valueFormatted, '', ''); + var start = numberWithCommas(valueFormatted.slice(0, -5)); + var middle = valueFormatted.slice(-5, -2); + var end = valueFormatted.substr(valueFormatted.length - 2); + buildAmount(start, middle, end); + } + break; + } + }] + }; + } +]); \ No newline at end of file diff --git a/src/sass/components/amount.scss b/src/sass/components/amount.scss new file mode 100644 index 000000000..d8fe552a2 --- /dev/null +++ b/src/sass/components/amount.scss @@ -0,0 +1,27 @@ +.amount { + .start, + .middle, + .end, + .currency { + display: inline-block; + } + + .start { + font-size: 1em; + } + + .middle { + font-size: 0.7857em; + margin-left: 5px; + } + + .end { + font-size: 0.7857em; + margin-left: 5px; + } + + .currency { + font-size: 1em; + margin-left: 5px; + } +} \ No newline at end of file diff --git a/src/sass/components/components.scss b/src/sass/components/components.scss new file mode 100644 index 000000000..def6289fa --- /dev/null +++ b/src/sass/components/components.scss @@ -0,0 +1 @@ +@import "amount.scss"; diff --git a/src/sass/main.scss b/src/sass/main.scss index 7b3e46291..516656449 100644 --- a/src/sass/main.scss +++ b/src/sass/main.scss @@ -9,4 +9,5 @@ @import "mixins/mixins"; @import "views/views"; @import "directives/directives"; +@import "components/components"; @import "shame"; diff --git a/www/css/main.css b/www/css/main.css index b4e67edac..d30a89142 100644 --- a/www/css/main.css +++ b/www/css/main.css @@ -9970,7 +9970,7 @@ ion-nav-bar.hide { .card { margin: 20px 14px; } -ion-view.deflash-blue:before, ion-view#view-amount:before, ion-view#view-confirm:before, ion-view#copayers-invitation:before, ion-view#tab-home:before, ion-view#tab-receive:before, ion-view#tab-send:before, ion-view.settings:before, ion-view#bitpayCard:before, ion-view#bitpayCard-intro:before, ion-view#view-address-book:before, ion-view#addresses:before, ion-view#send-feedback:before, ion-view#choose-fee-level:before, ion-view#txp-details:before, ion-view#coinbase:before, ion-view#glidera:before, ion-view#amazon:before, ion-view#mercadolibre:before, ion-view#custom-amount:before { +ion-view.deflash-blue:before, ion-view#view-amount:before, ion-view#view-confirm:before, ion-view#copayers-invitation:before, ion-view#tab-home:before, ion-view#tab-receive:before, ion-view#tab-send:before, ion-view.settings:before, ion-view#bitpayCard:before, ion-view#bitpayCard-intro:before, ion-view#view-address-book:before, ion-view#addresses:before, ion-view#choose-fee-level:before, ion-view#txp-details:before, ion-view#coinbase:before, ion-view#glidera:before, ion-view#amazon:before, ion-view#mercadolibre:before, ion-view#custom-amount:before { content: " "; display: block; position: absolute; @@ -9980,7 +9980,7 @@ ion-view.deflash-blue:before, ion-view#view-amount:before, ion-view#view-confirm height: 44px; background-color: #fab915; } -.platform-ios.platform-cordova:not(.fullscreen) ion-view.deflash-blue:before, .platform-ios.platform-cordova:not(.fullscreen) ion-view#view-amount:before, .platform-ios.platform-cordova:not(.fullscreen) ion-view#view-confirm:before, .platform-ios.platform-cordova:not(.fullscreen) ion-view#copayers-invitation:before, .platform-ios.platform-cordova:not(.fullscreen) ion-view#tab-home:before, .platform-ios.platform-cordova:not(.fullscreen) ion-view#tab-receive:before, .platform-ios.platform-cordova:not(.fullscreen) ion-view#tab-send:before, .platform-ios.platform-cordova:not(.fullscreen) ion-view.settings:before, .platform-ios.platform-cordova:not(.fullscreen) ion-view#bitpayCard:before, .platform-ios.platform-cordova:not(.fullscreen) ion-view#bitpayCard-intro:before, .platform-ios.platform-cordova:not(.fullscreen) ion-view#view-address-book:before, .platform-ios.platform-cordova:not(.fullscreen) ion-view#addresses:before, .platform-ios.platform-cordova:not(.fullscreen) ion-view#send-feedback:before, .platform-ios.platform-cordova:not(.fullscreen) ion-view#choose-fee-level:before, .platform-ios.platform-cordova:not(.fullscreen) ion-view#txp-details:before, .platform-ios.platform-cordova:not(.fullscreen) ion-view#coinbase:before, .platform-ios.platform-cordova:not(.fullscreen) ion-view#glidera:before, .platform-ios.platform-cordova:not(.fullscreen) ion-view#amazon:before, .platform-ios.platform-cordova:not(.fullscreen) ion-view#mercadolibre:before, .platform-ios.platform-cordova:not(.fullscreen) ion-view#custom-amount:before { +.platform-ios.platform-cordova:not(.fullscreen) ion-view.deflash-blue:before, .platform-ios.platform-cordova:not(.fullscreen) ion-view#view-amount:before, .platform-ios.platform-cordova:not(.fullscreen) ion-view#view-confirm:before, .platform-ios.platform-cordova:not(.fullscreen) ion-view#copayers-invitation:before, .platform-ios.platform-cordova:not(.fullscreen) ion-view#tab-home:before, .platform-ios.platform-cordova:not(.fullscreen) ion-view#tab-receive:before, .platform-ios.platform-cordova:not(.fullscreen) ion-view#tab-send:before, .platform-ios.platform-cordova:not(.fullscreen) ion-view.settings:before, .platform-ios.platform-cordova:not(.fullscreen) ion-view#bitpayCard:before, .platform-ios.platform-cordova:not(.fullscreen) ion-view#bitpayCard-intro:before, .platform-ios.platform-cordova:not(.fullscreen) ion-view#view-address-book:before, .platform-ios.platform-cordova:not(.fullscreen) ion-view#addresses:before, .platform-ios.platform-cordova:not(.fullscreen) ion-view#choose-fee-level:before, .platform-ios.platform-cordova:not(.fullscreen) ion-view#txp-details:before, .platform-ios.platform-cordova:not(.fullscreen) ion-view#coinbase:before, .platform-ios.platform-cordova:not(.fullscreen) ion-view#glidera:before, .platform-ios.platform-cordova:not(.fullscreen) ion-view#amazon:before, .platform-ios.platform-cordova:not(.fullscreen) ion-view#mercadolibre:before, .platform-ios.platform-cordova:not(.fullscreen) ion-view#custom-amount:before { height: 64px; } .just-a-hint, .icon.bp-arrow-right, .icon.bp-arrow-down, .icon.bp-arrow-up { @@ -10071,10 +10071,12 @@ ion-view.deflash-blue:before, ion-view#view-amount:before, ion-view#view-confirm .loading .spinner svg { margin-top: 0; } -.button.button-primary.button-standard, .button.button-secondary.button-standard, .button.button-light.button-standard, .button.button-assertive.button-standard, +.button.button-primary.button-standard, .button.button-secondary.button-standard, .button.button-light.button-standard, .button.button-white.button-standard, .button.button-green.button-standard, .button.button-assertive.button-standard, .onboarding .button.button-primary.button-standard, .onboarding .button.button-secondary.button-standard, .onboarding .button.button-light.button-standard, +.onboarding .button.button-white.button-standard, +.onboarding .button.button-green.button-standard, .onboarding .button.button-assertive.button-standard { width: 85%; max-width: 300px; @@ -10118,10 +10120,12 @@ ion-view.deflash-blue:before, ion-view#view-amount:before, ion-view#view-confirm box-shadow: none; color: #fff; } -.button.button-primary.button-standard + .button-standard, .button.button-secondary.button-standard + .button-standard, .button.button-light.button-standard + .button-standard, .button.button-assertive.button-standard + .button-standard, +.button.button-primary.button-standard + .button-standard, .button.button-secondary.button-standard + .button-standard, .button.button-light.button-standard + .button-standard, .button.button-white.button-standard + .button-standard, .button.button-green.button-standard + .button-standard, .button.button-assertive.button-standard + .button-standard, .onboarding .button.button-primary.button-standard + .button-standard, .onboarding .button.button-secondary.button-standard + .button-standard, .onboarding .button.button-light.button-standard + .button-standard, +.onboarding .button.button-white.button-standard + .button-standard, +.onboarding .button.button-green.button-standard + .button-standard, .onboarding .button.button-assertive.button-standard + .button-standard { margin-top: 1rem; } @@ -10183,8 +10187,67 @@ ion-view.deflash-blue:before, ion-view#view-amount:before, ion-view#view-confirm font-size: 0.7em !important; display: inline !important; } -.button.button-full { - display: block; } +.button { + border-radius: 6px; } + .button.button-full { + display: block; } + .button-green { + border-color: #FFF; + background-color: #719561; + color: #FFF; + border: 0px; + box-shadow: 0 2px 11px 0 #C1C1C1; } + .button-green:hover { + color: #FFF; + text-decoration: none; } + .button-green.active, .button-green.activated { + border-color: #FFF; + background-color: #606060; } + .button-green.button-clear { + border-color: transparent; + background: none; + box-shadow: none; + color: #FFF; } + .button-green.button-icon { + border-color: transparent; + background: none; } + .button-green.button-outline { + border-color: #C1C1C1; + background: transparent; + color: #C1C1C1; } + .button-green.button-outline.active, .button-green.button-outline.activated { + background-color: #C1C1C1; + box-shadow: none; + color: #fff; } + .button-white { + border-color: #C1C1C1; + background-color: #FFF; + color: #606060; + box-shadow: 0 2px 11px 0 #C1C1C1; } + .button-white:hover { + color: #606060; + text-decoration: none; } + .button-white.active, .button-white.activated { + border-color: #FFF; + background-color: #C1C1C1; } + .button-white.button-clear { + border-color: transparent; + background: none; + box-shadow: none; + color: #FFF; } + .button-white.button-icon { + border-color: transparent; + background: none; } + .button-white.button-outline { + border-color: #C1C1C1; + background: transparent; + color: #C1C1C1; } + .button-white.button-outline.active, .button-white.button-outline.activated { + background-color: #C1C1C1; + box-shadow: none; + color: #fff; } + .button-white.activated { + color: #FFF; } .button-clear { background: none !important; } @@ -10197,6 +10260,22 @@ textarea.d-block { display: block; width: 100%; } +qrcode { + position: relative; } + qrcode.qr-overlay::before { + content: ""; + background-size: 100% 100%; + display: block; + left: 88px; + margin-top: 88px; + width: 44px; + height: 44px; + position: absolute; } + qrcode.qr-overlay--bch::before { + background-image: url("../img/qr-overlay-bch.png"); } + qrcode.qr-overlay--btc::before { + background-image: url("../img/qr-overlay-btc.png"); } + .center-block { float: none; margin: 0 auto; } @@ -10237,6 +10316,10 @@ textarea.d-block { font-weight: 700; } #tab-home .card > .item-heading .icon, #tab-home .list > .item-heading .icon, #tab-send .card > .item-heading .icon, #tab-send .list > .item-heading .icon { color: #667; } + #tab-home .card > .item-heading .subtitle, #tab-home .list > .item-heading .subtitle, #tab-send .card > .item-heading .subtitle, #tab-send .list > .item-heading .subtitle { + color: #667; + font-size: 12px; + font-weight: 300; } #view-add .item { margin-bottom: 10px; @@ -10260,349 +10343,345 @@ textarea.d-block { #view-add .bg.join { padding: 10px; } -#view-amount .recipient-label { - font-size: 14px; - padding-bottom: 0; - color: #667; } - -#view-amount .item-no-bottom-border + .item { - border-top: 0; } - -#view-amount .icon-bitpay-card { - background-image: url("../img/icon-bitpay.svg"); } - -#view-amount .icon-amazon { - background-image: url("../img/icon-amazon.svg"); } - -@media (max-width: 480px) { - #view-amount .bitcoin-address { - font-size: 13px; - padding-left: 48px; } - #view-amount .bitcoin-address .icon { - left: 8px; - font-size: 24px; } - #view-amount .bitcoin-address .big-icon-svg { - left: 5px; } - #view-amount .bitcoin-address .big-icon-svg > .bg { - width: 30px; - height: 30px; - box-shadow: none; } } - -@media (max-width: 320px) { - #view-amount .bitcoin-address > span:last-child { - margin-left: -2px; } } - -#view-amount .send-gravatar { - left: 11px; - position: absolute; - top: 10px; } - -#view-amount .amount span input { - display: inline; - width: 120px; } - -#view-amount .amount-pane-recipient { - position: absolute; - top: 95px; - bottom: 0; - width: 100%; - background-color: #fff; - padding: 0 16px; } - #view-amount .amount-pane-recipient .amount-bar { - padding: 24px 0; - font-size: 18px; } - @media (max-height: 480px) { - #view-amount .amount-pane-recipient .amount-bar { - padding: 0px; } } - @media (max-width: 320px) { - #view-amount .amount-pane-recipient .amount-bar { - padding: 0px; } } - #view-amount .amount-pane-recipient .amount-bar .title { - float: left; - padding-top: 10px; - color: #445; - font-weight: bold; } +#view-amount { + background: #494949; } + #view-amount .recipient-label { + font-size: 14px; + padding-bottom: 0; + color: #667; } + #view-amount .item-no-bottom-border + .item { + border-top: 0; } + #view-amount .icon-bitpay-card { + background-image: url("../img/icon-bitpay.svg"); } + #view-amount .icon-amazon { + background-image: url("../img/icon-amazon.svg"); } + @media (max-width: 480px) { + #view-amount .bitcoin-address { + font-size: 13px; + padding-left: 48px; } + #view-amount .bitcoin-address .icon { + left: 8px; + font-size: 24px; } + #view-amount .bitcoin-address .big-icon-svg { + left: 5px; } + #view-amount .bitcoin-address .big-icon-svg > .bg { + width: 30px; + height: 30px; + box-shadow: none; } } + @media (max-width: 320px) { + #view-amount .bitcoin-address > span:last-child { + margin-left: -2px; } } + #view-amount .send-gravatar { + left: 11px; + position: absolute; + top: 10px; } + #view-amount .amount span input { + display: inline; + width: 120px; } + #view-amount .amount-pane-recipient { + position: absolute; + top: 95px; + bottom: 0; + width: 100%; + background-color: #fff; + padding: 0 16px; } + #view-amount .amount-pane-recipient .amount-bar { + padding: 24px 0; + font-size: 18px; } @media (max-height: 480px) { - #view-amount .amount-pane-recipient .amount-bar .title { + #view-amount .amount-pane-recipient .amount-bar { padding: 0px; } } - @media (max-height: 480px) { - #view-amount .amount-pane-recipient .amount-bar { - padding-top: 3px; } } - #view-amount .amount-pane-recipient .amount { - display: flex; - flex-direction: column; - justify-content: center; - flex-grow: 1; - position: absolute; - bottom: 254px; - top: 66px; } - #view-amount .amount-pane-recipient .amount .light { - color: #9b9bab; } - @media (max-height: 480px) { - #view-amount .amount-pane-recipient .amount { - top: 45px; } } - @media (max-width: 320px) { - #view-amount .amount-pane-recipient .amount { - bottom: 276px; - top: 60px; } - #view-amount .amount-pane-recipient .amount > div { - display: inline-block; } - #view-amount .amount-pane-recipient .amount > div:first-child { - display: inherit; } } - -#view-amount .amount-pane-no-recipient { - position: absolute; - top: 0; - bottom: 0; - width: 100%; - background-color: #fff; - padding: 0 16px; } - #view-amount .amount-pane-no-recipient .amount-bar { - padding: 24px 0; - font-size: 18px; } - #view-amount .amount-pane-no-recipient .amount-bar .title { - padding-top: 10px; - color: #445; - font-weight: bold; } - #view-amount .amount-pane-no-recipient .amount-bar .title .limits { - margin-top: 10px; - color: #9b9bab; - font-size: 12px; } - #view-amount .amount-pane-no-recipient .amount-bar .title .select { - margin: 10px 1px; } - #view-amount .amount-pane-no-recipient .amount { - display: flex; - flex-direction: column; - justify-content: center; - flex-grow: 1; - position: absolute; - bottom: 254px; - top: 66px; } - #view-amount .amount-pane-no-recipient .amount .light { - color: #9b9bab; } - -#view-amount .amount { - padding-top: 10px; - padding-bottom: 10px; } - #view-amount .amount .icon-toggle { - font-size: 1.2em; - width: auto; - margin: 0.8em auto; - border: 1px solid #f2f2f2; - color: #445; - border-radius: 3px; - padding: 0 10px; - cursor: pointer; } - @media (max-height: 280px) { - #view-amount .amount .icon-toggle { - margin: 0.1em auto; } } - #view-amount .amount__editable--minimize { - font-size: 22px; } - #view-amount .amount__editable--standard { - font-size: 42px; } - @media (max-height: 480px) { - #view-amount .amount__editable--standard { - font-size: 26px; - padding-top: 10px; } } - #view-amount .amount__editable--placeholder { - color: #9b9bab; } - #view-amount .amount__number { - color: #445; } - #view-amount .amount__currency-toggle { - border: 1px solid #f2f2f2; - color: #445; - border-radius: 3px; - padding: 0 10px; - cursor: pointer; - font-size: .6em; - position: relative; - top: -3px; - line-height: 1; } - @media (max-width: 320px) { - #view-amount .amount__currency-toggle { - line-height: 30px; - height: 30px; } } - #view-amount .amount__currency-toggle-mobile { - border: 1px solid #f2f2f2; - color: #445; - border-radius: 3px; - cursor: pointer; - position: relative; - line-height: 1; } - @media (max-width: 320px) { - #view-amount .amount__currency-toggle-mobile { - line-height: 30px; - height: 30px; } } - #view-amount .amount__results--minimize { - font-size: 12px; } - #view-amount .amount__results--standard { - font-size: 18px; - padding: 10px 0; } - #view-amount .amount__results--placeholder { - color: #9b9bab; } - #view-amount .amount__result { - color: #9b9bab; - font-size: .9em; - line-height: 1; } - @media (max-height: 480px) { - #view-amount .amount__result { - margin-bottom: 0; } } - #view-amount .amount__result-equiv { - color: #667; - font-size: 1.2em; } - @media (max-height: 480px) { - #view-amount .amount__result-equiv { - margin-top: 0; - font-size: 16px; } } - -#view-amount .scroll-content { - display: flex; - flex-direction: column; } - #view-amount .scroll-content .send-amount { - flex: 1 1 auto; - display: flex; - flex-direction: column; - justify-content: center; } - #view-amount .scroll-content .send-amount .send-amount-tool { - flex: 0 1 auto; } - #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input { - text-align: center; - position: relative; - padding: 10px 30px; } - #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .text-selectable { - -webkit-user-select: text; - -moz-user-select: text; - -ms-user-select: text; - user-select: text; } - #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount input, #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount .unit, #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount .primary-amount-display { - font-size: 1.8em; } - @media (min-width: 375px) { - #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount input, #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount .unit, #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount .primary-amount-display { - font-size: 2.1em; } } - @media (min-width: 414px) { - #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount input, #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount .unit, #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount .primary-amount-display { - font-size: 2.4em; } } - #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount.long input, #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount.long .unit, #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount.long .primary-amount-display { - font-size: 1.6em; } - @media (min-width: 375px) { - #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount.long input, #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount.long .unit, #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount.long .primary-amount-display { - font-size: 1.8em; } } - @media (min-width: 414px) { - #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount.long input, #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount.long .unit, #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount.long .primary-amount-display { - font-size: 2em; } } - #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount.very-long input, #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount.very-long .unit, #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount.very-long .primary-amount-display { - font-size: 0.9em; } - @media (min-width: 375px) { - #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount.very-long input, #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount.very-long .unit, #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount.very-long .primary-amount-display { - font-size: 1.3em; } } - @media (min-width: 414px) { - #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount.very-long input, #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount.very-long .unit, #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount.very-long .primary-amount-display { - font-size: 1.4em; } } - #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount input { - border: 0; - padding: 0; - white-space: normal; - background: none; - line-height: 1; - box-sizing: content-box; - display: inline-block; - vertical-align: middle; - margin: 0; - height: 1em; - margin-right: 5px; - font-family: 'ProximaNova'; } - #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount .unit, - #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount .primary-amount-display { - display: inline-block; - vertical-align: middle; - line-height: 1em; } - #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount .unit { - font-weight: bold; } - #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount .primary-amount-display { - margin-right: 5px; - word-break: break-all; } - #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .switch-currencies { - position: absolute; - right: 0; - top: 50%; - transform: translate(0, -50%); - padding: 15px; } - #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .switch-currencies img { - width: 18px; } - #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-actions { - margin-top: 15px; - display: flex; - align-items: center; - justify-content: center; } - #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-actions .button { - flex: 1 1 auto; - line-height: 1.2em; } - #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-actions .button + .button { - margin-left: 10px; } - #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-actions .button span { - display: flex; - align-items: center; - justify-content: center; } - #view-amount .scroll-content .button.no-margin { - margin: 0; } - #view-amount .scroll-content .notification-warning { - display: block; - padding: .75rem 1.25rem; - color: #856404; - background-color: #fff3cd; - border: 1px solid #ffeeba; - line-height: 1.4em; - margin-bottom: 20px; } - #view-amount .scroll-content .keypad-container { - position: relative; } - #view-amount .scroll-content .keypad-container .keypad { - text-align: center; - font-size: 18px; - font-weight: lighter; - position: absolute; - bottom: 0; - width: 100%; - color: #667; } - @media (min-height: 667px) { - #view-amount .scroll-content .keypad-container .keypad { - font-size: 24px; } } - #view-amount .scroll-content .keypad-container .keypad .row { - padding: 0 !important; - margin: 0 !important; } - #view-amount .scroll-content .keypad-container .keypad .col { - line-height: 38px; } - @media (min-height: 667px) { - #view-amount .scroll-content .keypad-container .keypad .col { - line-height: 45px; } } - #view-amount .scroll-content .keypad-container .keypad .row:last-child .col { - padding-bottom: 10px; } - #view-amount .scroll-content .keypad-container .keypad .operator { - background-color: #f2f2f2; - font-weight: normal; - cursor: pointer; } - #view-amount .scroll-content .keypad-container .keypad .operator:active { - background-color: #9b9bab; } - #view-amount .scroll-content .keypad-container .keypad .operator-send { - font-weight: bolder; - color: #fff; - background-color: #494949; - font-size: 36px; - cursor: pointer; } - #view-amount .scroll-content .keypad-container .keypad .operator-send:active { - background-color: #eaeaea; } - #view-amount .scroll-content .keypad-container .keypad .digit { - cursor: pointer; - border-top: 1px solid #f2f2f2; - border-left: 1px solid #f2f2f2; - transition: all 0.1s ease; } - #view-amount .scroll-content .keypad-container .keypad .digit:active { - background-color: #f2f2f2; } + @media (max-width: 320px) { + #view-amount .amount-pane-recipient .amount-bar { + padding: 0px; } } + #view-amount .amount-pane-recipient .amount-bar .title { + float: left; + padding-top: 10px; + color: #445; + font-weight: bold; } + @media (max-height: 480px) { + #view-amount .amount-pane-recipient .amount-bar .title { + padding: 0px; } } @media (max-height: 480px) { - #view-amount .scroll-content .keypad-container .keypad { - font-size: 12px; } } + #view-amount .amount-pane-recipient .amount-bar { + padding-top: 3px; } } + #view-amount .amount-pane-recipient .amount { + display: flex; + flex-direction: column; + justify-content: center; + flex-grow: 1; + position: absolute; + bottom: 254px; + top: 66px; } + #view-amount .amount-pane-recipient .amount .light { + color: #9b9bab; } + @media (max-height: 480px) { + #view-amount .amount-pane-recipient .amount { + top: 45px; } } + @media (max-width: 320px) { + #view-amount .amount-pane-recipient .amount { + bottom: 276px; + top: 60px; } + #view-amount .amount-pane-recipient .amount > div { + display: inline-block; } + #view-amount .amount-pane-recipient .amount > div:first-child { + display: inherit; } } + #view-amount .amount-pane-no-recipient { + position: absolute; + top: 0; + bottom: 0; + width: 100%; + background-color: #fff; + padding: 0 16px; } + #view-amount .amount-pane-no-recipient .amount-bar { + padding: 24px 0; + font-size: 18px; } + #view-amount .amount-pane-no-recipient .amount-bar .title { + padding-top: 10px; + color: #445; + font-weight: bold; } + #view-amount .amount-pane-no-recipient .amount-bar .title .limits { + margin-top: 10px; + color: #9b9bab; + font-size: 12px; } + #view-amount .amount-pane-no-recipient .amount-bar .title .select { + margin: 10px 1px; } + #view-amount .amount-pane-no-recipient .amount { + display: flex; + flex-direction: column; + justify-content: center; + flex-grow: 1; + position: absolute; + bottom: 254px; + top: 66px; } + #view-amount .amount-pane-no-recipient .amount .light { + color: #9b9bab; } + #view-amount .amount { + padding-top: 10px; + padding-bottom: 10px; } + #view-amount .amount .icon-toggle { + font-size: 1.2em; + width: auto; + margin: 0.8em auto; + border: 1px solid #f2f2f2; + color: #445; + border-radius: 3px; + padding: 0 10px; + cursor: pointer; } + @media (max-height: 280px) { + #view-amount .amount .icon-toggle { + margin: 0.1em auto; } } + #view-amount .amount__editable--minimize { + font-size: 22px; } + #view-amount .amount__editable--standard { + font-size: 42px; } + @media (max-height: 480px) { + #view-amount .amount__editable--standard { + font-size: 26px; + padding-top: 10px; } } + #view-amount .amount__editable--placeholder { + color: #9b9bab; } + #view-amount .amount__number { + color: #445; } + #view-amount .amount__currency-toggle { + border: 1px solid #f2f2f2; + color: #445; + border-radius: 3px; + padding: 0 10px; + cursor: pointer; + font-size: .6em; + position: relative; + top: -3px; + line-height: 1; } + @media (max-width: 320px) { + #view-amount .amount__currency-toggle { + line-height: 30px; + height: 30px; } } + #view-amount .amount__currency-toggle-mobile { + border: 1px solid #f2f2f2; + color: #445; + border-radius: 3px; + cursor: pointer; + position: relative; + line-height: 1; } + @media (max-width: 320px) { + #view-amount .amount__currency-toggle-mobile { + line-height: 30px; + height: 30px; } } + #view-amount .amount__results--minimize { + font-size: 12px; } + #view-amount .amount__results--standard { + font-size: 18px; + padding: 10px 0; } + #view-amount .amount__results--placeholder { + color: #9b9bab; } + #view-amount .amount__result { + color: #9b9bab; + font-size: .9em; + line-height: 1; } + @media (max-height: 480px) { + #view-amount .amount__result { + margin-bottom: 0; } } + #view-amount .amount__result-equiv { + color: #667; + font-size: 1.2em; } + @media (max-height: 480px) { + #view-amount .amount__result-equiv { + margin-top: 0; + font-size: 16px; } } + #view-amount .scroll-content { + display: flex; + flex-direction: column; } + #view-amount .scroll-content .send-amount { + flex: 1 1 auto; + display: flex; + flex-direction: column; + justify-content: center; } + #view-amount .scroll-content .send-amount .send-amount-tool { + flex: 0 1 auto; } + #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input { + text-align: center; + position: relative; + padding: 10px 30px; } + #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .text-selectable { + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; } + #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount input, #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount .unit, #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount .primary-amount-display { + font-size: 1.8em; } + @media (min-width: 375px) { + #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount input, #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount .unit, #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount .primary-amount-display { + font-size: 2.1em; } } + @media (min-width: 414px) { + #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount input, #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount .unit, #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount .primary-amount-display { + font-size: 2.4em; } } + #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount.long input, #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount.long .unit, #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount.long .primary-amount-display { + font-size: 1.6em; } + @media (min-width: 375px) { + #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount.long input, #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount.long .unit, #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount.long .primary-amount-display { + font-size: 1.8em; } } + @media (min-width: 414px) { + #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount.long input, #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount.long .unit, #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount.long .primary-amount-display { + font-size: 2em; } } + #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount.very-long input, #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount.very-long .unit, #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount.very-long .primary-amount-display { + font-size: 0.9em; } + @media (min-width: 375px) { + #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount.very-long input, #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount.very-long .unit, #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount.very-long .primary-amount-display { + font-size: 1.3em; } } + @media (min-width: 414px) { + #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount.very-long input, #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount.very-long .unit, #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount.very-long .primary-amount-display { + font-size: 1.4em; } } + #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount input { + border: 0; + padding: 0; + white-space: normal; + background: none; + line-height: 1; + box-sizing: content-box; + display: inline-block; + vertical-align: middle; + margin: 0; + height: 1em; + margin-right: 5px; + font-family: 'ProximaNova'; } + #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount .unit, + #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount .primary-amount-display { + display: inline-block; + vertical-align: middle; + line-height: 1em; } + #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount .unit { + font-weight: bold; } + #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .primary-amount .primary-amount-display { + margin-right: 5px; + word-break: break-all; } + #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .switch-currencies { + position: absolute; + right: 0; + top: 50%; + transform: translate(0, -50%); + padding: 15px; } + #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-tool-input .switch-currencies img { + width: 18px; } + #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-actions { + margin-top: 15px; + display: flex; + align-items: center; + justify-content: center; } + #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-actions .button { + flex: 1 1 auto; + line-height: 1.2em; } + #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-actions .button + .button { + margin-left: 10px; } + #view-amount .scroll-content .send-amount .send-amount-tool .send-amount-actions .button span { + display: flex; + align-items: center; + justify-content: center; } + #view-amount .scroll-content .button.no-margin { + margin: 0; } + #view-amount .scroll-content .notification-warning { + display: block; + padding: .75rem 1.25rem; + color: #856404; + background-color: #fff3cd; + border: 1px solid #ffeeba; + line-height: 1.4em; + margin-bottom: 20px; } + #view-amount .scroll-content .keypad-container { + position: relative; } + #view-amount .scroll-content .keypad-container .keypad { + text-align: center; + font-size: 18px; + font-weight: lighter; + position: absolute; + bottom: 0; + width: 100%; + color: #667; } + @media (min-height: 667px) { + #view-amount .scroll-content .keypad-container .keypad { + font-size: 24px; } } + #view-amount .scroll-content .keypad-container .keypad .row { + padding: 0 !important; + margin: 0 !important; } + #view-amount .scroll-content .keypad-container .keypad .col { + line-height: 38px; } + @media (min-height: 667px) { + #view-amount .scroll-content .keypad-container .keypad .col { + line-height: 45px; } } + #view-amount .scroll-content .keypad-container .keypad .row:last-child .col { + padding-bottom: 10px; } + #view-amount .scroll-content .keypad-container .keypad .operator { + background-color: #f2f2f2; + font-weight: normal; + cursor: pointer; } + #view-amount .scroll-content .keypad-container .keypad .operator:active { + background-color: #9b9bab; } + #view-amount .scroll-content .keypad-container .keypad .operator-send { + font-weight: bolder; + color: #fff; + background-color: #494949; + font-size: 36px; + cursor: pointer; } + #view-amount .scroll-content .keypad-container .keypad .operator-send:active { + background-color: #eaeaea; } + #view-amount .scroll-content .keypad-container .keypad .digit { + cursor: pointer; + border-top: 1px solid #f2f2f2; + border-left: 1px solid #f2f2f2; + transition: all 0.1s ease; } + #view-amount .scroll-content .keypad-container .keypad .digit:active { + background-color: #f2f2f2; } + @media (max-height: 480px) { + #view-amount .scroll-content .keypad-container .keypad { + font-size: 12px; } } + #view-amount ion-content { + margin-bottom: constant(safe-area-inset-bottom); + /* iOS 11.0 */ + margin-bottom: env(safe-area-inset-bottom); + /* iOS 11.2 */ } #view-confirm { - background-color: #ffffff; } + background-color: #494949; } #view-confirm .item-note { float: none; } #view-confirm .item-note .fee-rate { @@ -10622,6 +10701,13 @@ textarea.d-block { margin-top: -3px; } #view-confirm .toggle { cursor: pointer; } + #view-confirm ion-content { + background-color: #ffffff; } + #view-confirm slide-to-accept, #view-confirm slide-to-accept-success { + margin-bottom: constant(safe-area-inset-bottom); + /* iOS 11.0 */ + margin-bottom: env(safe-area-inset-bottom); + /* iOS 11.2 */ } #copayers-invitation .button-share { color: #fff; @@ -10728,6 +10814,8 @@ textarea.d-block { #tab-home .card-banner { padding: 0; } + #tab-home .card-banner svg { + margin: 40px auto 40px; } #tab-home .card-banner__img { width: 100%; display: block; } @@ -10951,123 +11039,154 @@ textarea.d-block { #cordova-plugin-qrscanner-still, #cordova-plugin-qrscanner-video-preview { background-color: #fab915 !important; } -#tab-send .input input { - width: 100%; - height: auto; } +#tab-send-header { + height: 300px; + width: 100%; } -#tab-send .input.item { - height: 55px; } +#tab-send-contacts { + height: calc(100vh - 300px - 50px - 44px); + /* screen size - button container - bottom-tab-menu - header top */ + overflow: scroll; } + #tab-send-contacts.ios { + height: calc(100vh - 300px - 50px - 44px - 18px); } -#tab-send .input i.left { - padding-left: 15px; } +#tab-send .input { + width: 100%; } + #tab-send .input input { + width: 100%; + height: 57px; + background: #FFF; + border: 1px #D9D9D9 solid; } + #tab-send .input input::placeholder { + color: #DCDCDC; } + #tab-send .input i.left { + padding-left: 15px; } + #tab-send .input i.qr { + cursor: pointer; + cursor: hand; + padding-right: 5px; } -#tab-send .input i.qr { - cursor: pointer; - cursor: hand; - padding-right: 5px; } - -#tab-send .qr-scan-icon { - cursor: pointer; - cursor: hand; - border-left: 1px solid #e4e4e4; - padding-left: 10px; } - -#tab-send .qr-icon { - line-height: 20px; } - -#tab-send .zero-state-cta { - padding-bottom: 3vh; - left: 0; } - -#tab-send .send-heading { - font-size: 14px; - font-weight: bold; - padding: 0 0 16px 0; - border: none; } - -#tab-send .send-header-wrapper { - padding: 10px; - background-color: white; - box-shadow: 0px 5px 10px 0px #cccccc; } - -#tab-send .search-wrapper { +#tab-send .send-wrapper { + padding: 18px 9px 9px 9px; background-color: #f2f2f2; border-radius: 3px; border: none; } - #tab-send .search-wrapper .svg#Bitcoin_Symbol { - width: 14px; } - #tab-send .search-wrapper .svg#Bitcoin_Symbol .st0 { - fill: #cccccc; } - #tab-send .search-wrapper.focus { - background: none; } - #tab-send .search-wrapper.focus .svg#Bitcoin_Symbol { - display: none; } - #tab-send .search-wrapper.focus .search-input { - padding-left: 30px; } - #tab-send .search-wrapper.focus .search-input:focus::-webkit-input-placeholder { - opacity: 0; } - -#tab-send .abs-v-center { - position: absolute; - top: 50%; - transform: translateY(-50%); } + #tab-send .send-wrapper:after { + display: block; + position: relative; + height: 1px; + background: #DEDEDE; + bottom: 0; + content: ''; + margin: 10px 6px 0px; } + #tab-send .send-wrapper.focus .search-input { + padding-left: 30px; } + #tab-send .send-wrapper.focus .search-input:focus::-webkit-input-placeholder { + opacity: 0; } + #tab-send .send-wrapper .buttons { + margin: auto; + margin-top: 18px; } + #tab-send .send-wrapper .buttons .button { + height: 60px; + line-height: 16px; + margin-right: 0px; + width: 95%; + max-width: none; + padding: 2px; } + #tab-send .send-wrapper .buttons .button-clipboard-paste { + margin-left: 0; } + #tab-send .send-wrapper .buttons .button-clipboard-paste .address { + display: none; } + #tab-send .send-wrapper .buttons .button-clipboard-paste .icon { + background: url(../img/icon-clipboard-paste.svg); + width: 15px; + height: 19px; + display: inline-block; + margin-bottom: 4px; } + #tab-send .send-wrapper .buttons .button-clipboard-paste.contains-address, #tab-send .send-wrapper .buttons .button-clipboard-paste.contains-content { + background: #FAB915; + color: #FFF !important; + border: 0; + box-shadow: 0 2px 11px 0 #C1C1C1; } + #tab-send .send-wrapper .buttons .button-clipboard-paste.contains-address .address, #tab-send .send-wrapper .buttons .button-clipboard-paste.contains-content .address { + display: none; } + #tab-send .send-wrapper .buttons .button-clipboard-paste.contains-address .icon, #tab-send .send-wrapper .buttons .button-clipboard-paste.contains-content .icon { + background: url(../img/icon-clipboard-paste-white.svg); } + #tab-send .send-wrapper .buttons .button-clipboard-paste.contains-address.contains-address .address, #tab-send .send-wrapper .buttons .button-clipboard-paste.contains-content.contains-address .address { + display: inline; } + #tab-send .send-wrapper .buttons .button-clipboard-paste.contains-address.contains-address .non-address, #tab-send .send-wrapper .buttons .button-clipboard-paste.contains-content.contains-address .non-address { + display: none; } + #tab-send .send-wrapper .buttons .button span { + font-size: 14px; } + #tab-send .send-wrapper .buttons .button img { + height: 16px; + width: auto; + margin: 2px 0 4px; } + #tab-send .send-wrapper .buttons .button-qr { + font-weight: bold; + max-width: none; + width: 100%; + height: 95px; + margin-top: 20px; } + #tab-send .send-wrapper .buttons .button-qr img { + vertical-align: middle; + margin-right: 12px; + width: 43px; + height: 43px; } + #tab-send .send-wrapper .buttons .button-qr span { + font-size: 19px; } #tab-send .search-input { background-color: transparent; padding-left: 30px; } -#tab-send .separator-left { - border-left: 1px solid #d9d9df; - padding-left: 10px; - height: 70%; } - -#tab-send .bitcoin-address { - border-top: none; - padding-bottom: .5rem; } - @media (max-width: 480px) { - #tab-send .bitcoin-address input { - font-size: 14px; } } - #tab-send .bitcoin-address .icon { - line-height: 31px; - padding-top: 2px; - padding-bottom: 1px; } - -#tab-send .show-more { - text-align: center; - padding: 20px; - font-size: 16px; - color: #387ef5; - font-weight: bold; } - #tab-send .sendTip { + padding-top: 5vh; text-align: center; } - #tab-send .sendTip > .item-heading { - margin-top: 10px; - background: 0 none; } - #tab-send .sendTip img { - content: url("../img/app/tab-icons/ico-send-selected.svg"); } #tab-send .sendTip .item { border-style: none; } #tab-send .sendTip > .title { font-size: 20px; - font-weight: bold; color: #445; margin: 20px 10px; } #tab-send .sendTip > .subtitle { font-size: 1rem; line-height: 1.5em; font-weight: 300; - color: #445; + color: #6F6F70; margin: 20px 1em 2.5em; } #tab-send .sendTip .big-icon-svg .bg.green { padding: 0 10px; box-shadow: none; } + #tab-send .sendTip .buttons { + margin-top: 18px; } + #tab-send .sendTip .buttons .button { + font-weight: bold; + font-size: 19px; } + #tab-send .sendTip .button-first-contact img { + height: 19px; + width: 19px; + margin-right: 6px; + vertical-align: sub; } + +#tab-send .item-heading { + line-height: 16px; + font-size: 14px; + font-weight: bold; } + #tab-send .item-heading .subtitle { + color: #B5B2B2; + font-size: 12px; + font-weight: 300; } #tab-send .list .item { + font-weight: 600; color: #444; - border-top: none; - padding-top: 1.5rem; - padding-bottom: 1.5rem; } + padding-top: 0.6rem; + padding-bottom: 0.6rem; } + #tab-send .list .item p { + font-weight: normal; } + #tab-send .list .item.item-icon-left { + padding-left: 64px; } #tab-send .list .item .big-icon-svg { left: 5px; } #tab-send .list .item .big-icon-svg > .bg { @@ -11077,7 +11196,7 @@ textarea.d-block { #tab-send .list .item:before { display: block; position: absolute; - width: 80%; + width: 100%; height: 1px; background: rgba(221, 221, 221, 0.3); top: 0; @@ -11096,6 +11215,28 @@ textarea.d-block { #tab-send .scroll { height: 100%; } +#tab-send .card.contacts { + margin: 4px 4px 16px 4px; + border-radius: 6px; + box-shadow: 0px 2px 1px 0 #C1C1C1; } + #tab-send .card.contacts .gravatar { + border-radius: 30px; + height: 40px; + width: 40px; } + +@media only screen and (min-device-width: 320px) and (max-device-width: 568px) { + #tab-send .send-wrapper .buttons .button-qr { + height: 60px; } + #tab-send .send-wrapper .buttons .button-qr span { + font-size: 16px; } + #tab-send #tab-send-header { + height: 270px; } + #tab-send #tab-send-contacts { + height: calc(100vh - 270px - 50px - 44px); + /* screen size - button container - bottom-tab-menu - header top */ } + #tab-send #tab-send-contacts.ios { + height: calc(100vh - 270px - 50px - 44px - 18px); } } + .settings .icon-bitpay { background-image: url("../img/icon-bitpay.svg"); } @@ -11604,7 +11745,8 @@ textarea.d-block { fill: white; } #walletDetails .bp-content { position: relative; - height: 100%; } + height: 100%; + height: calc(100% - env(safe-area-inset-bottom) * 2); } #walletDetails .bp-content.status-bar { margin-top: 20px; } #walletDetails .bar-header { @@ -11618,7 +11760,8 @@ textarea.d-block { background-color: inherit !important; } #walletDetails ion-content { padding-top: 0; - top: 0; } + top: 0; + margin-bottom: 16px; } #walletDetails ion-content.collapsible { margin-top: 210px; } #walletDetails ion-content .scroll { @@ -12211,7 +12354,6 @@ a.item { position: relative; height: 70px; border-color: #fab915; - background-color: #fab915; padding-top: 20px; margin-bottom: 50px; text-align: center; } @@ -13013,74 +13155,13 @@ a.item { .onboarding-illustration-backup-warning { background-image: url(../img/app/backup-warning.svg); } -#rate-card .item-heading { - font-weight: 700; } - -#rate-card .row { - border: none; } - -#rate-card .item-icon-right { - margin: 0; } - -#rate-card .feedback-flow-button { - margin-bottom: 20px; } - -#rate-card .icon-svg > img { - height: 1.8rem; - margin-bottom: 5px; } - -#send-feedback { - background-color: #ffffff; } - #send-feedback .row { - border: none; } - #send-feedback .skip { - color: rgba(255, 255, 255, 0.3); } - #send-feedback .feedback-heading { - padding-top: 20px; } - #send-feedback .feedback-title { - padding-left: 10px; - font-size: 20px; - font-weight: bold; - color: #445; } - #send-feedback .rating { - text-align: right; - padding-right: 15px; } - #send-feedback .comment { - padding: 0 20px 20px; - font-size: 1rem; - line-height: 1.5em; - font-weight: 300; - color: #445; } - #send-feedback .user-feedback { - border-top: 1px solid #f2f2f2; - border-bottom: 1px solid #f2f2f2; - padding: 20px; - width: 100%; - margin-bottom: 20px; - -webkit-appearance: none; } - #send-feedback .send-feedback-star { - height: 1rem; - margin-left: 5px; } - #send-feedback .form-fade-in { - opacity: 0; - animation-name: fadeIn; - animation-duration: .5s; - animation-fill-mode: forwards; - animation-timing-function: ease-in; } - -@keyframes fadeIn { - from { - opacity: 0; } - to { - opacity: 1; } } - -#complete { +#share-app { background-color: #fff; } - #complete .complete-layout { + #share-app .share-app-layout { display: flex; flex-direction: column; height: 100%; } - #complete .complete-layout__expand { + #share-app .share-app-layout__expand { display: flex; flex-direction: column; flex-grow: 1; @@ -13089,36 +13170,27 @@ a.item { text-align: center; opacity: 0; transition: opacity .3s; } - #complete .complete-layout__expand.fade-in { + #share-app .share-app-layout__expand.fade-in { opacity: 1; } - #complete .share-the-love-illustration { + #share-app .share-the-love-illustration { width: 5rem; margin: 1rem; } - #complete .send-feedback-illustration { - height: 16rem; - margin: 1rem; } - #complete .feedback-title { - font-size: 20px; - font-weight: bold; - color: #445; - margin: 20px 10px; - text-align: center; } - #complete .subtitle { + #share-app .subtitle { padding: 10px 30px 20px; text-align: center; color: #667; } - #complete .icon-svg > img { + #share-app .icon-svg > img { height: 16rem; width: 16rem; margin: 10px; } - #complete .socialsharing-icon { + #share-app .socialsharing-icon { display: inline-block; width: 60px; } - #complete .addressbook-icon-svg { + #share-app .addressbook-icon-svg { display: inline-block; width: 50px; height: 50px; } - #complete .share-buttons { + #share-app .share-buttons { padding: 50px 10px 30px; background-color: #f2f2f2; text-align: center; @@ -13130,7 +13202,7 @@ a.item { animation-fill-mode: forwards; animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); animation-delay: .2s; } - #complete .share-buttons__action { + #share-app .share-buttons__action { display: inline-block; color: #667; font-size: .9rem; @@ -13148,38 +13220,6 @@ a.item { transform: translateY(0); opacity: 1; } } -#rate-app { - background-color: #ffffff; - text-align: center; } - #rate-app .skip-rating { - color: #445; - position: absolute; - top: 5px; - right: 10px; - padding: 15px; } - #rate-app .icon-svg > img { - width: 80px; - height: 80px; - margin-top: 15px; } - #rate-app .feedback-title { - font-size: 20px; - font-weight: bold; - color: #445; - margin: 80px 50px 10px; - text-align: center; } - #rate-app .share-the-love-illustration { - width: 5rem; - margin: 1rem; } - #rate-app .subtitle { - padding: 10px 30px 20px 40px; - color: #667; } - #rate-app .rate-buttons { - bottom: 0; - width: 100%; - position: absolute; - background-color: #f2f2f2; - padding: 30px 0 15px; } - action-sheet .bp-action-sheet__sheet { background: #fff; width: calc(100% + 1px); @@ -13800,7 +13840,11 @@ slide-to-accept-success { transform: translateY(5rem); opacity: 0; transition: transform 400ms ease, opacity 400ms ease; - transition-delay: 250ms; } + transition-delay: 250ms; + margin-bottom: constant(safe-area-inset-bottom); + /* iOS 11.0 */ + margin-bottom: env(safe-area-inset-bottom); + /* iOS 11.2 */ } slide-to-accept-success .slide-success__footer.reveal { -webkit-transform: translateY(0); transform: translateY(0); @@ -13858,16 +13902,16 @@ slide-to-accept-success { line-height: 30px; } #txp-details .head .amount-label .amount, #view-confirm .head .amount-label .amount { - font-size: 38px; - margin-bottom: .5rem; } - #txp-details .head .amount-label .amount > .unit, - #view-confirm .head .amount-label .amount > .unit { - font-family: "Roboto-Light"; } + font-size: 16px; + color: #9B9B9B; + font-family: "Roboto-Light"; } #txp-details .head .amount-label .alternative, #view-confirm .head .amount-label .alternative { - font-size: 16px; - font-family: "Roboto-Light"; - color: #9B9B9B; } + font-size: 38px; + margin-bottom: .5rem; } + #txp-details .head .amount-label .alternative > .unit, + #view-confirm .head .amount-label .alternative > .unit { + font-family: "Roboto-Light"; } #txp-details .item, #view-confirm .item { border-color: #EFEFEF; } @@ -14155,6 +14199,10 @@ wallet-selector .subheader { font-weight: bold; padding-bottom: 10px; border-bottom: 1px solid #EFEFEF; } + wallet-selector .subheader .subtitle { + color: #667; + font-size: 12px; + font-weight: 300; } wallet-selector .subheader .wallet-coin-logo { vertical-align: middle; margin-right: 5px; } @@ -15018,6 +15066,27 @@ log-options #check-bar .checkbox-icon { border-radius: 3px; display: inline-block; } +.amount .start, +.amount .middle, +.amount .end, +.amount .currency { + display: inline-block; } + +.amount .start { + font-size: 1em; } + +.amount .middle { + font-size: 0.7857em; + margin-left: 5px; } + +.amount .end { + font-size: 0.7857em; + margin-left: 5px; } + +.amount .currency { + font-size: 1em; + margin-left: 5px; } + /* This is for rules that don't yet have a home. * Our goal is to delete this file. Search the regex: /class=".*CLASS.*?"/ */ diff --git a/www/index.html b/www/index.html index 4c73317e3..ecc2d923c 100644 --- a/www/index.html +++ b/www/index.html @@ -11,9 +11,8 @@ - Bitcoin.com Wallet - Bitcoin.com Wallet - - + Bitcoin.com Wallet + @@ -31,7 +30,7 @@ - + From 7fb2792a1a93cc02534177f5218f7bba8cd6ee3c Mon Sep 17 00:00:00 2001 From: Sam Cheng Hung Date: Mon, 30 Jul 2018 16:56:27 +0800 Subject: [PATCH 52/65] Adds size-equal class to amount directive --- src/sass/components/amount.scss | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/sass/components/amount.scss b/src/sass/components/amount.scss index d8fe552a2..b22604181 100644 --- a/src/sass/components/amount.scss +++ b/src/sass/components/amount.scss @@ -20,6 +20,13 @@ margin-left: 5px; } + &.size-equal { + .middle, + .end { + font-size: 1em; + } + } + .currency { font-size: 1em; margin-left: 5px; From f4b0b4606781afabbbe68c5ff5dbca5c6df248bb Mon Sep 17 00:00:00 2001 From: Sam Cheng Hung Date: Mon, 30 Jul 2018 17:33:38 +0800 Subject: [PATCH 53/65] Adds size-equal and capitalizes currency text --- src/js/directives/amount.js | 13 +++++++++++-- src/sass/components/amount.scss | 1 + www/css/main.css | 7 ++++++- www/views/includes/amount.html | 4 ++++ 4 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 www/views/includes/amount.html diff --git a/src/js/directives/amount.js b/src/js/directives/amount.js index bf519c0d0..98d6ac59f 100644 --- a/src/js/directives/amount.js +++ b/src/js/directives/amount.js @@ -2,7 +2,13 @@ /** * @desc amount directive that can be used to display formatted financial values - * @example + * size-equal attribute is optional, defaults to false. + * @example fee = { + * value: 12.49382901, + * currency: 'BCH' + * } + * @example + * @example */ angular.module('bitcoincom.directives') .directive('amount', [ @@ -12,10 +18,13 @@ angular.module('bitcoincom.directives') restrict: 'E', scope: { value: '=', - currency: '=' + currency: '=', + sizeEqual: '=' }, templateUrl: 'views/includes/amount.html', controller: ['$scope', function($scope) { + if (typeof $scope.sizeEqual != 'undefined') $scope.sizeEqual = false; + var decimalPlaces = { '0': ['BIF', 'CLP', 'DJF', 'GNF', 'ILS', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF'], '3': ['BHD', 'IQD', 'JOD', 'KWD', 'OMR', 'TND'], diff --git a/src/sass/components/amount.scss b/src/sass/components/amount.scss index b22604181..363d38a20 100644 --- a/src/sass/components/amount.scss +++ b/src/sass/components/amount.scss @@ -30,5 +30,6 @@ .currency { font-size: 1em; margin-left: 5px; + text-transform: uppercase; } } \ No newline at end of file diff --git a/www/css/main.css b/www/css/main.css index d30a89142..1798f4b98 100644 --- a/www/css/main.css +++ b/www/css/main.css @@ -15083,9 +15083,14 @@ log-options #check-bar .checkbox-icon { font-size: 0.7857em; margin-left: 5px; } +.amount.size-equal .middle, +.amount.size-equal .end { + font-size: 1em; } + .amount .currency { font-size: 1em; - margin-left: 5px; } + margin-left: 5px; + text-transform: uppercase; } /* This is for rules that don't yet have a home. * Our goal is to delete this file. Search the regex: /class=".*CLASS.*?"/ diff --git a/www/views/includes/amount.html b/www/views/includes/amount.html new file mode 100644 index 000000000..4cf2807ad --- /dev/null +++ b/www/views/includes/amount.html @@ -0,0 +1,4 @@ +
+ {{start}}{{middle}}{{end}}{{currency}} +
\ No newline at end of file From da536a3f5b035fe7524f96825bf4957f08a4422f Mon Sep 17 00:00:00 2001 From: Sam Cheng Hung Date: Mon, 30 Jul 2018 17:45:26 +0800 Subject: [PATCH 54/65] Fixes default value of size-equal --- src/js/directives/amount.js | 2 +- www/views/tab-home.html | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/js/directives/amount.js b/src/js/directives/amount.js index 98d6ac59f..a23069157 100644 --- a/src/js/directives/amount.js +++ b/src/js/directives/amount.js @@ -23,7 +23,7 @@ angular.module('bitcoincom.directives') }, templateUrl: 'views/includes/amount.html', controller: ['$scope', function($scope) { - if (typeof $scope.sizeEqual != 'undefined') $scope.sizeEqual = false; + if (typeof $scope.sizeEqual == 'undefined') $scope.sizeEqual = false; var decimalPlaces = { '0': ['BIF', 'CLP', 'DJF', 'GNF', 'ILS', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF'], diff --git a/www/views/tab-home.html b/www/views/tab-home.html index 8df176a56..459618996 100644 --- a/www/views/tab-home.html +++ b/www/views/tab-home.html @@ -22,6 +22,21 @@
+
+ + + +
+
From e0ef42b09a23ec7fe098a009dce87c244b2ac645 Mon Sep 17 00:00:00 2001 From: Sam Cheng Hung Date: Mon, 30 Jul 2018 17:47:05 +0800 Subject: [PATCH 55/65] Removes dummy text --- www/views/tab-home.html | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/www/views/tab-home.html b/www/views/tab-home.html index 459618996..8df176a56 100644 --- a/www/views/tab-home.html +++ b/www/views/tab-home.html @@ -22,21 +22,6 @@
-
- - - -
-
From 734153ec5b76cd4f8a5c130d4e534bbdcf62ba72 Mon Sep 17 00:00:00 2001 From: Sebastiaan Pasma Date: Mon, 30 Jul 2018 15:17:15 +0200 Subject: [PATCH 56/65] more fixes on the send/receive on Android & iOS / removed some unused code --- src/js/controllers/walletDetails.js | 12 ++---------- src/sass/views/walletDetails.scss | 4 +++- www/views/walletDetails.html | 8 ++++---- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/src/js/controllers/walletDetails.js b/src/js/controllers/walletDetails.js index f4f2d2488..ffbc070f5 100644 --- a/src/js/controllers/walletDetails.js +++ b/src/js/controllers/walletDetails.js @@ -12,13 +12,6 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun $scope.isAndroid = platformInfo.isAndroid; $scope.isIOS = platformInfo.isIOS; - $scope.currencySymbols = { - 'EUR': '€', - 'GBP': '£', - 'USD': '$', - 'YEN' : '' - }; - var channel = "firebase"; if (platformInfo.isNW) { channel = "ga"; @@ -354,7 +347,7 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun top = TOP_BALANCE_BUTTON; } - var amountTop = ((amountScale - 0.80) / 0.80) * top; //0.85 + var amountTop = ((amountScale - 0.80) / 0.80) * top; if (amountTop < -2) { amountTop = -2; } @@ -365,8 +358,7 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun var t = amountTop; $scope.altAmountOpacity = (amountHeight - 100) / 80; - - $scope.buttonsOpacity = (amountHeight - 150)/80; + $scope.buttonsOpacity = (amountHeight - 140) / 70; $window.requestAnimationFrame(function() { $scope.amountHeight = amountHeight + 'px'; $scope.contentMargin = contentMargin + 'px'; diff --git a/src/sass/views/walletDetails.scss b/src/sass/views/walletDetails.scss index 8d6972f09..6b760bbc4 100644 --- a/src/sass/views/walletDetails.scss +++ b/src/sass/views/walletDetails.scss @@ -194,7 +194,9 @@ .send-receive-buttons { max-width: 600px; - margin: 25px auto 0; + position: absolute; + bottom: 20px; + >.col { padding: 5px 10px; margin-bottom: 0; diff --git a/www/views/walletDetails.html b/www/views/walletDetails.html index 85aace8fc..e29cd5c51 100644 --- a/www/views/walletDetails.html +++ b/www/views/walletDetails.html @@ -91,7 +91,7 @@
-
+
Receive @@ -214,17 +214,17 @@
-
+
Receive
-
+
Buy Bitcoin
-
+
Send
From ed291b1ac5f706315c5e074e1389cc9e6b3f1fbc Mon Sep 17 00:00:00 2001 From: Sebastiaan Pasma Date: Mon, 30 Jul 2018 15:25:52 +0200 Subject: [PATCH 57/65] removed currencySymbolService and it's references --- src/js/controllers/walletDetails.js | 7 +- src/js/services/currencySymbolService.js | 195 ----------------------- www/views/walletDetails.html | 16 +- 3 files changed, 9 insertions(+), 209 deletions(-) delete mode 100644 src/js/services/currencySymbolService.js diff --git a/src/js/controllers/walletDetails.js b/src/js/controllers/walletDetails.js index ffbc070f5..3e92b2a40 100644 --- a/src/js/controllers/walletDetails.js +++ b/src/js/controllers/walletDetails.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.controllers').controller('walletDetailsController', function($scope, $rootScope, $interval, $timeout, $filter, $log, $ionicModal, $ionicPopover, $state, $stateParams, $ionicHistory, profileService, lodash, configService, currencySymbolService, platformInfo, walletService, txpModalService, externalLinkService, popupService, addressbookService, storageService, $ionicScrollDelegate, $window, bwcError, gettextCatalog, timeService, feeService, appConfigService, rateService) { +angular.module('copayApp.controllers').controller('walletDetailsController', function($scope, $rootScope, $interval, $timeout, $filter, $log, $ionicModal, $ionicPopover, $state, $stateParams, $ionicHistory, profileService, lodash, configService, platformInfo, walletService, txpModalService, externalLinkService, popupService, addressbookService, storageService, $ionicScrollDelegate, $window, bwcError, gettextCatalog, timeService, feeService, appConfigService, rateService) { var HISTORY_SHOW_LIMIT = 10; var currentTxHistoryPage = 0; @@ -256,11 +256,6 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun return !tx.confirmations || tx.confirmations === 0; }; - $scope.currencySymbol = function(code) { - var symbol = currencySymbolService.getCurrencySymbol(code); - return symbol?symbol:""; - }; - $scope.showMore = function() { $timeout(function() { currentTxHistoryPage++; diff --git a/src/js/services/currencySymbolService.js b/src/js/services/currencySymbolService.js deleted file mode 100644 index 029cd9eb2..000000000 --- a/src/js/services/currencySymbolService.js +++ /dev/null @@ -1,195 +0,0 @@ -'use strict'; - -angular.module('copayApp.services').factory('currencySymbolService', function($log) { - var root = {}; - root.currencySymbols = { - 'AED': 'د.إ', - 'AFN': '؋', - 'ALL': 'L', - 'AMD': '֏', - 'ANG': 'ƒ', - 'AOA': 'Kz', - 'ARS': '$', - 'AUD': '$', - 'AWG': 'ƒ', - 'AZN': '₼', - 'BAM': 'KM', - 'BBD': '$', - 'BDT': '৳', - 'BGN': 'лв', - 'BHD': '.د.ب', - 'BIF': 'FBu', - 'BMD': '$', - 'BND': '$', - 'BOB': '$b', - 'BRL': 'R$', - 'BSD': '$', - 'BTC': '฿', - 'BTN': 'Nu.', - 'BWP': 'P', - 'BYR': 'Br', - 'BYN': 'Br', - 'BZD': 'BZ$', - 'CAD': '$', - 'CDF': 'FC', - 'CHF': 'CHF', - 'CLP': '$', - 'CNY': '¥', - 'COP': '$', - 'CRC': '₡', - 'CUC': '$', - 'CUP': '₱', - 'CVE': '$', - 'CZK': 'Kč', - 'DJF': 'Fdj', - 'DKK': 'kr', - 'DOP': 'RD$', - 'DZD': 'دج', - 'EEK': 'kr', - 'EGP': '£', - 'ERN': 'Nfk', - 'ETB': 'Br', - 'ETH': 'Ξ', - 'EUR': '€', - 'FJD': '$', - 'FKP': '£', - 'GBP': '£', - 'GEL': '₾', - 'GGP': '£', - 'GHC': '₵', - 'GHS': 'GH₵', - 'GIP': '£', - 'GMD': 'D', - 'GNF': 'FG', - 'GTQ': 'Q', - 'GYD': '$', - 'HKD': '$', - 'HNL': 'L', - 'HRK': 'kn', - 'HTG': 'G', - 'HUF': 'Ft', - 'IDR': 'Rp', - 'ILS': '₪', - 'IMP': '£', - 'INR': '₹', - 'IQD': 'ع.د', - 'IRR': '﷼', - 'ISK': 'kr', - 'JEP': '£', - 'JMD': 'J$', - 'JOD': 'JD', - 'JPY': '¥', - 'KES': 'KSh', - 'KGS': 'лв', - 'KHR': '៛', - 'KMF': 'CF', - 'KPW': '₩', - 'KRW': '₩', - 'KWD': 'KD', - 'KYD': '$', - 'KZT': 'лв', - 'LAK': '₭', - 'LBP': '£', - 'LKR': '₨', - 'LRD': '$', - 'LSL': 'M', - 'LTC': 'Ł', - 'LTL': 'Lt', - 'LVL': 'Ls', - 'LYD': 'LD', - 'MAD': 'MAD', - 'MDL': 'lei', - 'MGA': 'Ar', - 'MKD': 'ден', - 'MMK': 'K', - 'MNT': '₮', - 'MOP': 'MOP$', - 'MRO': 'UM', - 'MRU': 'UM', - 'MUR': '₨', - 'MVR': 'Rf', - 'MWK': 'MK', - 'MXN': '$', - 'MYR': 'RM', - 'MZN': 'MT', - 'NAD': '$', - 'NGN': '₦', - 'NIO': 'C$', - 'NOK': 'kr', - 'NPR': '₨', - 'NZD': '$', - 'OMR': '﷼', - 'PAB': 'B/.', - 'PEN': 'S/.', - 'PGK': 'K', - 'PHP': '₱', - 'PKR': '₨', - 'PLN': 'zł', - 'PYG': 'Gs', - 'QAR': '﷼', - 'RMB': '¥', - 'RON': 'lei', - 'RSD': 'Дин.', - 'RUB': '₽', - 'RWF': 'R₣', - 'SAR': '﷼', - 'SBD': '$', - 'SCR': '₨', - 'SDG': 'ج.س.', - 'SEK': 'kr', - 'SGD': '$', - 'SHP': '£', - 'SLL': 'Le', - 'SOS': 'S', - 'SRD': '$', - 'SSP': '£', - 'STD': 'Db', - 'STN': 'Db', - 'SVC': '$', - 'SYP': '£', - 'SZL': 'E', - 'THB': '฿', - 'TJS': 'SM', - 'TMT': 'T', - 'TND': 'د.ت', - 'TOP': 'T$', - 'TRL': '₤', - 'TRY': '₺', - 'TTD': 'TT$', - 'TVD': '$', - 'TWD': 'NT$', - 'TZS': 'TSh', - 'UAH': '₴', - 'UGX': 'USh', - 'USD': '$', - 'UYU': '$U', - 'UZS': 'лв', - 'VEF': 'Bs', - 'VND': '₫', - 'VUV': 'VT', - 'WST': 'WS$', - 'XAF': 'FCFA', - 'XBT': 'Ƀ', - 'XCD': '$', - 'XOF': 'CFA', - 'XPF': '₣', - 'YER': '﷼', - 'ZAR': 'R', - 'ZWD': 'Z$' - }; - - root.getCurrencySymbol = function(code) { - if (!code) return false; - - code = code.toUpperCase(); - - if (root.currencySymbols[code]) { - return root.currencySymbols[code]; - } - $log.debug("Currency symbol for "+code+" not found"); - return false; - }; - - return root; - -}); \ No newline at end of file diff --git a/www/views/walletDetails.html b/www/views/walletDetails.html index e29cd5c51..f9cf662cb 100644 --- a/www/views/walletDetails.html +++ b/www/views/walletDetails.html @@ -34,7 +34,7 @@ on-hold="hideToggle()" ng-style="{'transform': amountScale}" ng-class="{amount__balance: amountIsCollapsible}"> - {{currencySymbol(status.alternativeIsoCode)}} {{status.totalBalanceAlternative}} {{status.alternativeIsoCode}} + {{status.totalBalanceAlternative}} {{status.alternativeIsoCode}}
- {{currencySymbol(status.alternativeIsoCode)}} {{status.totalBalanceAlternative}} {{status.alternativeIsoCode}} + {{status.totalBalanceAlternative}} {{status.alternativeIsoCode}}
@@ -86,7 +86,7 @@   - {{currencySymbol(status.alternativeIsoCode)}} {{status.spendableBalanceAlternative}} {{status.alternativeIsoCode}} + {{status.spendableBalanceAlternative}} {{status.alternativeIsoCode}}
@@ -148,7 +148,7 @@ class="size-14 amount-alternative" ng-if="status.totalBalanceAlternative && wallet.network == 'livenet'" ng-style="{opacity: altAmountOpacity}"> - {{currencySymbol(status.alternativeIsoCode)}} {{status.totalBalanceAlternative}} {{status.alternativeIsoCode}} + {{status.totalBalanceAlternative}} {{status.alternativeIsoCode}}
@@ -158,7 +158,7 @@ on-hold="hideToggle()" ng-style="{'transform': amountScale}" ng-class="{amount__balance: amountIsCollapsible}"> - {{currencySymbol(status.alternativeIsoCode)}} {{status.totalBalanceAlternative}} {{status.alternativeIsoCode}} + {{status.totalBalanceAlternative}} {{status.alternativeIsoCode}}
  - {{currencySymbol(status.alternativeIsoCode)}} {{status.spendableBalanceAlternative}} {{status.alternativeIsoCode}} + {{status.spendableBalanceAlternative}} {{status.alternativeIsoCode}}
@@ -205,7 +205,7 @@
From 0fdd478ae4969e8258e53f70c6d7810dcfd3e0bc Mon Sep 17 00:00:00 2001 From: Brendon Duncan Date: Tue, 31 Jul 2018 12:47:03 +1200 Subject: [PATCH 58/65] Fixed up bold fonts. --- src/sass/views/amountNew.scss | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sass/views/amountNew.scss b/src/sass/views/amountNew.scss index 0e1d183b6..c0ce94c7a 100644 --- a/src/sass/views/amountNew.scss +++ b/src/sass/views/amountNew.scss @@ -273,7 +273,7 @@ .primary-amount { color: #333; - font-family: 'ProximaNova-Semibold'; + font-weight: bold; input, .unit, .primary-amount-display { font-size: 1.8em; @@ -537,11 +537,12 @@ .button-primary { background-color: $v-primary-color; border-radius: 0; - font-family: 'ProximaNova-Semibold'; + font-weight: bold; } .button-primary[disabled] { background-color: $v-button-primary-disabled-bg; + opacity: 1; } } From 71a31ce39954c1ec1d245f612ec0420196a5a649 Mon Sep 17 00:00:00 2001 From: Brendon Duncan Date: Tue, 31 Jul 2018 13:25:56 +1200 Subject: [PATCH 59/65] Available funds now accurately reflects the primary currency choice. --- src/js/controllers/amount.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/js/controllers/amount.js b/src/js/controllers/amount.js index 3cf93b4c9..070dc5e9b 100644 --- a/src/js/controllers/amount.js +++ b/src/js/controllers/amount.js @@ -671,21 +671,21 @@ function amountController(configService, $filter, $ionicHistory, $ionicModal, $i }; function updateAvailableFundsStringIfNeeded() { - console.log('updateAvailableFundsStringIfNeeded()'); if (vm.fromWalletId && availableSatoshis !== null) { - console.log('updating'); availableFundsInFiat = ''; vm.availableFunds = availableFundsInCrypto; var coin = availableUnits[altUnitIndex].isFiat ? availableUnits[unitIndex].id : availableUnits[altUnitIndex].id; txFormatService.formatAlternativeStr(coin, availableSatoshis, function formatCallback(formatted){ - console.log('txFormatService returned'); if (formatted) { availableFundsInFiat = formatted; - if (availableUnits[unitIndex].isFiat) { - vm.availableFunds = availableFundsInFiat; - } else { - vm.availableFunds = availableFundsInCrypto; - } + + $scope.$apply(function() { + if (availableUnits[unitIndex].isFiat) { + vm.availableFunds = availableFundsInFiat; + } else { + vm.availableFunds = availableFundsInCrypto; + } + }); } }); } From 2353109adfbacad28f9ab8f1e0c1e158dd4b75e4 Mon Sep 17 00:00:00 2001 From: Brendon Duncan Date: Tue, 31 Jul 2018 17:59:26 +1200 Subject: [PATCH 60/65] Bugfix for font for insufficient funds warning. --- src/sass/views/amountNew.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sass/views/amountNew.scss b/src/sass/views/amountNew.scss index c0ce94c7a..8c8e771f7 100644 --- a/src/sass/views/amountNew.scss +++ b/src/sass/views/amountNew.scss @@ -249,7 +249,7 @@ min-height: 20px; .warning { - font-family: 'ProximaNova-Semibold'; + font-weight: bold; font-size: 12px; padding: 0 6px 6px 6px; text-align: center; From 778cbfbab0a9877be520b05226f093a8edf12a66 Mon Sep 17 00:00:00 2001 From: Brendon Duncan Date: Tue, 31 Jul 2018 19:16:11 +1200 Subject: [PATCH 61/65] Should have been part of merge for amount directive. --- src/sass/main.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sass/main.scss b/src/sass/main.scss index 7b3e46291..516656449 100644 --- a/src/sass/main.scss +++ b/src/sass/main.scss @@ -9,4 +9,5 @@ @import "mixins/mixins"; @import "views/views"; @import "directives/directives"; +@import "components/components"; @import "shame"; From 5a0c1417d47b1e38f8a479254e07a69caa29c903 Mon Sep 17 00:00:00 2001 From: Sam Cheng Hung Date: Tue, 31 Jul 2018 15:44:59 +0800 Subject: [PATCH 62/65] Prevents reassignment of bound attribute size-equal --- src/js/directives/amount.js | 2 +- www/views/includes/amount.html | 2 +- www/views/tab-home.html | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/js/directives/amount.js b/src/js/directives/amount.js index a23069157..f991f0a28 100644 --- a/src/js/directives/amount.js +++ b/src/js/directives/amount.js @@ -23,7 +23,7 @@ angular.module('bitcoincom.directives') }, templateUrl: 'views/includes/amount.html', controller: ['$scope', function($scope) { - if (typeof $scope.sizeEqual == 'undefined') $scope.sizeEqual = false; + $scope.displaySizeEqual = typeof $scope.sizeEqual == 'undefined' ? false : true; var decimalPlaces = { '0': ['BIF', 'CLP', 'DJF', 'GNF', 'ILS', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF'], diff --git a/www/views/includes/amount.html b/www/views/includes/amount.html index 4cf2807ad..361dededc 100644 --- a/www/views/includes/amount.html +++ b/www/views/includes/amount.html @@ -1,4 +1,4 @@
+ ng-class="{ 'size-equal': displaySizeEqual }"> {{start}}{{middle}}{{end}}{{currency}}
\ No newline at end of file diff --git a/www/views/tab-home.html b/www/views/tab-home.html index 8df176a56..77ecbfefe 100644 --- a/www/views/tab-home.html +++ b/www/views/tab-home.html @@ -21,6 +21,12 @@ Download
+
+ +
From 8dc1e060481e01d92f319bf66ac948b342273ff2 Mon Sep 17 00:00:00 2001 From: Sam Cheng Hung Date: Tue, 31 Jul 2018 15:46:12 +0800 Subject: [PATCH 63/65] Removes dummy values on home tab --- www/views/tab-home.html | 6 ------ 1 file changed, 6 deletions(-) diff --git a/www/views/tab-home.html b/www/views/tab-home.html index 77ecbfefe..8df176a56 100644 --- a/www/views/tab-home.html +++ b/www/views/tab-home.html @@ -21,12 +21,6 @@ Download
-
- -
From 02f7bcc2812f323fcf39363328e8f77c2d7a4087 Mon Sep 17 00:00:00 2001 From: Brendon Duncan Date: Tue, 31 Jul 2018 20:18:27 +1200 Subject: [PATCH 64/65] Not using amount directive. Removed safety area below All Available Funds button. --- src/js/controllers/amount.js | 49 ++++++++++++++++++----------------- src/sass/views/amountNew.scss | 1 - www/views/amountNew.html | 4 +-- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/js/controllers/amount.js b/src/js/controllers/amount.js index 070dc5e9b..c50a949a0 100644 --- a/src/js/controllers/amount.js +++ b/src/js/controllers/amount.js @@ -9,13 +9,14 @@ function amountController(configService, $filter, $ionicHistory, $ionicModal, $i vm.altCurrencyList = []; vm.alternativeAmount = ''; vm.alternativeUnit = ''; - vm.amountModel = { amount: 0 }; + vm.amount = '0'; vm.availableFunds = ''; vm.fromWalletId = ''; // Use insufficient for logic, as when the amount is invalid, funds being // either sufficent or insufficient doesn't make sense. vm.fundsAreInsufficient = false; vm.globalResult = ''; + vm.hello = 'hi'; vm.isRequestingSpecificAmount = false; vm.listComplete = false; vm.lastUsedPopularList = []; @@ -77,9 +78,9 @@ function amountController(configService, $filter, $ionicHistory, $ionicModal, $i } function onBeforeEnter(event, data) { - + initCurrencies(); - + vm.hello = 'greetings'; if (data.stateParams.shapeshiftOrderId && data.stateParams.shapeshiftOrderId.length > 0) { vm.minShapeshiftAmount = parseFloat(data.stateParams.minShapeshiftAmount); vm.maxShapeshiftAmount = parseFloat(data.stateParams.maxShapeshiftAmount); @@ -159,7 +160,7 @@ function amountController(configService, $filter, $ionicHistory, $ionicModal, $i // in SAT ALWAYS if ($stateParams.toAmount) { - vm.amountModel.amount = (($stateParams.toAmount) * satToUnit).toFixed(unitDecimals); + vm.amount = (($stateParams.toAmount) * satToUnit).toFixed(unitDecimals); } processAmount(); @@ -271,7 +272,7 @@ function amountController(configService, $filter, $ionicHistory, $ionicModal, $i } function paste(value) { - vm.amountModel.amount = value; + vm.amount = value; processAmount(); $timeout(function() { $scope.$apply(); @@ -299,7 +300,7 @@ function amountController(configService, $filter, $ionicHistory, $ionicModal, $i function changeUnit() { - vm.amountModel.amount = '0'; + vm.amount = '0'; if (fixedUnit) return; @@ -321,32 +322,32 @@ function amountController(configService, $filter, $ionicHistory, $ionicModal, $i }; function pushDigit(digit) { - if (vm.amountModel.amount && digit != '.') { - var amountSplitByComma = vm.amountModel.amount.split('.'); + if (vm.amount && digit != '.') { + var amountSplitByComma = vm.amount.split('.'); if (amountSplitByComma.length > 1 && amountSplitByComma[1].length >= LENGTH_AFTER_COMMA_EXPRESSION_LIMIT) return; if (amountSplitByComma.length == 1 && amountSplitByComma[0].length >= LENGTH_BEFORE_COMMA_EXPRESSION_LIMIT) return; } - if (vm.amountModel.amount && vm.amountModel.amount.length >= LENGTH_EXPRESSION_LIMIT) return; - if (vm.amountModel.amount.indexOf('.') > -1 && digit == '.') return; - if (vm.amountModel.amount == '0' && digit == '0') return; - if (availableUnits[unitIndex].isFiat && vm.amountModel.amount.indexOf('.') > -1 && vm.amountModel.amount[vm.amountModel.amount.indexOf('.') + 2]) return; + if (vm.amount && vm.amount.length >= LENGTH_EXPRESSION_LIMIT) return; + if (vm.amount.indexOf('.') > -1 && digit == '.') return; + if (vm.amount == '0' && digit == '0') return; + if (availableUnits[unitIndex].isFiat && vm.amount.indexOf('.') > -1 && vm.amount[vm.amount.indexOf('.') + 2]) return; - if (vm.amountModel.amount == '0' && digit != '.') { - vm.amountModel.amount = ''; + if (vm.amount == '0' && digit != '.') { + vm.amount = ''; } - if (vm.amountModel.amount == '' && digit == '.') { - vm.amountModel.amount = '0'; + if (vm.amount == '' && digit == '.') { + vm.amount = '0'; } - vm.amountModel.amount = (vm.amountModel.amount + digit).replace('..', '.'); + vm.amount = (vm.amount + digit).replace('..', '.'); processAmount(); }; function pushOperator(operator) { - if (!vm.amountModel.amount || vm.amountModel.amount.length == 0) return; - vm.amountModel.amount = pushOperator(vm.amountModel.amount); + if (!vm.amount || vm.amount.length == 0) return; + vm.amount = pushOperator(vm.amount); function pushOperator(val) { if (!isOperator(lodash.last(val))) { @@ -368,12 +369,12 @@ function amountController(configService, $filter, $ionicHistory, $ionicModal, $i }; function removeDigit() { - vm.amountModel.amount = (vm.amountModel.amount).toString().slice(0, -1); + vm.amount = (vm.amount).toString().slice(0, -1); processAmount(); } function resetAmount() { - vm.amountModel.amount = vm.alternativeAmount = vm.globalResult = ''; + vm.amount = vm.alternativeAmount = vm.globalResult = '0'; vm.allowSend = false; } @@ -393,11 +394,11 @@ function amountController(configService, $filter, $ionicHistory, $ionicModal, $i }; function processAmount() { - var formatedValue = format(vm.amountModel.amount); + var formatedValue = format(vm.amount); var result = evaluate(formatedValue); if (lodash.isNumber(result)) { - vm.globalResult = isExpression(vm.amountModel.amount) ? '= ' + processResult(result) : ''; + vm.globalResult = isExpression(vm.amount) ? '= ' + processResult(result) : ''; if (availableUnits[unitIndex].isFiat) { @@ -481,7 +482,7 @@ function amountController(configService, $filter, $ionicHistory, $ionicModal, $i function finish() { var unit = availableUnits[unitIndex]; - var _amount = evaluate(format(vm.amountModel.amount)); + var _amount = evaluate(format(vm.amount)); var coin = unit.id; if (unit.isFiat) { coin = availableUnits[altUnitIndex].id; diff --git a/src/sass/views/amountNew.scss b/src/sass/views/amountNew.scss index 8c8e771f7..24338fe99 100644 --- a/src/sass/views/amountNew.scss +++ b/src/sass/views/amountNew.scss @@ -462,7 +462,6 @@ border-radius: 0; font-size: 0.8em; line-height: 2em; - margin-bottom: 1.618em; width: 100%; .available-funds-amount { diff --git a/www/views/amountNew.html b/www/views/amountNew.html index b67757f5e..e0296219a 100644 --- a/www/views/amountNew.html +++ b/www/views/amountNew.html @@ -19,8 +19,8 @@
- {{ vm.amountModel.amount || 0 }}{{vm.unit}} + ng-class="{long: vm.amount.length > 5, 'very-long': vm.amount.length > 10}"> + {{vm.amount}} {{vm.unit}}
{{vm.globalResult}} {{vm.unit}}
From 0cba978d6539574e9a75098b6a94b2c596e36462 Mon Sep 17 00:00:00 2001 From: Brendon Duncan Date: Tue, 31 Jul 2018 20:25:21 +1200 Subject: [PATCH 65/65] Replaced old amount screen. --- src/js/routes.js | 4 +- src/sass/views/amount.scss | 158 +++++++--- src/sass/views/amountNew.scss | 557 ---------------------------------- src/sass/views/views.scss | 1 - www/views/amount.html | 63 ++-- www/views/amountNew.html | 102 ------- 6 files changed, 158 insertions(+), 727 deletions(-) delete mode 100644 src/sass/views/amountNew.scss delete mode 100644 www/views/amountNew.html diff --git a/src/js/routes.js b/src/js/routes.js index 5b0b59d77..286b27ab1 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -292,7 +292,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr 'tab-send@tabs': { controller: 'amountController', controllerAs: 'vm', - templateUrl: 'views/amountNew.html' + templateUrl: 'views/amount.html' } } }) @@ -701,7 +701,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr 'tab-receive@tabs': { controller: 'amountController', controllerAs: 'vm', - templateUrl: 'views/amountNew.html' + templateUrl: 'views/amount.html' } } }) diff --git a/src/sass/views/amount.scss b/src/sass/views/amount.scss index c712d85e5..daf6cf4fe 100644 --- a/src/sass/views/amount.scss +++ b/src/sass/views/amount.scss @@ -244,6 +244,18 @@ flex-direction: column; justify-content: center; + .send-amount-header-footer { + flex: 1 1 auto; + min-height: 20px; + + .warning { + font-weight: bold; + font-size: 12px; + padding: 0 6px 6px 6px; + text-align: center; + } + } + .send-amount-tool { flex: 0 1 auto; @@ -260,6 +272,8 @@ } .primary-amount { + color: #333; + font-weight: bold; input, .unit, .primary-amount-display { font-size: 1.8em; @@ -329,16 +343,15 @@ line-height: 1em; } - .unit { - font-weight: bold; - } - .primary-amount-display { margin-right: 5px; word-break: break-all; } } + .alternative-amount { + color: #6F6F70; + } .switch-currencies { position: absolute; right: 0; @@ -351,27 +364,56 @@ } } } + } + } - .send-amount-actions { - margin-top: 15px; + .send-amount-extras { + display: flex; + flex: 0 0 auto; + /* So that if only one item is present, it appears on the right. */ + flex-direction: row-reverse; + font-size: 12px; + align-items: center; + justify-content: space-between; + margin: 0 14px; + + .available-funds { + color: #6F6F70; + } + + .warning { + color: $v-warning-color-2; + } + + .extra, + button.extra { + /*display: flex;*/ + flex: 0 1 auto; + } + + button.extra { + background: none; + border: none; + color: #000; + font-family: 'ProximaNova'; + font-size: 14px; + line-height: normal; + min-height: auto; + min-width: auto; + padding: 0; + } + + .button .icon:before { + font-size: 14px; + line-height: normal; + } + + + .button { + span { display: flex; align-items: center; justify-content: center; - - .button { - flex: 1 1 auto; - line-height: 1.2em; - - + .button { - margin-left: 10px; - } - - span { - display: flex; - align-items: center; - justify-content: center; - } - } } } } @@ -394,37 +436,58 @@ .keypad-container { position: relative; + font-size: 18px; + line-height: 2em; //flex: 0 1 196px; + @media (min-height: 667px) { + font-size: 24px; + } + + @media(max-height: 480px) { + font-size: 12px; + } + @media (min-height: 667px) { //flex: 0 1 224px; } + .sendmax { + background: $v-off-black; + + .button { + color: white; + background: black; + border: 1px solid $v-off-black; + border-radius: 0; + font-size: 0.8em; + line-height: 2em; + width: 100%; + + .available-funds-amount { + color: #C9C9C9; + } + + &:active { + background-color: $v-dark-gray; + } + } + } + .keypad { text-align: center; - font-size: 18px; font-weight: lighter; position: absolute; bottom: 0; width: 100%; - color: $v-mid-gray; + color: $v-text-primary-color; + - @media (min-height: 667px) { - font-size: 24px; - } .row { padding: 0 !important; margin: 0 !important; } - - .col { - line-height: 38px; - - @media (min-height: 667px) { - line-height: 45px; - } - } .row { &:last-child { @@ -458,23 +521,34 @@ .digit{ cursor: pointer; - border-top: 1px solid $v-subtle-gray; - border-left: 1px solid $v-subtle-gray; + background-color: #000; + border: 1px solid $v-off-black; transition: all 0.1s ease; &:active { - background-color: $v-subtle-gray; + background-color: $v-dark-gray; } } - @media(max-height: 480px) { - font-size: 12px; - - } } } + + .button-primary { + background-color: $v-primary-color; + border-radius: 0; + font-weight: bold; + } + + .button-primary[disabled] { + background-color: $v-button-primary-disabled-bg; + opacity: 1; + } } - background: #494949; + + .warning { + color: $v-warning-color-2; + } + background: $v-background-under-card; ion-content { margin-bottom: constant(safe-area-inset-bottom); /* iOS 11.0 */ diff --git a/src/sass/views/amountNew.scss b/src/sass/views/amountNew.scss deleted file mode 100644 index 24338fe99..000000000 --- a/src/sass/views/amountNew.scss +++ /dev/null @@ -1,557 +0,0 @@ -#view-amount-new { - @extend .deflash-blue; - .recipient-label { - font-size: 14px; - padding-bottom: 0; - color: $v-mid-gray; - } - .item-no-bottom-border + .item { - border-top: 0; - } - .icon-bitpay-card { - background-image: url("../img/icon-bitpay.svg"); - } - .icon-amazon { - background-image: url("../img/icon-amazon.svg"); - } - @media(max-width: 480px) { - .bitcoin-address { - .icon { - left: 8px; - font-size: 24px; - } - .big-icon-svg { - left:5px; - & > .bg{ - width:30px; - height:30px; - box-shadow: none; - } - } - font-size: 13px; - padding-left: 48px; - } - } - @media(max-width: 320px) { - .bitcoin-address { - & > span:last-child { - margin-left: -2px; - } - } - } - .send-gravatar { - left: 11px; - position: absolute; - top: 10px; - } - .amount span input { - display: inline; - width: 120px; - } - .amount-pane-recipient { - position: absolute; - top: 95px; - bottom: 0; - width: 100%; - background-color: #fff; - padding: 0 16px; - - .amount-bar { - padding: 24px 0; - font-size: 18px; - @media(max-height: 480px) { - padding: 0px; - } - @media(max-width: 320px) { - padding: 0px; - } - .title { - float: left; - padding-top: 10px; - color: $v-dark-gray; - font-weight: bold; - @media(max-height: 480px) { - padding: 0px; - } - } - @media(max-height: 480px) { - padding-top: 3px; - } - } - .amount { - display: flex; - flex-direction: column; - justify-content: center; - flex-grow: 1; - position: absolute; - bottom: 254px; - top: 66px; - .light { - color: $v-light-gray; - } - @media(max-height: 480px) { - top: 45px; - } - @media(max-width: 320px) { - bottom: 276px; - top: 60px; - & > div { - display: inline-block; - } - & > div:first-child { - display: inherit; - } - } - } - } - .amount-pane-no-recipient { - position: absolute; - top: 0; - bottom: 0; - width: 100%; - background-color: #fff; - padding: 0 16px; - - .amount-bar { - padding: 24px 0; - font-size: 18px; - .title { - padding-top: 10px; - color: $v-dark-gray; - font-weight: bold; - .limits { - margin-top: 10px; - color: $v-light-gray; - font-size: 12px; - } - .select { - margin: 10px 1px; - } - } - } - .amount { - display: flex; - flex-direction: column; - justify-content: center; - flex-grow: 1; - position: absolute; - bottom: 254px; - top: 66px; - .light { - color: $v-light-gray; - } - } - } - .amount { - padding-top: 10px; - padding-bottom: 10px; - .icon-toggle { - font-size: 1.2em; - width: auto; - margin: 0.8em auto; - border: 1px solid $v-subtle-gray; - color: $v-dark-gray; - border-radius: 3px; - padding: 0 10px; - cursor: pointer; - @media(max-height: 280px) { - margin: 0.1em auto; - } - } - &__editable { - &--minimize { - font-size: 22px; - } - &--standard { - font-size: 42px; - @media(max-height: 480px) { - font-size: 26px; - padding-top: 10px; - } - } - &--placeholder { - color: $v-light-gray; - } - } - &__number { - color: $v-dark-gray; - } - &__currency-toggle { - border: 1px solid $v-subtle-gray; - color: $v-dark-gray; - border-radius: 3px; - padding: 0 10px; - cursor: pointer; - font-size: .6em; - position: relative; - top: -3px; - line-height: 1; - @media(max-width: 320px) { - line-height: 30px; - height: 30px; - } - } - &__currency-toggle-mobile { - border: 1px solid $v-subtle-gray; - color: $v-dark-gray; - border-radius: 3px; - cursor: pointer; - position: relative; - line-height: 1; - @media(max-width: 320px) { - line-height: 30px; - height: 30px; - } - } - &__results { - &--minimize { - font-size: 12px; - } - &--standard { - font-size: 18px; - padding: 10px 0; - } - &--placeholder { - color: $v-light-gray; - } - } - &__result { - color: $v-light-gray; - font-size: .9em; - //margin-bottom: -.9em; TODO matias - line-height: 1; - @media(max-height: 480px) { - margin-bottom: 0; - } - } - &__result-equiv { - color: $v-mid-gray; - font-size: 1.2em; - @media(max-height: 480px) { - margin-top: 0; - font-size: 16px; - } - } - } - - .scroll-content { - display: flex; - flex-direction: column; - - .send-amount { - flex: 1 1 auto; - display: flex; - flex-direction: column; - justify-content: center; - - .send-amount-header-footer { - flex: 1 1 auto; - min-height: 20px; - - .warning { - font-weight: bold; - font-size: 12px; - padding: 0 6px 6px 6px; - text-align: center; - } - } - - .send-amount-tool { - flex: 0 1 auto; - - .send-amount-tool-input { - text-align: center; - position: relative; - padding: 10px 30px; - - .text-selectable { - -webkit-user-select: text; - -moz-user-select: text; - -ms-user-select: text; - user-select: text; - } - - .primary-amount { - color: #333; - font-weight: bold; - input, .unit, .primary-amount-display { - font-size: 1.8em; - - @media (min-width: 375px) { - font-size: 2.1em; - } - - @media (min-width: 414px) { - font-size: 2.4em; - } - } - - &.long { - input, .unit, .primary-amount-display { - font-size: 1.6em; - - @media (min-width: 375px) { - font-size: 1.8em; - } - - @media (min-width: 414px) { - font-size: 2em; - } - } - } - - &.very-long { - input, .unit, .primary-amount-display { - font-size: 0.9em; - - @media (min-width: 375px) { - font-size: 1.3em; - } - - @media (min-width: 414px) { - font-size: 1.4em; - } - } - } - - - input { - border:0; - padding:0; - white-space:normal; - background:none; - line-height:1; - box-sizing:content-box; - display: inline-block; - vertical-align: middle; - margin: 0; - height: 1em; - margin-right: 5px; - font-family: 'ProximaNova'; - - @media (min-width: 375px) { - } - - @media (min-width: 414px) { - } - } - - .unit, - .primary-amount-display { - display: inline-block; - vertical-align: middle; - line-height: 1em; - } - - .primary-amount-display { - margin-right: 5px; - word-break: break-all; - } - } - - .alternative-amount { - color: #6F6F70; - } - .switch-currencies { - position: absolute; - right: 0; - top: 50%; - transform: translate(0, -50%); - padding: 15px; - - img { - width: 18px; - } - } - } - } - } - - .send-amount-extras { - display: flex; - flex: 0 0 auto; - /* So that if only one item is present, it appears on the right. */ - flex-direction: row-reverse; - font-size: 12px; - align-items: center; - justify-content: space-between; - margin: 0 14px; - - .available-funds { - color: #6F6F70; - } - - .warning { - color: $v-warning-color-2; - } - - .extra, - button.extra { - /*display: flex;*/ - flex: 0 1 auto; - } - - button.extra { - background: none; - border: none; - color: #000; - font-family: 'ProximaNova'; - font-size: 14px; - line-height: normal; - min-height: auto; - min-width: auto; - padding: 0; - } - - .button .icon:before { - font-size: 14px; - line-height: normal; - } - - - .button { - span { - display: flex; - align-items: center; - justify-content: center; - } - } - } - - .button { - &.no-margin { - margin: 0; - } - } - - .notification-warning { - display: block; - padding: .75rem 1.25rem; - color: #856404; - background-color: #fff3cd; - border: 1px solid #ffeeba; - line-height: 1.4em; - margin-bottom: 20px; - } - - .keypad-container { - position: relative; - font-size: 18px; - line-height: 2em; - //flex: 0 1 196px; - - @media (min-height: 667px) { - font-size: 24px; - } - - @media(max-height: 480px) { - font-size: 12px; - } - - @media (min-height: 667px) { - //flex: 0 1 224px; - } - - .sendmax { - background: $v-off-black; - - .button { - color: white; - background: black; - border: 1px solid $v-off-black; - border-radius: 0; - font-size: 0.8em; - line-height: 2em; - width: 100%; - - .available-funds-amount { - color: #C9C9C9; - } - - &:active { - background-color: $v-dark-gray; - } - } - } - - .keypad { - text-align: center; - font-weight: lighter; - position: absolute; - bottom: 0; - width: 100%; - color: $v-text-primary-color; - - - - .row { - padding: 0 !important; - margin: 0 !important; - } - - .row { - &:last-child { - .col { - padding-bottom: 10px; - } - } - } - - .operator { - background-color: $v-subtle-gray; - font-weight: normal; - cursor: pointer; - - &:active { - background-color: $v-light-gray; - } - } - - .operator-send { - font-weight: bolder; - color: #fff; - background-color: $positive; - font-size: 36px; - cursor: pointer; - - &:active { - background-color: #eaeaea; - } - } - - .digit{ - cursor: pointer; - background-color: #000; - border: 1px solid $v-off-black; - transition: all 0.1s ease; - - &:active { - background-color: $v-dark-gray; - } - } - - } - } - - .button-primary { - background-color: $v-primary-color; - border-radius: 0; - font-weight: bold; - } - - .button-primary[disabled] { - background-color: $v-button-primary-disabled-bg; - opacity: 1; - } - } - - .warning { - color: $v-warning-color-2; - } - background: $v-background-under-card; - - ion-content { - margin-bottom: constant(safe-area-inset-bottom); /* iOS 11.0 */ - margin-bottom: env(safe-area-inset-bottom); /* iOS 11.2 */ - } -} \ No newline at end of file diff --git a/src/sass/views/views.scss b/src/sass/views/views.scss index 387b68597..d4ed735ed 100644 --- a/src/sass/views/views.scss +++ b/src/sass/views/views.scss @@ -1,7 +1,6 @@ @import "tabs"; @import "add"; @import "amount"; -@import "amountNew"; @import "confirm"; @import "copayers"; @import "starting"; diff --git a/www/views/amount.html b/www/views/amount.html index 90187ef59..77c52f96c 100644 --- a/www/views/amount.html +++ b/www/views/amount.html @@ -1,24 +1,26 @@ - {{'Enter amount' | translate}} + {{'Enter Amount' | translate}} - +
-
-
- Minimum amount: {{vm.minShapeshiftAmount}}
- Maximum amount: {{vm.maxShapeshiftAmount}}
+
+
- {{ vm.amountModel.amount || 0 }}{{vm.unit}} + ng-class="{long: vm.amount.length > 5, 'very-long': vm.amount.length > 10}"> + {{vm.amount}} {{vm.unit}}
{{vm.globalResult}} {{vm.unit}}
@@ -26,26 +28,41 @@
-
- - + -
+
+
+ +
+ +
+ Available Funds:{{vm.availableFunds}} +
-
+
+ +
+ +
7
diff --git a/www/views/amountNew.html b/www/views/amountNew.html deleted file mode 100644 index e0296219a..000000000 --- a/www/views/amountNew.html +++ /dev/null @@ -1,102 +0,0 @@ - - - - {{'Enter Amount' | translate}} - - - - - -
- -
- -
-
-
- {{vm.amount}} {{vm.unit}} -
- {{vm.globalResult}} {{vm.unit}} -
- {{vm.alternativeAmount || '0.00'}} {{vm.alternativeUnit}} -
-
-
- -
-
- -
- -
- Available Funds:{{vm.availableFunds}} -
-
-
- -
-
- -
- -
- -
-
7
-
8
-
9
-
- -
-
4
-
5
-
6
-
- -
-
1
-
2
-
3
-
- -
-
.
-
0
-
-
-
-
- - -
-
\ No newline at end of file