diff --git a/app/includes/header-node-modal.tpl b/app/includes/header-node-modal.tpl index 8f46ccd638..a5e9d84bc8 100644 --- a/app/includes/header-node-modal.tpl +++ b/app/includes/header-node-modal.tpl @@ -48,11 +48,11 @@
- - - - - + + + + +
diff --git a/app/scripts/main.js b/app/scripts/main.js index 790f7438fa..d82bc99eb6 100644 --- a/app/scripts/main.js +++ b/app/scripts/main.js @@ -128,6 +128,22 @@ if (IS_CX) { var mainPopCtrl = require('./controllers/CX/mainPopCtrl'); var quickSendCtrl = require('./controllers/CX/quickSendCtrl'); } + +// prepare some variables +var nodeList = {}; +if (typeof selectedNetworks !== 'undefined') { + var found = 0; + selectedNetworks.forEach(function(n) { + if (nodes.nodeList[n]) { + nodeList[n] = nodes.nodeList[n]; + found++; + } + }); + if (found > 0) { + nodes.nodeList = nodeList; + } +} + var app = angular.module('mewApp', ['pascalprecht.translate', 'ngSanitize','ngAnimate']); app.config(['$compileProvider', function($compileProvider) { $compileProvider.aHrefSanitizationWhitelist(/^\s*(|blob|https|mailto):/); diff --git a/gulpfile.js b/gulpfile.js index 18a51980a2..1cd5da81de 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -30,6 +30,13 @@ const dist_CX = './chrome-extension/'; // default Settings const Settings = require('./config.default.json'); +// get selected nodeList to override the nodes.nodeList +let selectedNetworks, i = process.argv.indexOf("--networks"); +if (i > -1 && process.argv[i + 1]) { + selectedNetworks = process.argv[i + 1].split(","); + console.log("Selected networks =", selectedNetworks); +} + // load custom settings try { let local = require('./config.json'); @@ -124,13 +131,23 @@ let js_srcFile = app + 'scripts/main.js'; let js_destFolder = dist + 'js/'; let js_destFolder_CX = dist_CX + 'js/'; let js_destFile = 'etherwallet-master.js'; -let browseOpts = { debug: true }; // generates inline source maps - only in js-debug +let js_opts = {}; // browserify opts let babelOpts = { presets: ['es2015'], compact: false, global: true }; +// have selected nodes ? +if (selectedNetworks) { + // setup browserify opts + js_opts.insertGlobalVars = { + selectedNetworks: function() { + return JSON.stringify(selectedNetworks); + } + }; +} + function bundle_js(bundler) { return bundler.bundle() .pipe(plumber({ errorHandler: onError })) @@ -155,17 +172,18 @@ function bundle_js_debug(bundler) { gulp.task('js', function() { - let bundler = browserify(js_srcFile).transform(babelify).transform(html2js); + let bundler = browserify(js_srcFile, js_opts).transform(babelify).transform(html2js); bundle_js(bundler) }); gulp.task('js-production', function() { - let bundler = browserify(js_srcFile).transform(babelify, babelOpts).transform(html2js); + let bundler = browserify(js_srcFile, js_opts).transform(babelify, babelOpts).transform(html2js); bundle_js(bundler) }); gulp.task('js-debug', function() { - let bundler = browserify(js_srcFile, browseOpts).transform(babelify, babelOpts).transform(html2js); + js_opts.debug = true; // generates inline source maps - only in js-debug + let bundler = browserify(js_srcFile, js_opts).transform(babelify, babelOpts).transform(html2js); bundle_js_debug(bundler) });