From 8035846fafb7e5e5dd4fe136c17110af9a61c1ec Mon Sep 17 00:00:00 2001 From: Jason Dreyzehner Date: Tue, 11 Oct 2016 22:26:55 -0400 Subject: [PATCH 01/51] feat(build): use cordova-custom-config, remove unnecessary hooks --- app-template/config-template.xml | 26 +++++++++--------- package.json | 11 +++----- .../add-custom-urls-to-android-manifest.js | 27 ------------------- ...hibit-cloud-backups-in-android-manifest.js | 18 ------------- 4 files changed, 17 insertions(+), 65 deletions(-) delete mode 100644 util/hooks/android/add-custom-urls-to-android-manifest.js delete mode 100644 util/hooks/android/prohibit-cloud-backups-in-android-manifest.js diff --git a/app-template/config-template.xml b/app-template/config-template.xml index 5a72f4560..1629573c3 100644 --- a/app-template/config-template.xml +++ b/app-template/config-template.xml @@ -16,11 +16,6 @@ - - - - - @@ -28,6 +23,13 @@ + + + + + + + @@ -57,8 +59,9 @@ - - + + + @@ -67,9 +70,8 @@ - - + + @@ -87,7 +89,6 @@ - @@ -101,8 +102,7 @@ - - + diff --git a/package.json b/package.json index e474ad514..03b305a7c 100644 --- a/package.json +++ b/package.json @@ -27,8 +27,8 @@ "bitcore-wallet-client": "4.2.1", "bower": "^1.7.9", "chai": "^3.5.0", - "cordova": "5.4.1", "cordova-android": "5.1.1", + "cordova-custom-config": "^3.0.5", "cordova-plugin-qrscanner": "^2.3.1", "coveralls": "^2.11.9", "express": "^4.11.2", @@ -89,12 +89,9 @@ "clean-all": "git clean -dfx && npm install" }, "devDependencies": { - "androidmanifest": "^2.0.0", - "cordova": "^5.4.1", - "globby": "^6.0.0", + "cordova": "^6.3.1", + "grunt": "^1.0.1", "ionic": "^2.1.0", - "plist": "^2.0.1", - "trash-cli": "^1.4.0", - "xcode": "^0.8.2" + "trash-cli": "^1.4.0" } } diff --git a/util/hooks/android/add-custom-urls-to-android-manifest.js b/util/hooks/android/add-custom-urls-to-android-manifest.js deleted file mode 100644 index 6fd5747df..000000000 --- a/util/hooks/android/add-custom-urls-to-android-manifest.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict'; - -var AndroidManifest = require('androidmanifest'); - -var FILEPATH = 'platforms/android/AndroidManifest.xml'; -var manifest = new AndroidManifest().readFile(FILEPATH); - -var mainActivity = manifest.activity('MainActivity'); - -var customUrls = ['copay', 'bitcoin', 'bitauth']; - -customUrls.forEach(function(url){ - var selector = 'intent-filter > data[android\\:scheme=' + url + ']'; - if(mainActivity.find(selector).length > 0){ - return; - } - - var intentFilter = manifest.$(''); - intentFilter.append(''); - intentFilter.append(''); - intentFilter.append(''); - intentFilter.append(''); - mainActivity.append(intentFilter); -}); - -manifest.writeFile(FILEPATH); -console.log('custome uri schemes written to AndroidManifest'); diff --git a/util/hooks/android/prohibit-cloud-backups-in-android-manifest.js b/util/hooks/android/prohibit-cloud-backups-in-android-manifest.js deleted file mode 100644 index 1f5f4d53a..000000000 --- a/util/hooks/android/prohibit-cloud-backups-in-android-manifest.js +++ /dev/null @@ -1,18 +0,0 @@ -module.exports = function(ctx) { - var fs = ctx.requireCordovaModule('fs'), - path = ctx.requireCordovaModule('path'), - xml = ctx.requireCordovaModule('cordova-common').xmlHelpers; - - var manifestPath = path.join(ctx.opts.projectRoot, '/platforms/android/AndroidManifest.xml'); - var doc = xml.parseElementtreeSync(manifestPath); - if (doc.getroot().tag !== 'manifest') { - throw new Error(manifestPath + ' has incorrect root node name (expected "manifest")'); - } - - doc.getroot().find('./application').attrib['android:allowBackup'] = "false"; - - //write the manifest file - fs.writeFileSync(manifestPath, doc.write({ - indent: 4 - }), 'utf-8'); -}; From 4de3cad7128ae2b2ea1e917ebbf776174ae015c8 Mon Sep 17 00:00:00 2001 From: Jason Dreyzehner Date: Tue, 11 Oct 2016 22:46:07 -0400 Subject: [PATCH 02/51] perf(startupService): remove timers, control splashscreen and statusbar from startupService --- .gitignore | 3 +++ src/js/controllers/onboarding/disclaimer.js | 7 ++++- .../onboarding/welcomeController.js | 6 ++++- src/js/controllers/tab-home.js | 6 ++++- src/js/routes.js | 6 +---- src/js/services/startupService.js | 26 +++++++++++++++++++ 6 files changed, 46 insertions(+), 8 deletions(-) create mode 100644 src/js/services/startupService.js diff --git a/.gitignore b/.gitignore index 54427aba1..16ebb09f3 100644 --- a/.gitignore +++ b/.gitignore @@ -84,6 +84,9 @@ Session.vim .netrwhist *~ +.tags +.tags1 + # SASS src/sass/*.css .sass-cache diff --git a/src/js/controllers/onboarding/disclaimer.js b/src/js/controllers/onboarding/disclaimer.js index 7459b18da..a18be4e6d 100644 --- a/src/js/controllers/onboarding/disclaimer.js +++ b/src/js/controllers/onboarding/disclaimer.js @@ -1,6 +1,11 @@ 'use strict'; -angular.module('copayApp.controllers').controller('disclaimerController', function($scope, $timeout, $state, $log, $ionicModal, profileService, uxLanguage, externalLinkService, storageService, $stateParams) { +angular.module('copayApp.controllers').controller('disclaimerController', function($scope, $timeout, $state, $log, $ionicModal, profileService, uxLanguage, externalLinkService, storageService, $stateParams, startupService) { + + $scope.$on("$ionicView.afterEnter", function() { + startupService.ready(); + }); + $scope.init = function() { $scope.lang = uxLanguage.currentLanguage; $scope.terms = {}; diff --git a/src/js/controllers/onboarding/welcomeController.js b/src/js/controllers/onboarding/welcomeController.js index 6a7154c55..3a1651f75 100644 --- a/src/js/controllers/onboarding/welcomeController.js +++ b/src/js/controllers/onboarding/welcomeController.js @@ -1,9 +1,13 @@ 'use strict'; -angular.module('copayApp.controllers').controller('welcomeController', function($scope, $state, $timeout, $ionicConfig, $log, profileService) { +angular.module('copayApp.controllers').controller('welcomeController', function($scope, $state, $timeout, $ionicConfig, $log, profileService, startupService) { $ionicConfig.views.swipeBackEnabled(false); + $scope.$parent.$on("$ionicView.afterEnter", function() { + startupService.ready(); + }); + $scope.goImport = function(code) { $state.go('onboarding.import', { fromOnboarding: true, diff --git a/src/js/controllers/tab-home.js b/src/js/controllers/tab-home.js index 7cad213aa..c4fa9b106 100644 --- a/src/js/controllers/tab-home.js +++ b/src/js/controllers/tab-home.js @@ -1,7 +1,7 @@ 'use strict'; angular.module('copayApp.controllers').controller('tabHomeController', - function($rootScope, $timeout, $scope, $state, $stateParams, $ionicModal, $ionicScrollDelegate, gettextCatalog, lodash, popupService, ongoingProcess, profileService, walletService, configService, $log, platformInfo, storageService, txpModalService, $window, bitpayCardService) { + function($rootScope, $timeout, $scope, $state, $stateParams, $ionicModal, $ionicScrollDelegate, gettextCatalog, lodash, popupService, ongoingProcess, profileService, walletService, configService, $log, platformInfo, storageService, txpModalService, $window, bitpayCardService, startupService) { var wallet; var listeners = []; var notifications = []; @@ -13,6 +13,10 @@ angular.module('copayApp.controllers').controller('tabHomeController', $scope.homeTip = $stateParams.fromOnboarding; $scope.isCordova = platformInfo.isCordova; + $scope.$on("$ionicView.afterEnter", function() { + startupService.ready(); + }); + if (!$scope.homeTip) { storageService.getHomeTipAccepted(function(error, value) { $scope.homeTip = (value == 'false') ? false : true; diff --git a/src/js/routes.js b/src/js/routes.js index ed29cd0a0..09d99dfae 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -947,16 +947,12 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr }); $ionicPlatform.on('resume', function() { - // Nothing tot do + // Nothing to do }); $ionicPlatform.on('menubutton', function() { window.location = '#/preferences'; }); - - setTimeout(function() { - navigator.splashscreen.hide(); - }, 500); } diff --git a/src/js/services/startupService.js b/src/js/services/startupService.js new file mode 100644 index 000000000..d3d55fc02 --- /dev/null +++ b/src/js/services/startupService.js @@ -0,0 +1,26 @@ +'use strict'; + +angular.module('copayApp.services').service('startupService', function($log) { + + var splashscreenVisible = true; + var statusBarVisible = false; + + function _hideSplash(){ + if(navigator.splashscreen && splashscreenVisible){ + $log.debug('startupService is hiding the splashscreen...'); + navigator.splashscreen.hide(); + splashscreenVisible = false; + } + } + function _showStatusBar(){ + if(StatusBar && !statusBarVisible){ + $log.debug('startupService is showing the StatusBar...'); + StatusBar.show(); + statusBarVisible = true; + } + } + this.ready = function() { + _showStatusBar(); + _hideSplash(); + }; +}); From 702697a9dcb74e197949af65f0fdeb6dcd7de28d Mon Sep 17 00:00:00 2001 From: Marty Alcala Date: Wed, 12 Oct 2016 11:45:11 -0400 Subject: [PATCH 03/51] prelim send screen styling --- src/js/controllers/confirm.js | 11 ++++ src/js/routes.js | 2 +- src/sass/buttons.scss | 3 +- src/sass/views/confirm.scss | 60 +++++++++---------- src/sass/views/includes/txp-details.scss | 5 +- www/views/confirm.html | 74 +++++++++++++++++++++++- 6 files changed, 119 insertions(+), 36 deletions(-) diff --git a/src/js/controllers/confirm.js b/src/js/controllers/confirm.js index d8dc250c0..7c1289967 100644 --- a/src/js/controllers/confirm.js +++ b/src/js/controllers/confirm.js @@ -40,6 +40,8 @@ angular.module('copayApp.controllers').controller('confirmController', function( $scope.toAmount = parseInt($scope.toAmount); $scope.amountStr = txFormatService.formatAmountStr($scope.toAmount); + $scope.displayAmount = getDisplayAmount($scope.amountStr); + $scope.displayUnit = getDisplayUnit($scope.amountStr); var networkName = (new bitcore.Address($scope.toAddress)).network.name; $scope.network = networkName; @@ -75,6 +77,7 @@ angular.module('copayApp.controllers').controller('confirmController', function( if (++index == wallets.length) { if (!lodash.isEmpty(filteredWallets)) { $scope.wallets = lodash.clone(filteredWallets); + setWallet($scope.wallets[0]); } else { if (!enoughFunds) @@ -123,6 +126,14 @@ angular.module('copayApp.controllers').controller('confirmController', function( }); }; + function getDisplayAmount(amountStr) { + return amountStr.split(' ')[0]; + } + + function getDisplayUnit(amountStr) { + return amountStr.split(' ')[1]; + } + var setFromPayPro = function(uri, cb) { if (!cb) cb = function() {}; diff --git a/src/js/routes.js b/src/js/routes.js index ed29cd0a0..d04fcfef1 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -986,7 +986,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr profileService.storeProfileIfDirty(); $log.debug('Profile loaded ... Starting UX.'); scannerService.gentleInitialize(); - $state.go('tabs.home'); + //$state.go('tabs.home'); } }); }); diff --git a/src/sass/buttons.scss b/src/sass/buttons.scss index 5c0c05713..0978eb2bd 100644 --- a/src/sass/buttons.scss +++ b/src/sass/buttons.scss @@ -19,7 +19,8 @@ $button-secondary-border: transparent; $button-secondary-active-bg: darken($subtle-gray, 5%); $button-secondary-active-border: transparent; -%button-standard { +%button-standard, +click-to-accept { width: 85%; max-width: 300px; margin-left: auto; diff --git a/src/sass/views/confirm.scss b/src/sass/views/confirm.scss index 667184165..00f4f0f20 100644 --- a/src/sass/views/confirm.scss +++ b/src/sass/views/confirm.scss @@ -1,30 +1,30 @@ -#view-confirm { - .icon-bitpay-card { - background-image: url("../img/icon-bitpay.svg"); - } - .slide-to-pay{ - bottom: 149px; - } - .send-gravatar { - left: 11px; - position: absolute; - top: 10px; - } - .accept-slide { - position: fixed; - bottom: 0; - width: 100%; - height: 100px; - background-color: #647CE8; - color: #ffffff; - font-size: 25px; - text-align: center; - padding-top: 34px; - line-height: 32px; - } - .accept-slide i { - float: right; - font-size: 32px; - margin-right: 20px; - } -} +// #view-confirm { +// .icon-bitpay-card { +// background-image: url("../img/icon-bitpay.svg"); +// } +// .slide-to-pay{ +// bottom: 92px; +// } +// .send-gravatar { +// left: 11px; +// position: absolute; +// top: 10px; +// } +// .accept-slide { +// position: fixed; +// bottom: 0; +// width: 100%; +// height: 100px; +// background-color: #647CE8; +// color: #ffffff; +// font-size: 25px; +// text-align: center; +// padding-top: 34px; +// line-height: 32px; +// } +// .accept-slide i { +// float: right; +// font-size: 32px; +// margin-right: 20px; +// } +// } diff --git a/src/sass/views/includes/txp-details.scss b/src/sass/views/includes/txp-details.scss index 76f48336d..4cce40298 100644 --- a/src/sass/views/includes/txp-details.scss +++ b/src/sass/views/includes/txp-details.scss @@ -1,4 +1,5 @@ -#txp-details { +#txp-details, +#view-confirm { $item-lateral-padding: 20px; $item-vertical-padding: 10px; $item-border-color: #EFEFEF; @@ -8,7 +9,7 @@ background: #f5f5f5; } .slide-to-pay { - bottom: 100px; + bottom: 92px; } .head { padding: 30px $item-lateral-padding 4rem; diff --git a/www/views/confirm.html b/www/views/confirm.html index cb2a3063b..d772c9164 100644 --- a/www/views/confirm.html +++ b/www/views/confirm.html @@ -7,7 +7,77 @@ - + +
+
+
+ + Sending +
+
+
{{displayAmount}} {{displayUnit}}
+
{{alternativeAmountStr}}
+
+
+
+
+ To + + + {{toAddress}} + + +
+
+ From +
+ + + +
{{wallet.name}}
+
+
+
+ {{'Memo'|translate}} + + {{description}} + +
+
+ Fee + + {{fee}} + +
+
+
+
+ + Slide to pay + + + Payment Sent + Proposal Created + + + From d10e0bfcc9254fbd2120246209c371ee8b29f65a Mon Sep 17 00:00:00 2001 From: Marty Alcala Date: Wed, 12 Oct 2016 12:15:24 -0400 Subject: [PATCH 04/51] make send screen items clickable --- src/sass/views/includes/txp-details.scss | 31 ++++++++++++++++-------- www/views/confirm.html | 17 +++++++------ 2 files changed, 31 insertions(+), 17 deletions(-) diff --git a/src/sass/views/includes/txp-details.scss b/src/sass/views/includes/txp-details.scss index 4cce40298..498665c31 100644 --- a/src/sass/views/includes/txp-details.scss +++ b/src/sass/views/includes/txp-details.scss @@ -51,7 +51,13 @@ } .item { color: #4A4A4A; - padding: $item-vertical-padding $item-lateral-padding; + padding-top: $item-vertical-padding; + padding-bottom: $item-vertical-padding; + padding-left: $item-lateral-padding; + + &:not(.item-icon-right) { + padding-right: $item-lateral-padding; + } .label { font-size: 14px; @@ -62,7 +68,8 @@ &.single-line { display: flex; align-items: center; - padding: 17px $item-lateral-padding; + padding-top: 17px; + padding-bottom: 17px; .label { margin: 0; @@ -113,15 +120,19 @@ display: flex; align-items: center; padding: .2rem 0; - i { + margin-bottom: 5px; + + > i { padding: 0; - } - img { - height: 24px; - width: 24px; - padding: 2px; - margin-right: .7rem; - box-shadow: none; + position: static; + + > img { + height: 24px; + width: 24px; + padding: 2px; + margin-right: .7rem; + box-shadow: none; + } } } diff --git a/www/views/confirm.html b/www/views/confirm.html index d772c9164..411fe4b63 100644 --- a/www/views/confirm.html +++ b/www/views/confirm.html @@ -29,7 +29,7 @@ Multiple recipients --> - - - + +
From 7f180d1335924d38114dcd674e75f54480daa3d9 Mon Sep 17 00:00:00 2001 From: Marty Alcala Date: Wed, 12 Oct 2016 12:31:38 -0400 Subject: [PATCH 05/51] lighten arrows --- src/sass/icons.scss | 1 + src/sass/views/includes/txp-details.scss | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/sass/icons.scss b/src/sass/icons.scss index fd352e9ca..2cb69734f 100644 --- a/src/sass/icons.scss +++ b/src/sass/icons.scss @@ -1,5 +1,6 @@ .icon.bp-arrow-right { @extend .ion-ios-arrow-right; + color: #bfbfbf; } .icon.bp-arrow-down { diff --git a/src/sass/views/includes/txp-details.scss b/src/sass/views/includes/txp-details.scss index 498665c31..f03cc201c 100644 --- a/src/sass/views/includes/txp-details.scss +++ b/src/sass/views/includes/txp-details.scss @@ -122,6 +122,10 @@ padding: .2rem 0; margin-bottom: 5px; + ~ .bp-arrow-right { + top: 14px; + } + > i { padding: 0; position: static; From ec343e4991a63d1247c31eedc26069bfe622dd92 Mon Sep 17 00:00:00 2001 From: Jason Dreyzehner Date: Wed, 12 Oct 2016 13:27:19 -0400 Subject: [PATCH 06/51] perf(startupService): speedup perceived load time by removing animations before the splashscreen hid --- app-template/config-template.xml | 5 +++-- package.json | 3 ++- src/js/routes.js | 3 +++ src/js/services/startupService.js | 6 ++++-- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/app-template/config-template.xml b/app-template/config-template.xml index 1629573c3..1db63c59a 100644 --- a/app-template/config-template.xml +++ b/app-template/config-template.xml @@ -17,14 +17,15 @@ - - + + + diff --git a/package.json b/package.json index 03b305a7c..2d9cd754c 100644 --- a/package.json +++ b/package.json @@ -92,6 +92,7 @@ "cordova": "^6.3.1", "grunt": "^1.0.1", "ionic": "^2.1.0", - "trash-cli": "^1.4.0" + "trash-cli": "^1.4.0", + "lodash": "^4.3.0" } } diff --git a/src/js/routes.js b/src/js/routes.js index 09d99dfae..ec6471742 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -959,6 +959,9 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr $log.info('Init profile...'); // Try to open local profile profileService.loadAndBindProfile(function(err) { + $ionicHistory.nextViewOptions({ + disableAnimate: true + }); if (err) { if (err.message && err.message.match('NOPROFILE')) { $log.debug('No profile... redirecting'); diff --git a/src/js/services/startupService.js b/src/js/services/startupService.js index d3d55fc02..31c1b7460 100644 --- a/src/js/services/startupService.js +++ b/src/js/services/startupService.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.services').service('startupService', function($log) { +angular.module('copayApp.services').service('startupService', function($log, $timeout) { var splashscreenVisible = true; var statusBarVisible = false; @@ -8,7 +8,9 @@ angular.module('copayApp.services').service('startupService', function($log) { function _hideSplash(){ if(navigator.splashscreen && splashscreenVisible){ $log.debug('startupService is hiding the splashscreen...'); - navigator.splashscreen.hide(); + $timeout(function(){ + navigator.splashscreen.hide(); + }, 20); splashscreenVisible = false; } } From d56504b2537e3f6664e1d46e9dee5624c2dd9e9d Mon Sep 17 00:00:00 2001 From: Marty Alcala Date: Wed, 12 Oct 2016 13:48:32 -0400 Subject: [PATCH 07/51] add click to accept component to send screen --- www/views/confirm.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/www/views/confirm.html b/www/views/confirm.html index 411fe4b63..a17a8d3b9 100644 --- a/www/views/confirm.html +++ b/www/views/confirm.html @@ -55,6 +55,12 @@ + + Click to pay + Date: Wed, 12 Oct 2016 14:03:36 -0400 Subject: [PATCH 08/51] fix(desktop): fix error if StatusBar is not available --- src/js/services/startupService.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/services/startupService.js b/src/js/services/startupService.js index 31c1b7460..557d51997 100644 --- a/src/js/services/startupService.js +++ b/src/js/services/startupService.js @@ -6,7 +6,7 @@ angular.module('copayApp.services').service('startupService', function($log, $ti var statusBarVisible = false; function _hideSplash(){ - if(navigator.splashscreen && splashscreenVisible){ + if(typeof navigator.splashscreen !== "undefined" && splashscreenVisible){ $log.debug('startupService is hiding the splashscreen...'); $timeout(function(){ navigator.splashscreen.hide(); @@ -15,7 +15,7 @@ angular.module('copayApp.services').service('startupService', function($log, $ti } } function _showStatusBar(){ - if(StatusBar && !statusBarVisible){ + if(typeof StatusBar !== "undefined" && !statusBarVisible){ $log.debug('startupService is showing the StatusBar...'); StatusBar.show(); statusBarVisible = true; From 2d205cbebd2935729c23b14fc0457691e7a062c0 Mon Sep 17 00:00:00 2001 From: Marty Alcala Date: Wed, 12 Oct 2016 14:04:23 -0400 Subject: [PATCH 09/51] handle insufficient funds case --- src/sass/views/includes/txp-details.scss | 4 ++++ www/views/confirm.html | 9 ++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/sass/views/includes/txp-details.scss b/src/sass/views/includes/txp-details.scss index f03cc201c..c5d216e8f 100644 --- a/src/sass/views/includes/txp-details.scss +++ b/src/sass/views/includes/txp-details.scss @@ -49,6 +49,10 @@ span { display: block; } + .badge { + border-radius: 0; + padding: .5rem; + } .item { color: #4A4A4A; padding-top: $item-vertical-padding; diff --git a/www/views/confirm.html b/www/views/confirm.html index a17a8d3b9..0fbffddb9 100644 --- a/www/views/confirm.html +++ b/www/views/confirm.html @@ -29,7 +29,10 @@ Multiple recipients --> - +
+ Insufficient funds +
+
From
@@ -39,14 +42,14 @@
- + {{'Add Memo'|translate}} {{description}} - + Fee {{fee}} From bbf1c632df4be4409a5399d6d23b6482329adb4f Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Wed, 12 Oct 2016 15:07:09 -0300 Subject: [PATCH 10/51] Ref copayers view --- src/js/controllers/copayers.js | 14 ++++------ src/sass/views/copayers.scss | 12 ++++++-- www/views/copayers.html | 47 +++++++++++++++----------------- www/views/includes/copayers.html | 12 ++++---- 4 files changed, 44 insertions(+), 41 deletions(-) diff --git a/src/js/controllers/copayers.js b/src/js/controllers/copayers.js index 765db7d52..d9568cb1a 100644 --- a/src/js/controllers/copayers.js +++ b/src/js/controllers/copayers.js @@ -3,15 +3,11 @@ angular.module('copayApp.controllers').controller('copayersController', function($scope, $log, $timeout, $stateParams, $state, $rootScope, $ionicHistory, lodash, profileService, walletService, popupService, platformInfo, gettextCatalog, ongoingProcess) { + $scope.isCordova = platformInfo.isCordova; $scope.$on("$ionicView.beforeEnter", function(event, data) { - init(); - }); - - var init = function() { - $scope.isCordova = platformInfo.isCordova; - $scope.wallet = profileService.getWallet($stateParams.walletId); + $scope.wallet = profileService.getWallet(data.stateParams.walletId); updateWallet(); - }; + }); $rootScope.$on('bwsEvent', function() { updateWallet(); @@ -40,7 +36,9 @@ angular.module('copayApp.controllers').controller('copayersController', }; $scope.showDeletePopup = function() { - popupService.showConfirm(gettextCatalog.getString('Confirm'), gettextCatalog.getString('Are you sure you want to delete this wallet?'), null, null, function(res) { + var title = gettextCatalog.getString('Confirm'); + var msg = gettextCatalog.getString('Are you sure you want to cancel and delete this wallet?'); + popupService.showConfirm(title, msg, null, null, function(res) { if (res) deleteWallet(); }); }; diff --git a/src/sass/views/copayers.scss b/src/sass/views/copayers.scss index 27117e859..2f3458a4e 100644 --- a/src/sass/views/copayers.scss +++ b/src/sass/views/copayers.scss @@ -1,7 +1,13 @@ .copayers-secret { - overflow-wrap: break-word; - word-wrap: break-word; text-align: center; - font-size: 14px; + font-size: 12px; margin: 10px; + white-space: -moz-pre-wrap !important; + white-space: -pre-wrap; + white-space: -o-pre-wrap; + white-space: pre-wrap; + word-wrap: break-word; + white-space: -webkit-pre-wrap; + word-break: break-all; + white-space: normal; } diff --git a/www/views/copayers.html b/www/views/copayers.html index 519ba5195..c026af015 100644 --- a/www/views/copayers.html +++ b/www/views/copayers.html @@ -4,26 +4,29 @@ {{wallet.name}} + + +
- +
Share this invitation with your copayers - -
-
- -
-
- -
-
-
- {{secret || ('Loading...'|translate)}} +
+
+ +
+
+
+
+ {{secret || ('Loading...'|translate)}} +
@@ -36,30 +39,24 @@
-
-

- Waiting for copayers +
+
[ {{wallet.m}}-of-{{wallet.n}} ] -

+ Waiting for copayers +
-
+
- Waiting... + {{'Waiting...'|translate}}
-
+

Wallet incomplete and broken

Delete it and create a new one

- -
- -
diff --git a/www/views/includes/copayers.html b/www/views/includes/copayers.html index 2ab3e5f49..53fbeeebe 100644 --- a/www/views/includes/copayers.html +++ b/www/views/includes/copayers.html @@ -1,8 +1,10 @@ -
- - {{'Me'|translate}} +
+ + + {{'Me'|translate}} - - {{copayer.name}} + + + {{copayer.name}}
From 3d1a3ee98493e8a22a2303f21d1a2930ff2c8022 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Wed, 12 Oct 2016 15:50:38 -0300 Subject: [PATCH 11/51] Revert "fix send tip" --- src/js/controllers/tab-send.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/js/controllers/tab-send.js b/src/js/controllers/tab-send.js index 8c74feb78..9636fa305 100644 --- a/src/js/controllers/tab-send.js +++ b/src/js/controllers/tab-send.js @@ -106,7 +106,7 @@ angular.module('copayApp.controllers').controller('tabSendController', function( var updateHasFunds = function() { - $scope.hasFunds = true; + $scope.hasFunds = null; var wallets = profileService.getWallets({ onlyComplete: true, @@ -114,9 +114,6 @@ angular.module('copayApp.controllers').controller('tabSendController', function( if (!wallets || !wallets.length) { $scope.hasFunds = false; - $timeout(function() { - $scope.$apply(); - }); } var index = 0; @@ -127,16 +124,13 @@ angular.module('copayApp.controllers').controller('tabSendController', function( $log.error(err); return; } - if (status.availableBalanceSat && status.availableBalanceSat > 0) { + + if (status.availableBalanceSat) { $scope.hasFunds = true; } - else $scope.hasFunds = false; if (index == wallets.length) { $scope.hasFunds = $scope.hasFunds || false; } - $timeout(function() { - $scope.$apply(); - }) }); }); }; From a505842310c299bb24d91ae39103215b4fd84650 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Wed, 12 Oct 2016 15:55:33 -0300 Subject: [PATCH 12/51] fix send tips --- src/js/controllers/tab-send.js | 6 ++++++ www/views/tab-send.html | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/js/controllers/tab-send.js b/src/js/controllers/tab-send.js index 9636fa305..1792ccae1 100644 --- a/src/js/controllers/tab-send.js +++ b/src/js/controllers/tab-send.js @@ -114,6 +114,9 @@ angular.module('copayApp.controllers').controller('tabSendController', function( if (!wallets || !wallets.length) { $scope.hasFunds = false; + $timeout(function() { + $scope.$apply(); + }); } var index = 0; @@ -130,6 +133,9 @@ angular.module('copayApp.controllers').controller('tabSendController', function( } if (index == wallets.length) { $scope.hasFunds = $scope.hasFunds || false; + $timeout(function() { + $scope.$apply(); + }); } }); }); diff --git a/www/views/tab-send.html b/www/views/tab-send.html index 886ea93a7..3432416b4 100644 --- a/www/views/tab-send.html +++ b/www/views/tab-send.html @@ -2,8 +2,8 @@ {{'Send' | translate}} - -
+ +
From ce298fdfb69588faf87702a4c3de051283b02a5e Mon Sep 17 00:00:00 2001 From: Marty Alcala Date: Wed, 12 Oct 2016 15:01:48 -0400 Subject: [PATCH 13/51] prelim action sheet directive --- src/js/controllers/confirm.js | 5 ++++ src/js/directives/actionSheet.js | 23 +++++++++++++++ src/sass/views/includes/actionSheet.scss | 37 ++++++++++++++++++++++++ src/sass/views/views.scss | 1 + www/views/confirm.html | 5 +++- www/views/includes/actionSheet.html | 8 +++++ 6 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 src/js/directives/actionSheet.js create mode 100644 src/sass/views/includes/actionSheet.scss create mode 100644 www/views/includes/actionSheet.html diff --git a/src/js/controllers/confirm.js b/src/js/controllers/confirm.js index 7c1289967..7eeab75be 100644 --- a/src/js/controllers/confirm.js +++ b/src/js/controllers/confirm.js @@ -111,6 +111,11 @@ angular.module('copayApp.controllers').controller('confirmController', function( setWallet(wallet, true); }); + $scope.showWalletSelector = function() { + console.log('showWalletSelector called'); + $scope.showWallets = true; + }; + $scope.showDescriptionPopup = function() { var message = gettextCatalog.getString('Add description'); diff --git a/src/js/directives/actionSheet.js b/src/js/directives/actionSheet.js new file mode 100644 index 000000000..d2697e930 --- /dev/null +++ b/src/js/directives/actionSheet.js @@ -0,0 +1,23 @@ +'use strict'; + +angular.module('copayApp.directives') + .directive('actionSheet', function() { + return { + restrict: 'E', + templateUrl: 'views/includes/actionSheet.html', + transclude: true, + scope: { + show: '=actionSheetShow', + }, + link: function(scope, element, attrs) { + console.log('action sheet instantiated'); + scope.$watch('show', function() { + console.log('show called', scope.show); + }); + + scope.hide = function() { + scope.show = false; + }; + } + }; + }); diff --git a/src/sass/views/includes/actionSheet.scss b/src/sass/views/includes/actionSheet.scss new file mode 100644 index 000000000..9d2b1e173 --- /dev/null +++ b/src/sass/views/includes/actionSheet.scss @@ -0,0 +1,37 @@ +action-sheet { + .bp-action-sheet { + + &__sheet { + background: #fff; + height: 300px; + width: 100%; + position: fixed; + bottom: 0; + left: 0; + transform: translateY(100%); + transition: transform 250ms ease; + z-index: 100; + + &.slide-up { + transform: translateY(0); + } + } + + &__backdrop { + height: 100%; + width: 100%; + position: fixed; + top: 0; + left: 0; + background: rgba(0, 0, 0, 0); + transition: background 250ms ease; + pointer-events: none; + z-index: 99; + + &.fade-in { + background: rgba(0, 0, 0, .5); + pointer-events: all; + } + } + } +} diff --git a/src/sass/views/views.scss b/src/sass/views/views.scss index 8b1319ac0..8bf09e6df 100644 --- a/src/sass/views/views.scss +++ b/src/sass/views/views.scss @@ -17,6 +17,7 @@ @import "address-book"; @import "zero-state"; @import "onboarding/onboarding"; +@import "includes/actionSheet"; @import "includes/walletActivity"; @import "includes/wallets"; @import "includes/modals/modals"; diff --git a/www/views/confirm.html b/www/views/confirm.html index 0fbffddb9..dcbf0ce33 100644 --- a/www/views/confirm.html +++ b/www/views/confirm.html @@ -32,7 +32,7 @@
Insufficient funds
- + From
@@ -79,6 +79,9 @@ Payment Sent Proposal Created + + + + controls-ico-back + Created with Sketch. + + + + + + + + + + + + + \ No newline at end of file diff --git a/www/views/includes/actionSheet.html b/www/views/includes/actionSheet.html index 41cd68a57..b4abfffae 100644 --- a/www/views/includes/actionSheet.html +++ b/www/views/includes/actionSheet.html @@ -4,5 +4,5 @@ ng-click="hide()">
- +
From 15982e7ce83c432cac0a8b565dc0d975a7917743 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Wed, 12 Oct 2016 16:22:02 -0300 Subject: [PATCH 15/51] add scope apply to onboarding rate values --- src/js/controllers/onboarding/tour.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/js/controllers/onboarding/tour.js b/src/js/controllers/onboarding/tour.js index c16eba67e..c2a38791e 100644 --- a/src/js/controllers/onboarding/tour.js +++ b/src/js/controllers/onboarding/tour.js @@ -34,6 +34,9 @@ angular.module('copayApp.controllers').controller('tourController', var rate = rateService.toFiat(btcAmount * 1e8, localCurrency); $scope.localCurrencySymbol = '$'; $scope.localCurrencyPerBtc = $filter('formatFiatAmount')(parseFloat(rate.toFixed(2), 10)); + $timeout(function() { + $scope.$apply(); + }) }); }); @@ -50,7 +53,7 @@ angular.module('copayApp.controllers').controller('tourController', ongoingProcess.set('creatingWallet', false); popupService.showAlert( gettextCatalog.getString('Cannot Create Wallet'), err, - function() { + function() { retryCount = 0; return $scope.createDefaultWallet(); }, gettextCatalog.getString('Retry')); From 146f8a43a395ef0aa823e13f31728778cbf39ad2 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Wed, 12 Oct 2016 16:46:44 -0300 Subject: [PATCH 16/51] Fix styling: delete wallet button --- src/sass/buttons.scss | 3 ++- www/views/preferencesDeleteWallet.html | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/sass/buttons.scss b/src/sass/buttons.scss index 5c0c05713..80139248f 100644 --- a/src/sass/buttons.scss +++ b/src/sass/buttons.scss @@ -35,7 +35,8 @@ $button-secondary-active-border: transparent; @include button-outline($button-primary-bg); } &.button-primary, - &.button-secondary { + &.button-secondary, + &.button-assertive { &.button-standard { @extend %button-standard; & + .button-standard { diff --git a/www/views/preferencesDeleteWallet.html b/www/views/preferencesDeleteWallet.html index 176981e40..de664a46b 100644 --- a/www/views/preferencesDeleteWallet.html +++ b/www/views/preferencesDeleteWallet.html @@ -16,6 +16,10 @@

- +
+ +
From 47a0a1f83db235d69cb85b49851c19b7f2ea370f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Wed, 12 Oct 2016 17:43:23 -0300 Subject: [PATCH 17/51] remove ion toogle --- src/js/controllers/import.js | 14 +++++++++++++- www/views/import.html | 6 +++--- www/views/tab-import-file.html | 6 ++++-- www/views/tab-import-hardware.html | 6 ++++-- www/views/tab-import-phrase.html | 6 ++++-- 5 files changed, 28 insertions(+), 10 deletions(-) diff --git a/src/js/controllers/import.js b/src/js/controllers/import.js index bdc97e984..056d55ed5 100644 --- a/src/js/controllers/import.js +++ b/src/js/controllers/import.js @@ -1,7 +1,7 @@ 'use strict'; angular.module('copayApp.controllers').controller('importController', - function($scope, $timeout, $log, $state, $stateParams, $ionicHistory, profileService, configService, sjcl, ledger, trezor, derivationPathHelper, platformInfo, bwcService, ongoingProcess, walletService, popupService, gettextCatalog) { + function($scope, $timeout, $log, $state, $stateParams, $ionicHistory, $ionicScrollDelegate, profileService, configService, sjcl, ledger, trezor, derivationPathHelper, platformInfo, bwcService, ongoingProcess, walletService, popupService, gettextCatalog) { var isChromeApp = platformInfo.isChromeApp; var isDevel = platformInfo.isDevel; @@ -350,4 +350,16 @@ angular.module('copayApp.controllers').controller('importController', fromOnboarding: $stateParams.fromOnboarding }); }; + + $scope.showAdvChange = function() { + $scope.showAdv = !$scope.showAdv; + $scope.resizeView(); + }; + + $scope.resizeView = function() { + $timeout(function() { + $ionicScrollDelegate.resize(); + }); + }; + }); diff --git a/www/views/import.html b/www/views/import.html index 81c80f651..7a9940c83 100644 --- a/www/views/import.html +++ b/www/views/import.html @@ -7,13 +7,13 @@
-
+
Recovery phrase
-
+
File/Text
-
+
Hardware wallet
diff --git a/www/views/tab-import-file.html b/www/views/tab-import-file.html index 31d439c4f..8cfa4fa7f 100644 --- a/www/views/tab-import-file.html +++ b/www/views/tab-import-file.html @@ -21,10 +21,12 @@ ng-model="formData.password"> - +
+ +
Show advanced options Hide advanced options - +
- +
+ + Show advanced options Hide advanced options -
+