PreferenceManager

Description

PreferenceManager only works in browser (it uses global localStorage object).

Variables Summary

Functions Summary

Variables

_itemMap

Preference Item Map

_schemaMap

Preference Schema Map

Functions

Public API

get

Return value of key

key string
defaultValue nullable
Returns: ?
Public API

getViewState

Convenience function that gets a view state

id string
preference to get
context nullable Object
Optional additional information about the request
Public API

register

Register preference schema

id string
name string
schema Object
Public API

set

Change value of key

key string
value nullable
Public API

setViewState

Convenience function that sets a view state and then saves the file

id string
preference to set
value *
new value for the preference
context nullable Object
Optional additional information about the request
doNotSave optional boolean
If it is undefined or false, then save the view state immediately.

validate

Validate preference schema

schema Object
Returns: boolean