Merge branch 'master' of github.com:jean-emmanuel/open-stage-control

This commit is contained in:
bordun 2020-05-23 12:26:55 +02:00
commit 6e548ae48b
7 changed files with 37 additions and 22 deletions

View file

@ -23,7 +23,7 @@ module.exports = class Plot extends StaticProperties(Canvas, {bypass: true, inte
logScaleX: {type: 'boolean|number', value: false, help: 'Set to `true` to use logarithmic scale for the x axis (base 10). Set to a `number` to define the logarithm\'s base.'},
logScaleY: {type: 'boolean|number', value: false, help: 'Set to `true` to use logarithmic scale for the y axis (base 10). Set to a `number` to define the logarithm\'s base.'},
origin: {type: 'number', value: 'auto', help: 'Defines the y axis origin. Set to `false` to disable it.'},
dots: {type: 'boolean', value: true, help: 'Draw dots on the line'},
dots: {type: 'boolean', value: false, help: 'Draw dots on the line'},
bars: {type: 'boolean', value: false, help: 'Set to `true` to use draw bars instead (disables `logScaleX` and forces `x axis` even spacing)'},
pips:{type: 'boolean', value: true, help: 'Set to `false` to hide the scale'},
@ -186,7 +186,7 @@ module.exports = class Plot extends StaticProperties(Canvas, {bypass: true, inte
this.ctx.lineWidth = 2 * PXSCALE
for (var i = 0; i < points.length; i += 2) {
this.ctx.beginPath()
this.ctx.arc(points[i], points[i + 1], 3 * PXSCALE, 0, 2*Math.PI)
this.ctx.arc(points[i], points[i + 1], 2 * PXSCALE, 0, 2*Math.PI)
this.ctx.fill()
this.ctx.stroke()
}

View file

@ -132,6 +132,21 @@ class ScriptVm extends Vm {
}
this.sandbox.contentWindow.updateProp = (id, prop)=>{
var widgets = this.resolveId(id),
widget = this.getWidget()
if (widget.builtIn) widget = widget.parent
for (var i = widgets.length - 1; i >= 0; i--) {
widgets[i].updateProps(Array.isArray(prop) ? prop : [prop], widget)
}
}
this.sandbox.contentWindow.httpGet = (url, callback)=>{
var parser = urlParser(url),
@ -263,7 +278,7 @@ class ScriptVm extends Vm {
}
for (var imports of ['set', 'get', 'getProp', 'send', 'httpGet', 'stateGet', 'stateSet', 'storage',
for (var imports of ['set', 'get', 'getProp', 'updateProp', 'send', 'httpGet', 'stateGet', 'stateSet', 'storage',
'setInterval', 'clearInterval', 'setTimeout', 'clearTimeout']) {
this.sanitize(this.sandbox.contentWindow[imports])
}

View file

@ -105,7 +105,7 @@ class Script extends Widget {
this.scriptLock = true
try {
this.script(context, this.parsersLocalScope)
this.script(context, this.builtIn ? this.parent.parsersLocalScope : this.parsersLocalScope)
} catch(e) {
console.log(e)
}

View file

@ -69,7 +69,7 @@ $padding: 8rem;
// border: $padding solid var(--color-ui-background);
padding: $padding;
background: var(--color-ui-background);
.btn, input {
.btn {
margin: 1rem;
margin-left: $padding;
text-overflow: clip;
@ -82,6 +82,7 @@ $padding: 8rem;
.save-as {
flex:1;
border: 0;
margin: 1rem;
padding: 0 10rem;
font-size: 120%;
position: relative;

View file

@ -101,8 +101,9 @@ $padding: 8rem;
white-space: normal;
line-height: 150%;
background: var(--color-background);
padding-top:8rem;
padding: $padding;
overflow-x: auto;
}
}
}