- theming support added
- not caching fake input color as private var because it doesn't work with themes
This commit is contained in:
parent
8469c688d1
commit
6574b8465a
7 changed files with 31 additions and 10 deletions
|
|
@ -21,7 +21,7 @@ Please note that :
|
|||
- bi-directionnal osc bindings
|
||||
- headless server mode with any number of clients using chromium
|
||||
- app state store / recall & import / export
|
||||
- light & dark themes !
|
||||
- themes !
|
||||
|
||||
### Getting started
|
||||
|
||||
|
|
@ -37,6 +37,7 @@ 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
|
||||
|
||||
Exemples :
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ MISC = {
|
|||
|
||||
|
||||
PXSCALE = getComputedStyle(document.documentElement).getPropertyValue("--pixel-scale")
|
||||
|
||||
INITIALZOOM = PXSCALE
|
||||
|
||||
|
||||
///////////////////////
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ module.exports = {
|
|||
// fetch ids corresponding to the osc path
|
||||
var path = data.path
|
||||
var ids = WIDGETS_ID_BY_PATH[path]
|
||||
|
||||
|
||||
for (i in ids) {
|
||||
var id = ids[i]
|
||||
// update
|
||||
|
|
@ -77,6 +77,17 @@ module.exports = {
|
|||
var data = data || event
|
||||
|
||||
utils.createPopup(icon('warning')+' '+data.title,data.text)
|
||||
},
|
||||
|
||||
applyStyle: function(event,data){
|
||||
var data = data || event
|
||||
var style = document.createElement('style');
|
||||
style.innerHTML = data;
|
||||
document.body.appendChild(style);
|
||||
if (data.indexOf('--pixel-scale')) {
|
||||
PXSCALE = data.match(/--pixel-scale\s*:\s*([^;]*)/)[1]
|
||||
INITIALZOOM = PXSCALE
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@ var tabs = function() {
|
|||
// if shift is pressed (native), or if there is no vertical scrollbar,
|
||||
// or if mouse is on h-scrollbar
|
||||
var scrollbarHeight = 20
|
||||
var initialZoom = PXSCALE
|
||||
var scrolls = function(){
|
||||
$('html').on('mousewheel.zoom',function(e) {
|
||||
// console.log(e)
|
||||
|
|
@ -51,9 +50,9 @@ var scrolls = function(){
|
|||
})
|
||||
$(document).on('keydown.resetzoom', function(e){
|
||||
if (e.keyCode==96||e.keyCode==48) {
|
||||
PXSCALE = 1
|
||||
PXSCALE = INITIALZOOM
|
||||
document.documentElement.style.setProperty("--pixel-scale",'')
|
||||
document.documentElement.style.setProperty("--pixel-scale",initialZoom)
|
||||
document.documentElement.style.setProperty("--pixel-scale",PXSCALE)
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
(function ($) {
|
||||
var color = String(getComputedStyle(document.documentElement).getPropertyValue("--color-text")).trim()
|
||||
$.fn.fakeInput = function(options) {
|
||||
|
||||
var settings = $.extend({
|
||||
|
|
@ -13,7 +12,7 @@
|
|||
self.value = undefined
|
||||
self.height = undefined
|
||||
self.width = undefined
|
||||
self.color = color
|
||||
self.color = undefined
|
||||
self.center = settings.align == 'center'
|
||||
self.visible = false
|
||||
|
||||
|
|
@ -33,6 +32,7 @@
|
|||
canvas.addClass('visible')
|
||||
}
|
||||
|
||||
self.color = getComputedStyle(document.documentElement).getPropertyValue("--color-text")
|
||||
self.height=height
|
||||
self.width=width
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ module.exports = function(settings,fs,ipc,osc,dialog) {
|
|||
return {
|
||||
|
||||
ready: function(data,clientId) {
|
||||
if (settings.read('theme')) ipc.send('applyStyle',settings.read('theme'),clientId)
|
||||
if (settings.read('sessionFile')) this.sessionOpen({path:settings.read('sessionFile')},clientId)
|
||||
var recentSessions = settings.read('recentSessions')
|
||||
ipc.send('sessionList',recentSessions,clientId)
|
||||
|
|
|
|||
|
|
@ -11,6 +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'}
|
||||
})
|
||||
.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'}})
|
||||
|
|
@ -28,10 +29,18 @@ module.exports = function(fs) {
|
|||
appName: 'Open Stage Control',
|
||||
syncTargets: argv.s || false,
|
||||
oscInPort: argv.p || false,
|
||||
compileScss: argv.c!==undefined || false,
|
||||
lightTheme: argv.c && argv.c.match(/light/),
|
||||
sessionFile: argv.l || false,
|
||||
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')}
|
||||
catch(err) {
|
||||
return
|
||||
}
|
||||
}
|
||||
}()
|
||||
}
|
||||
return {
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue