diff --git a/public/index.html b/public/index.html index ca09c8051..8a16947b8 100644 --- a/public/index.html +++ b/public/index.html @@ -20,6 +20,7 @@ + diff --git a/public/views/modals/inputAmount.html b/public/views/modals/inputAmount.html index 9e1ca7b41..7af0e46a0 100644 --- a/public/views/modals/inputAmount.html +++ b/public/views/modals/inputAmount.html @@ -1,15 +1,16 @@ - - - - Close - + + + Close - Enter amount - + + Enter amount + + {{alternativeIsoCode}} - {{unitName}} + {{unitName}} + Cancel @@ -18,64 +19,68 @@ - + + + Recipient + + + {{recipientName}} + + + + - {{amount || '-'}} + {{amount || '-'}} - {{globalResult}} {{amountResult || '0.00'}} {{alternativeIsoCode}} + {{globalResult}} {{amountResult || '0.00'}} {{alternativeIsoCode}} - {{globalResult}} {{alternativeResult || '0.00'}} {{unitName}} + {{globalResult}} {{alternativeResult || '0.00'}} {{unitName}} - - - - AC - - - - - OK - - + + + AC + + + OK + - - 7 - 8 - 9 - / + + 7 + 8 + 9 + / - - 4 - 5 - 6 - x + + 4 + 5 + 6 + x - - 1 - 2 - 3 - + + + 1 + 2 + 3 + + - - . - 0 - - - + + . + 0 + + - - + QR Code @@ -110,5 +115,43 @@ + + + + + Sending + {{sendingAmount}} {{unitName}} + {{sendingAlternativeAmount}} {{alternativeIsoCode}} + + + + + Fee: Economy (97 bits) + + + + To + {{recipientName}} + + + + + From + Focused Wallet (Default Wallet) + + + + Add Memo + + + + + + + Slide to complete + + + + diff --git a/public/views/tab-receive.html b/public/views/tab-receive.html index 40380bc47..a7dc9a38e 100644 --- a/public/views/tab-receive.html +++ b/public/views/tab-receive.html @@ -1,5 +1,42 @@ - - - Welcome to Receive + + Receive + + + + + + + + + + + + Share address + + + + Next Address + + + + {{generatingAddress ? '...' : addr}} + + + + + + + + + {{item.name || item.id}} + + {{item.m}}-of-{{item.n}} + + + + + + + - + diff --git a/public/views/tab-send.html b/public/views/tab-send.html index 9d59c5b8c..26c8a1816 100644 --- a/public/views/tab-send.html +++ b/public/views/tab-send.html @@ -1,5 +1,29 @@ - - Welcome to Send + + Recipient + + + + + + + Contacts + + + + + + {{item.label}} + + + + + {{item.name || item.alias}} + + {{item.balance || '123,999.91 bits'}} + + + + - + diff --git a/src/css/ionic-migration.css b/src/css/ionic-migration.css index ab7e5f347..6d4caeba1 100644 --- a/src/css/ionic-migration.css +++ b/src/css/ionic-migration.css @@ -12,10 +12,6 @@ /* Conflicting styles that are customized as a compromise. These styles are a merge or compromise of foundation.css and ionic.css. */ -.row { - display: inherit; -} - .behind { z-index: -1; } @@ -28,6 +24,10 @@ display: none !important; } +.swiper-container-horizontal>.swiper-pagination{ + display: none; +} + .bar .title { font-size: 14px; line-height: 48px; @@ -88,30 +88,6 @@ font-size: 14px; } -.button.button-light:hover { - background-color: #fff; - border: 1px solid #E9E9EC; -} - -.button.button-light:active { - background-color: #ababab; - border: 1px solid #E9E9EC; -} - -.button.button-stable:hover { - background-color: transparent; - border: 1px solid #E9E9EC; -} - -.button.button-stable:active { - background-color: #ababab; - border: 1px solid #E9E9EC; -} - -.button-amount { - text-transform: none; -} - button, .button { min-width: inherit; min-height: inherit; diff --git a/src/js/controllers/modals/inputAmount.js b/src/js/controllers/modals/inputAmount.js index bb7b1caf1..abb25ed8d 100644 --- a/src/js/controllers/modals/inputAmount.js +++ b/src/js/controllers/modals/inputAmount.js @@ -160,8 +160,9 @@ angular.module('copayApp.controllers').controller('inputAmountController', funct $ionicScrollDelegate.resize(); }, 100); } else { - self.setAmount(amount, $scope.showAlternativeAmount); - $scope.cancel(); + $scope.sending = true; + $scope.sendingAmount = profileService.formatAmount(amount * unitToSatoshi, true); + $scope.sendingAlternativeAmount = $filter('formatFiatAmount')(alternativeAmount); } }; diff --git a/src/js/controllers/tab-receive.js b/src/js/controllers/tab-receive.js new file mode 100644 index 000000000..87c146516 --- /dev/null +++ b/src/js/controllers/tab-receive.js @@ -0,0 +1,112 @@ +'use strict'; + +angular.module('copayApp.controllers').controller('tabReceiveController', function($scope, $ionicPopover, $timeout, platformInfo, nodeWebkit, addressService, profileService, configService, lodash) { + + $scope.init = function() { + $scope.index = 0; + $scope.isCordova = platformInfo.isCordova; + $scope.isNW = platformInfo.isNW; + $scope.setWallets(); + $scope.setAddress(false); + $scope.options = { + loop: false, + effect: 'flip', + speed: 500, + spaceBetween: 100 + } + + $scope.$on("$ionicSlides.sliderInitialized", function(event, data) { + // data.slider is the instance of Swiper + $scope.slider = data.slider; + }); + + $scope.$on("$ionicSlides.slideChangeStart", function(event, data) { + console.log('Slide change is beginning'); + }); + + $scope.$on("$ionicSlides.slideChangeEnd", function(event, data) { + $scope.index = data.slider.activeIndex; + $scope.setAddress(false); + }); + } + + $scope.copyToClipboard = function(addr, $event) { + + var showPopover = function() { + + $ionicPopover.fromTemplateUrl('views/includes/copyToClipboard.html', { + scope: $scope + }).then(function(popover) { + $scope.popover = popover; + $scope.popover.show($event); + }); + + $scope.close = function() { + $scope.popover.hide(); + } + + $timeout(function() { + $scope.popover.hide(); //close the popover after 0.7 seconds + }, 700); + + $scope.$on('$destroy', function() { + $scope.popover.remove(); + }); + }; + + if ($scope.isCordova) { + window.cordova.plugins.clipboard.copy(addr); + window.plugins.toast.showShortCenter(gettextCatalog.getString('Copied to clipboard')); + } else if ($scope.isNW) { + nodeWebkit.writeToClipboard(addr); + showPopover($event); + } + }; + + $scope.shareAddress = function(addr) { + if ($scope.isCordova) { + window.plugins.socialsharing.share('bitcoin:' + addr, null, null, null); + } + }; + + $scope.setAddress = function(forceNew) { + $scope.addrError = null; + $scope.generatingAddress = true; + $timeout(function() { + addressService.getAddress($scope.wallets[$scope.index].id, forceNew, function(err, addr) { + $scope.generatingAddress = false; + if (err) { + $scope.addrError = err; + } else { + if (addr) + $scope.addr = addr; + } + $scope.$digest(); + }); + }); + }; + + + $scope.setWallets = function() { + if (!profileService.profile) return; + + var config = configService.getSync(); + config.colorFor = config.colorFor || {}; + config.aliasFor = config.aliasFor || {}; + + // Sanitize empty wallets (fixed in BWC 1.8.1, and auto fixed when wallets completes) + var credentials = lodash.filter(profileService.profile.credentials, 'walletName'); + var ret = lodash.map(credentials, function(c) { + return { + m: c.m, + n: c.n, + name: config.aliasFor[c.walletId] || c.walletName, + id: c.walletId, + color: config.colorFor[c.walletId] || '#4A90E2', + }; + }); + + $scope.wallets = lodash.sortBy(ret, 'name'); + }; + +}); diff --git a/src/js/controllers/tab-send.js b/src/js/controllers/tab-send.js new file mode 100644 index 000000000..d1f5f1f97 --- /dev/null +++ b/src/js/controllers/tab-send.js @@ -0,0 +1,69 @@ +'use strict'; + +angular.module('copayApp.controllers').controller('tabSendController', function($scope, $ionicModal, $log, addressbookService, profileService, configService, lodash) { + var completeList; + + $scope.init = function() { + addressbookService.list(function(err, ab) { + if (err) $log.error(err); + + // $scope.contactList = lodash.isEmpty(ab) ? null : ab; + $scope.contactList = [{ + label: 'Javier', + address: '123456' + }, { + label: 'Javier 2', + address: '654321' + }, { + label: 'Javier 3', + address: '7891011' + }, { + label: 'Javier 4', + address: '1101987' + }]; + }); + + var config = configService.getSync(); + config.colorFor = config.colorFor || {}; + config.aliasFor = config.aliasFor || {}; + + var credentials = lodash.filter(profileService.profile.credentials, 'walletName'); + var ret = lodash.map(credentials, function(c) { + return { + m: c.m, + n: c.n, + name: config.aliasFor[c.walletId] || c.walletName, + id: c.walletId, + color: config.colorFor[c.walletId] || '#4A90E2', + }; + }); + + $scope.wallets = lodash.sortBy(ret, 'name'); + $scope.list = completeList = $scope.contactList.concat($scope.wallets); + }; + + $scope.findContact = function() { + var result = lodash.filter($scope.list, function(item) { + var val = item.label || item.alias || item.name; + return lodash.includes(val.toLowerCase(), $scope.search.toLowerCase()); + }); + + if (lodash.isEmpty(result) || lodash.isEmpty($scope.search)) { + $scope.list = completeList; + return; + } + $scope.list = result; + }; + + $scope.openInputAmountModal = function(recipient) { + $scope.recipientName = recipient.name || recipient.label; + $scope.recipientColor = recipient.color; + + $ionicModal.fromTemplateUrl('views/modals/inputAmount.html', { + scope: $scope + }).then(function(modal) { + $scope.inputAmountModal = modal; + $scope.inputAmountModal.show(); + }); + }; +}); diff --git a/src/sass/main.scss b/src/sass/main.scss index 858ed961e..caf5c7f29 100644 --- a/src/sass/main.scss +++ b/src/sass/main.scss @@ -1981,6 +1981,10 @@ to prevent collapsing during animation*/ color: #fff; } +.transform-none { + text-transform: none; +} + /*** modals ***/ .hideModal { @@ -2189,16 +2193,16 @@ input[type="number"] { @media all and (max-height: 480px) { .calculator .button-calc .columns { padding: 10px; } - .calculator .header-calc { top: 11%; } + .calculator .header-calc { top: 30%; } } @media (min-height: 481px) and (max-height: 670px) { .calculator .button-calc .columns { padding: 15px; } - .calculator .header-calc { top: 15%; } + .calculator .header-calc { top: 30%; } } @media all and (min-height: 671px) { .calculator .button-calc .columns { padding: 20px; } - .calculator .header-calc { top: 18%; } + .calculator .header-calc { top: 32%; } }
{{recipientName}}
Focused Wallet (Default Wallet)