From 8ce2032bfa70b92a08ce22c0946d7aa7f9eade29 Mon Sep 17 00:00:00 2001 From: bordun Date: Sat, 9 May 2020 18:39:04 +0200 Subject: [PATCH] docs: update and fixes --- .../docs/docs/widgets/properties-reference.md | 14 ++++++++------ resources/docs/docs/widgets/scripting.md | 6 +++--- src/client/widgets/common/widget.js | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/resources/docs/docs/widgets/properties-reference.md b/resources/docs/docs/widgets/properties-reference.md index cf5d27d4..e9569eb3 100644 --- a/resources/docs/docs/widgets/properties-reference.md +++ b/resources/docs/docs/widgets/properties-reference.md @@ -12,7 +12,7 @@ | property | type |default | description | | --- | --- | --- | --- | - |
type#
| `string` | "auto" | | + |
type#
| `string` | "auto" | Widget type | |
id#
| `string` | "auto" | Widgets sharing the same `id` will act as clones and update each other's value(s) without sending extra osc messages. | |
visible#
| `boolean` | true | Set to `false` to hide the widget. | |
interaction#
| `boolean` | true | Set to `false` to disable pointer interactions. | @@ -24,8 +24,8 @@ | --- | --- | --- | --- | |
left#
| `number`|
`string` | "auto" | When both top and left are set to auto, the widget is positioned according to the normal flow of the page (from left to right, by order of creation).

Otherwise, the widget will be absolutely positioned | |
top#
| `number`|
`percentage` | "auto" | When both top and left are set to auto, the widget is positioned according to the normal flow of the page (from left to right, by order of creation).

Otherwise, the widget will be absolutely positioned | - |
width#
| `number`|
`percentage` | "auto" | | - |
height#
| `number`|
`percentage` | "auto" | | + |
width#
| `number`|
`percentage` | "auto" | Widget width | + |
height#
| `number`|
`percentage` | "auto" | Widget height | |
expand#
| `boolean`|
`number` | "false" | If parent's layout is `vertical` or `horizontal`, set this to `true` to stretch the widget to use available space automatically. | @@ -52,7 +52,7 @@ |
value#
| `*` | "" | Define the widget's value depending on other widget's values / properties using the advanced property syntax | |
default#
| `*` | "" | If set, the widget will be initialized with this value when the session is loaded. | |
linkId#
| `string`|
`array` | "" | Widgets sharing the same `linkId` update each other's value(s) AND send their respective osc messages.

When prefixed with >>, the `linkId` will make the widget act as a master (sending but not receiving)

When prefixed with <<, the `linkId` will make the widget act as a slave (receiving but not sending) | - |
script#
| `script` | "" | Script executed whenever the widget's value updates. See documentation. | + |
script#
| `script` | "" | Script executed whenever the widget's value updates. See documentation. | === "osc" @@ -125,7 +125,9 @@ | property | type |default | description | | --- | --- | --- | --- | | | `number`|
`array` | 200 | - If `layout` is `circular`: diameter (in px)
- Else: square size or `[width, height]` array | - | | `string` | "center" | Set to `left` or `right` to change text alignment (otherwise center)

Choices: `center`, `left`, `right` | + | | `string` | "center" | Set to `left` or `right` to change text alignment (otherwise center)

Choices: `center`, `left`, `right` | + | | `string` | "center" | Set to `top` or `bottom` to change menu alignment (otherwise center)

Choices: `center`, `top`, `bottom` | + | | `string` | "center" | Set to `left` or `right` to change menu alignment (otherwise center)

Choices: `center`, `left`, `right` | | | `string` | "circular" | Defines whether the menu's layout should be rendered in a circle or in a box

Choices: `circular`, `horizontal`, `vertical`, `grid` | | | `string`|
`number` | "" | If `layout` is `grid`, can be either a number of columns of a value css grid-template definition. | | | `boolean` | false | Set to `true` to make the menu stay opened after mouse/touch release | @@ -445,7 +447,7 @@ |
logScaleX#
| `boolean`|
`number` | false | Set to `true` to use logarithmic scale for the x axis (base 10). Set to a `number` to define the logarithm's base. | |
logScaleY#
| `boolean`|
`number` | false | Set to `true` to use logarithmic scale for the y axis (base 10). Set to a `number` to define the logarithm's base. | |
origin#
| `number` | "auto" | Defines the y axis origin. Set to `false` to disable it. | - |
dots#
| `boolean` | true | | + |
dots#
| `boolean` | true | Draw dots on the line | |
bars#
| `boolean` | false | Set to `true` to use draw bars instead (disables `logScaleX` and forces `x axis` even spacing) | |
pips#
| `boolean` | true | Set to `false` to hide the scale | diff --git a/resources/docs/docs/widgets/scripting.md b/resources/docs/docs/widgets/scripting.md index dd88fb99..53899106 100644 --- a/resources/docs/docs/widgets/scripting.md +++ b/resources/docs/docs/widgets/scripting.md @@ -39,7 +39,7 @@ Returns the value of the first matching widget. ---- #### `set`: `function(id, value)` -- `id`: widget `id` as a string. Can be `"self"` to target the host widget, or `"parent"` to target the parent widget. +- `id`: widget `id` as a string. Can be `"this"` to target the host widget, or `"parent"` to target the parent widget. - `value`: new value for the widget. Sets the value of the first matching widget. @@ -57,7 +57,7 @@ If the event that triggered the script's execution was not initiated by a user i ---- #### `getProp`: `function(id, name)` -- `id`: widget `id` as a string. Can be `"self"` to target the host widget, or `"parent"` to target the parent widget. +- `id`: widget `id` as a string. Can be `"this"` to target the host widget, or `"parent"` to target the parent widget. - `name`: property name. Returns the property called `"name"` of the first matching widget. @@ -72,7 +72,7 @@ Returns the property called `"name"` of the first matching widget. ---- #### `stateGet`: `function(id)` -- `id`: widget `id` as a string, or array of `id` strings. Can be `"self"` to target the host widget, or `"parent"` to target the parent widget. +- `id`: widget `id` as a string, or array of `id` strings. Can be `"this"` to target the host widget, or `"parent"` to target the parent widget. Returns a state object (`id:value`) for matching widget and all their children. diff --git a/src/client/widgets/common/widget.js b/src/client/widgets/common/widget.js index 2ca41ed9..8c47ca2d 100644 --- a/src/client/widgets/common/widget.js +++ b/src/client/widgets/common/widget.js @@ -99,7 +99,7 @@ class Widget extends EventEmitter { 'When prefixed with >>, the `linkId` will make the widget act as a master (sending but not receiving)', 'When prefixed with <<, the `linkId` will make the widget act as a slave (receiving but not sending)' ]}, - script: {type: 'script', value: '', help: 'Script executed whenever the widget\'s value updates. See documentation.'}, + script: {type: 'script', value: '', help: 'Script executed whenever the widget\'s value updates. See documentation.'}, _osc: 'osc',