diff --git a/CHANGELOG.md b/CHANGELOG.md index acf44553..943b3ede 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,10 @@ - script: added `onKeyboard` property, removed `event` property - canvas: expose additional touch event informations (`radiusX`, `radiusY`, `rotationAngle` and iOS-only `altitudeAngle`, `azimuthAngle` and `touchType`) +- advanced syntaxes + - added `IMPORT{file}` syntax to allow loading external files in properties + + ## 1.13.2 - bug fixes diff --git a/resources/docs/docs/customization/css-tips.md b/resources/docs/docs/customization/css-tips.md index c40d5ba4..904101f1 100644 --- a/resources/docs/docs/customization/css-tips.md +++ b/resources/docs/docs/customization/css-tips.md @@ -90,3 +90,11 @@ Media queries can also be used: [CSS variables](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties) declared in the [default theme](https://github.com/jean-emmanuel/open-stage-control/blob/master/src/scss/themes/default.scss) can be overridden. Widgets also rely on CSS variables for the style properties (colors, padding, etc). These are documented in the widgets' `css` property description. + +# Loading images + +Image urls are resolved in this order: +- in the session's directory +- in theme's directory +- in the server's `remote-root` directory if the option is set +- as absolute paths diff --git a/resources/docs/docs/widgets/advanced-syntaxes.md b/resources/docs/docs/widgets/advanced-syntaxes.md index 2a9f80d1..1e11fa6c 100644 --- a/resources/docs/docs/widgets/advanced-syntaxes.md +++ b/resources/docs/docs/widgets/advanced-syntaxes.md @@ -60,6 +60,15 @@ Options can contain `@{}` blocks. This syntax creates a custom variable in the widget that can be read and modified from any widget's script property (see [scripting](./scripting.md#getvarid-name)). Changes made to this variable will be applied automatically. +# File imports: `IMPORT{file_name}` + +This allows loading the content of an external file in a property. If used in a `JS{}` of `#{}` block, it will be seen as a string variable containing the raw content of the file. Changes made to the file be applied automatically. + +File paths are resolved in this order: +- in the session's directory +- in theme's directory +- in the server's `remote-root` directory if the option is set +- as absolute paths ## Javascript: `JS{ }` diff --git a/resources/docs/docs/widgets/properties-reference.md b/resources/docs/docs/widgets/properties-reference.md index 37c81763..25dba1e6 100644 --- a/resources/docs/docs/widgets/properties-reference.md +++ b/resources/docs/docs/widgets/properties-reference.md @@ -770,9 +770,9 @@ | property | type |default | description | | --- | --- | --- | --- | + |
onValue#
| `script` | "" | Script executed whenever the widget's value updates. See documentation. | |
onTouch#
| `script` | "" | Script executed when the widget is touched. See documentation. | |
onDraw#
| `script` | "" | Script executed when the widget is redrawn. See documentation. | - |
onValue#
| `script` | "" | Script executed whenever the widget's value updates. See documentation. | ## Sliders ??? api "
fader#
" @@ -909,14 +909,13 @@ ## Scripts ??? api "
script#
" - Evaluates a script each time it receives a value. + Sscripting widget utility with keyboard bindings === "scripting" | property | type |default | description | | --- | --- | --- | --- | - |
event#
| `string` | "value" | Define which events trigger the script's execution.

Choices: `value`, `keyboard` | - |
onEvent#
| `script` | "" | Script executed whenever the widget receives the defined event. See documentation. | + |
onKeyboard#
| `script` | "" | Script executed whenever the widget receives a keyboard event if `keyBinding` is set). See documentation. | |
keyBinding#
| `string`|
`array` | "" | Key combo `string` or `array` of strings (see KeyboardJS documentation).

If the editor is enabled, some keys / combos will not work. | |
keyRepeat#
| `boolean` | true | Set to `false` to prevent keydown repeats when holding the key combo pressed | |
keyType#
| `string` | "keydown" | Determines which key event trigger the script's execution

Choices: `keydown`, `keyup`, `both` |