From c59484bbb4307875694c43500ef200822ab5eda7 Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Wed, 13 May 2015 11:29:36 -0300 Subject: [PATCH 1/4] update animations --- src/css/mobile.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/css/mobile.css b/src/css/mobile.css index b78c5cdc4..e1929ad2d 100644 --- a/src/css/mobile.css +++ b/src/css/mobile.css @@ -404,12 +404,12 @@ to prevent collapsing during animation*/ left: 0; right: 0; - animation-timing-function: linear; + animation-timing-function: ease-in-out; animation-duration: .3s; animation-iteration-count: 1; animation-fill-mode: both; - -webkit-animation-timing-function: linear; + -webkit-animation-timing-function: ease-in-out; -webkit-animation-duration: .3s; -webkit-animation-iteration-count: 1; -webkit-animation-fill-mode: both; From 51ad7d83dc2d8a1bb12a4c518804fc98fb08c035 Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Wed, 13 May 2015 11:58:19 -0300 Subject: [PATCH 2/4] import on splash --- public/views/add.html | 7 ------- public/views/import.html | 6 ++++++ public/views/importLegacy.html | 8 +------- public/views/{splash/1.html => splash.html} | 4 +++- public/views/splash/2.html | 3 --- public/views/splash/3.html | 3 --- public/views/splash/4.html | 3 --- public/views/splash/5.html | 15 --------------- src/js/controllers/index.js | 2 +- src/js/models/profile.js | 5 ++++- src/js/routes.js | 10 +++++----- src/js/services/profileService.js | 14 ++++++++------ 12 files changed, 28 insertions(+), 52 deletions(-) rename public/views/{splash/1.html => splash.html} (84%) delete mode 100644 public/views/splash/2.html delete mode 100644 public/views/splash/3.html delete mode 100644 public/views/splash/4.html delete mode 100644 public/views/splash/5.html diff --git a/public/views/add.html b/public/views/add.html index 86c7505d4..d42824a7b 100644 --- a/public/views/add.html +++ b/public/views/add.html @@ -29,13 +29,6 @@ Import wallet -
  • - - - - Import from Copay Beta 0.9 - -
  • diff --git a/public/views/import.html b/public/views/import.html index 2edf34ff3..71e1dc4a7 100644 --- a/public/views/import.html +++ b/public/views/import.html @@ -54,6 +54,12 @@ Import backup + + + Importing Backup from Copay v0.9? Click here + + + diff --git a/public/views/importLegacy.html b/public/views/importLegacy.html index 8442f7208..0f9b09fff 100644 --- a/public/views/importLegacy.html +++ b/public/views/importLegacy.html @@ -1,18 +1,13 @@
    + ng-init="titleSection='Import legacy wallet'; goBackToState = 'import'; noColor = true">
    -
    -
    - Copay -
    -

    Importing...

    @@ -78,6 +73,5 @@
    -
    diff --git a/public/views/splash/1.html b/public/views/splash.html similarity index 84% rename from public/views/splash/1.html rename to public/views/splash.html index dcaf084c7..92cef28fa 100644 --- a/public/views/splash/1.html +++ b/public/views/splash.html @@ -22,10 +22,12 @@
    - Creating Wallet... + Creating Profile...
    +

    Already have a wallet?

    +
    diff --git a/public/views/splash/2.html b/public/views/splash/2.html deleted file mode 100644 index 9d902e76c..000000000 --- a/public/views/splash/2.html +++ /dev/null @@ -1,3 +0,0 @@ -
    - tour1 -
    diff --git a/public/views/splash/3.html b/public/views/splash/3.html deleted file mode 100644 index 53dfcd551..000000000 --- a/public/views/splash/3.html +++ /dev/null @@ -1,3 +0,0 @@ -
    - tour1 -
    diff --git a/public/views/splash/4.html b/public/views/splash/4.html deleted file mode 100644 index 47c02065b..000000000 --- a/public/views/splash/4.html +++ /dev/null @@ -1,3 +0,0 @@ -
    - tour1 -
    diff --git a/public/views/splash/5.html b/public/views/splash/5.html deleted file mode 100644 index 2612f963e..000000000 --- a/public/views/splash/5.html +++ /dev/null @@ -1,15 +0,0 @@ -
    - tour1 -
    -
    -
    - -
    -
    - -
    -
    \ No newline at end of file diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js index 2b24e300c..e3b4388d2 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -721,7 +721,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r self.noFocusedWallet = true; self.isComplete = null; self.walletName = null; - go.addWallet(); + go.path('import'); }); }); diff --git a/src/js/models/profile.js b/src/js/models/profile.js index c18967ded..b5374c1c1 100644 --- a/src/js/models/profile.js +++ b/src/js/models/profile.js @@ -14,17 +14,20 @@ Profile.create = function(opts) { var x = new Profile(); x.createdOn = Date.now(); - x.credentials = opts.credentials; + x.credentials = opts.credentials || []; return x; }; Profile.fromObj = function(obj) { var x = new Profile(); + x.createdOn = obj.createdOn; x.credentials = obj.credentials; + if (x.credentials[0] && typeof x.credentials[0] != 'object') throw ("credentials should be an object"); + return x; }; diff --git a/src/js/routes.js b/src/js/routes.js index a60dc0796..e0ebe98a3 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -68,23 +68,23 @@ angular needProfile: false, views: { 'main': { - templateUrl: 'views/splash/1.html', + templateUrl: 'views/splash.html', controller: function($scope, $timeout, $log, profileService, go) { if (profileService.profile) { go.walletHome(); } - $scope.create = function() { + $scope.create = function(noWallet) { $scope.creatingProfile = true; - profileService.create(function(err) { + profileService.create({noWallet: noWallet}, function(err) { if (err) { $scope.creatingProfile = false; $log.warn(err); $scope.error = err; $scope.$apply(); $timeout(function() { - $scope.create(); + $scope.create(noWallet); }, 3000); } }); @@ -384,7 +384,7 @@ angular create: 12, join: 12, import: 12, - importLegacy: 12 + importLegacy: 13 }; diff --git a/src/js/services/profileService.js b/src/js/services/profileService.js index 80ea5a1f0..e2d85d1ce 100644 --- a/src/js/services/profileService.js +++ b/src/js/services/profileService.js @@ -157,9 +157,13 @@ angular.module('copayApp.services') }); }; - root._createNewProfile = function(cb) { - var walletClient = bwcService.getClient(); + root._createNewProfile = function(opts, cb) { + if (opts.noWallet) { + return cb(null, Profile.create()); + } + + var walletClient = bwcService.getClient(); walletClient.createWallet('Personal Wallet', 'me', 1, 1, { network: 'livenet' }, function(err) { @@ -276,13 +280,11 @@ angular.module('copayApp.services') }); }; - - - root.create = function(cb) { + root.create = function(opts, cb) { $log.info('Creating profile'); configService.get(function(err) { root.applyConfig(); - root._createNewProfile(function(err, p) { + root._createNewProfile(opts, function(err, p) { if (err) return cb(err); root.bindProfile(p, function(err) { From bd103fbd4f4428ab731ca5e8f5084538ed1d3d99 Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Wed, 13 May 2015 12:22:08 -0300 Subject: [PATCH 3/4] design review --- public/views/import.html | 14 +++++++++----- public/views/importLegacy.html | 6 ++++-- public/views/preferences.html | 1 - 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/public/views/import.html b/public/views/import.html index 71e1dc4a7..937436502 100644 --- a/public/views/import.html +++ b/public/views/import.html @@ -49,16 +49,20 @@ - - - Importing Backup from Copay v0.9? Click here - - +
    +

    Have a Backup from Copay v0.9?

    + + + +
    diff --git a/public/views/importLegacy.html b/public/views/importLegacy.html index 0f9b09fff..c4410aa78 100644 --- a/public/views/importLegacy.html +++ b/public/views/importLegacy.html @@ -8,7 +8,7 @@
    -
    +

    Importing...

      @@ -64,9 +64,11 @@
    - +
    diff --git a/public/views/preferences.html b/public/views/preferences.html index 8281eb458..523ef6b7e 100644 --- a/public/views/preferences.html +++ b/public/views/preferences.html @@ -51,7 +51,6 @@ {{preferences.unitName}} -
  • Alternative Currency From 9f5d09f1cca7b8edeeab5c0c66c8638c2952561a Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Wed, 13 May 2015 12:41:05 -0300 Subject: [PATCH 4/4] fix colors --- public/views/includes/topbar.html | 2 +- public/views/preferences.html | 7 ++++--- public/views/walletHome.html | 6 +++++- src/css/mobile.css | 2 +- src/js/controllers/preferences.js | 5 ++++- src/js/controllers/preferencesColor.js | 2 +- src/js/controllers/walletHome.js | 3 +++ 7 files changed, 19 insertions(+), 8 deletions(-) diff --git a/public/views/includes/topbar.html b/public/views/includes/topbar.html index 8ec5880ca..4be35bfbc 100644 --- a/public/views/includes/topbar.html +++ b/public/views/includes/topbar.html @@ -20,7 +20,7 @@
    -

    +

    {{(titleSection|translate) || index.walletName}}

    diff --git a/public/views/preferences.html b/public/views/preferences.html index 523ef6b7e..d40d26613 100644 --- a/public/views/preferences.html +++ b/public/views/preferences.html @@ -8,14 +8,14 @@
    -
      +

        {{index.walletName}} settings

      • Color - +
      • @@ -23,7 +23,6 @@
      • -

         

      • @@ -33,6 +32,8 @@ Advanced
      • +
      +

        Global settings

        diff --git a/public/views/walletHome.html b/public/views/walletHome.html index a06c86496..543b1c200 100644 --- a/public/views/walletHome.html +++ b/public/views/walletHome.html @@ -10,6 +10,10 @@ You do not have any wallet
    + +
    + +
  • @@ -457,4 +461,4 @@
    -
    +
    diff --git a/src/css/mobile.css b/src/css/mobile.css index e1929ad2d..f4fab59a6 100644 --- a/src/css/mobile.css +++ b/src/css/mobile.css @@ -97,7 +97,7 @@ _:-ms-fullscreen, :root .main { } .tab-bar h1 { - color: #1ABC9C; + color: #7A8C9E; font-weight: 500; font-size: 14px; } diff --git a/src/js/controllers/preferences.js b/src/js/controllers/preferences.js index ba63e4225..742db5a84 100644 --- a/src/js/controllers/preferences.js +++ b/src/js/controllers/preferences.js @@ -10,10 +10,13 @@ angular.module('copayApp.controllers').controller('preferencesController', isoCode: config.wallet.settings.alternativeIsoCode }; var fc = profileService.focusedClient; - $scope.encrypt = fc.hasPrivKeyEncrypted(); + if (fc) + $scope.encrypt = fc.hasPrivKeyEncrypted(); var unwatch = $scope.$watch('encrypt', function(val) { var fc = profileService.focusedClient; + if (!fc) return; + if (val && !fc.hasPrivKeyEncrypted()) { $rootScope.$emit('Local/NeedsPassword', true, function(err, password) { if (err || !password) { diff --git a/src/js/controllers/preferencesColor.js b/src/js/controllers/preferencesColor.js index d6e7fe823..d01a878fb 100644 --- a/src/js/controllers/preferencesColor.js +++ b/src/js/controllers/preferencesColor.js @@ -4,6 +4,7 @@ angular.module('copayApp.controllers').controller('preferencesColorController', function($scope, configService, profileService, go) { var config = configService.getSync(); this.colorOpts = [ + '#7A8C9E', '#F38F12', '#F4D03F', '#4A90E2', @@ -11,7 +12,6 @@ angular.module('copayApp.controllers').controller('preferencesColorController', '#9B59B6', '#E856EF', '#F883B4', - '#7A8C9E', ]; var fc = profileService.focusedClient; diff --git a/src/js/controllers/walletHome.js b/src/js/controllers/walletHome.js index cf35c0bb3..1f9894080 100644 --- a/src/js/controllers/walletHome.js +++ b/src/js/controllers/walletHome.js @@ -356,6 +356,9 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi return; var fc = profileService.focusedClient; + if (!fc) + return; + $timeout(function() { storageService.getLastAddress(fc.credentials.walletId, function(err, addr) { if (addr) {