diff --git a/README.md b/README.md index 7062d83b..41d64e35 100644 --- a/README.md +++ b/README.md @@ -37,9 +37,9 @@ Options: -l, --load session file to load -p, --port osc input port (for synchronization) -n, --nogui disable default gui and makes the app availabe through http on specified port - -t, --theme theme name (light) or path to theme file + -t, --theme theme name or path (mutliple values allowed) -Exemples : +Exemples: $ open-stage-control -s 127.0.0.1:5555 127.0.0.1:6666 -p 7777 @@ -49,6 +49,15 @@ $ open-stage-control -n 8080 -l path/to/session.js This will create a headless app available through http on port 8080. Multiple clients can use the app (with chrome only) simultaneously, their widgets will be synchronized. + +$ open-stage-control -t light noinput /path/to/custom_theme.css + +This will apply three themes (light ui, remove all inputs, and a custom theme file) + + +Available themes: +- light +- noinput ``` ### Documentation diff --git a/browser/js/app/callbacks.js b/browser/js/app/callbacks.js index 6a2e0cec..25443da0 100644 --- a/browser/js/app/callbacks.js +++ b/browser/js/app/callbacks.js @@ -81,8 +81,9 @@ module.exports = { applyStyle: function(event,data){ var data = data || event + console.log(data) var style = document.createElement('style'); - style.innerHTML = data; + style.innerHTML = data.join(''); document.body.appendChild(style); if (data.indexOf('--pixel-scale')!=-1) { PXSCALE = data.match(/--pixel-scale\s*:\s*([^;]*)/)[1] diff --git a/main/settings.js b/main/settings.js index 80cf3da2..295c688f 100644 --- a/main/settings.js +++ b/main/settings.js @@ -11,7 +11,7 @@ var argv = require('yargs') 'l':{alias:'load',type:'string',describe:'session file to load'}, 'p':{alias:'port',describe:'osc input port (for synchronization)'}, 'n':{alias:'nogui',describe:'disable default gui and makes the app availabe through http on specified port'}, - 't':{alias:'theme',type:'string',describe:'theme name or file'} + 't':{alias:'theme',type:'array',describe:'theme name or path (mutliple values allowed)'} }) .check(function(a,x){if(a.port==undefined || !isNaN(a.p)&&a.p>1023&&parseInt(a.p)===a.p){return true}else{throw 'Error: Port must be an integer >= 1024'}}) .check(function(a,x){if(a.n==undefined || !isNaN(a.n)&&a.n>1023&&parseInt(a.n)===a.n){return true}else{throw 'Error: Port must be an integer >= 1024'}}) @@ -33,13 +33,17 @@ module.exports = function(fs) { noGui: argv.n || false, theme: function(){ if (!argv.t) return - try {return fs.readFileSync(__dirname + '/themes/' + argv.t + '.css','utf-8')} - catch(err) { - try {return fs.readFileSync(argv.t,'utf-8')} + var style = [] + for (i in argv.t) { + try {style.push(fs.readFileSync(__dirname + '/themes/' + argv.t[i] + '.css','utf-8'))} catch(err) { - return + try {style.push(fs.readFileSync(argv.t[i],'utf-8'))} + catch(err) { + continue + } } } + return style }() } return { diff --git a/main/themes/noinput.css b/main/themes/noinput.css new file mode 100644 index 00000000..1c78333f --- /dev/null +++ b/main/themes/noinput.css @@ -0,0 +1,3 @@ +.widget .input { + display: none; +}