docs: script property desc

This commit is contained in:
bordun 2020-04-05 17:41:05 +02:00
parent 9ccbe31b3f
commit d76e43a826
2 changed files with 2 additions and 15 deletions

View file

@ -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 is set.'},
script: {type: 'script', value: '', help: 'Script executed whenever the widget\'s value is set. See https://openstagecontrol.ammd.net/v1/docs/widgets/scripting/'},
_osc: 'osc',

View file

@ -19,20 +19,7 @@ class Script extends Widget {
_script: 'script',
event: {type: 'string', value: 'value', choices: ['value', 'keyboard'], help: 'Define which events trigger the script\'s execution.'},
script: {type: 'string', value: '', help: [
'This property is evaluated each time the widget receives a value*. Formulas are given extras variables in this context:',
'- `value`: value received by the widget',
'- `id`: id of the widget that triggered the script',
'- `send(target, address, arg1, arg2, ...)`: function for sending osc messages (ignores the script\'s targets and the server\'s defaults unless `target` is `false`; ignores the script\'s `preArgs`)',
'- `set(id, value)`: function for setting a widget\'s value',
'- `get(id)`: function for getting a widget\'s value (dynamic equivalent of @{id})',
'- `getProp(id, property)`: function for getting a widget\'s property value ((dynamic equivalent of @{id.property})',
'- `httpGet(url, callback)`: function for making http requests (asynchronous "GET" request and local urls only)',
'',
'* Note: `value` or `linkId` properties can be used to receive other widgets\' values. The `value` property must actually change to trigger the execution, where linked widgets via `linkId` can submit the same value over and over and trigger the execution',
]},
script: {type: 'script', value: '', help: 'Script executed whenever the widget\'s receives the defined event. See https://openstagecontrol.ammd.net/v1/docs/widgets/scripting/'},
_eventKey: 'event: keyboard',