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 settingPSV.plugins.SettingsPlugin.Setting -
Changes the value of an setting
-
Name Type Description settingPSV.plugins.SettingsPlugin.OptionsSetting optionIdstring -
destroy () package overrides
-
-
Hides the settings menu
-
-
init () package overrides
-
-
Removes a setting
-
Name Type Description idstring -
Shows the settings menu
-
-
Toggles the settings menu
-
-
Toggles a setting
-
Name Type Description settingPSV.plugins.SettingsPlugin.ToggleSetting -
Updates the badge in the button
-
Type Definitions
-
Option of an 'option' setting
-
Properties:
Name Type Description idstring identifier of the option
labelstring label of the option
-
Properties:
Name Type Argument Default Description persistboolean <optional>
false should the settings be saved accross sessions
storageObject <optional>
custom storage handler, defaults to LocalStorage
Properties
Name Type Argument Description getPSV.plugins.SettingsPlugin.StorageGetter <optional>
setPSV.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
currentfunction function which returns the current option id
optionsfunction function which the possible options as an array of PSV.plugins.SettingsPlugin.Option
applyfunction function called with the id of the selected option
-
Description of a setting
-
Properties:
Name Type Argument Description idstring identifier of the setting
labelstring label of the setting
type'options' | 'toggle' type of the setting
badgefunction <optional>
function which returns the value of the button badge
-
Name Type Description settingIdstring Returns:
Type Description boolean | string | Promise.<(boolean|string)> - return
undefinedornullif the option does not exist
- return
-
Name Type Description settingIdstring valueboolean | string -
PSV.plugins.SettingsPlugin.ToggleSetting PSV.plugins.SettingsPlugin.Setting
Description of a 'toggle' setting
-
Properties:
Name Type Description type'toggle' type of the setting
activefunction function which return whereas the setting is active or not
togglefunction function called when the setting is toggled
Events
-
Triggered when a setting is changed
-
Name Type Description settingIdstring valueany