From f9fd1ca2a8834a58838363b6437353a31f282d33 Mon Sep 17 00:00:00 2001 From: bordun Date: Mon, 6 Apr 2020 14:53:08 +0200 Subject: [PATCH] docs: wip wip --- .../docs/docs/getting-started/server-configuration.md | 6 +++--- resources/docs/docs/widgets/advanced-syntaxes.md | 9 ++++----- resources/docs/docs/widgets/properties-reference.md | 3 ++- resources/docs/docs/widgets/scripting.md | 8 ++++++-- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/resources/docs/docs/getting-started/server-configuration.md b/resources/docs/docs/getting-started/server-configuration.md index 831193a2..60e34c30 100644 --- a/resources/docs/docs/getting-started/server-configuration.md +++ b/resources/docs/docs/getting-started/server-configuration.md @@ -95,19 +95,19 @@ Default [client options](../client-options). ---- -####  `--disable-vsync` +#### `disable-vsync` Disable built-in client window's vertical synchronization. ---- -####  `--force-gpu` +#### `force-gpu` Disable built-in client window's gpu blacklist (may improve rendering performance in some cases). ---- -####  `--read-only` +#### `read-only` Disable session editing, and file saving. diff --git a/resources/docs/docs/widgets/advanced-syntaxes.md b/resources/docs/docs/widgets/advanced-syntaxes.md index 06504b0a..5ed14237 100644 --- a/resources/docs/docs/widgets/advanced-syntaxes.md +++ b/resources/docs/docs/widgets/advanced-syntaxes.md @@ -65,11 +65,10 @@ This syntax allows writing formulas in pure javascript. The code will be compile - `console`: javascript console - `locals`: object for storing/reading arbitrary values. Changing its properties *does not* trigger any synchronisation even if the value is used somewhere else. - `globals`: same as `locals` but shared between all widgets, contains a few useful variables: - - - `screen`: `{width, height}` - - `env`: client options (ie: url query options), - - `url`: server url, - - `platform`: operating system as seen by the client + - `screen`: `{width, height}` + - `env`: client options (ie: url query options), + - `url`: server url, + - `platform`: operating system as seen by the client In this context, `@{} / OSC{}` are also seen as variables (named `VAR_XXX`), not as the value they hold, diff --git a/resources/docs/docs/widgets/properties-reference.md b/resources/docs/docs/widgets/properties-reference.md index 4e6152a6..bac0e4be 100644 --- a/resources/docs/docs/widgets/properties-reference.md +++ b/resources/docs/docs/widgets/properties-reference.md @@ -32,7 +32,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 receives the defined event. See documentation. | +|
script#
| `script` | "" | Script executed whenever the widget's value updates. See documentation. | |
osc#
|||| |
address#
| `string` | "auto" | OSC address for sending messages, it must start with a / | |
preArgs#
| `*`|
`array` | "" | A value or array of values that will be prepended to the OSC messages. | @@ -655,6 +655,7 @@ | --- | --- | --- | --- | |
script#
|||| |
event#
| `string` | "value" | Define which events trigger the script's execution.

Possible values: value, keyboard | +|
script#
| `script` | "" | Script executed whenever the widget's receives the defined event. See documentation. | |
event: keyboard#
|||| |
keyBinding#
| `string`|
`array` | "" | Key combo `string` or `array` of strings (see KeyboardJS documentation) | |
keyRepeat#
| `boolean` | true | Set to `false` to prevent keydown repeats when holding the key combo pressed | diff --git a/resources/docs/docs/widgets/scripting.md b/resources/docs/docs/widgets/scripting.md index 5961a49e..0f5ec909 100644 --- a/resources/docs/docs/widgets/scripting.md +++ b/resources/docs/docs/widgets/scripting.md @@ -1,18 +1,20 @@ # Scripting -The `script` property allows widgets to run javascript code when their value update. It differs from the javascript property syntax in the following ways: +The `script` property allows widgets to run javascript code when their value update. It differs from the [javascript property syntax ](./advanced-syntaxes.md#available-variables) in the following ways: - no `JS{{}}` wrapper, just the code - `@{}`, `OSC{}`, `JS{{}}` and `#{}` blocks are replaced with their value before the script's compilation ## Event-dependent variables +Depending on what triggered the script's execution, a few variables are available to help determine the execution conditions. + **Event: value** - `id` (`string`): id of the widget that's reponsible for the value update - `value`: widget's value -**Event: keyboard** +**Event: keyboard** (script widget only) - `type` (`string`): `keydown` or `keyup` - `key` (`string`): key name, @@ -25,6 +27,8 @@ The `script` property allows widgets to run javascript code when their value upd ## Available variables +Besides the variables available in the [javascript property syntax ](./advanced-syntaxes.md#available-variables), the following variables and functions are also accessible in this context. + ---- #### `get`: `function(id)`