ToolSettings

new ToolSettings(tool)

This module manages a few settings and gives you easy functions to store your settings in the localStorage.
Parameters:
Name Type Description
tool TTVTool

Members

readonly autoRecoverMessages :Boolean

Loads and returns weither or not to auto recover deleted messages.

readonly flashActions :Boolean

Loads and returns weither or not to animate actions in the action bar

readonly highlights :Array

Loads and returns an array of configured highlight objects.

readonly language :String

Loads and returns the selected application language.

readonly lightDesignMode :Boolean

Loads and returns weither or not to invert the application's colors
Creates and returns a settings menu. This always creates a new MenuItem. If you want access to the items in the application menu use getMenuItemById of the ToolUI.

readonly showBanAlert :Boolean

Loads and returns weither or not to show ban alerts

readonly showFollowAlert :Boolean

Loads and returns weither or not to show follow alerts

readonly showHostAlert :Boolean

Loads and returns weither or not to show host alerts

readonly showLocalizedNames :Boolean

Loads and returns weither or not localized names should be displayed.

readonly showRaidAlert :Boolean

Loads and returns weither or not to show raid alerts

readonly showSubscriptionAlert :Boolean

Loads and returns weither or not to show subscription alerts

readonly showTimeoutAlert :Boolean

Loads and returns weither or not to show timeout alerts

readonly showViewerList :Boolean

Loads and returns weither or not to show the viewers list

Methods

addHighlight()

Opens the dialog to add a new highlight.

appendSetting(setting, label, type, options)

Parameters:
Name Type Description
setting String
label String
type String
options Object

getBoolean(name, defaultValue)

Load a boolean from the localStorage.
Parameters:
Name Type Description
name String Name of the localStorage value
defaultValue Boolean The default value you want returned if storage value was not found

getJSON(name, defaultValue)

Gets a object from the localStorage.
Parameters:
Name Type Description
name String Name of the localStorage value
defaultValue Object The default value you want returned if storage value was not found

getString(name, defaultValue)

Gets a string from the localStorage.
Parameters:
Name Type Description
name String Name of the localStorage value
defaultValue String The default value you want returned if storage value was not found

remove(name)

Removes an item in the localStorage
Parameters:
Name Type Description
name String

setBoolean(name, value)

Sets a boolean to the localStorage.
Parameters:
Name Type Description
name String Name of the localStorage value
value Boolean The value you want to set

setJSON(name, value)

Sets a JSON object to the localStorage.
Parameters:
Name Type Description
name String Name of the localStorage value
value Object The value you want to set

setLanguage(lang)

Sets the application language to lang. Please don't use this without explicit user interaction.
Parameters:
Name Type Description
lang String The short i18n languge description. Currently only en and de are really supported.

setString(name, value)

Sets a string to the localStroage.
Parameters:
Name Type Description
name String Name of the localStorage value
value String The value you want to set