diff --git a/Gruntfile.js b/Gruntfile.js index 1ef8ef2cf..05df4524b 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -28,8 +28,11 @@ module.exports = function(grunt) { chrome: { command: 'make -C chrome-app ' }, - wp: { - command: 'make -C cordova wp', + wpinit: { + command: 'make -C cordova wp-init', + }, + wpcopy: { + command: 'make -C cordova wp-copy', }, ios: { command: 'make -C cordova ios', @@ -254,7 +257,8 @@ module.exports = function(grunt) { grunt.registerTask('osx', ['prod', 'nwjs', 'exec:osx']); grunt.registerTask('chrome', ['exec:chrome']); grunt.registerTask('wp', ['prod', 'exec:wp']); - grunt.registerTask('wp-debug', ['default', 'exec:wp']); + grunt.registerTask('wp-copy', ['default', 'exec:wpcopy']); + grunt.registerTask('wp-init', ['default', 'exec:wpinit']); grunt.registerTask('ios', ['prod', 'exec:ios']); grunt.registerTask('ios-debug', ['default', 'exec:ios']); grunt.registerTask('ios-run', ['exec:xcode']); diff --git a/app-template/Makefile b/app-template/Makefile index 058cbce10..f18321402 100644 --- a/app-template/Makefile +++ b/app-template/Makefile @@ -8,7 +8,7 @@ clean: rm -Rf $(WORKDIR)* -$(WORKDIR)android $(WORKDIR)ios $(WORKDIR)wp: config.xml +$(WORKDIR)android $(WORKDIR)ios: config.xml cordova create $@ com.bitpay.*NAMENOSPACE* *NAMECASENOSPACE* || echo "Project Path Existed" cp ProjectMakefile $@/Makefile rm -r $@/www && ln -sF ../../public $@/www @@ -27,16 +27,23 @@ android: project-android cp -R android/res/* $(WORKDIR)android/platforms/android/res make -C $(WORKDIR)android build-android +wp-init: config.xml + cordova create $(WORKDIR)$@ com.bitpay.*NAMENOSPACE* *NAMECASENOSPACE* || echo "Project Path Existed" + cp ProjectMakefile $(WORKDIR)$@/Makefile + mkdir -p $(WORKDIR)$@/www + cp -Rf ../public/* $(WORKDIR)$@/www + cp config.xml $(WORKDIR)$@/config.xml + make -C $(WORKDIR)$@ $(subst $(WORKDIR),, $(WORKDIR)$@) -wp: build-wp - cp -vf wp/Properties/* $

Create new wallet

- +

Join shared wallet

- +
- +

Import wallet

- +
diff --git a/public/views/amazon.html b/public/views/amazon.html index 1d145f05e..49edf5f46 100644 --- a/public/views/amazon.html +++ b/public/views/amazon.html @@ -1,8 +1,8 @@ - Gift cards @@ -21,7 +21,7 @@
- @@ -36,12 +36,12 @@ Buy Gift Card - +
-
+
Your cards
-
+
-
@@ -106,13 +104,13 @@ Claim code: {{buy.giftCard.claimCode}}
-
-
diff --git a/public/views/buyGlidera.html b/public/views/buyGlidera.html index ff7d0bd54..bdbdd6cf0 100644 --- a/public/views/buyGlidera.html +++ b/public/views/buyGlidera.html @@ -24,7 +24,7 @@ (remaining {{limits.monthlyBuyRemaining|currency:'':2}} {{limits.currency}})
-
+
This operation was disabled because you have a pending first transaction @@ -35,7 +35,7 @@
-
+
diff --git a/public/views/copayers.html b/public/views/copayers.html index aa5b8f626..0e8a0f7de 100644 --- a/public/views/copayers.html +++ b/public/views/copayers.html @@ -1,15 +1,12 @@ - + - {{wallet.name}} - - - + + + - +

Share this invitation with your copayers

@@ -43,14 +40,14 @@ [ {{wallet.m}}-of-{{wallet.n}} ] -
+
- + Waiting...
-
diff --git a/public/views/glidera.html b/public/views/glidera.html index 10cfcc304..4933fa584 100644 --- a/public/views/glidera.html +++ b/public/views/glidera.html @@ -1,8 +1,8 @@ - Glidera @@ -39,7 +39,7 @@

Connect your Glidera account to get started

- @@ -51,7 +51,7 @@
-
+
@@ -90,7 +90,7 @@ {{email}} - +
-
-
+
+
Activity
- + + {{'Import Wallet' | translate}} + + + + -
- - - - - - - - - - - + +
+
+ Recovery phrase +
+
+ File/Text +
+
+ Hardware wallet +
-
- - - - - - - - - - - -
- - +
+
+
+
diff --git a/public/views/includes/copayers.html b/public/views/includes/copayers.html index ae519e35a..2ab3e5f49 100644 --- a/public/views/includes/copayers.html +++ b/public/views/includes/copayers.html @@ -1,10 +1,8 @@ -
    -
  • - - {{'Me'|translate}} +
    + + {{'Me'|translate}} - - {{copayer.name}} + + {{copayer.name}} -
  • -
+
diff --git a/public/views/includes/txp.html b/public/views/includes/txp.html index 183c49f90..584216ba1 100644 --- a/public/views/includes/txp.html +++ b/public/views/includes/txp.html @@ -1,5 +1,8 @@
+
+ {{tx.amountStr}} +
{{addressbook[tx.toAddress]}} @@ -18,11 +21,6 @@ -
- {{tx.amountStr}} -
- -

{{tx.wallet.name}} diff --git a/public/views/modals/amazon-card-details.html b/public/views/modals/amazon-card-details.html index 528933a6c..de0fa25ca 100644 --- a/public/views/modals/amazon-card-details.html +++ b/public/views/modals/amazon-card-details.html @@ -1,7 +1,6 @@ - -

Details

@@ -23,7 +22,7 @@ Claim code: {{card.claimCode}}
- @@ -48,18 +47,12 @@
- -
- - {{error}} - -
- -
+
There was a failure to the create gift card. Please, contact BitPay support.
@@ -86,7 +79,7 @@
-
+
* Amazon.com is not a sponsor of this promotion. Except as required by law, Amazon.com Gift Cards ("GCs") cannot be transferred for value or redeemed for cash. GCs may be used only for purchases of diff --git a/public/views/modals/glidera-tx-details.html b/public/views/modals/glidera-tx-details.html index 34e3992d5..1e2dd1261 100644 --- a/public/views/modals/glidera-tx-details.html +++ b/public/views/modals/glidera-tx-details.html @@ -1,6 +1,6 @@ - diff --git a/public/views/onboarding/terms.html b/public/views/onboarding/terms.html index 1977b6a6e..61767e604 100644 --- a/public/views/onboarding/terms.html +++ b/public/views/onboarding/terms.html @@ -10,7 +10,7 @@
diff --git a/public/views/onboarding/welcome.html b/public/views/onboarding/welcome.html index 1c97d5274..f71e8a053 100644 --- a/public/views/onboarding/welcome.html +++ b/public/views/onboarding/welcome.html @@ -14,7 +14,7 @@
- +
diff --git a/public/views/preferences.html b/public/views/preferences.html index 27f1c2bc5..fa1b74027 100644 --- a/public/views/preferences.html +++ b/public/views/preferences.html @@ -7,41 +7,41 @@ diff --git a/public/views/preferencesAbout.html b/public/views/preferencesAbout.html index 1604fe98e..ce5d07776 100644 --- a/public/views/preferencesAbout.html +++ b/public/views/preferencesAbout.html @@ -27,21 +27,21 @@
- - - + +
diff --git a/public/views/preferencesAdvanced.html b/public/views/preferencesAdvanced.html index 2c821f634..e2a87c140 100644 --- a/public/views/preferencesAdvanced.html +++ b/public/views/preferencesAdvanced.html @@ -9,30 +9,30 @@ diff --git a/public/views/preferencesGlidera.html b/public/views/preferencesGlidera.html index d34ef5ff1..6adc813d2 100644 --- a/public/views/preferencesGlidera.html +++ b/public/views/preferencesGlidera.html @@ -10,7 +10,8 @@ -
    +
      +
      Permissions
      @@ -38,10 +39,9 @@ {{permissions.transaction_history}} -
    +
-
    +
    Email
    @@ -57,10 +57,9 @@ {{email.userEmailIsSetup}} -
+
-
    +
    Personal Information
    @@ -137,10 +136,9 @@ {{personalInfo.basicInfoState}} -
+
-
    +
    Status
    @@ -200,10 +198,9 @@ {{status.country}} -
+
-
    +
    Limits
    @@ -262,9 +259,8 @@ {{limits.transactDisabledPendingFirstTransaction}} -
+
-
    Account
    diff --git a/public/views/sellGlidera.html b/public/views/sellGlidera.html index e6aa011a0..8d18628b5 100644 --- a/public/views/sellGlidera.html +++ b/public/views/sellGlidera.html @@ -34,7 +34,7 @@ -
    +
    diff --git a/public/views/tab-home.html b/public/views/tab-home.html index c323373cf..a31f00002 100644 --- a/public/views/tab-home.html +++ b/public/views/tab-home.html @@ -9,7 +9,7 @@ + diff --git a/public/views/tab-import-phrase.html b/public/views/tab-import-phrase.html index 0473f6944..91447b758 100644 --- a/public/views/tab-import-phrase.html +++ b/public/views/tab-import-phrase.html @@ -1,84 +1,66 @@ - - - - - - Import wallet - +
    +
    Could not access the wallet at the server. Please check:
    +
      +
    • The password of the recovery phrase (if set)
    • +
    • The derivation path
    • +
    • The wallet service URL
    • +
    +
    + NOTE: To import a wallet from a 3rd party software, please go to Add Wallet > Create Wallet, and specify the Recovery Phrase there. +
    +
    - - -
    -
    Could not access the wallet at the server. Please check:
    -
      -
    • The password of the recovery phrase (if set)
    • -
    • The derivation path
    • -
    • The wallet service URL
    • -
    -
    - NOTE: To import a wallet from a 3rd party software, please go to Add Wallet > Create Wallet, and specify the Recovery Phrase there. +
    +
    +
    +
    + +
    +
    +
    - -
    + + Show advanced options + Hide advanced options + -
    -
    - -
    -
    - -
    -
    +
    + - - Show advanced options - Hide advanced options - + -
    + - + + Testnet + +
    +
    - - - - - - Testnet - -
    -
    - - -
    - - + + diff --git a/public/views/tab-settings.html b/public/views/tab-settings.html index 1b8220bb6..f7d2942a1 100644 --- a/public/views/tab-settings.html +++ b/public/views/tab-settings.html @@ -6,48 +6,49 @@
    - + +
    Preferences
    - + + - + + - + + - + +
    Notifications
    @@ -84,7 +85,7 @@
    Wallets Preferences
    -
    @@ -95,15 +96,15 @@ Incomplete - -
    + +
    - + +
    diff --git a/public/views/walletDetails.html b/public/views/walletDetails.html index 78cd5ce10..0bef1c79b 100644 --- a/public/views/walletDetails.html +++ b/public/views/walletDetails.html @@ -10,22 +10,7 @@ -
    - No Wallet - - Go home - -
    - - - - - -
    +
    diff --git a/src/js/controllers/copayers.js b/src/js/controllers/copayers.js index 9e52e635a..b95a22121 100644 --- a/src/js/controllers/copayers.js +++ b/src/js/controllers/copayers.js @@ -1,13 +1,15 @@ 'use strict'; angular.module('copayApp.controllers').controller('copayersController', - function($scope, $log, $ionicPopup, profileService, platformInfo, gettextCatalog, $stateParams, ongoingProcess, $state) { + function($scope, $log, $ionicNavBarDelegate, $stateParams, $state, profileService, popupService, platformInfo, gettextCatalog, ongoingProcess) { if (!$stateParams.walletId) { $log.debug('No wallet provided...back to home'); - return $state.transitionTo('tabs.home'); + return $state.go('tabs.home'); } var wallet = profileService.getWallet($stateParams.walletId); + $ionicNavBarDelegate.title(wallet.name); + var secret; try { secret = wallet.status.wallet.secret; @@ -15,28 +17,12 @@ angular.module('copayApp.controllers').controller('copayersController', $scope.wallet = wallet; $scope.secret = secret; + $scope.copayers = wallet.status.wallet.copayers; $scope.isCordova = platformInfo.isCordova; $scope.showDeletePopup = function() { - var popup = $ionicPopup.show({ - template: '' + gettextCatalog.getString('Are you sure you want to delete this wallet?') + '', - title: gettextCatalog.getString('Confirm'), - buttons: [ - { - text: gettextCatalog.getString('Cancel'), - onTap: function(e) { - popup.close(); - } - }, - { - text: gettextCatalog.getString('Accept'), - type: 'button-positive', - onTap: function(e) { - deleteWallet(); - popup.close(); - } - } - ] + popupService.showConfirm(gettextCatalog.getString('Confirm'), gettextCatalog.getString('Are you sure you want to delete this wallet?'), function(res) { + if (res) deleteWallet(); }); }; @@ -47,7 +33,7 @@ angular.module('copayApp.controllers').controller('copayersController', if (err) { popupService.showAlert(gettextCatalog.getString('Error'), err.message || err); } else { - $state.transitionTo('tabs.home'); + $state.go('tabs.home'); } }); }; diff --git a/src/js/controllers/import.js b/src/js/controllers/import.js index 4ba74e011..01d452c6b 100644 --- a/src/js/controllers/import.js +++ b/src/js/controllers/import.js @@ -1,21 +1,26 @@ 'use strict'; angular.module('copayApp.controllers').controller('importController', - function($scope, $rootScope, $timeout, $log, $state, $stateParams, $ionicHistory, profileService, configService, sjcl, gettext, ledger, trezor, derivationPathHelper, platformInfo, bwcService, ongoingProcess, walletService, popupService, gettextCatalog) { + function($scope, $timeout, $log, $state, $stateParams, profileService, configService, sjcl, ledger, trezor, derivationPathHelper, platformInfo, bwcService, ongoingProcess, walletService, popupService, gettextCatalog) { var isChromeApp = platformInfo.isChromeApp; var isDevel = platformInfo.isDevel; var reader = new FileReader(); var defaults = configService.getDefaults(); var errors = bwcService.getErrors(); - $scope.isSafari = platformInfo.isSafari; - $scope.isCordova = platformInfo.isCordova; - $scope.bwsurl = defaults.bws.url; - $scope.derivationPath = derivationPathHelper.default; - $scope.account = 1; - $scope.importErr = false; - var updateSeedSourceSelect = function() { + $scope.init = function() { + $scope.isSafari = platformInfo.isSafari; + $scope.isCordova = platformInfo.isCordova; + $scope.formData = {}; + $scope.formData.bwsurl = defaults.bws.url; + $scope.formData.derivationPath = derivationPathHelper.default; + $scope.formData.account = 1; + $scope.importErr = false; + + if ($stateParams.code) + $scope.processWalletInfo($stateParams.code); + $scope.seedOptions = []; if (isChromeApp) { @@ -36,6 +41,7 @@ angular.module('copayApp.controllers').controller('importController', $scope.processWalletInfo = function(code) { if (!code) return; + $scope.importErr = false; var parsedCode = code.split('|'); @@ -56,26 +62,19 @@ angular.module('copayApp.controllers').controller('importController', if (info.type == 1 && info.hasPassphrase) popupService.showAlert(gettextCatalog.getString('Password required. Make sure to enter your password in advanced options')); - $scope.derivationPath = info.derivationPath; - $scope.testnetEnabled = info.network == 'testnet' ? true : false; + $scope.formData.derivationPath = info.derivationPath; + $scope.formData.testnetEnabled = info.network == 'testnet' ? true : false; $timeout(function() { - $scope.words = info.data; - $rootScope.$apply(); - }, 1); - }; - - $scope.setType = function(type) { - $scope.type = type; - $timeout(function() { - $rootScope.$apply(); + $scope.formData.words = info.data; + $scope.$apply(); }, 1); }; var _importBlob = function(str, opts) { var str2, err; try { - str2 = sjcl.decrypt($scope.password, str); + str2 = sjcl.decrypt($scope.formData.password, str); } catch (e) { err = gettextCatalog.getString('Could not decrypt file, check your password'); $log.warn(e); @@ -83,9 +82,6 @@ angular.module('copayApp.controllers').controller('importController', if (err) { popupService.showAlert(gettextCatalog.getString('Error'), err); - $timeout(function() { - $rootScope.$apply(); - }); return; } @@ -147,7 +143,7 @@ angular.module('copayApp.controllers').controller('importController', if (err) $log.error(err); }); } - + $state.go('tabs.home'); }); }, 100); @@ -176,11 +172,8 @@ angular.module('copayApp.controllers').controller('importController', }, 100); }; - $scope.setDerivationPath = function(testnetEnabled) { - if (testnetEnabled) - $scope.derivationPath = derivationPathHelper.defaultTestnet; - else - $scope.derivationPath = derivationPathHelper.default; + $scope.setDerivationPath = function() { + $scope.formData.derivationPath = $scope.formData.testnetEnabled ? derivationPathHelper.defaultTestnet : derivationPathHelper.default; }; $scope.getFile = function() { @@ -188,7 +181,7 @@ angular.module('copayApp.controllers').controller('importController', reader.onloadend = function(evt) { if (evt.target.readyState == FileReader.DONE) { // DONE == 2 var opts = {}; - opts.bwsurl = $scope.bwsurl; + opts.bwsurl = $scope.formData.bwsurl; _importBlob(evt.target.result, opts); } } @@ -200,9 +193,9 @@ angular.module('copayApp.controllers').controller('importController', return; } - var backupFile = $scope.file; - var backupText = form.backupText.$modelValue; - var password = form.password.$modelValue; + var backupFile = $scope.formData.file; + var backupText = $scope.formData.backupText; + var password = $scope.formData.password; if (!backupFile && !backupText) { popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('Please, select your backup file')); @@ -213,7 +206,7 @@ angular.module('copayApp.controllers').controller('importController', reader.readAsBinaryString(backupFile); } else { var opts = {}; - opts.bwsurl = $scope.bwsurl; + opts.bwsurl = $scope.formData.bwsurl; _importBlob(backupText, opts); } }; @@ -225,19 +218,22 @@ angular.module('copayApp.controllers').controller('importController', } var opts = {}; - if ($scope.bwsurl) - opts.bwsurl = $scope.bwsurl; - var pathData = derivationPathHelper.parse($scope.derivationPath); + if ($scope.formData.bwsurl) + opts.bwsurl = $scope.formData.bwsurl; + + var pathData = derivationPathHelper.parse($scope.formData.derivationPath); + if (!pathData) { popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('Invalid derivation path')); return; } + opts.account = pathData.account; opts.networkName = pathData.networkName; opts.derivationStrategy = pathData.derivationStrategy; - var words = form.words.$modelValue || null; + var words = $scope.formData.words || null; if (!words) { popupService.showAlert(gettextCatalog.getString('Please enter the recovery phrase')); @@ -254,9 +250,7 @@ angular.module('copayApp.controllers').controller('importController', } } - var passphrase = form.passphrase.$modelValue; - opts.passphrase = form.passphrase.$modelValue || null; - + opts.passphrase = $scope.formData.passphrase || null; _importMnemonic(words, opts); }; @@ -269,7 +263,7 @@ angular.module('copayApp.controllers').controller('importController', } lopts.externalSource = 'trezor'; - lopts.bwsurl = $scope.bwsurl; + lopts.bwsurl = $scope.formData.bwsurl; ongoingProcess.set('importingWallet', true); $log.debug('Import opts', lopts); @@ -285,45 +279,37 @@ angular.module('copayApp.controllers').controller('importController', }; $scope.importHW = function(form) { - if (form.$invalid || $scope.account < 0) { + if (form.$invalid || $scope.formData.ccount < 0) { popupService.showAlert(gettextCatalog.getString('There is an error in the form')); return; } + $scope.importErr = false; - var account = +$scope.account; + var account = $scope.formData.ccount; - if ($scope.seedSourceId == 'trezor') { + if ($scope.seedSource.id == 'trezor') { if (account < 1) { - $scope.error = gettext('Invalid account number'); + popupService.showAlert(gettextCatalog.getString('Invalid account number')); return; } account = account - 1; } - switch ($scope.seedSourceId) { + switch ($scope.seedSource.id) { case ('ledger'): ongoingProcess.set('connectingledger', true); $scope.importLedger(account); break; case ('trezor'): ongoingProcess.set('connectingtrezor', true); - $scope.importTrezor(account, $scope.isMultisig); + $scope.importTrezor(account, $scope.formData.isMultisig); break; default: throw ('Error: bad source id'); }; }; - $scope.setSeedSource = function() { - - if (!$scope.seedSource) return; - $scope.seedSourceId = $scope.seedSource.id; - $timeout(function() { - $rootScope.$apply(); - }); - }; - $scope.importLedger = function(account) { ledger.getInfoForNewWallet(true, account, function(err, lopts) { ongoingProcess.clear(); @@ -333,7 +319,7 @@ angular.module('copayApp.controllers').controller('importController', } lopts.externalSource = 'ledger'; - lopts.bwsurl = $scope.bwsurl; + lopts.bwsurl = $scope.formData.bwsurl; ongoingProcess.set('importingWallet', true); $log.debug('Import opts', lopts); @@ -349,7 +335,6 @@ angular.module('copayApp.controllers').controller('importController', }; var finish = function(wallet) { - walletService.updateRemotePreferences(wallet, {}, function() { $log.debug('Remote preferences saved for:' + wallet.credentials.walletId) }); @@ -362,8 +347,4 @@ angular.module('copayApp.controllers').controller('importController', } $state.go('tabs.home'); }; - - updateSeedSourceSelect(); - $scope.setSeedSource(); - if ($stateParams.code) $scope.processWalletInfo($stateParams.code); }); diff --git a/src/js/controllers/modals/txpDetails.js b/src/js/controllers/modals/txpDetails.js index a9fd5656c..bfd04e3e3 100644 --- a/src/js/controllers/modals/txpDetails.js +++ b/src/js/controllers/modals/txpDetails.js @@ -5,6 +5,7 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi var tx = $scope.tx; var copayers = $scope.copayers; var isGlidera = $scope.isGlidera; + var GLIDERA_LOCK_TIME = 6 * 60 * 60; var now = Math.floor(Date.now() / 1000); $scope.loading = null; diff --git a/src/js/controllers/onboarding/terms.js b/src/js/controllers/onboarding/terms.js index a76d52b96..ac9473933 100644 --- a/src/js/controllers/onboarding/terms.js +++ b/src/js/controllers/onboarding/terms.js @@ -2,6 +2,7 @@ angular.module('copayApp.controllers').controller('termsController', function($scope, $log, $state, uxLanguage, profileService, externalLinkService) { $scope.lang = uxLanguage.currentLanguage; + $scope.disclaimerUrl = $window.appConfig.disclaimerUrl; $scope.confirm = function() { profileService.setDisclaimerAccepted(function(err) { diff --git a/src/js/controllers/onboarding/welcomeController.js b/src/js/controllers/onboarding/welcomeController.js index f08a5b5eb..bb74b9206 100644 --- a/src/js/controllers/onboarding/welcomeController.js +++ b/src/js/controllers/onboarding/welcomeController.js @@ -3,7 +3,7 @@ angular.module('copayApp.controllers').controller('welcomeController', function($scope, $state, $timeout, $log, $ionicPopup, profileService) { $scope.goImport = function(code) { - $state.go('onboarding.import.phrase', { + $state.go('onboarding.import', { fromOnboarding: true, code: code }); diff --git a/src/js/controllers/preferencesGlidera.js b/src/js/controllers/preferencesGlidera.js index ca372a67d..86c3516af 100644 --- a/src/js/controllers/preferencesGlidera.js +++ b/src/js/controllers/preferencesGlidera.js @@ -51,7 +51,7 @@ angular.module('copayApp.controllers').controller('preferencesGlideraController' if (permissions.view_email_address && opts.fullUpdate) { glideraService.getEmail(accessToken, function(err, data) { - $scope.email = data.email; + $scope.email = data; }); } if (permissions.personal_info && opts.fullUpdate) { diff --git a/src/js/controllers/tab-home.js b/src/js/controllers/tab-home.js index 3abf9f157..18f0b236a 100644 --- a/src/js/controllers/tab-home.js +++ b/src/js/controllers/tab-home.js @@ -1,19 +1,37 @@ 'use strict'; angular.module('copayApp.controllers').controller('tabHomeController', - function($rootScope, $timeout, $scope, $state, $ionicScrollDelegate, lodash, profileService, walletService, configService, txFormatService, $ionicModal, $log, platformInfo, storageService, txpModalService, $window) { - + function($rootScope, $timeout, $scope, $state, $ionicScrollDelegate, lodash, profileService, walletService, configService, $log, platformInfo, storageService, txpModalService, $window) { $scope.externalServices = {}; $scope.bitpayCardEnabled = true; // TODO + $scope.openTxpModal = txpModalService.open; + $scope.version = $window.version; + $scope.name = $window.appConfig.nameCase; + configService.whenAvailable(function() { + var config = configService.getSync(); + var isWindowsPhoneApp = platformInfo.isWP && platformInfo.isCordova; + $scope.glideraEnabled = config.glidera.enabled && !isWindowsPhoneApp; + $scope.coinbaseEnabled = config.coinbase.enabled && !isWindowsPhoneApp; + }); + + $scope.openWallet = function(wallet) { + if (!wallet.isComplete()) { + return $state.go('tabs.copayers', { + walletId: wallet.credentials.walletId + }); + } + + $state.go('tabs.details', { + walletId: wallet.credentials.walletId + }); + }; function updateTxps() { profileService.getTxps({ limit: 3 }, function(err, txps, n) { - if (err) { - console.log('[tab-home.js.35:err:]', $log.error(err)); //TODO - } + if (err) $log.error(err); $scope.txps = txps; $scope.txpsN = n; $ionicScrollDelegate.resize(); @@ -24,7 +42,6 @@ angular.module('copayApp.controllers').controller('tabHomeController', }) }; - $scope.updateAllWallets = function() { $scope.wallets = profileService.getWallets(); if (lodash.isEmpty($scope.wallets)) return; @@ -41,7 +58,7 @@ angular.module('copayApp.controllers').controller('tabHomeController', } else { wallet.status = status; } - if (++j==i) { + if (++j == i) { updateTxps(); } }); @@ -106,7 +123,7 @@ angular.module('copayApp.controllers').controller('tabHomeController', $scope.updateWallet(wallet); }), $rootScope.$on('Local/TxAction', function(e, walletId) { - $log.debug('Got action for wallet '+ walletId); + $log.debug('Got action for wallet ' + walletId); var wallet = profileService.getWallet(walletId); $scope.updateWallet(wallet); }), @@ -117,19 +134,4 @@ angular.module('copayApp.controllers').controller('tabHomeController', x(); }); }); - - configService.whenAvailable(function() { - var config = configService.getSync(); - var isWindowsPhoneApp = platformInfo.isWP && isCordova; - $scope.glideraEnabled = config.glidera.enabled && !isWindowsPhoneApp; - $scope.coinbaseEnabled = config.coinbase.enabled && !isWindowsPhoneApp; - }); - - $scope.openTxpModal = txpModalService.open; - - $scope.version = $window.version; - $scope.name = $window.appConfig.nameCase; - - - }); diff --git a/src/js/controllers/walletDetails.js b/src/js/controllers/walletDetails.js index 6e8f7b078..fa6ea0d47 100644 --- a/src/js/controllers/walletDetails.js +++ b/src/js/controllers/walletDetails.js @@ -1,21 +1,58 @@ 'use strict'; angular.module('copayApp.controllers').controller('walletDetailsController', function($scope, $rootScope, $interval, $timeout, $filter, $log, $ionicModal, $ionicPopover, $ionicNavBarDelegate, $state, $stateParams, bwcError, profileService, lodash, configService, gettext, gettextCatalog, platformInfo, walletService, $ionicPopup, txpModalService, externalLinkService) { - - var isCordova = platformInfo.isCordova; - var isWP = platformInfo.isWP; - var isAndroid = platformInfo.isAndroid; - var isChromeApp = platformInfo.isChromeApp; - - var errorPopup; - var HISTORY_SHOW_LIMIT = 10; + var currentTxHistoryPage; + var wallet; $scope.txps = []; $scope.openExternalLink = function(url, target) { externalLinkService.open(url, target); }; + $scope.init = function() { + currentTxHistoryPage = 0; + $scope.completeTxHistory = []; + + wallet = profileService.getWallet($stateParams.walletId); + + /* Set color for header bar */ + $rootScope.walletDetailsColor = wallet.color; + $rootScope.walletDetailsName = wallet.name; + $scope.wallet = wallet; + + $scope.requiresMultipleSignatures = wallet.credentials.m > 1; + $scope.newTx = false; + + $ionicNavBarDelegate.title(wallet.name); + + $scope.updateAll(function() { + if ($stateParams.txid) { + var tx = lodash.find($scope.completeTxHistory, { + txid: $stateParams.txid + }); + if (tx) { + $scope.openTxModal(tx); + } else { + $ionicPopup.alert({ + title: gettext('TX not available'), + }); + } + } else if ($stateParams.txpId) { + var txp = lodash.find($scope.txps, { + id: $stateParams.txpId + }); + if (txp) { + $scope.openTxpModal(txp); + } else { + $ionicPopup.alert({ + title: gettext('Proposal not longer available'), + }); + } + } + }); + } + var setPendingTxps = function(txps) { if (!txps) { $scope.txps = []; @@ -169,54 +206,4 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun if (err) $log.error(err); }); } - - var currentTxHistoryPage; - var wallet; - - $scope.init = function() { - currentTxHistoryPage = 0; - $scope.completeTxHistory = []; - - wallet = profileService.getWallet($stateParams.walletId); - - if (!wallet.isComplete()) { - return $state.go('wallet.copayers'); - }; - - /* Set color for header bar */ - $rootScope.walletDetailsColor = wallet.color; - $rootScope.walletDetailsName = wallet.name; - - $scope.wallet = wallet; - $scope.requiresMultipleSignatures = wallet.credentials.m > 1; - $scope.newTx = false; - - $ionicNavBarDelegate.title(wallet.name); - - $scope.updateAll(function() { - if ($stateParams.txid) { - var tx = lodash.find($scope.completeTxHistory, { - txid: $stateParams.txid - }); - if (tx) { - $scope.openTxModal(tx); - } else { - $ionicPopup.alert({ - title: gettext('TX not available'), - }); - } - } else if ($stateParams.txpId) { - var txp = lodash.find($scope.txps, { - id: $stateParams.txpId - }); - if (txp) { - $scope.openTxpModal(txp); - } else { - $ionicPopup.alert({ - title: gettext('Proposal not longer available'), - }); - } - } - }); - } }); diff --git a/src/js/directives/directives.js b/src/js/directives/directives.js index 88458c146..d9bee9bf3 100644 --- a/src/js/directives/directives.js +++ b/src/js/directives/directives.js @@ -107,7 +107,7 @@ angular.module('copayApp.directives') return { link: function($scope, el) { el.bind('change', function(e) { - $scope.file = (e.srcElement || e.target).files[0]; + $scope.formData.file = (e.srcElement || e.target).files[0]; $scope.getFile(); }); } diff --git a/src/js/routes.js b/src/js/routes.js index bde25a606..209627a30 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -276,37 +276,12 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr }) .state('tabs.import', { url: '/import', - // abstract: true, views: { 'tab-home': { templateUrl: 'views/import.html' }, }, }) - .state('tabs.import.phrase', { - url: '/tab-import-phrase', - views: { - 'tab-import-phrase': { - templateUrl: 'views/tab-import-phrase.html', - }, - } - }) - .state('tabs.import.file', { - url: '/tab-import-file', - views: { - 'tab-import-file': { - templateUrl: 'views/tab-import-file.html', - }, - } - }) - .state('tabs.import.hardware', { - url: '/tab-import-hardware', - views: { - 'tab-import-hardware': { - templateUrl: 'views/tab-import-hardware.html', - }, - } - }) .state('tabs.create', { url: '/create', views: { @@ -533,9 +508,9 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr */ .state('tabs.copayers', { - url: '/copayers', + url: '/copayers/:walletId', views: { - 'wallet': { + 'tab-home': { templateUrl: 'views/copayers.html' } } @@ -626,7 +601,6 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr }) .state('onboarding.import', { url: '/import', - abstract: true, views: { 'onboarding': { templateUrl: 'views/import.html' @@ -637,30 +611,6 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr fromOnboarding: null }, }) - .state('onboarding.import.phrase', { - url: '/tab-import-phrase', - views: { - 'tab-import-phrase': { - templateUrl: 'views/tab-import-phrase.html', - }, - } - }) - .state('onboarding.import.file', { - url: '/tab-import-file', - views: { - 'tab-import-file': { - templateUrl: 'views/tab-import-file.html', - }, - } - }) - .state('onboarding.import.hardware', { - url: '/tab-import-hardware', - views: { - 'tab-import-hardware': { - templateUrl: 'views/tab-import-hardware.html', - }, - } - }) /* * diff --git a/src/sass/common.scss b/src/sass/common.scss index 9350009f1..34ab2e428 100644 --- a/src/sass/common.scss +++ b/src/sass/common.scss @@ -1,6 +1,7 @@ .icon.nav-item-arrow-right { color: #666; font-size: 26px; + @extend .ion-ios-arrow-right; } .item.item-heading { diff --git a/src/sass/main.scss b/src/sass/main.scss index b0f2c402a..aceb97f68 100644 --- a/src/sass/main.scss +++ b/src/sass/main.scss @@ -86,7 +86,7 @@ h3.title { .box-notification { padding: 0.5rem; border: 1px solid; - margin-bottom: 20px; + margin: 10px; a { color: #fff; } diff --git a/src/sass/views/includes/walletActivity.scss b/src/sass/views/includes/walletActivity.scss index af7ff4c65..ffba46ecf 100644 --- a/src/sass/views/includes/walletActivity.scss +++ b/src/sass/views/includes/walletActivity.scss @@ -1,7 +1,8 @@ .wallet-activity { &-not-pending { - background-color:#eee; + opacity: 0.6; + filter: alpha(opacity=60); /* For IE8 and earlier */ } &-amount {