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

@ -1,6 +1,7 @@
'use strict';
var config = {
var localConfig = JSON.parse(localStorage.getItem('config'));
var defaultConfig = {
networkName: 'testnet',
network: {
// key: 'lwjd5qra8257b9', //Copay API key for public PeerJS server
@ -11,7 +12,7 @@ var config = {
//path: '/',
//
key: 'g23ihfh82h35rf', // api key for the peerjs server
host: '162.242.219.26', // peerjs server
host: '162.242.245.33', // peerjs server
port: 10009,
path: '/',
maxPeers: 15,
@ -105,6 +106,18 @@ var config = {
verbose: 1,
};
var config = defaultConfig;
// Merge localConfig
if (localConfig) {
var count = 0;
for (name in localConfig) {
if (localConfig.hasOwnProperty(name)) {
config[name] = localConfig[name];
}
}
}
var log = function() {
if (config.verbose) console.log(arguments);
}