diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d749698..36be0293 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -74,6 +74,7 @@ - dropdown: close menu when receiving a value - dropdown: removed empty 1st option - switch: removed `showValues` (inconsistent with menu/dropdown, feature covered by `values` property) + - frame: allow loading non local urls - widget removals - `push`, `toggle`: merged into `button` diff --git a/package.json b/package.json index 3b892466..2849a8c8 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "open-stage-control", "productName": "Open Stage Control", "description": "Libre and modular OSC / MIDI controller", - "version": "1.0.0-alpha17", + "version": "1.0.0-alpha18", "author": { "name": "Jean-Emmanuel Doucet", "email": "jean-emmanuel@ammd.net" diff --git a/resources/docs/docs/widgets/properties-reference.md b/resources/docs/docs/widgets/properties-reference.md index e9569eb3..6e65237b 100644 --- a/resources/docs/docs/widgets/properties-reference.md +++ b/resources/docs/docs/widgets/properties-reference.md @@ -81,7 +81,7 @@ | property | type |default | description | | --- | --- | --- | --- | - |
"auto" | Set to `false` to hide completely"auto" | Set to `false` to hide completely1 | Set to `null` to send send no argument in the osc message |
| 0 | Set to `null` to send send no argument in the osc message. Must be different from `on`. |
| "toggle" | Interraction mode:"auto" | Set to `false` to hide completely"auto" | Set to `false` to hide completely"@\{parent.variables}" | Defines one or more arbitrary variables that can be inherited by children widgets |
| false | Set to `true` to enable traversing gestures in this widget. Set to `smart` or `auto` to limit affected widgets by the type of the first touched widget |
@@ -396,7 +396,7 @@
| property | type |default | description |
| --- | --- | --- | --- |
- | "" | 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. |
??? api ""value" | Define which events trigger the script's execution."" | Script executed whenever the widget's receives the defined event. See documentation. |
+ | "" | Script executed whenever the widget's receives the defined event. See documentation. |
=== "event: keyboard"
diff --git a/scripts/client-shim.js b/scripts/client-shim.js
index 99a12013..ff175878 100644
--- a/scripts/client-shim.js
+++ b/scripts/client-shim.js
@@ -53,6 +53,7 @@ document = {
}
window = {
+ screen: {width: 800, height: 600},
addEventListener: ()=>{},
location: {},
document: document,
diff --git a/src/client/widgets/basics/button.js b/src/client/widgets/basics/button.js
index 73824d64..73567e42 100644
--- a/src/client/widgets/basics/button.js
+++ b/src/client/widgets/basics/button.js
@@ -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
diff --git a/src/client/widgets/common/osc-receiver.js b/src/client/widgets/common/osc-receiver.js
index fba6bf21..a21b97a6 100644
--- a/src/client/widgets/common/osc-receiver.js
+++ b/src/client/widgets/common/osc-receiver.js
@@ -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) {
diff --git a/src/client/widgets/containers/tab.js b/src/client/widgets/containers/tab.js
index f4e1aaf0..f6b75470 100644
--- a/src/client/widgets/containers/tab.js
+++ b/src/client/widgets/containers/tab.js
@@ -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
diff --git a/src/client/widgets/frames/frame.js b/src/client/widgets/frames/frame.js
index 927ace17..38681c1b 100644
--- a/src/client/widgets/frames/frame.js
+++ b/src/client/widgets/frames/frame.js
@@ -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) {
diff --git a/src/client/widgets/scripts/script-vm.js b/src/client/widgets/scripts/script-vm.js
index 11a978c5..19f0d79e 100644
--- a/src/client/widgets/scripts/script-vm.js
+++ b/src/client/widgets/scripts/script-vm.js
@@ -84,6 +84,7 @@ class ScriptVm extends Vm {
if (target && target[0] === '/') {
args.unshift(address)
address = target
+ target = null
}
var overrides = {
diff --git a/src/client/widgets/vm.js b/src/client/widgets/vm.js
index e77847b5..be1903ae 100644
--- a/src/client/widgets/vm.js
+++ b/src/client/widgets/vm.js
@@ -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'