added the settings page

This commit is contained in:
Mario Colque 2014-05-13 14:19:37 -03:00
commit 9027243052
5 changed files with 101 additions and 4 deletions

View file

@ -21,7 +21,8 @@ var copayApp = window.copayApp = angular.module('copay',[
'copay.directives',
'copay.video',
'copay.import',
'copay.passphrase'
'copay.passphrase',
'copay.settings'
]);
angular.module('copay.header', []);
@ -39,4 +40,5 @@ angular.module('copay.directives', []);
angular.module('copay.video', []);
angular.module('copay.import', []);
angular.module('copay.passphrase', []);
angular.module('copay.settings', []);

View file

@ -0,0 +1,29 @@
'use strict';
angular.module('copay.settings').controller('SettingsController',
function($scope, $rootScope, $window) {
$scope.title = 'Settings';
$scope.networkName = config.networkName;
$scope.blockchainHost = config.blockchain.host;
$scope.blockchainPort = config.blockchain.port;
$scope.socketHost = config.socket.host;
$scope.socketPort = config.socket.port;
$scope.save = function() {
localStorage.setItem('config', JSON.stringify({
networkName: $scope.networkName,
blockchain: {
host: $scope.blockchainHost,
port: $scope.blockchainPort
},
socket: {
host: $scope.socketHost,
port: $scope.socketPort
}
})
);
$window.location.reload();
};
});

View file

@ -42,6 +42,10 @@ angular
templateUrl: 'backup.html',
validate: true
})
.when('/settings', {
templateUrl: 'settings.html',
validate: false
})
.otherwise({
templateUrl: '404.html'
});