remote-control: add /SESSION/OPEN and /SESSION/SAVE commands

This commit is contained in:
bordun 2020-10-15 11:00:35 +02:00
parent 23e1a1c793
commit 07201d8427
3 changed files with 32 additions and 0 deletions

View file

@ -7,6 +7,9 @@
- fullscreen: lack of support not detected on some ios devices
- multixy: labels not hidden when `ephemeral` is `true`
- remote control
- add `/SESSION/OPEN` and `/SESSION/SAVE` commands
## 1.5.1
- bug fixes

View file

@ -169,3 +169,15 @@ Save the state of all widgets in the temporary slot.
#### `/STATE/RECALL`
Reload saved state from the temporary slot.
----
#### `/SESSION/OPEN path.json`
Open session file `path.json`.
----
#### `/SESSION/SAVE path.json`
Save current session to `path.json`. If `path.json` is omitted, current session's path is used.

View file

@ -2,6 +2,7 @@ var {updateWidget} = require('./editor/data-workers'),
editor = require('./editor'),
widgetManager = require('./managers/widgets'),
stateManager = require('./managers/state'),
sessionManager = require('./managers/session'),
deepExtend = require('deep-extend'),
notifications = require('./ui/notifications')
@ -231,6 +232,22 @@ var callbacks = {
})
},
'/SESSION/OPEN': function(args) {
if (!Array.isArray(args)) args = [args]
if (typeof args === 'string') sessionManager.requestOpen(args[0])
},
'/SESSION/SAVE': function(args) {
if (!Array.isArray(args)) args = [args]
sessionManager.save(args[0])
}
}