state: store quickstate in client localStorage
This commit is contained in:
parent
2a78d8d693
commit
c1ca0aaecd
2 changed files with 6 additions and 1 deletions
|
|
@ -94,6 +94,10 @@
|
|||
- added `storage` object, proxy to the document's sessionStorage object (allows storing data that persist after page refresh, but not closing)
|
||||
- added `setTimeout`, `clearTimeout`, `setInterval`, `clearInterval` function proxies with an extra `id` argument (they clear automatically when called multiple times and upon widget removal. `id` is scoped to the widget)
|
||||
|
||||
|
||||
- state
|
||||
- quickstate (store/recall from menu) is now stored in the clients cache and persists after refresh/close (cleared with the browser's cache)
|
||||
|
||||
- custom module
|
||||
- `settings.read(name)`: `name` is now the long name of command-line options (not a camelCased one)
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ var StateManager = class StateManager {
|
|||
this.statePath = ''
|
||||
this.lastDir = null
|
||||
|
||||
this.quickState = null
|
||||
this.quickState = JSON.parse(localStorage.getItem('osc.state.quickState')) || null
|
||||
|
||||
this.valueStateQueue = {}
|
||||
this.valueOldPropQueue = {}
|
||||
|
|
@ -182,6 +182,7 @@ var StateManager = class StateManager {
|
|||
quickSave() {
|
||||
|
||||
this.quickState = deepCopy(this.get())
|
||||
localStorage.setItem('osc.state.quickState', JSON.stringify(this.quickState))
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue