Adds a button to access various settings.
Name | Type | Description |
---|---|---|
psv |
PSV.Viewer | |
options |
PSV.plugins.SettingsPlugin.Options |
Extends
Members
-
Available events
-
-
-
-
-
Unique identifier of the plugin
-
-
psv PSV.Viewer readonly inherited overrides
Reference to main controller
-
Methods
-
Registers a new setting
-
Name Type Description setting
PSV.plugins.SettingsPlugin.Setting -
Changes the value of an setting
-
Name Type Description setting
PSV.plugins.SettingsPlugin.OptionsSetting optionId
string -
destroy () package overrides
-
-
Hides the settings menu
-
-
init () package overrides
-
-
Removes a setting
-
Name Type Description id
string -
Shows the settings menu
-
-
Toggles the settings menu
-
-
Toggles a setting
-
Name Type Description setting
PSV.plugins.SettingsPlugin.ToggleSetting -
Updates the badge in the button
-
Type Definitions
-
Option of an 'option' setting
-
Properties:
Name Type Description id
string identifier of the option
label
string label of the option
-
Properties:
Name Type Argument Default Description persist
boolean <optional>
false should the settings be saved accross sessions
storage
Object <optional>
custom storage handler, defaults to LocalStorage
Properties
Name Type Argument Description get
PSV.plugins.SettingsPlugin.StorageGetter <optional>
set
PSV.plugins.SettingsPlugin.StorageSetter <optional>
-
PSV.plugins.SettingsPlugin.OptionsSetting PSV.plugins.SettingsPlugin.Setting
Description of a 'options' setting
-
Properties:
Name Type Description type
'options' type of the setting
current
function function which returns the current option id
options
function function which the possible options as an array of PSV.plugins.SettingsPlugin.Option
apply
function function called with the id of the selected option
-
Description of a setting
-
Properties:
Name Type Argument Description id
string identifier of the setting
label
string label of the setting
type
'options' | 'toggle' type of the setting
badge
function <optional>
function which returns the value of the button badge
-
Name Type Description settingId
string Returns:
Type Description boolean | string | Promise.<(boolean|string)> - return
undefined
ornull
if the option does not exist
- return
-
Name Type Description settingId
string value
boolean | string -
PSV.plugins.SettingsPlugin.ToggleSetting PSV.plugins.SettingsPlugin.Setting
Description of a 'toggle' setting
-
Properties:
Name Type Description type
'toggle' type of the setting
active
function function which return whereas the setting is active or not
toggle
function function called when the setting is toggled
Events
-
Triggered when a setting is changed
-
Name Type Description settingId
string value
any