Fixes access to settings and a small typo

This commit is contained in:
Matias Pando 2014-10-16 11:25:45 -03:00 committed by Matias Alejo Garcia
parent 43c0eb9cb6
commit d461ddd600
1 changed files with 90 additions and 90 deletions

View File

@ -2,100 +2,100 @@
//Setting up route //Setting up route
angular angular
.module('copayApp') .module('copayApp')
.config(function($routeProvider) { .config(function($routeProvider) {
$routeProvider $routeProvider
.when('/', { .when('/', {
templateUrl: 'views/home.html', templateUrl: 'views/home.html',
}) })
.when('/createProfile', { .when('/createProfile', {
templateUrl: 'views/createProfile.html', templateUrl: 'views/createProfile.html',
}) })
.when('/unsupported', { .when('/unsupported', {
templateUrl: 'views/unsupported.html' templateUrl: 'views/unsupported.html'
}) })
.when('/uri-payment/:data', { .when('/uri-payment/:data', {
templateUrl: 'views/uri-payment.html' templateUrl: 'views/uri-payment.html'
}) })
.when('/join', { .when('/join', {
templateUrl: 'views/join.html', templateUrl: 'views/join.html',
logged: true logged: true
}) })
.when('/import', { .when('/import', {
templateUrl: 'views/import.html', templateUrl: 'views/import.html',
logged: true logged: true
}) })
.when('/create', { .when('/create', {
templateUrl: 'views/create.html', templateUrl: 'views/create.html',
logged: true logged: true
}) })
.when('/copayers', { .when('/copayers', {
templateUrl: 'views/copayers.html', templateUrl: 'views/copayers.html',
logged: true logged: true
}) })
.when('/receive', { .when('/receive', {
templateUrl: 'views/addresses.html', templateUrl: 'views/addresses.html',
logged: true logged: true
}) })
.when('/history', { .when('/history', {
templateUrl: 'views/transactions.html', templateUrl: 'views/transactions.html',
logged: true logged: true
}) })
.when('/send', { .when('/send', {
templateUrl: 'views/send.html', templateUrl: 'views/send.html',
logged: true logged: true
}) })
.when('/more', { .when('/more', {
templateUrl: 'views/more.html', templateUrl: 'views/more.html',
logged: true logged: true
}) })
.when('/settings', { .when('/settings', {
templateUrl: 'views/settings.html', templateUrl: 'views/settings.html',
logged: true logged: false
}) })
.when('/warning', { .when('/warning', {
templateUrl: 'views/warning.html', templateUrl: 'views/warning.html',
logged: true logged: true
}) })
.when('/manage', { .when('/manage', {
templateUrl: 'views/manage.html', templateUrl: 'views/manage.html',
logged: true logged: true
}) })
.otherwise({ .otherwise({
templateUrl: 'views/errors/404.html', templateUrl: 'views/errors/404.html',
title: 'Error' title: 'Error'
});
}); });
});
//Setting HTML5 Location Mode //Setting HTML5 Location Mode
angular angular
.module('copayApp') .module('copayApp')
.config(function($locationProvider, $idleProvider, $keepaliveProvider) { .config(function($locationProvider, $idleProvider, $keepaliveProvider) {
$locationProvider $locationProvider
.html5Mode(false) .html5Mode(false)
.hashPrefix('!'); .hashPrefix('!');
// IDLE timeout // IDLE timeout
var timeout = config.wallet.idleDurationMin * 60 || 300; var timeout = config.wallet.idleDurationMin * 60 || 300;
$idleProvider.idleDuration(timeout); // in seconds $idleProvider.idleDuration(timeout); // in seconds
$idleProvider.warningDuration(40); // in seconds $idleProvider.warningDuration(40); // in seconds
$keepaliveProvider.interval(30); // in seconds $keepaliveProvider.interval(30); // in seconds
}) })
.run(function($rootScope, $location, $idle, gettextCatalog) { .run(function($rootScope, $location, $idle, gettextCatalog) {
gettextCatalog.currentLanguage = config.defaultLanguage; gettextCatalog.currentLanguage = config.defaultLanguage;
$idle.watch(); $idle.watch();
$rootScope.$on('$routeChangeStart', function(event, next, current) { $rootScope.$on('$routeChangeStart', function(event, next, current) {
if (!localStorage || localStorage.length < 1) { if (!localStorage || localStorage.length < 1) {
$location.path('unsupported'); $location.path('unsupported');
} else { } else {
if (!$rootScope.iden && next.logged) { if (!$rootScope.iden && next.logged) {
console.log('not logged... redirecting') console.log('not logged... redirecting')
$idle.unwatch(); $idle.unwatch();
$location.path('/'); $location.path('/');
}
} }
} });
})
.config(function($compileProvider) {
$compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|tel|chrome-extension|resource):/);
}); });
})
.config(function($compileProvider) {
$compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|tel|chrome-extension|resource):/);
});