Class: SettingsPlugin

PSV.plugins~SettingsPlugin

new SettingsPlugin (psv)

Adds a button to access various settings.

Name Type Description
psv PSV.Viewer

Extends

Members

id string readonly inherited overrides

Unique identifier of the plugin

ID_PANEL string constant

Panel identifier for settings content

Reference to main controller

SETTING_DATA string constant

Property name added to settings items

SETTING_OPTIONS_TEMPLATE

Settings options template

SETTINGS_TEMPLATE

Settings list template

SETTINGS_TEMPLATE_

Setting item template, by type

Methods

addSetting (setting)

Registers a new setting

Name Type Description
setting PSV.plugins.SettingsPlugin.Setting

destroy () package overrides

hideSettings ()

Hides the settings panel

removeSetting (id)

Removes a setting

Name Type Description
id string

showSettings ()

Shows the settings panel

toggleSettings ()

Toggles the settings panel

Type Definitions

PSV.plugins.SettingsPlugin.Option Object

Option of an 'option' setting

Properties:
Name Type Description
id string

identifier of the option

label string

label of the option

active boolean

state of the option

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 value (human readable)

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

PSV.plugins.SettingsPlugin.Setting Object

Description of a setting

Properties:
Name Type Description
id string

identifier of the setting

label string

label of the setting

type 'options' | 'toggle'

type of the setting

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