RandomTips

Shows random tips to the user, if wanted.

Source:

Requires

  • module:../lib/lodash/debounce
  • module:../AddonSettings
  • module:../MessageHandler/CustomMessages

Methods

(static) init(tipsToShow) → {Promise.<void>}

Source:

Initialises the module.

Parameters:
Name Type Description
tipsToShow Array.<TipObject>

the tips object to init

Returns:
Type
Promise.<void>

(static) setContext(newContext) → {void}

Source:

Sets the context for the current session.

Parameters:
Name Type Description
newContext string
Returns:
Type
void

(static) showRandomTip() → {void}

Source:

Selects and shows a random tip.

Returns:
Type
void

(static) showRandomTipIfWanted() → {void}

Source:

Shows the random tip only randomly so the user is not annoyed.

Returns:
Type
void

Type Definitions

ModuleConfig

Source:
Properties:
Name Type Description
tips Object.<string, module:RandomTips~TipConfigObject>

config for each tip

triggeredOpen integer

how often the whole module/add-on has been triggered, i.e. how often the init method has been called.

The configuration stored by this module.

It is stored in the key TIP_SETTING_STORAGE_ID in the data storage.

Type:
  • Object

TipConfigObject

Source:
Properties:
Name Type Attributes Description
shownCount integer

how often the tip has already been shown

dismissedCount integer

how often the tip has already been dismissed

shownContext Object.<string, integer> <optional>

how often the tip has already been shown in a specific context. The aquivalent to TipObject#shownInContext See setContext}.

The saved settings of a specific tip.

Type:
  • Object