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

This commit is contained in:
bordun 2020-05-13 14:21:53 +02:00
commit 0c11d5fd35
10 changed files with 29 additions and 22 deletions

View file

@ -223,7 +223,8 @@ Button.cssVariables = Button.prototype.constructor.cssVariables.concat(
Button.dynamicProps = Button.prototype.constructor.dynamicProps.concat(
'on',
'off',
'norelease'
'norelease',
'label'
)
module.exports = Button

View file

@ -53,7 +53,7 @@ module.exports = class OscReceiver {
callback(args) {
if (typeof args !== 'object') args = [args]
if (!Array.isArray(args)) args = [args]
var preArgs = this.usePreArgs ? (this.parent.getProp('preArgs') || []) : []
if (!Array.isArray(preArgs) && preArgs !== '') preArgs = [preArgs]
if (args.length >= preArgs.length) {

View file

@ -3,7 +3,7 @@ var Panel = require('./panel'),
resize = require('../../events/resize'),
{iconify} = require('../../ui/utils')
module.exports = class Tab extends Panel {
class Tab extends Panel {
static description() {
@ -130,3 +130,9 @@ module.exports = class Tab extends Panel {
}
}
Tab.dynamicProps = Tab.prototype.constructor.dynamicProps.concat(
'label'
)
module.exports = Tab

View file

@ -1,6 +1,5 @@
var Widget = require('../common/widget'),
html = require('nanohtml'),
{urlParser} = require('../utils'),
locales = require('../../locales'),
StaticProperties = require('../mixins/static_properties')
@ -19,7 +18,7 @@ class Frame extends StaticProperties(Widget, {bypass: true}) {
}, ['decimals', 'bypass'], {
value: {type: 'string', value: '', help: [
'External web page URL. Only local URLs are allowed (starting with `http://127.0.0.1/`, `http://10.x.x.x/`, `http://192.168.x.x/`, etc)',
'External web page URL.',
]}
})
@ -47,9 +46,7 @@ class Frame extends StaticProperties(Widget, {bypass: true}) {
this.value = v
var parser = urlParser(this.value)
if (this.value && parser.isLocal()) {
if (this.value) {
this.frame.setAttribute('src', this.value)
this.widget.classList.remove('error')
if (this.errorTextMounted) {

View file

@ -84,6 +84,7 @@ class ScriptVm extends Vm {
if (target && target[0] === '/') {
args.unshift(address)
address = target
target = null
}
var overrides = {

View file

@ -2,19 +2,19 @@ var loopProtect = require('loop-protect'),
{deepCopy} = require('../utils'),
globals
setTimeout(()=>{
globals = {
screen: {width: screen.width, height: screen.height},
env: deepCopy(ENV),
url: document.location.host,
platform: navigator.platform
}
})
class Vm {
constructor() {
if (!globals) {
globals = {
screen: {width: screen.width, height: screen.height},
env: deepCopy(ENV),
url: document.location.host,
platform: navigator.platform
}
}
this.sandbox = document.createElement('iframe')
this.sandbox.style.display = 'none'
this.sandbox.sandbox = 'allow-same-origin'