From b1d4e6224cc104a28c336dc07973d3817ac64052 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Mon, 16 Nov 2015 12:00:10 -0300 Subject: [PATCH 001/183] license and profile creation in the same view --- public/views/disclaimer.html | 116 +++++++++++++++++++------------ public/views/splash.html | 43 ------------ src/css/main.css | 5 +- src/js/controllers/disclaimer.js | 31 ++++++--- src/js/controllers/splash.js | 35 ---------- 5 files changed, 97 insertions(+), 133 deletions(-) delete mode 100644 public/views/splash.html delete mode 100644 src/js/controllers/splash.js diff --git a/public/views/disclaimer.html b/public/views/disclaimer.html index 5b988b940..8197a5d44 100644 --- a/public/views/disclaimer.html +++ b/public/views/disclaimer.html @@ -1,47 +1,71 @@ -
-
-
- -
-

-
Copay
-
Terms of Use
-

-
-

-

    -
  • The software you are about to use functions as a free, open source, and multi-signature digital wallet.
  • -
  • The software does not constitute an account where BitPay or other third parties serve as financial intermediaries or custodians of your bitcoin.
  • -
  • While the software has undergone beta testing and continues to be improved by feedback from the open-source user and developer community, we cannot guarantee that there will be no bugs in the software.
  • -
  • You acknowledge that your use of this software is at your own discretion and in compliance with all applicable laws.
  • -
  • You are responsible for safekeeping your passwords, private key pairs, PINs and any other codes you use to access the software.
  • -
  • IF YOU LOSE ACCESS TO YOUR COPAY WALLET OR YOUR ENCRYPTED PRIVATE KEYS AND YOU HAVE NOT SEPARATELY STORED A BACKUP OF YOUR WALLET AND CORRESPONDING PASSWORD, YOU ACKNOWLEDGE AND AGREE THAT ANY BITCOIN YOU HAVE ASSOCIATED WITH THAT COPAY WALLET WILL BECOME INACCESSIBLE.
  • -
  • All transaction requests are irreversible.
  • -
  • The authors of the software, employees and affiliates of Bitpay, copyright holders, and BitPay, Inc. cannot retrieve your private keys or passwords if you lose or forget them and cannot guarantee transaction confirmation as they do not have control over the Bitcoin network.
  • -
  • To the fullest extent permitted by law, this software is provided “as is” and no representations or warranties can be made of any kind, express or implied, including but not limited to the warranties of merchantability, fitness or a particular purpose and noninfringement.
  • -
  • You assume any and all risks associated with the use of the software.
  • -
  • In no event shall the authors of the software, employees and affiliates of Bitpay, copyright holders, or BitPay, Inc. be held liable for any claim, damages or other liability, whether in an action of contract, tort, or otherwise, arising from, out of or in connection with the software.
  • -
  • We reserve the right to modify this disclaimer from time to time.
  • -
-

-

- Official English Disclaimer -

- -
-

I affirm that I have read, understood, and agree with these terms.

- -
- -
-
-
+
+
+
+
+
+ WELCOME TO COPAY +

A multisignature bitcoin wallet

+
+
+
+
+
+ icon +
+
+
+

+

    +
  • The software you are about to use functions as a free, open source, and multi-signature digital wallet.
  • +
  • The software does not constitute an account where BitPay or other third parties serve as financial intermediaries or custodians of your bitcoin.
  • +
  • While the software has undergone beta testing and continues to be improved by feedback from the open-source user and developer community, we cannot guarantee that there will be no bugs in the software.
  • +
  • You acknowledge that your use of this software is at your own discretion and in compliance with all applicable laws.
  • +
  • You are responsible for safekeeping your passwords, private key pairs, PINs and any other codes you use to access the software.
  • +
  • IF YOU LOSE ACCESS TO YOUR COPAY WALLET OR YOUR ENCRYPTED PRIVATE KEYS AND YOU HAVE NOT SEPARATELY STORED A BACKUP OF YOUR WALLET AND CORRESPONDING PASSWORD, YOU ACKNOWLEDGE AND AGREE THAT ANY BITCOIN YOU HAVE ASSOCIATED WITH THAT COPAY WALLET WILL BECOME INACCESSIBLE.
  • +
  • All transaction requests are irreversible.
  • +
  • The authors of the software, employees and affiliates of Bitpay, copyright holders, and BitPay, Inc. cannot retrieve your private keys or passwords if you lose or forget them and cannot guarantee transaction confirmation as they do not have control over the Bitcoin network.
  • +
  • To the fullest extent permitted by law, this software is provided “as is” and no representations or warranties can be made of any kind, express or implied, including but not limited to the warranties of merchantability, fitness or a particular purpose and noninfringement.
  • +
  • You assume any and all risks associated with the use of the software.
  • +
  • In no event shall the authors of the software, employees and affiliates of Bitpay, copyright holders, or BitPay, Inc. be held liable for any claim, damages or other liability, whether in an action of contract, tort, or otherwise, arising from, out of or in connection with the software.
  • +
  • We reserve the right to modify this disclaimer from time to time.
  • +
+

+
+
+
+
+ {{(error)|translate}}. Retrying... +
+
+
+
+
+
+
+
+
+
+ Creating Profile... +
+
+ +
+

I affirm that I have read, understood, and agree with these terms.

+
+
+
+ +

Already have a wallet?

+ +
+
+
diff --git a/public/views/splash.html b/public/views/splash.html deleted file mode 100644 index 6354688bd..000000000 --- a/public/views/splash.html +++ /dev/null @@ -1,43 +0,0 @@ -
-
-
-
-
- WELCOME TO COPAY -

A multisignature bitcoin wallet

-
-
-
-
-
- icon -
-
-
- {{(error)|translate}}. Retrying... -
-
-
-
-
-
-
-
-
-
- Creating Profile... -
-
-
-
- -

Already have a wallet?

- -
-
-
-
diff --git a/src/css/main.css b/src/css/main.css index 9767bbd71..a817b3ac7 100644 --- a/src/css/main.css +++ b/src/css/main.css @@ -7,7 +7,6 @@ font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; } - .panel h1, .panel h2, .panel h3, .panel h4, .panel h5, .panel h6, .panel p, .panel li, .panel dl { color: #2C3E50; } @@ -1094,6 +1093,10 @@ input.ng-invalid-match, input.ng-invalid-match:focus { } /*/////////////////////////////////////////////////*/ +.scrollArea { + height: 280px; + overflow: scroll; +} .tabbable { border: 2px solid #213140; diff --git a/src/js/controllers/disclaimer.js b/src/js/controllers/disclaimer.js index 88533fd31..f1cedcc71 100644 --- a/src/js/controllers/disclaimer.js +++ b/src/js/controllers/disclaimer.js @@ -1,29 +1,44 @@ 'use strict'; angular.module('copayApp.controllers').controller('disclaimerController', - function($scope, $timeout, storageService, applicationService, gettextCatalog, isCordova, uxLanguage) { + function($scope, $timeout, $log, profileService, isCordova, storageService, gettextCatalog, uxLanguage, go) { - $scope.agree = function() { + $scope.create = function(noWallet) { + $scope.creatingProfile = true; if (isCordova) { window.plugins.spinnerDialog.show(null, gettextCatalog.getString('Loading...'), true); } $scope.loading = true; $timeout(function() { storageService.setCopayDisclaimerFlag(function(err) { - $timeout(function() { - if (isCordova) { - window.plugins.spinnerDialog.hide(); + if (isCordova) { + window.plugins.spinnerDialog.hide(); + } + profileService.create({ + noWallet: noWallet + }, function(err) { + if (err) { + $scope.creatingProfile = false; + $log.warn(err); + $scope.error = err; + $scope.$apply(); + $timeout(function() { + $scope.create(noWallet); + }, 3000); } - applicationService.restart(); - }, 1000); + }); }); }, 100); }; - + $scope.init = function() { storageService.getCopayDisclaimerFlag(function(err, val) { $scope.lang = uxLanguage.currentLanguage; $scope.agreed = val; + + if (profileService.profile) { + go.walletHome(); + } $timeout(function() { $scope.$digest(); }, 1); diff --git a/src/js/controllers/splash.js b/src/js/controllers/splash.js deleted file mode 100644 index b52b2d443..000000000 --- a/src/js/controllers/splash.js +++ /dev/null @@ -1,35 +0,0 @@ -'use strict'; - -angular.module('copayApp.controllers').controller('splashController', - function($scope, $timeout, $log, profileService, storageService, go) { - - $scope.create = function(noWallet) { - $scope.creatingProfile = true; - - $timeout(function() { - profileService.create({ - noWallet: noWallet - }, function(err) { - if (err) { - $scope.creatingProfile = false; - $log.warn(err); - $scope.error = err; - $scope.$apply(); - $timeout(function() { - $scope.create(noWallet); - }, 3000); - } - }); - }, 100); - }; - - $scope.init = function() { - storageService.getCopayDisclaimerFlag(function(err, val) { - if (!val) go.path('disclaimer'); - - if (profileService.profile) { - go.walletHome(); - } - }); - }; - }); From f2375a7bac16a0eaf41179cad18d9517345c20de Mon Sep 17 00:00:00 2001 From: bechi Date: Mon, 16 Nov 2015 17:04:46 -0300 Subject: [PATCH 002/183] add style on disclaimer --- public/views/disclaimer.html | 28 ++++++++++++---------------- src/css/main.css | 14 +++++++++++++- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/public/views/disclaimer.html b/public/views/disclaimer.html index 8197a5d44..aed44567e 100644 --- a/public/views/disclaimer.html +++ b/public/views/disclaimer.html @@ -1,22 +1,20 @@ -
-
-
- WELCOME TO COPAY -

A multisignature bitcoin wallet

-
-
-
-
-
+
icon
+
+
+ WELCOME TO COPAY +

A multisignature bitcoin wallet

+
+
-

+

  • The software you are about to use functions as a free, open source, and multi-signature digital wallet.
  • The software does not constitute an account where BitPay or other third parties serve as financial intermediaries or custodians of your bitcoin.
  • @@ -56,15 +54,13 @@

-

I affirm that I have read, understood, and agree with these terms.

+

I affirm that I have read, understood, and agree with these terms.

-
+
-

Already have a wallet?

-
diff --git a/src/css/main.css b/src/css/main.css index a817b3ac7..bb4cf5588 100644 --- a/src/css/main.css +++ b/src/css/main.css @@ -1096,6 +1096,18 @@ input.ng-invalid-match, input.ng-invalid-match:focus { .scrollArea { height: 280px; overflow: scroll; + background: #213140; + border: 1px solid #4B6178; + border-radius: 5px; + margin: 1.6rem; + color: #A5B2BF; + line-height: 30px; + padding: 0.5rem; +} + +.scrollArea ul { + font-size: 0.8rem; + text-align: left; } .tabbable { @@ -1203,7 +1215,7 @@ input.ng-invalid-match, input.ng-invalid-match:focus { } .splash .container-image { - padding: 2rem 0; + padding: 1rem 0; } .preferences li { From 7b3e308e25c9436eb23ac3d09fec7f9ae48c8c8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Mon, 16 Nov 2015 17:43:54 -0300 Subject: [PATCH 003/183] adding delete words option to security Preferences --- public/views/preferences.html | 7 +- public/views/preferencesDeleteWords.html | 32 +++++++ public/views/securityPreferences.html | 19 ++++ src/js/controllers/preferencesDeleteWords.js | 23 +++++ src/js/controllers/securityPreferences.js | 12 +++ src/js/routes.js | 92 ++++++++++++-------- 6 files changed, 150 insertions(+), 35 deletions(-) create mode 100644 public/views/preferencesDeleteWords.html create mode 100644 public/views/securityPreferences.html create mode 100644 src/js/controllers/preferencesDeleteWords.js create mode 100644 src/js/controllers/securityPreferences.js diff --git a/public/views/preferences.html b/public/views/preferences.html index ff31aaa0f..7af803f41 100644 --- a/public/views/preferences.html +++ b/public/views/preferences.html @@ -56,7 +56,12 @@
Backup
- + +
  • + +
    Security Preferences
    +
  • +
  • Advanced
    diff --git a/public/views/preferencesDeleteWords.html b/public/views/preferencesDeleteWords.html new file mode 100644 index 000000000..218845048 --- /dev/null +++ b/public/views/preferencesDeleteWords.html @@ -0,0 +1,32 @@ +
    +
    + + +
    + +

    +
    + Wallet: {{index.walletName}} + ({{index.alias}}) +
    +

    Warning!

    +
    + + {{preferences.error|translate}} + +
    +
    +

    + Once you have copied your wallet seed down, it is recommended to delete it from this device. +

    + +
    +
    diff --git a/public/views/securityPreferences.html b/public/views/securityPreferences.html new file mode 100644 index 000000000..f9754ff50 --- /dev/null +++ b/public/views/securityPreferences.html @@ -0,0 +1,19 @@ +
    +
    + + +
    + +

    + +
      + +
    • + +
      Delete seed words
      +
    • + +
    diff --git a/src/js/controllers/preferencesDeleteWords.js b/src/js/controllers/preferencesDeleteWords.js new file mode 100644 index 000000000..6c14ba9ea --- /dev/null +++ b/src/js/controllers/preferencesDeleteWords.js @@ -0,0 +1,23 @@ +'use strict'; + +angular.module('copayApp.controllers').controller('preferencesDeleteWordsController', + function($scope, $rootScope, $filter, $timeout, $modal, $log, confirmDialog, storageService, notification, profileService, isCordova, go, gettext, gettextCatalog, animationService) { + var self = this; + var fc = profileService.focusedClient; + var msg = gettext('Are you sure you want to delete the backup words?'); + var successMsg = gettext('Backup words deleted'); + + self.delete = function() { + confirmDialog.show(msg, + function(ok) { + if (ok) { + fc.clearMnemonic(); + profileService.updateCredentialsFC(function() { + notification.success(successMsg); + go.walletHome(); + }); + } + }); + }; + + }); diff --git a/src/js/controllers/securityPreferences.js b/src/js/controllers/securityPreferences.js new file mode 100644 index 000000000..b864ae2eb --- /dev/null +++ b/src/js/controllers/securityPreferences.js @@ -0,0 +1,12 @@ +'use strict'; + +angular.module('copayApp.controllers').controller('securityPreferencesController', + function($scope, profileService) { + var self = this; + var fc = profileService.focusedClient; + self.deleted = false; + if (fc.credentials && !fc.credentials.mnemonicEncrypted && !fc.credentials.mnemonic) { + self.deleted = true; + } + + }); diff --git a/src/js/routes.js b/src/js/routes.js index 44f7ca551..0e2da59b8 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -286,6 +286,18 @@ angular } }) + .state('securityPreferences', { + url: '/securityPreferences', + templateUrl: 'views/securityPreferences.html', + walletShouldBeComplete: true, + needProfile: true, + views: { + 'main': { + templateUrl: 'views/securityPreferences.html' + }, + } + }) + .state('preferencesAdvanced', { url: '/preferencesAdvanced', templateUrl: 'views/preferencesAdvanced.html', @@ -297,29 +309,30 @@ angular }, } }) - .state('preferencesColor', { - url: '/preferencesColor', - templateUrl: 'views/preferencesColor.html', - walletShouldBeComplete: true, - needProfile: true, - views: { - 'main': { - templateUrl: 'views/preferencesColor.html' - }, - } - }) - .state('preferencesAltCurrency', { - url: '/preferencesAltCurrency', - templateUrl: 'views/preferencesAltCurrency.html', + .state('preferencesColor', { + url: '/preferencesColor', + templateUrl: 'views/preferencesColor.html', walletShouldBeComplete: true, needProfile: true, views: { 'main': { - templateUrl: 'views/preferencesAltCurrency.html' + templateUrl: 'views/preferencesColor.html' }, } }) + + .state('preferencesAltCurrency', { + url: '/preferencesAltCurrency', + templateUrl: 'views/preferencesAltCurrency.html', + walletShouldBeComplete: true, + needProfile: true, + views: { + 'main': { + templateUrl: 'views/preferencesAltCurrency.html' + }, + } + }) .state('preferencesAlias', { url: '/preferencesAlias', templateUrl: 'views/preferencesAlias.html', @@ -356,6 +369,17 @@ angular } }) + .state('deleteWords', { + url: '/deleteWords', + templateUrl: 'views/preferencesDeleteWords.html', + walletShouldBeComplete: true, + needProfile: true, + views: { + 'main': { + templateUrl: 'views/preferencesDeleteWords.html' + }, + } + }) .state('delete', { url: '/delete', templateUrl: 'views/preferencesDeleteWallet.html', @@ -379,16 +403,16 @@ angular }) .state('about', { - url: '/about', - templateUrl: 'views/preferencesAbout.html', - walletShouldBeComplete: true, - needProfile: true, - views: { - 'main': { - templateUrl: 'views/preferencesAbout.html' - }, - } - }) + url: '/about', + templateUrl: 'views/preferencesAbout.html', + walletShouldBeComplete: true, + needProfile: true, + views: { + 'main': { + templateUrl: 'views/preferencesAbout.html' + }, + } + }) .state('logs', { url: '/logs', templateUrl: 'views/preferencesLogs.html', @@ -450,14 +474,14 @@ angular }) .state('add', { - url: '/add', - needProfile: true, - views: { - 'main': { - templateUrl: 'views/add.html' - }, - } - }) + url: '/add', + needProfile: true, + views: { + 'main': { + templateUrl: 'views/add.html' + }, + } + }) .state('cordova', { url: '/cordova/:status/:isHome', views: { @@ -539,7 +563,7 @@ angular $state.transitionTo('copayers'); event.preventDefault(); - } + } if (!animationService.transitionAnimated(fromState, toState)) { event.preventDefault(); From 8217c7bfbd4146c7d30ff68cd851605d384c862c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Tue, 17 Nov 2015 11:10:09 -0300 Subject: [PATCH 004/183] create profile before accepting terms --- src/js/controllers/disclaimer.js | 50 ++++++++++++++------------------ src/js/controllers/index.js | 26 +++++++++-------- 2 files changed, 35 insertions(+), 41 deletions(-) diff --git a/src/js/controllers/disclaimer.js b/src/js/controllers/disclaimer.js index f1cedcc71..0ad075bca 100644 --- a/src/js/controllers/disclaimer.js +++ b/src/js/controllers/disclaimer.js @@ -1,47 +1,39 @@ 'use strict'; angular.module('copayApp.controllers').controller('disclaimerController', - function($scope, $timeout, $log, profileService, isCordova, storageService, gettextCatalog, uxLanguage, go) { + function($scope, $timeout, $log, profileService, isCordova, storageService, gettextCatalog, applicationService, uxLanguage, go) { - $scope.create = function(noWallet) { + + $scope.create = function() { $scope.creatingProfile = true; if (isCordova) { window.plugins.spinnerDialog.show(null, gettextCatalog.getString('Loading...'), true); } $scope.loading = true; - $timeout(function() { - storageService.setCopayDisclaimerFlag(function(err) { - if (isCordova) { - window.plugins.spinnerDialog.hide(); - } - profileService.create({ - noWallet: noWallet - }, function(err) { - if (err) { - $scope.creatingProfile = false; - $log.warn(err); - $scope.error = err; - $scope.$apply(); - $timeout(function() { - $scope.create(noWallet); - }, 3000); - } - }); - }); - }, 100); + storageService.setCopayDisclaimerFlag(function(err) { + $scope.creatingProfile = false; + if (isCordova) { + window.plugins.spinnerDialog.hide(); + } + applicationService.restart(); + }); }; - $scope.init = function() { + $scope.init = function(noWallet) { storageService.getCopayDisclaimerFlag(function(err, val) { $scope.lang = uxLanguage.currentLanguage; $scope.agreed = val; - if (profileService.profile) { - go.walletHome(); - } - $timeout(function() { - $scope.$digest(); - }, 1); + profileService.create({ + noWallet: noWallet + }, function(err) { + if (err) { + $log.warn(err); + $scope.error = err; + $scope.$apply(); + } + }); }); }; + }); diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js index 3dcedc4ae..dd359e663 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -142,7 +142,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r var defaults = configService.getDefaults(); var config = configService.getSync(); - self.usingCustomBWS = config.bwsFor && config.bwsFor[self.walletId] && (config.bwsFor[self.walletId] != defaults.bws.url); + self.usingCustomBWS = config.bwsFor && config.bwsFor[self.walletId] && (config.bwsFor[self.walletId] != defaults.bws.url); }; self.setTab = function(tab, reset, tries, switchState) { @@ -807,7 +807,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r return i_cb(null, newTxs); } - if (walletId == profileService.focusedClient.credentials.walletId) + if (walletId == profileService.focusedClient.credentials.walletId) self.txProgress = newTxs.length; $timeout(function() { @@ -822,7 +822,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r var newHistory = lodash.compact(txs.concat(txsFromLocal)); $log.debug('Tx History synced. Total Txs: ' + newHistory.length); - if (walletId == profileService.focusedClient.credentials.walletId) { + if (walletId == profileService.focusedClient.credentials.walletId) { self.completeHistory = newHistory; self.txHistory = newHistory.slice(0, self.historyShowLimit); self.historyShowShowAll = newHistory.length >= self.historyShowLimit; @@ -1295,15 +1295,17 @@ angular.module('copayApp.controllers').controller('indexController', function($r $rootScope.$on('Local/NewFocusedWallet', function() { self.setFocusedWallet(); self.updateTxHistory(); - go.walletHome(); - storageService.getCleanAndScanAddresses(function(err, walletId) { - if (walletId && profileService.walletClients[walletId]) { - $log.debug('Clear last address cache and Scan ', walletId); - addressService.expireAddress(walletId, function(err) { - self.startScan(walletId); - }); - storageService.removeCleanAndScanAddresses(function() {}); - } + storageService.getCopayDisclaimerFlag(function(err, val) { + if (val) go.walletHome(); + storageService.getCleanAndScanAddresses(function(err, walletId) { + if (walletId && profileService.walletClients[walletId]) { + $log.debug('Clear last address cache and Scan ', walletId); + addressService.expireAddress(walletId, function(err) { + self.startScan(walletId); + }); + storageService.removeCleanAndScanAddresses(function() {}); + } + }); }); }); From 04e989ce44398e6fde162f0d38c63ac6b71c3a32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Tue, 17 Nov 2015 12:39:51 -0300 Subject: [PATCH 005/183] error handling --- public/views/disclaimer.html | 2 +- src/js/controllers/disclaimer.js | 21 ++++++++++----------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/public/views/disclaimer.html b/public/views/disclaimer.html index aed44567e..b6f97f477 100644 --- a/public/views/disclaimer.html +++ b/public/views/disclaimer.html @@ -58,7 +58,7 @@
    -
    diff --git a/src/js/controllers/disclaimer.js b/src/js/controllers/disclaimer.js index 0ad075bca..8e038aee4 100644 --- a/src/js/controllers/disclaimer.js +++ b/src/js/controllers/disclaimer.js @@ -2,19 +2,11 @@ angular.module('copayApp.controllers').controller('disclaimerController', function($scope, $timeout, $log, profileService, isCordova, storageService, gettextCatalog, applicationService, uxLanguage, go) { - + self = this; + $scope.noProfile = true; $scope.create = function() { - $scope.creatingProfile = true; - if (isCordova) { - window.plugins.spinnerDialog.show(null, gettextCatalog.getString('Loading...'), true); - } - $scope.loading = true; storageService.setCopayDisclaimerFlag(function(err) { - $scope.creatingProfile = false; - if (isCordova) { - window.plugins.spinnerDialog.hide(); - } applicationService.restart(); }); }; @@ -27,10 +19,17 @@ angular.module('copayApp.controllers').controller('disclaimerController', profileService.create({ noWallet: noWallet }, function(err) { - if (err) { + if (err && !'EEXIST') { $log.warn(err); $scope.error = err; $scope.$apply(); + $scope.noProfile = true; + $timeout(function() { + $scope.init(); + }, 3000); + } else { + $scope.error = ""; + $scope.noProfile = false; } }); }); From 1e418ef0604b232525a67eb6d00704f3d5162a04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Tue, 17 Nov 2015 12:42:15 -0300 Subject: [PATCH 006/183] delete creating profile flag --- public/views/disclaimer.html | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/public/views/disclaimer.html b/public/views/disclaimer.html index b6f97f477..4dd615f7b 100644 --- a/public/views/disclaimer.html +++ b/public/views/disclaimer.html @@ -33,21 +33,9 @@
  • -
    +
    {{(error)|translate}}. Retrying...
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - Creating Profile... -
    -

    Official English Disclaimer @@ -56,7 +44,7 @@

    I affirm that I have read, understood, and agree with these terms.

    -
    +
    diff --git a/src/css/main.css b/src/css/main.css index bb4cf5588..16b0b35b1 100644 --- a/src/css/main.css +++ b/src/css/main.css @@ -1107,7 +1107,13 @@ input.ng-invalid-match, input.ng-invalid-match:focus { .scrollArea ul { font-size: 0.8rem; - text-align: left; + text-align: justify; + margin-left: 0; +} + +.scrollArea li { + list-style-type:none; + display: inline; } .tabbable { diff --git a/src/js/controllers/disclaimer.js b/src/js/controllers/disclaimer.js index 8e038aee4..be720f3f9 100644 --- a/src/js/controllers/disclaimer.js +++ b/src/js/controllers/disclaimer.js @@ -1,38 +1,37 @@ 'use strict'; angular.module('copayApp.controllers').controller('disclaimerController', - function($scope, $timeout, $log, profileService, isCordova, storageService, gettextCatalog, applicationService, uxLanguage, go) { + function($scope, $timeout, $log, profileService, isCordova, storageService, gettextCatalog, uxLanguage, go) { self = this; - $scope.noProfile = true; + $scope.lang = uxLanguage.currentLanguage; - $scope.create = function() { - storageService.setCopayDisclaimerFlag(function(err) { - applicationService.restart(); + $scope.goHome = function() { + go.walletHome(); + }; + + var create = function () { + $scope.creatingProfile = true; + profileService.create({}, function(err) { + + if (err) { + + if (err == 'EEXISTS') + return go.walletHome(); + + $log.warn(err); + $scope.error = err; + $scope.$apply(); + $timeout(function() { + $log.warn('Retrying to create profile......'); + create(); + }, 3000); + } else { + $scope.error = ""; + $scope.creatingProfile = false; + } }); }; - $scope.init = function(noWallet) { - storageService.getCopayDisclaimerFlag(function(err, val) { - $scope.lang = uxLanguage.currentLanguage; - $scope.agreed = val; - - profileService.create({ - noWallet: noWallet - }, function(err) { - if (err && !'EEXIST') { - $log.warn(err); - $scope.error = err; - $scope.$apply(); - $scope.noProfile = true; - $timeout(function() { - $scope.init(); - }, 3000); - } else { - $scope.error = ""; - $scope.noProfile = false; - } - }); - }); - }; +// create(); }); diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js index dd359e663..da6a734b5 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -1295,17 +1295,14 @@ angular.module('copayApp.controllers').controller('indexController', function($r $rootScope.$on('Local/NewFocusedWallet', function() { self.setFocusedWallet(); self.updateTxHistory(); - storageService.getCopayDisclaimerFlag(function(err, val) { - if (val) go.walletHome(); - storageService.getCleanAndScanAddresses(function(err, walletId) { - if (walletId && profileService.walletClients[walletId]) { - $log.debug('Clear last address cache and Scan ', walletId); - addressService.expireAddress(walletId, function(err) { - self.startScan(walletId); - }); - storageService.removeCleanAndScanAddresses(function() {}); - } - }); + storageService.getCleanAndScanAddresses(function(err, walletId) { + if (walletId && profileService.walletClients[walletId]) { + $log.debug('Clear last address cache and Scan ', walletId); + addressService.expireAddress(walletId, function(err) { + self.startScan(walletId); + }); + storageService.removeCleanAndScanAddresses(function() {}); + } }); }); diff --git a/src/js/routes.js b/src/js/routes.js index 44f7ca551..12e51be4c 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -75,17 +75,6 @@ angular // link: http://stackoverflow.com/questions/15606751/angular-changes-urls-to-unsafe-in-extension-page?lq=1 $compileProvider.imgSrcSanitizationWhitelist(/^\s*((https?|ftp|file|blob|chrome-extension):|data:image\/)/); - $stateProvider - .state('splash', { - url: '/splash', - needProfile: false, - views: { - 'main': { - templateUrl: 'views/splash.html', - } - } - }); - $stateProvider .state('translators', { url: '/translators', @@ -521,9 +510,6 @@ angular if (err) { if (err.message && err.message.match('NOPROFILE')) { $log.debug('No profile... redirecting'); - $state.transitionTo('splash'); - } else if (err.message && err.message.match('NONAGREEDDISCLAIMER')) { - $log.debug('Display disclaimer... redirecting'); $state.transitionTo('disclaimer'); } else { throw new Error(err); // TODO diff --git a/src/js/services/profileService.js b/src/js/services/profileService.js index f159deeaf..1770ea751 100644 --- a/src/js/services/profileService.js +++ b/src/js/services/profileService.js @@ -134,32 +134,26 @@ angular.module('copayApp.services') }; root.loadAndBindProfile = function(cb) { - storageService.getCopayDisclaimerFlag(function(err, val) { - if (!val) { - return cb(new Error('NONAGREEDDISCLAIMER: Non agreed disclaimer')); - } else { - storageService.getProfile(function(err, profile) { - if (err) { - $rootScope.$emit('Local/DeviceError', err); - return cb(err); - } - if (!profile) { - // Migration?? - storageService.tryToMigrate(function(err, migratedProfile) { - if (err) return cb(err); - if (!migratedProfile) - return cb(new Error('NOPROFILE: No profile')); - - profile = migratedProfile; - return root.bindProfile(profile, cb); - }) - } else { - $log.debug('Profile read'); - return root.bindProfile(profile, cb); - } - - }); + storageService.getProfile(function(err, profile) { + if (err) { + $rootScope.$emit('Local/DeviceError', err); + return cb(err); } + if (!profile) { + // Migration?? + storageService.tryToMigrate(function(err, migratedProfile) { + if (err) return cb(err); + if (!migratedProfile) + return cb(new Error('NOPROFILE: No profile')); + + profile = migratedProfile; + return root.bindProfile(profile, cb); + }) + } else { + $log.debug('Profile read'); + return root.bindProfile(profile, cb); + } + }); }; @@ -276,8 +270,8 @@ angular.module('copayApp.services') // check if exist if (lodash.find(root.profile.credentials, { - 'walletId': walletData.walletId - })) { + 'walletId': walletData.walletId + })) { return cb(gettext('Cannot join the same wallet more that once')); } } catch (ex) { diff --git a/src/js/services/storageService.js b/src/js/services/storageService.js index b9c2deb0e..9178cb69c 100644 --- a/src/js/services/storageService.js +++ b/src/js/services/storageService.js @@ -199,14 +199,6 @@ angular.module('copayApp.services') storage.remove('config', cb); }; - root.setCopayDisclaimerFlag = function(cb) { - storage.set('agreeDisclaimer', true, cb); - }; - - root.getCopayDisclaimerFlag = function(cb) { - storage.get('agreeDisclaimer', cb); - }; - root.setRemotePrefsStoredFlag = function(cb) { storage.set('remotePrefStored', true, cb); }; From c1d19a29739f658be5f2ada488c0a725df4a580d Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Tue, 17 Nov 2015 14:03:03 -0300 Subject: [PATCH 008/183] add title and button text --- public/views/disclaimer.html | 3 ++- src/css/main.css | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/public/views/disclaimer.html b/public/views/disclaimer.html index a75ce92c2..65ee16367 100644 --- a/public/views/disclaimer.html +++ b/public/views/disclaimer.html @@ -12,6 +12,7 @@
    +
    Terms of Use

      @@ -49,7 +50,7 @@
    diff --git a/src/css/main.css b/src/css/main.css index 16b0b35b1..bbc8e4ac7 100644 --- a/src/css/main.css +++ b/src/css/main.css @@ -1099,7 +1099,7 @@ input.ng-invalid-match, input.ng-invalid-match:focus { background: #213140; border: 1px solid #4B6178; border-radius: 5px; - margin: 1.6rem; + margin: 0 1.6rem 1.6rem 1.6rem; color: #A5B2BF; line-height: 30px; padding: 0.5rem; From 3fb2086407d211bf222d06610270f36a49c9e763 Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Tue, 17 Nov 2015 14:10:41 -0300 Subject: [PATCH 009/183] move title inside the scrolable area --- public/views/disclaimer.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/views/disclaimer.html b/public/views/disclaimer.html index 65ee16367..9c4cd2a92 100644 --- a/public/views/disclaimer.html +++ b/public/views/disclaimer.html @@ -12,9 +12,9 @@
    -
    Terms of Use

    +

    Terms of Use
    • The software you are about to use functions as a free, open source, and multi-signature digital wallet.
    • The software does not constitute an account where BitPay or other third parties serve as financial intermediaries or custodians of your bitcoin.
    • From 25300a1c4af9b41dc9f62e910f6ca77d7df13bc1 Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Tue, 17 Nov 2015 14:11:27 -0300 Subject: [PATCH 010/183] fix margins --- src/css/main.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/css/main.css b/src/css/main.css index bbc8e4ac7..16b0b35b1 100644 --- a/src/css/main.css +++ b/src/css/main.css @@ -1099,7 +1099,7 @@ input.ng-invalid-match, input.ng-invalid-match:focus { background: #213140; border: 1px solid #4B6178; border-radius: 5px; - margin: 0 1.6rem 1.6rem 1.6rem; + margin: 1.6rem; color: #A5B2BF; line-height: 30px; padding: 0.5rem; From e1ce85745b7bf12899b0015066ac1888fdcad8f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Tue, 17 Nov 2015 15:49:17 -0300 Subject: [PATCH 011/183] uncomment create function --- src/js/controllers/disclaimer.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/js/controllers/disclaimer.js b/src/js/controllers/disclaimer.js index be720f3f9..4d55984cc 100644 --- a/src/js/controllers/disclaimer.js +++ b/src/js/controllers/disclaimer.js @@ -9,13 +9,13 @@ angular.module('copayApp.controllers').controller('disclaimerController', go.walletHome(); }; - var create = function () { + var create = function() { $scope.creatingProfile = true; profileService.create({}, function(err) { if (err) { - if (err == 'EEXISTS') + if (err == 'EEXISTS') return go.walletHome(); $log.warn(err); @@ -32,6 +32,6 @@ angular.module('copayApp.controllers').controller('disclaimerController', }); }; -// create(); + create(); }); From 1c841e5f217082b7452efb65ef3853b4ec13f166 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Wed, 18 Nov 2015 10:41:06 -0300 Subject: [PATCH 012/183] moving delete wallet and request password to security preferences --- public/views/preferences.html | 16 ------------ public/views/preferencesAdvanced.html | 5 ---- public/views/preferencesDeleteWords.html | 3 +++ public/views/securityPreferences.html | 32 ++++++++++++++++++------ 4 files changed, 27 insertions(+), 29 deletions(-) diff --git a/public/views/preferences.html b/public/views/preferences.html index 7af803f41..1b905d09e 100644 --- a/public/views/preferences.html +++ b/public/views/preferences.html @@ -67,22 +67,6 @@
      Advanced
    -
    -

    - Spending Restrictions -

    -
      -
    • - -
      Request Password
      -
    • -
    • - -
      Scan Fingerprint
      -
    • -
    -
    -

    diff --git a/public/views/preferencesAdvanced.html b/public/views/preferencesAdvanced.html index 1fc70c1a0..195914114 100644 --- a/public/views/preferencesAdvanced.html +++ b/public/views/preferencesAdvanced.html @@ -28,11 +28,6 @@ Wallet Service URL - -
  • - -
    Delete Wallet
    -
  • diff --git a/public/views/preferencesDeleteWords.html b/public/views/preferencesDeleteWords.html index 218845048..0025f6808 100644 --- a/public/views/preferencesDeleteWords.html +++ b/public/views/preferencesDeleteWords.html @@ -22,6 +22,9 @@

    Once you have copied your wallet seed down, it is recommended to delete it from this device.

    +

    + Need to do backup +

    -
    - -

    - +

      - -
    • - -
      Delete seed words
      +
    • + +
      Delete Wallet
    • +
    • + +
      Delete seed words
      +
    +
    +

    + Spending Restrictions +

    +
      +
    • + +
      Request Password
      +
    • +
    • + +
      Scan Fingerprint
      +
    • +
    +
    +

    From eef61bfd51418ac958e4c57ea14169f411ec556a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Wed, 18 Nov 2015 15:14:09 -0300 Subject: [PATCH 013/183] security preferences in wallet preferences --- public/views/preferences.html | 42 +++++++++++++++++++----- public/views/preferencesAdvanced.html | 10 +++++- public/views/preferencesDeleteWords.html | 42 +++++++++++++++++------- public/views/securityPreferences.html | 35 -------------------- src/js/controllers/preferences.js | 17 ++++++---- src/js/routes.js | 12 ------- 6 files changed, 84 insertions(+), 74 deletions(-) delete mode 100644 public/views/securityPreferences.html diff --git a/public/views/preferences.html b/public/views/preferences.html index 1b905d09e..a75e66212 100644 --- a/public/views/preferences.html +++ b/public/views/preferences.html @@ -9,8 +9,8 @@

    -
      +
      • @@ -45,8 +45,6 @@
        Hardware wallet
      • -

        -

      • @@ -56,17 +54,45 @@
        Backup
      • - -
      • - -
        Security Preferences
        -
      • Advanced
      • +
      +

      + Security preferences +

      + +
      + +
        + +
      • + +
        Request Password
        +
      • + +
      • + +
        Scan Fingerprint
        +
      • +
      + +
      +
      + +
        +
      • + +
        Delete seed words
        +
      • +
      + +
      +
    +
    diff --git a/public/views/preferencesAdvanced.html b/public/views/preferencesAdvanced.html index 195914114..52bb3634f 100644 --- a/public/views/preferencesAdvanced.html +++ b/public/views/preferencesAdvanced.html @@ -7,6 +7,7 @@

    +
    • @@ -26,9 +27,16 @@
    • - Wallet Service URL +
      Wallet Service URL
    • + +
    • + +
      Delete Wallet
      +
    • +
    +
    diff --git a/public/views/preferencesDeleteWords.html b/public/views/preferencesDeleteWords.html index 0025f6808..796ec99bf 100644 --- a/public/views/preferencesDeleteWords.html +++ b/public/views/preferencesDeleteWords.html @@ -1,35 +1,53 @@
    + ng-init="titleSection='Delete Seed Words'; goBackToState = 'preferences'">

    +
    + Wallet: {{index.walletName}} ({{index.alias}}) +
    +

    Warning!

    +
    + {{preferences.error|translate}} +
    +
    -

    - Once you have copied your wallet seed down, it is recommended to delete it from this device. -

    -

    - Need to do backup -

    + +

    + + Once you have copied your wallet seed down, it is recommended to delete it from this device. + +

    + +

    + + Need to do backup + +

    + +
    -
    + +
    diff --git a/public/views/securityPreferences.html b/public/views/securityPreferences.html deleted file mode 100644 index 3ee9fce2e..000000000 --- a/public/views/securityPreferences.html +++ /dev/null @@ -1,35 +0,0 @@ -
    -
    - -
    -

    -
      -
    • - -
      Delete Wallet
      -
    • -
    • - -
      Delete seed words
      -
    • - -
    -
    -

    - Spending Restrictions -

    -
      -
    • - -
      Request Password
      -
    • -
    • - -
      Scan Fingerprint
      -
    • -
    -
    -

    diff --git a/src/js/controllers/preferences.js b/src/js/controllers/preferences.js index 1701f16be..046d4e6da 100644 --- a/src/js/controllers/preferences.js +++ b/src/js/controllers/preferences.js @@ -2,7 +2,13 @@ angular.module('copayApp.controllers').controller('preferencesController', function($scope, $rootScope, $timeout, $log, configService, profileService) { - + + var fc = profileService.focusedClient; + $scope.deleted = false; + if (fc.credentials && !fc.credentials.mnemonicEncrypted && !fc.credentials.mnemonic) { + $scope.deleted = true; + } + this.init = function() { var config = configService.getSync(); var fc = profileService.focusedClient; @@ -37,8 +43,8 @@ angular.module('copayApp.controllers').controller('preferencesController', }); }); } else { - if (!val && fc.hasPrivKeyEncrypted()) { - profileService.unlockFC(function(err){ + if (!val && fc.hasPrivKeyEncrypted()) { + profileService.unlockFC(function(err) { if (err) { $scope.encrypt = true; return; @@ -70,14 +76,13 @@ angular.module('copayApp.controllers').controller('preferencesController', opts.touchIdFor[walletId] = newVal; $rootScope.$emit('Local/RequestTouchid', function(err) { - if (err) { + if (err) { $log.debug(err); $timeout(function() { $scope.touchidError = true; $scope.touchid = oldVal; }, 100); - } - else { + } else { configService.set(opts, function(err) { if (err) { $log.debug(err); diff --git a/src/js/routes.js b/src/js/routes.js index 0e2da59b8..b2baef96c 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -286,18 +286,6 @@ angular } }) - .state('securityPreferences', { - url: '/securityPreferences', - templateUrl: 'views/securityPreferences.html', - walletShouldBeComplete: true, - needProfile: true, - views: { - 'main': { - templateUrl: 'views/securityPreferences.html' - }, - } - }) - .state('preferencesAdvanced', { url: '/preferencesAdvanced', templateUrl: 'views/preferencesAdvanced.html', From ebedb64237d1ca62b043506afe7edb1d5d0f6e08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Thu, 19 Nov 2015 15:15:36 -0300 Subject: [PATCH 014/183] refactor --- public/views/preferences.html | 1 + public/views/preferencesAdvanced.html | 2 +- public/views/preferencesDeleteWords.html | 4 ++-- src/js/controllers/preferencesDeleteWords.js | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/public/views/preferences.html b/public/views/preferences.html index a75e66212..8cd8e7649 100644 --- a/public/views/preferences.html +++ b/public/views/preferences.html @@ -93,6 +93,7 @@
    +

    diff --git a/public/views/preferencesAdvanced.html b/public/views/preferencesAdvanced.html index 52bb3634f..47a043629 100644 --- a/public/views/preferencesAdvanced.html +++ b/public/views/preferencesAdvanced.html @@ -27,7 +27,7 @@
  • -
    Wallet Service URL
    +
    Wallet Service URL
  • diff --git a/public/views/preferencesDeleteWords.html b/public/views/preferencesDeleteWords.html index 796ec99bf..d63f27be6 100644 --- a/public/views/preferencesDeleteWords.html +++ b/public/views/preferencesDeleteWords.html @@ -34,13 +34,13 @@

    -

    +

    Need to do backup

    -
  • -
    +
    Show advanced options diff --git a/src/js/controllers/walletHome.js b/src/js/controllers/walletHome.js index 9a14d960b..e4c04e26d 100644 --- a/src/js/controllers/walletHome.js +++ b/src/js/controllers/walletHome.js @@ -23,6 +23,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi this.isMobile = isMobile.any(); this.isWindowsPhoneApp = isMobile.Windows() && isCordova; this.blockUx = false; + this.disableAdvSend = false; this.isRateAvailable = false; this.showScanner = false; this.isMobile = isMobile.any(); @@ -1022,6 +1023,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi this.lockAmount = false; this.currentSendFeeLevel = null; this.hideAdvSend = true; + this.disableAdvSend = false; $scope.currentSpendUnconfirmed = configService.getSync().wallet.spendUnconfirmed; this._amount = this._address = null; @@ -1285,15 +1287,19 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi this.setForm(null, amount, null, feeRate); }; - this.sendAll = function(amount, feeStr, feeRate) { + this.sendAll = function(amount, feeStr, feeRate, currentFeeLevel) { var self = this; var msg = gettextCatalog.getString("{{fee}} will be deducted for bitcoin networking fees", { fee: feeStr }); confirmDialog.show(msg, function(confirmed) { - if (confirmed) + if (confirmed) { self._doSendAll(amount, feeRate); + self.disableAdvSend = true; + self.currentSendFeeLevel = currentFeeLevel; + $scope.currentSpendUnconfirmed = configService.getSync().wallet.spendUnconfirmed; + } }); }; From 95bac39e99c1cbd44fdd968a96d46232d027adaf Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Mon, 23 Nov 2015 12:56:43 -0300 Subject: [PATCH 019/183] Swipe to close modals --- public/views/modals/glidera-tx-details.html | 4 +++- public/views/modals/tx-details.html | 4 +++- public/views/modals/txp-details.html | 5 ++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/public/views/modals/glidera-tx-details.html b/public/views/modals/glidera-tx-details.html index 5902bbc72..14c4abbf2 100644 --- a/public/views/modals/glidera-tx-details.html +++ b/public/views/modals/glidera-tx-details.html @@ -12,7 +12,9 @@ -