diff --git a/resources/docs/docs/remote-control.md b/resources/docs/docs/remote-control.md index d5c93062..214468a8 100644 --- a/resources/docs/docs/remote-control.md +++ b/resources/docs/docs/remote-control.md @@ -5,35 +5,28 @@ All widgets that send osc messages respond to the same messages. Additionnaly, O ---- -#### `/EDIT id options` +#### `/EDIT id properties options` Apply a set of options to an existing widget by replacing the old ones with the new ones. - `id`: `string`, widget's `id` -- `options`: `string`, [JSON5](https://github.com/json5/json5) stringified object defining the new properties to merge +- `properties`: `string`, [JSON5](https://github.com/json5/json5) stringified object defining the new properties to merge - example: `{"label":"New Label", "color":"red"}` +- `options` (optional): `string`, [JSON5](https://github.com/json5/json5) stringified object defining extra option flags: + - `noWarning`: set to `true` to prevent further warning when exiting. -!!! info "" - Editing a widget can be cpu expensive, hence updating the UI continuously is not a good idea +!!! danger "Warning" + Editing widgets is cpu expensive; for small and recurrent changes, consider using [osc listeners](./widgets/advanced-syntaxes.md) instead. ---- -#### `/EDIT/MERGE id options` +#### `/EDIT/MERGE id properties options` Apply a set of options to an existing widget by merging them to the widget's options. - -- `id`: `string`, widget's `id` -- `options`: `string`, [JSON5](https://github.com/json5/json5) stringified object defining the new properties to merge - - example: `{"label":"New Label", "color":"red"}` - -!!! info "" - Editing a widget can be cpu expensive, hence updating the UI continuously is not a good idea - - ---- #### `/EDIT/UNDO` diff --git a/resources/docs/docs/widgets/properties-reference.md b/resources/docs/docs/widgets/properties-reference.md index 878759a9..cf654c13 100644 --- a/resources/docs/docs/widgets/properties-reference.md +++ b/resources/docs/docs/widgets/properties-reference.md @@ -14,7 +14,7 @@ | --- | --- | --- | --- | |
"auto" | |
| "auto" | Widgets sharing the same `id` will act as clones and update each other's value(s) without sending extra osc messages. |
- | "auto" | Set to `false` to hide completely"auto" | Set to `false` to hide completelytrue | Set to `false` to hide the widget. |
| true | Set to `false` to disable pointer interactions. |
@@ -165,19 +165,30 @@
| property | type |default | description |
| --- | --- | --- | --- |
| "auto" | Panel background color. Set to "auto" to inherit from parent widget. |
+ | "@\{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 |
+
+ === "panel: widget container"
+
+ | property | type |default | description |
+ | --- | --- | --- | --- |
| "default" | Defines how children are laid out."start" | If `layout` is `vertical` or `horizontal`, defines how widgets should be justified."" | If `layout` is `grid`, can be either a number of columns of a value css grid-template definition. |
- | false | Set to `true` to display for vertical tab layout |
- | 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 |
| true | Set to `false` to disable scrollbars |
- | "@\{parent.variables}" | Defines one or more arbitrary variables that can be inherited by children widgets |
+ | true | Set to `false` to make the `padding` property apply only between children and not at the container's inner boundaries. |
+
+ === "panel: tab container"
+
+ | property | type |default | description |
+ | --- | --- | --- | --- |
+ | false | Set to `true` to display for vertical tab layout |
=== "value"
| property | type |default | description |
| --- | --- | --- | --- |
- | "" | Defines currently widgeted tab in the widget"" | Defines currently selected tab in the widgetfalse | Set to `true` to make the modal require a double tap to open instead of a single tap |
+ | "@\{parent.variables}" | Defines one or more arbitrary variables that can be inherited by children widgets |
+
+ === "modal: popup"
+
+ | property | type |default | description |
+ | --- | --- | --- | --- |
| "" | Alternative label for the modal popup |
| "80%" | Modal popup's size |
| "80%" | Modal popup's size |
@@ -204,7 +221,7 @@
| "" | If `layout` is `grid`, can be either a number of columns of a value css grid-template definition. |
| 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 |
| true | Set to `false` to disable scrollbars |
- | "@\{parent.variables}" | Defines one or more arbitrary variables that can be inherited by children widgets |
+ | true | Set to `false` to make the `padding` property apply only between children and not at the container's inner boundaries. |
=== "value"
@@ -236,18 +253,24 @@
??? api ""button" | Defines the type of the widgets in the matrix |
+ | 4 | Defines the number of widgets in the matrix |
+ | 0 | First widget's index |
+ | \{} | Defines a set of property to override the widgets' defaults."auto" | Panel background color. Set to "auto" to inherit from parent widget. |
| "horizontal" | Defines how children are laid out."" | If `layout` is `grid`, can be either a number of columns of a value css grid-template definition. |
- | 4 | Defines the number of widgets in the matrix |
- | 0 | First widget's index |
| true | Set to `false` to disable traversing gestures |
- | \{} | Defines a set of property to override the widgets' defaults.true | Set to `false` to make the `padding` property apply only between children and not at the container's inner boundaries. |
??? api ""auto" | Panel background color. Set to "auto" to inherit from parent widget. |
+ | "@\{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 |
+
+ === "panel: widget container"
+
+ | property | type |default | description |
+ | --- | --- | --- | --- |
| "default" | Defines how children are laid out."start" | If `layout` is `vertical` or `horizontal`, defines how widgets should be justified."" | If `layout` is `grid`, can be either a number of columns of a value css grid-template definition. |
- | false | Set to `true` to display for vertical tab layout |
- | 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 |
| true | Set to `false` to disable scrollbars |
- | "" | Defines one or more arbitrary variables that can be inherited by children widgets |
+ | true | Set to `false` to make the `padding` property apply only between children and not at the container's inner boundaries. |
+
+ === "panel: tab container"
+
+ | property | type |default | description |
+ | --- | --- | --- | --- |
+ | false | Set to `true` to display for vertical tab layout |
=== "value"
@@ -317,18 +351,29 @@
??? api ""auto" | Panel background color. Set to "auto" to inherit from parent widget. |
+ | "@\{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 |
+
+ === "panel: widget container"
+
+ | property | type |default | description |
+ | --- | --- | --- | --- |
| "default" | Defines how children are laid out."start" | If `layout` is `vertical` or `horizontal`, defines how widgets should be justified."" | If `layout` is `grid`, can be either a number of columns of a value css grid-template definition. |
- | false | Set to `true` to display for vertical tab layout |
- | 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 |
| true | Set to `false` to disable scrollbars |
- | "@\{parent.variables}" | Defines one or more arbitrary variables that can be inherited by children widgets |
+ | true | Set to `false` to make the `padding` property apply only between children and not at the container's inner boundaries. |
+
+ === "panel: tab container"
+
+ | property | type |default | description |
+ | --- | --- | --- | --- |
+ | false | Set to `true` to display for vertical tab layout |
=== "value"
diff --git a/src/client/remote-control.js b/src/client/remote-control.js
index c791f991..58b555ad 100644
--- a/src/client/remote-control.js
+++ b/src/client/remote-control.js
@@ -4,14 +4,15 @@ var {updateWidget} = require('./editor/data-workers'),
stateManager = require('./managers/state'),
deepExtend = require('deep-extend'),
notifications = require('./ui/notifications')
-
+
var callbacks = {
'/EDIT': function(args) {
if (READ_ONLY) return
- var [id, json] = args,
+ var [id, json, opts] = args,
newdata = typeof json == 'string' ? JSON.parseFlex(json) : json,
+ options = typeof opts == 'string' ? JSON.parseFlex(opts) : {},
widgets = widgetManager.getWidgetById(id)
if (!widgets.length) return
@@ -33,13 +34,16 @@ var callbacks = {
editor.pushHistory()
+ if (options.noWarning) editor.unsavedSession = false
+
},
'/EDIT/MERGE': function(args) {
if (READ_ONLY) return
- var [id, json] = args,
+ var [id, json, opts] = args,
newdata = typeof json == 'string' ? JSON.parseFlex(json) : json,
+ options = typeof opts == 'string' ? JSON.parseFlex(opts) : {},
widgets = widgetManager.getWidgetById(id)
if (!widgets.length) return
@@ -59,6 +63,8 @@ var callbacks = {
editor.pushHistory()
+ if (options.noWarning) editor.unsavedSession = false
+
},
'/EDIT/UNDO': function(args) {