Merge pull request #6 from JDonadio/ref/design-03
Refactor navigation parameters
This commit is contained in:
commit
d42de0b651
41 changed files with 160 additions and 186 deletions
|
|
@ -1,10 +1,9 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('backupController',
|
||||
function($rootScope, $scope, $timeout, $log, $state, $stateParams, $ionicPopup, uxLanguage, lodash, fingerprintService, platformInfo, configService, profileService, gettext, bwcService, walletService, ongoingProcess) {
|
||||
|
||||
function($rootScope, $scope, $timeout, $log, $state, $stateParams, $ionicPopup, $ionicNavBarDelegate, uxLanguage, lodash, fingerprintService, platformInfo, configService, profileService, bwcService, walletService, ongoingProcess) {
|
||||
var wallet = profileService.getWallet($stateParams.walletId);
|
||||
$scope.walletName = wallet.credentials.walletName;
|
||||
$ionicNavBarDelegate.title(wallet.credentials.walletName);
|
||||
$scope.n = wallet.n;
|
||||
var keys;
|
||||
|
||||
|
|
@ -71,8 +70,7 @@ angular.module('copayApp.controllers').controller('backupController',
|
|||
if ($scope.step == 1) {
|
||||
if ($stateParams.fromOnboarding) $state.go('onboarding.backupRequest');
|
||||
else $state.go('wallet.preferences');
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$scope.goToStep($scope.step - 1);
|
||||
}
|
||||
};
|
||||
|
|
@ -98,8 +96,7 @@ angular.module('copayApp.controllers').controller('backupController',
|
|||
confirmBackupPopup.close();
|
||||
if ($stateParams.fromOnboarding) $state.go('onboarding.disclaimer');
|
||||
else $state.go('tabs.home')
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
confirmBackupPopup.close();
|
||||
$scope.goToStep(1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('importController',
|
||||
function($scope, $rootScope, $timeout, $log, $state, $stateParams, profileService, configService, sjcl, gettext, ledger, trezor, derivationPathHelper, platformInfo, bwcService, ongoingProcess, walletService) {
|
||||
function($scope, $rootScope, $timeout, $log, $state, $stateParams, $ionicHistory, profileService, configService, sjcl, gettext, ledger, trezor, derivationPathHelper, platformInfo, bwcService, ongoingProcess, walletService) {
|
||||
|
||||
var isChromeApp = platformInfo.isChromeApp;
|
||||
var isDevel = platformInfo.isDevel;
|
||||
|
|
@ -15,6 +15,10 @@ angular.module('copayApp.controllers').controller('importController',
|
|||
$scope.account = 1;
|
||||
$scope.importErr = false;
|
||||
|
||||
$scope.goBack = function() {
|
||||
$ionicHistory.goBack();
|
||||
};
|
||||
|
||||
var updateSeedSourceSelect = function() {
|
||||
$scope.seedOptions = [];
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesController',
|
||||
function($scope, $rootScope, $timeout, $log, $stateParams, configService, profileService, fingerprintService, walletService, $state) {
|
||||
|
||||
function($scope, $rootScope, $timeout, $log, $stateParams, $ionicHistory, $ionicNavBarDelegate, gettextCatalog, configService, profileService, fingerprintService, walletService) {
|
||||
$ionicNavBarDelegate.title(gettextCatalog.getString('Preferences'));
|
||||
var wallet = profileService.getWallet($stateParams.walletId);
|
||||
var walletId = wallet.credentials.walletId;
|
||||
$scope.wallet = wallet;
|
||||
|
|
@ -10,8 +10,8 @@ angular.module('copayApp.controllers').controller('preferencesController',
|
|||
$scope.init = function() {
|
||||
$scope.externalSource = null;
|
||||
|
||||
if (!wallet)
|
||||
return $state.go('tabs.home');
|
||||
if (!wallet)
|
||||
return $ionicHistory.goBack();
|
||||
|
||||
var config = configService.getSync();
|
||||
config.aliasFor = config.aliasFor || {};
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesAbout',
|
||||
function() {});
|
||||
function($ionicNavBarDelegate, gettextCatalog) {
|
||||
$ionicNavBarDelegate.title(gettextCatalog.getString('About Copay'));
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesAliasController',
|
||||
function($scope, $timeout, $stateParams, $state, configService, profileService, walletService) {
|
||||
|
||||
function($scope, $timeout, $stateParams, $ionicHistory, $ionicNavBarDelegate, gettextCatalog, configService, profileService, walletService) {
|
||||
$ionicNavBarDelegate.title(gettextCatalog.getString('Alias'));
|
||||
var wallet = profileService.getWallet($stateParams.walletId);
|
||||
$scope.wallet = wallet;
|
||||
var walletId = wallet.credentials.walletId;
|
||||
|
|
@ -20,7 +20,7 @@ angular.module('copayApp.controllers').controller('preferencesAliasController',
|
|||
|
||||
configService.set(opts, function(err) {
|
||||
if (err) $log.warn(err);
|
||||
$state.go('wallet.preferences')
|
||||
$ionicHistory.goBack();
|
||||
});
|
||||
};
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesAltCurrencyController',
|
||||
function($scope, $log, $state, $timeout, configService, rateService, lodash, profileService, walletService) {
|
||||
function($scope, $log, $timeout, $ionicNavBarDelegate, $ionicHistory, gettextCatalog, configService, rateService, lodash, profileService, walletService) {
|
||||
$ionicNavBarDelegate.title(gettextCatalog.getString('Alternative Currency'));
|
||||
|
||||
var next = 10;
|
||||
var completeAlternativeList;
|
||||
|
|
@ -42,8 +43,8 @@ angular.module('copayApp.controllers').controller('preferencesAltCurrencyControl
|
|||
|
||||
configService.set(opts, function(err) {
|
||||
if (err) $log.warn(err);
|
||||
$state.go('tabs.settings');
|
||||
|
||||
$ionicHistory.goBack();
|
||||
walletService.updateRemotePreferences(profileService.getWallets(), {}, function() {
|
||||
$log.debug('Remote preferences saved');
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesBwsUrlController',
|
||||
function($scope, $log, $stateParams, configService, applicationService, profileService, storageService) {
|
||||
function($scope, $log, $stateParams, $ionicNavBarDelegate, configService, applicationService, profileService, storageService) {
|
||||
$ionicNavBarDelegate.title('Wallet Service URL');
|
||||
$scope.error = null;
|
||||
$scope.success = null;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesColorController', function($scope, $log, $stateParams, $state, configService, profileService) {
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesColorController', function($scope, $log, $stateParams, $ionicHistory, $ionicNavBarDelegate, gettextCatalog, configService, profileService) {
|
||||
$ionicNavBarDelegate.title(gettextCatalog.getString('Color'));
|
||||
$scope.colorList = [
|
||||
'#DD4B39',
|
||||
'#F38F12',
|
||||
|
|
@ -35,7 +35,7 @@ angular.module('copayApp.controllers').controller('preferencesColorController',
|
|||
|
||||
configService.set(opts, function(err) {
|
||||
if (err) $log.warn(err);
|
||||
$state.go('wallet.preferences');
|
||||
$ionicHistory.goBack();
|
||||
});
|
||||
};
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesDeleteWalletController',
|
||||
function($scope, $ionicPopup, $stateParams, lodash, profileService, $state, gettextCatalog, ongoingProcess) {
|
||||
function($scope, $ionicPopup, $stateParams, $ionicNavBarDelegate, gettextCatalog, lodash, profileService, $state, ongoingProcess) {
|
||||
$ionicNavBarDelegate.title(gettextCatalog.getString('Delete Wallet'));
|
||||
var wallet = profileService.getWallet($stateParams.walletId);
|
||||
$scope.alias = lodash.isEqual(wallet.name, wallet.credentials.walletName) ? null : wallet.name + ' ';
|
||||
$scope.walletName = '[' + wallet.credentials.walletName + ']';
|
||||
$scope.error = null;
|
||||
var walletName = $scope.alias || $scope.walletName;
|
||||
|
||||
$scope.showDeletePopup = function() {
|
||||
var popup = $ionicPopup.show({
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesDeleteWordsController', function($scope, $state, $stateParams, confirmDialog, lodash, notification, profileService, walletService, gettext) {
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesDeleteWordsController', function($scope, $ionicHistory, $stateParams, $ionicNavBarDelegate, gettextCatalog, confirmDialog, lodash, profileService, walletService, gettext) {
|
||||
$ionicNavBarDelegate.title(gettextCatalog.getString('Delete recovery phrase'));
|
||||
var wallet = profileService.getWallet($stateParams.walletId);
|
||||
var msg = gettext('Are you sure you want to delete the recovery phrase?');
|
||||
var successMsg = gettext('Recovery phrase deleted');
|
||||
|
|
@ -17,8 +17,7 @@ angular.module('copayApp.controllers').controller('preferencesDeleteWordsControl
|
|||
if (ok) {
|
||||
wallet.clearMnemonic();
|
||||
profileService.updateCredentials(JSON.parse(wallet.export()), function() {
|
||||
notification.success(successMsg);
|
||||
$state.go('wallet.details');
|
||||
$ionicHistory.goBack();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesEmailController', function($rootScope, $scope, $state, $stateParams, profileService, walletService) {
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesEmailController', function($rootScope, $scope, $ionicHistory, $stateParams, $ionicNavBarDelegate, gettextCatalog, profileService, walletService) {
|
||||
$ionicNavBarDelegate.title(gettextCatalog.getString('Email Notifications'));
|
||||
$scope.save = function(form) {
|
||||
var wallet = profileService.getWallet($stateParams.walletId);
|
||||
var email = $scope.email || '';
|
||||
|
|
@ -10,7 +10,7 @@ angular.module('copayApp.controllers').controller('preferencesEmailController',
|
|||
email: email,
|
||||
}, function(err) {
|
||||
if (err) $log.warn(err);
|
||||
$state.go('wallet.preferences');
|
||||
$ionicHistory.goBack();
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesFeeController', function($scope, $timeout, configService, feeService) {
|
||||
angular.module('copayApp.controllers').controller('preferencesFeeController', function($scope, $timeout, $ionicHistory, $ionicNavBarDelegate, gettextCatalog, configService, feeService) {
|
||||
$ionicNavBarDelegate.title(gettextCatalog.getString('Preferences fee'));
|
||||
|
||||
$scope.init = function() {
|
||||
$scope.loading = true;
|
||||
|
|
@ -25,6 +26,7 @@ angular.module('copayApp.controllers').controller('preferencesFeeController', fu
|
|||
configService.set(opts, function(err) {
|
||||
if (err) $log.debug(err);
|
||||
$scope.currentFeeLevel = newFee.level;
|
||||
$ionicHistory.goBack();
|
||||
$timeout(function() {
|
||||
$scope.$apply();
|
||||
}, 10);
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesHistory',
|
||||
function($scope, $log, $stateParams, $timeout, storageService, $state, profileService, lodash) {
|
||||
|
||||
function($scope, $log, $stateParams, $timeout, $ionicNavBarDelegate, gettextCatalog, storageService, $state, profileService, lodash) {
|
||||
$ionicNavBarDelegate.title(gettextCatalog.getString('Transaction History'));
|
||||
var wallet = profileService.getWallet($stateParams.walletId);
|
||||
var c = wallet.credentials;
|
||||
$scope.csvReady = false;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesInformation',
|
||||
function($scope, $log, $timeout, platformInfo, gettextCatalog, lodash, profileService, configService, $stateParams, walletService, $state) {
|
||||
function($scope, $log, $timeout, $ionicNavBarDelegate, platformInfo, gettextCatalog, lodash, profileService, configService, $stateParams, walletService, $state) {
|
||||
$ionicNavBarDelegate.title(gettextCatalog.getString('Wallet Information'));
|
||||
var base = 'xpub';
|
||||
var wallet = profileService.getWallet($stateParams.walletId);
|
||||
var walletId = wallet.id;
|
||||
|
|
@ -12,7 +13,7 @@ angular.module('copayApp.controllers').controller('preferencesInformation',
|
|||
config.colorFor = config.colorFor || {};
|
||||
|
||||
$scope.init = function() {
|
||||
var c =wallet.credentials;
|
||||
var c = wallet.credentials;
|
||||
var basePath = c.getBaseAddressDerivationPath();
|
||||
|
||||
$scope.wallet = wallet;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesLanguageController',
|
||||
function($scope, $log, $state, configService, profileService, uxLanguage, walletService) {
|
||||
function($scope, $log, $ionicNavBarDelegate, $ionicHistory, gettextCatalog, configService, profileService, uxLanguage, walletService) {
|
||||
$ionicNavBarDelegate.title(gettextCatalog.getString('Language'));
|
||||
|
||||
$scope.init = function() {
|
||||
$scope.availableLanguages = uxLanguage.getLanguages();
|
||||
|
|
@ -20,7 +21,7 @@ angular.module('copayApp.controllers').controller('preferencesLanguageController
|
|||
configService.set(opts, function(err) {
|
||||
if (err) $log.warn(err);
|
||||
|
||||
$state.go('tabs.settings')
|
||||
$ionicHistory.goBack();
|
||||
uxLanguage.update(function() {
|
||||
walletService.updateRemotePreferences(profileService.getWallets(), {}, function() {
|
||||
$log.debug('Remote preferences saved');
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesLogs',
|
||||
function($scope, historicLog) {
|
||||
function($scope, historicLog, $ionicNavBarDelegate, gettextCatalog) {
|
||||
$ionicNavBarDelegate.title(gettextCatalog.getString('Session Log'));
|
||||
|
||||
$scope.init = function() {
|
||||
$scope.logs = historicLog.get();
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesUnitController', function($scope, $log, configService, $state, walletService, profileService) {
|
||||
angular.module('copayApp.controllers').controller('preferencesUnitController', function($scope, $log, configService, $ionicNavBarDelegate, $ionicHistory, gettextCatalog, walletService, profileService) {
|
||||
$ionicNavBarDelegate.title(gettextCatalog.getString('Unit'));
|
||||
|
||||
$scope.init = function() {
|
||||
var config = configService.getSync();
|
||||
|
|
@ -36,7 +37,7 @@ angular.module('copayApp.controllers').controller('preferencesUnitController', f
|
|||
configService.set(opts, function(err) {
|
||||
if (err) $log.warn(err);
|
||||
|
||||
$state.go('tabs.settings');
|
||||
$ionicHistory.goBack();
|
||||
walletService.updateRemotePreferences(profileService.getWallets(), {}, function() {
|
||||
$log.debug('Remote preferences saved');
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('termOfUseController',
|
||||
function($scope, uxLanguage) {
|
||||
|
||||
function($scope, uxLanguage, $ionicNavBarDelegate, gettextCatalog) {
|
||||
$ionicNavBarDelegate.title(gettextCatalog.getString('About Copay'));
|
||||
$scope.lang = uxLanguage.currentLanguage;
|
||||
|
||||
});
|
||||
|
|
|
|||
|
|
@ -29,6 +29,10 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
|||
$ionicConfigProvider.navBar.positionPrimaryButtons('left');
|
||||
$ionicConfigProvider.navBar.positionSecondaryButtons('right');
|
||||
|
||||
// NAV BACK-BUTTON TEXT/ICON
|
||||
$ionicConfigProvider.backButton.icon('ion-chevron-left');
|
||||
$ionicConfigProvider.backButton.previousTitleText(false);
|
||||
|
||||
$logProvider.debugEnabled(true);
|
||||
$provide.decorator('$log', ['$delegate', 'platformInfo',
|
||||
function($delegate, platformInfo) {
|
||||
|
|
@ -95,7 +99,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
|||
*
|
||||
*/
|
||||
|
||||
.state('unsupported', {
|
||||
.state('unsupported', {
|
||||
url: '/unsupported',
|
||||
templateUrl: 'views/unsupported.html'
|
||||
})
|
||||
|
|
|
|||
|
|
@ -865,6 +865,7 @@ ul.wallet-selection.wallets {
|
|||
|
||||
.no-border {
|
||||
border-style: none;
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
input[type=file] {
|
||||
|
|
@ -889,6 +890,16 @@ input[type=file] {
|
|||
.wallets {
|
||||
height: 90px;
|
||||
}
|
||||
|
||||
.bar .button.back-button {
|
||||
color: #444;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.bar .button.button-clear .icon:before {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
/*
|
||||
* Calculator
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue