diff --git a/old/go.js b/old/go.js index 082d3c207..932b9d9ae 100644 --- a/old/go.js +++ b/old/go.js @@ -42,7 +42,7 @@ angular.module('copayApp.services').factory('go', function($window, $ionicSideMe }; root.confirm = function(params) { - $state.transitionTo('confirm', params) + $state.transitionTo('send.confirm', params) }; root.send = function() { diff --git a/public/index.html b/public/index.html index ff019a7af..cef1fb09e 100644 --- a/public/index.html +++ b/public/index.html @@ -13,7 +13,7 @@ - + diff --git a/public/views/add.html b/public/views/add.html index 1ebd115de..11fb0ec89 100644 --- a/public/views/add.html +++ b/public/views/add.html @@ -7,17 +7,17 @@ - +

Create new wallet

- +

Join shared wallet

- +

Import wallet

diff --git a/public/views/preferencesAbout.html b/public/views/preferencesAbout.html index 133fa0fb4..6b13239cd 100644 --- a/public/views/preferencesAbout.html +++ b/public/views/preferencesAbout.html @@ -27,15 +27,15 @@
-
+
Terms of Use
-
+
Translators
-
+
Session log
diff --git a/public/views/tab-home.html b/public/views/tab-home.html index 0745a0b90..2cbd180b8 100644 --- a/public/views/tab-home.html +++ b/public/views/tab-home.html @@ -50,7 +50,7 @@

Wallets

diff --git a/public/views/tab-scan.html b/public/views/tab-scan.html index 0402251b9..1c6296cb8 100644 --- a/public/views/tab-scan.html +++ b/public/views/tab-scan.html @@ -1,7 +1,8 @@ - + Scan + diff --git a/public/views/tab-settings.html b/public/views/tab-settings.html index a93ca86fc..de055d49d 100644 --- a/public/views/tab-settings.html +++ b/public/views/tab-settings.html @@ -19,28 +19,28 @@ Preferences
-
+
Language {{currentLanguageName|translate}}
-
+
Unit {{unitName}}
-
+
Alternative Currency {{selectedAlternative.name}}
-
+
Bitcoin Network Fee Policy @@ -80,7 +80,7 @@ Use Unconfirmed Funds -
+
About Copay
diff --git a/src/js/controllers/amount.js b/src/js/controllers/amount.js index ce6f34008..f15710618 100644 --- a/src/js/controllers/amount.js +++ b/src/js/controllers/amount.js @@ -187,7 +187,7 @@ angular.module('copayApp.controllers').controller('amountController', function($ var _amount = evaluate(format($scope.amount)); var amount = $scope.showAlternativeAmount ? fromFiat(_amount).toFixed(unitDecimals) : _amount.toFixed(unitDecimals); - $state.transitionTo('confirm', { + $state.transitionTo('send.confirm', { toAmount:amount * unitToSatoshi, toAddress: $scope.toAddress, toName: $scope.toName, diff --git a/src/js/controllers/tab-send.js b/src/js/controllers/tab-send.js index f158194d2..a7ab420f9 100644 --- a/src/js/controllers/tab-send.js +++ b/src/js/controllers/tab-send.js @@ -68,7 +68,7 @@ angular.module('copayApp.controllers').controller('tabSendController', function( return; } $log.debug('Got toAddress:' + addr + ' | ' + item.label) - return $state.transitionTo('amount', { toAddress: addr, toName: item.label}) + return $state.transitionTo('send.amount', { toAddress: addr, toName: item.label}) }); }; diff --git a/src/js/controllers/walletDetails.js b/src/js/controllers/walletDetails.js index cc9b4cd3e..49ecdedbf 100644 --- a/src/js/controllers/walletDetails.js +++ b/src/js/controllers/walletDetails.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.controllers').controller('walletDetailsController', function($scope, $rootScope, $interval, $timeout, $filter, $log, $ionicModal, $ionicPopover, $state, $stateParams, bwcError, profileService, lodash, configService, gettext, gettextCatalog, platformInfo, walletService) { +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) { var isCordova = platformInfo.isCordova; var isWP = platformInfo.isWP; @@ -134,6 +134,8 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun $scope.requiresMultipleSignatures = wallet.credentials.m > 1; $scope.newTx = false; + $ionicNavBarDelegate.title(wallet.name); + $scope.updateAll(); }; diff --git a/src/js/routes.js b/src/js/routes.js index 950651f7a..41fa20cce 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -13,8 +13,11 @@ if (window && window.navigator) { } //Setting up route -angular.module('copayApp').config(function(historicLogProvider, $provide, $logProvider, $stateProvider, $urlRouterProvider, $compileProvider) { - $urlRouterProvider.otherwise('/tabs.home'); +angular.module('copayApp').config(function(historicLogProvider, $provide, $logProvider, $stateProvider, $urlRouterProvider, $compileProvider, $ionicConfigProvider) { + $urlRouterProvider.otherwise('/tabs/home'); + + // NO CACHE + $ionicConfigProvider.views.maxCache(0); $logProvider.debugEnabled(true); $provide.decorator('$log', ['$delegate', 'platformInfo', @@ -75,220 +78,30 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr $compileProvider.imgSrcSanitizationWhitelist(/^\s*((https?|ftp|file|blob|chrome-extension):|data:image\/)/); $stateProvider - .state('translators', { - url: '/translators', - needProfile: true, - views: { - 'main': { - templateUrl: 'views/translators.html' - } - } - }) + + /* + * + * Other pages + * + */ + .state('disclaimer', { url: '/disclaimer', - needProfile: false, - views: { - 'main': { - templateUrl: 'views/disclaimer.html', - } - } - }) - .state('wallet', { - url: '/wallet/{walletId}', - abstract: true, - cache: false, - needProfile: true, - views: { - 'main': { - template: '', - }, - }, - }) - .state('wallet.details', { - cache: false, - url: '/details', - templateUrl: 'views/walletDetails.html', - needProfile: true - }) - .state('wallet.preferences', { - cache: false, - url: '/preferences', - templateUrl: 'views/preferences.html', - needProfile: true - }) - .state('wallet.preferencesAlias', { - cache: false, - url: '/preferencesAlias', - templateUrl: 'views/preferencesAlias.html', - needProfile: true - }) - .state('wallet.preferencesColor', { - cache: false, - url: '/preferencesColor', - templateUrl: 'views/preferencesColor.html', - needProfile: true - }) - .state('wallet.preferencesEmail', { - cache: false, - url: '/preferencesEmail', - templateUrl: 'views/preferencesEmail.html', - needProfile: true - }) - .state('wallet.backup', { - cache: false, - url: '/backup', - templateUrl: 'views/backup.html', - needProfile: true - }) - .state('wallet.preferencesAdvanced', { - cache: false, - url: '/preferencesAdvanced', - templateUrl: 'views/preferencesAdvanced.html', - needProfile: true - }) - .state('wallet.information', { - cache: false, - url: '/information', - templateUrl: 'views/preferencesInformation.html', - needProfile: true - }) - .state('wallet.export', { - cache: false, - url: '/export', - templateUrl: 'views/export.html', - needProfile: true - }) - .state('wallet.preferencesBwsUrl', { - cache: false, - url: '/preferencesBwsUrl', - templateUrl: 'views/preferencesBwsUrl.html', - needProfile: true - }) - .state('wallet.preferencesHistory', { - cache: false, - url: '/preferencesHistory', - templateUrl: 'views/preferencesHistory.html', - needProfile: true - }) - .state('wallet.deleteWords', { - cache: false, - url: '/deleteWords', - templateUrl: 'views/preferencesDeleteWords.html', - needProfile: true - }) - .state('wallet.delete', { - cache: false, - url: '/delete', - templateUrl: 'views/preferencesDeleteWallet.html', - needProfile: true - }) - .state('wallet.copayers', { - cache: false, - url: '/copayers', - needProfile: true, - cache: false, - templateUrl: 'views/copayers.html' + templateUrl: 'views/disclaimer.html', }) - // OLD - // .state('walletHome', { - // url: '/old', - // needProfile: true, - // views: { - // 'main': { - // templateUrl: 'views/walletHome.html', - // }, - // } - // }) - .state('tabs', { - url: '/tabs', - cache: false, - needProfile: true, - abstract: true, - views: { - 'main': { - templateUrl: 'views/tabs.html', - }, - } - }) - .state('tabs.home', { - url: '/home', - cache: false, - needProfile: true, - views: { - 'tab-home': { - templateUrl: 'views/tab-home.html', - }, - } - }) - .state('tabs.receive', { - url: '/receive', - cache: false, - needProfile: true, - views: { - 'tab-receive': { - templateUrl: 'views/tab-receive.html', - }, - } - }) - .state('tabs.scan', { - url: '/scan', - needProfile: true, - views: { - 'tab-scan': { - templateUrl: 'views/tab-scan.html', - }, - } - }) - .state('tabs.send', { - url: '/send', - cache: false, - needProfile: true, - views: { - 'tab-send': { - templateUrl: 'views/tab-send.html', - }, - } - }) - .state('tabs.settings', { - url: '/settings', - needProfile: true, - views: { - 'tab-settings': { - templateUrl: 'views/tab-settings.html', - }, - } - }) - .state('amount', { - cache: false, - url: '/amount:/:toAddress/:toName', - needProfile: true, - views: { - 'main': { - templateUrl: 'views/amount.html', - }, - }, - }) - .state('confirm', { - cache: false, - url: '/confirm/:toAddress/:toName/:toAmount', - needProfile: true, - views: { - 'main': { - templateUrl: 'views/confirm.html', - }, - }, - }) - - .state('unsupported', { + .state('unsupported', { url: '/unsupported', - needProfile: false, - views: { - 'main': { - templateUrl: 'views/unsupported.html' - } - } + templateUrl: 'views/unsupported.html' }) + + + /* + * + * URI + * + */ + .state('uri', { url: '/uri/:url', needProfile: true, @@ -308,266 +121,237 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr }, needProfile: true }) - .state('join', { - url: '/join', - needProfile: true, - views: { - 'main': { - templateUrl: 'views/join.html' - }, - } + + + /* + * + * Wallet + * + */ + + .state('wallet', { + url: '/wallet/{walletId}', + abstract: true, + template: '' }) - .state('import', { - url: '/import', - needProfile: true, + .state('wallet.details', { + url: '/details', views: { - 'main': { - templateUrl: 'views/import.html' - }, - } - }) - .state('create', { - url: '/create', - templateUrl: 'views/create.html', - needProfile: true, - views: { - 'main': { - templateUrl: 'views/create.html' - }, - } - }) - .state('preferencesLanguage', { - url: '/preferencesLanguage', - needProfile: true, - views: { - 'main': { - templateUrl: 'views/preferencesLanguage.html' - }, - } - }) - .state('preferencesUnit', { - url: '/preferencesUnit', - templateUrl: 'views/preferencesUnit.html', - needProfile: true, - views: { - 'main': { - templateUrl: 'views/preferencesUnit.html' - }, - } - }) - .state('preferencesFee', { - url: '/preferencesFee', - templateUrl: 'views/preferencesFee.html', - needProfile: true, - views: { - 'main': { - templateUrl: 'views/preferencesFee.html' - }, - } - }) - .state('uriglidera', { - url: '/uri-glidera/:url', - needProfile: true, - views: { - 'main': { - templateUrl: 'views/glideraUri.html' - }, - } - }) - .state('glidera', { - url: '/glidera', - needProfile: true, - views: { - 'main': { - templateUrl: 'views/glidera.html' - }, - } - }) - .state('buyGlidera', { - url: '/buy', - needProfile: true, - views: { - 'main': { - templateUrl: 'views/buyGlidera.html' - }, - } - }) - .state('sellGlidera', { - url: '/sell', - needProfile: true, - views: { - 'main': { - templateUrl: 'views/sellGlidera.html' - }, - } - }) - .state('preferencesGlidera', { - url: '/preferencesGlidera', - needProfile: true, - views: { - 'main': { - templateUrl: 'views/preferencesGlidera.html' - }, - } - }) - .state('bitpayCard', { - url: '/bitpay-card', - needProfile: true, - views: { - 'main': { - templateUrl: 'views/bitpayCard.html' - }, - } - }) - .state('preferencesBitpayCard', { - url: '/preferences-bitpay-card', - needProfile: true, - views: { - 'main': { - templateUrl: 'views/preferencesBitpayCard.html' - }, - } - }) - .state('coinbase', { - url: '/coinbase', - needProfile: true, - views: { - 'main': { - templateUrl: 'views/coinbase.html' - }, - } - }) - .state('preferencesCoinbase', { - url: '/preferencesCoinbase', - needProfile: true, - views: { - 'main': { - templateUrl: 'views/preferencesCoinbase.html' - }, - } - }) - .state('uricoinbase', { - url: '/uri-coinbase/:url', - needProfile: true, - views: { - 'main': { - templateUrl: 'views/coinbaseUri.html' - }, - } - }) - .state('buyCoinbase', { - url: '/buycoinbase', - needProfile: true, - views: { - 'main': { - templateUrl: 'views/buyCoinbase.html' - }, - } - }) - .state('sellCoinbase', { - url: '/sellcoinbase', - needProfile: true, - views: { - 'main': { - templateUrl: 'views/sellCoinbase.html' - }, - } - }) - .state('buyandsell', { - url: '/buyandsell', - needProfile: true, - views: { - 'main': { - templateUrl: 'views/buyAndSell.html', - controller: function(platformInfo) { - if (platformInfo.isCordova && StatusBar.isVisible) { - StatusBar.backgroundColorByHexString("#4B6178"); - } - } + 'wallet': { + templateUrl: 'views/walletDetails.html' } } }) - .state('amazon', { - url: '/amazon', - needProfile: true, + .state('wallet.preferences', { + url: '/preferences', views: { - 'main': { - templateUrl: 'views/amazon.html' - }, + 'wallet': { + templateUrl: 'views/preferences.html' + } } }) - .state('buyAmazon', { - url: '/buyamazon', - needProfile: true, + .state('wallet.preferencesAlias', { + url: '/preferencesAlias', views: { - 'main': { - templateUrl: 'views/buyAmazon.html' - }, + 'wallet': { + templateUrl: 'views/preferencesAlias.html' + } } }) - .state('preferencesAltCurrency', { - url: '/preferencesAltCurrency', - templateUrl: 'views/preferencesAltCurrency.html', - needProfile: true, + .state('wallet.preferencesColor', { + url: '/preferencesColor', views: { - 'main': { - templateUrl: 'views/preferencesAltCurrency.html' - }, + 'wallet': { + templateUrl: 'views/preferencesColor.html' + } } }) - .state('about', { - url: '/about', - templateUrl: 'views/preferencesAbout.html', - needProfile: true, + .state('wallet.preferencesEmail', { + url: '/preferencesEmail', views: { - 'main': { - templateUrl: 'views/preferencesAbout.html' - }, + 'wallet': { + templateUrl: 'views/preferencesEmail.html' + } } }) - .state('logs', { - url: '/logs', - templateUrl: 'views/preferencesLogs.html', - needProfile: true, + .state('wallet.backup', { + url: '/backup', views: { - 'main': { - templateUrl: 'views/preferencesLogs.html' - }, + 'wallet': { + templateUrl: 'views/backup.html' + } } }) - .state('paperWallet', { + .state('wallet.preferencesAdvanced', { + url: '/preferencesAdvanced', + views: { + 'wallet': { + templateUrl: 'views/preferencesAdvanced.html' + } + } + }) + .state('wallet.information', { + url: '/information', + views: { + 'wallet': { + templateUrl: 'views/preferencesInformation.html' + } + } + }) + .state('wallet.export', { + url: '/export', + views: { + 'wallet': { + templateUrl: 'views/export.html' + } + } + }) + .state('wallet.preferencesBwsUrl', { + url: '/preferencesBwsUrl', + views: { + 'wallet': { + templateUrl: 'views/preferencesBwsUrl.html' + } + } + }) + .state('wallet.preferencesHistory', { + url: '/preferencesHistory', + views: { + 'wallet': { + templateUrl: 'views/preferencesHistory.html' + } + } + }) + .state('wallet.deleteWords', { + url: '/deleteWords', + views: { + 'wallet': { + templateUrl: 'views/preferencesDeleteWords.html' + } + } + }) + .state('wallet.delete', { + url: '/delete', + views: { + 'wallet': { + templateUrl: 'views/preferencesDeleteWallet.html' + } + } + }) + .state('wallet.copayers', { + url: '/copayers', + views: { + 'wallet': { + templateUrl: 'views/copayers.html' + } + } + }) + .state('wallet.paperWallet', { url: '/paperWallet', - templateUrl: 'views/paperWallet.html', - needProfile: true, views: { - 'main': { + 'wallet': { templateUrl: 'views/paperWallet.html' - }, + } } }) - .state('preferencesGlobal', { - url: '/preferencesGlobal', - needProfile: true, + + /* + * + * Tabs + * + */ + + .state('tabs', { + url: '/tabs', + abstract: true, + templateUrl: 'views/tabs.html' + }) + .state('tabs.home', { + url: '/home', views: { - 'main': { - templateUrl: 'views/preferencesGlobal.html', - }, + 'tab-home': { + templateUrl: 'views/tab-home.html', + } } }) - .state('termOfUse', { - url: '/termOfUse', - needProfile: true, + .state('tabs.receive', { + url: '/receive', views: { - 'main': { - templateUrl: 'views/termOfUse.html', - }, + 'tab-receive': { + templateUrl: 'views/tab-receive.html', + } } }) + .state('tabs.scan', { + url: '/scan', + views: { + 'tab-scan': { + templateUrl: 'views/tab-scan.html', + } + } + }) + .state('tabs.send', { + url: '/send', + views: { + 'tab-send': { + templateUrl: 'views/tab-send.html', + } + } + }) + .state('tabs.settings', { + url: '/settings', + views: { + 'tab-settings': { + templateUrl: 'views/tab-settings.html', + } + } + }) + + /* + * + * Send + * + */ + + .state('send', { + url: '/send', + abstract: true, + template: '' + }) + + .state('send.amount', { + url: '/amount:/:toAddress/:toName', + views: { + 'send': { + templateUrl: 'views/amount.html' + } + } + }) + .state('send.confirm', { + url: '/confirm/:toAddress/:toName/:toAmount', + views: { + 'send': { + templateUrl: 'views/confirm.html' + } + } + }) + + + /* + * + * Add + * + */ + .state('add', { url: '/add', - needProfile: true, + abstract: true, + template: '' + }) + .state('add.main', { + url: '/main', views: { - 'main': { + 'add': { templateUrl: 'views/add.html', controller: function(platformInfo) { if (platformInfo.isCordova && StatusBar.isVisible) { @@ -576,6 +360,200 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr } } } + }) + .state('add.join', { + url: '/join', + views: { + 'add': { + templateUrl: 'views/join.html' + }, + } + }) + .state('add.import', { + url: '/import', + views: { + 'add': { + templateUrl: 'views/import.html' + }, + } + }) + .state('add.create', { + url: '/create', + views: { + 'add': { + templateUrl: 'views/create.html' + }, + } + }) + + + /* + * + * Global Settings + * + */ + + .state('settings', { + url: '/settings', + abstract: true, + template: '' + }) + .state('settings.language', { + url: '/language', + views: { + 'settings': { + templateUrl: 'views/preferencesLanguage.html' + } + } + }) + .state('settings.unit', { + url: '/unit', + views: { + 'settings': { + templateUrl: 'views/preferencesUnit.html' + } + } + }) + .state('settings.fee', { + url: '/fee', + views: { + 'settings': { + templateUrl: 'views/preferencesFee.html' + } + } + }) + .state('settings.altCurrency', { + url: '/altCurrency', + views: { + 'settings': { + templateUrl: 'views/preferencesAltCurrency.html' + } + } + }) + .state('settings.about', { + url: '/about', + views: { + 'settings': { + templateUrl: 'views/preferencesAbout.html' + } + } + }) + .state('settings.logs', { + url: '/logs', + views: { + 'settings': { + templateUrl: 'views/preferencesLogs.html' + } + } + }) + .state('settings.termOfUse', { + url: '/termOfUse', + views: { + 'settings': { + templateUrl: 'views/termOfUse.html', + } + } + }) + .state('settings.translators', { + url: '/translators', + views: { + 'settings': { + templateUrl: 'views/translators.html' + } + } + }) + + /* + * + * Glidera + * + */ + + .state('uriglidera', { + url: '/uri-glidera/:url', + templateUrl: 'views/glideraUri.html' + }) + .state('glidera', { + url: '/glidera', + templateUrl: 'views/glidera.html' + }) + .state('buyGlidera', { + url: '/buy', + templateUrl: 'views/buyGlidera.html' + }) + .state('sellGlidera', { + url: '/sell', + templateUrl: 'views/sellGlidera.html' + }) + .state('preferencesGlidera', { + url: '/preferencesGlidera', + templateUrl: 'views/preferencesGlidera.html' + }) + + /* + * + * BitPay Card + * + */ + + .state('bitpayCard', { + url: '/bitpay-card', + templateUrl: 'views/bitpayCard.html' + }) + .state('preferencesBitpayCard', { + url: '/preferences-bitpay-card', + templateUrl: 'views/preferencesBitpayCard.html' + }) + + /* + * + * Coinbase + * + */ + + .state('coinbase', { + url: '/coinbase', + templateUrl: 'views/coinbase.html' + }) + .state('preferencesCoinbase', { + url: '/preferencesCoinbase', + templateUrl: 'views/preferencesCoinbase.html' + }) + .state('uricoinbase', { + url: '/uri-coinbase/:url', + templateUrl: 'views/coinbaseUri.html' + }) + .state('buyCoinbase', { + url: '/buycoinbase', + templateUrl: 'views/buyCoinbase.html' + }) + .state('sellCoinbase', { + url: '/sellcoinbase', + templateUrl: 'views/sellCoinbase.html' + }) + .state('buyandsell', { + url: '/buyandsell', + templateUrl: 'views/buyAndSell.html', + controller: function(platformInfo) { + if (platformInfo.isCordova && StatusBar.isVisible) { + StatusBar.backgroundColorByHexString("#4B6178"); + } + } + }) + + /* + * + * Amazon Gift Card + * + */ + + .state('amazon', { + url: '/amazon', + templateUrl: 'views/amazon.html' + }) + .state('buyAmazon', { + url: '/buyamazon', + templateUrl: 'views/buyAmazon.html' }); }) .run(function($rootScope, $state, $location, $log, $timeout, $ionicPlatform, lodash, platformInfo, profileService, uxLanguage, gettextCatalog) {