CommonMessages

Provides access to the most common message types.

Source:

Methods

(static) hideError(optionsopt) → {void}

Source:

Hides the error message.

Parameters:
Name Type Attributes Description
options Object <optional>
Properties
Name Type Attributes Default Description
animate boolean <optional>
false

set to true to animate the hiding

Returns:
Type
void

(static) hideInfo(optionsopt) → {void}

Source:

Hide info message.

Parameters:
Name Type Attributes Description
options Object <optional>
Properties
Name Type Attributes Default Description
animate boolean <optional>
false

set to true to animate the hiding

Returns:
Type
void

(static) hideLoading(optionsopt) → {void}

Source:

Hide loading message.

Parameters:
Name Type Attributes Description
options Object <optional>
Properties
Name Type Attributes Default Description
animate boolean <optional>
false

set to true to animate the hiding

Returns:
Type
void

(static) hideSuccess(optionsopt) → {void}

Source:

Hide success message.

Parameters:
Name Type Attributes Description
options Object <optional>
Properties
Name Type Attributes Default Description
animate boolean <optional>
false

set to true to animate the hiding

Returns:
Type
void

(static) hideWarning(optionsopt) → {void}

Source:

Hide warning message.

Parameters:
Name Type Attributes Description
options Object <optional>
Properties
Name Type Attributes Default Description
animate boolean <optional>
false

set to true to animate the hiding

Returns:
Type
void

(static) init() → {void}

Source:

Initialises the module.

Returns:
Type
void

(static) setDismissHooks(startHookopt, endHookopt) → {void}

Source:

Called when a message is dismissed.

  • When called, the function does not know, which message is hidden, but you can determinante it by yourself. The called hook gets an object with two parameters:
    • {HTMLElement} elMessage – the message element, which was hidden
    • {event} event – the original click even on the dismiss button
Parameters:
Name Type Attributes Description
startHook function | null <optional>
endHook function | null <optional>
Returns:
Type
void

(static) setErrorHook(hookShownopt, hookHiddenopt) → {void}

Source:

Let's other functions set a hook to be called when a error message is shown or hidden.

Set parameters to null or undefined (i.e. do not set) in order to disable the hook. The errorShown function gets one parameter: The arguments passed to the function, as an array.

Parameters:
Name Type Attributes Description
hookShown function | null <optional>
hookHidden function | null <optional>
Returns:
Type
void

(static) setInfoHook(hookShownopt, hookHiddenopt) → {void}

Source:

Let's other functions set a hook to be called when a info message is shown or hidden.

Set parameters to null or undefined (i.e. do not set) in order to disable the hook. The errorShown function gets one parameter: The arguments passed to the function, as an array.

Parameters:
Name Type Attributes Description
hookShown function | null <optional>
hookHidden function | null <optional>
Returns:
Type
void

(static) setLoadingHook(hookShownopt, hookHiddenopt) → {void}

Source:

Let's other functions set a hook to be called when a loading message is shown or hidden.

Set parameters to null or undefined (i.e. do not set) in order to disable the hook. The errorShown function gets one parameter: The arguments passed to the function, as an array.

Parameters:
Name Type Attributes Description
hookShown function | null <optional>
hookHidden function | null <optional>
Returns:
Type
void

(static) setSuccessHook(hookShownopt, hookHiddenopt) → {void}

Source:

Let's other functions set a hook to be called when an success message is shown or hidden.

Set parameters to null or undefined (i.e. do not set) in order to disable the hook. The errorShown function gets one parameter: The arguments passed to the function, as an array.

Parameters:
Name Type Attributes Description
hookShown function | null <optional>
hookHidden function | null <optional>
Returns:
Type
void

(static) setWarningHook(hookShownopt, hookHiddenopt) → {void}

Source:

Let's other functions set a hook to be called when a warning message is shown or hidden.

Set parameters to null or undefined (i.e. do not set) in order to disable the hook. The errorShown function gets one parameter: The arguments passed to the function, as an array.

Parameters:
Name Type Attributes Description
hookShown function | null <optional>
hookHidden function | null <optional>
Returns:
Type
void

(static) showError(messageopt, isDismissableopt, actionButtonopt, …args) → {void}

Source:

Show a critical error.

Note this should only be used to show short error messages, which are meaningfull to the user, as the space is limited. So it is mostly only useful to use only one param: a string. Also pay attention to the fact, that it currently can only show one error once.

Parameters:
Name Type Attributes Description
message string <optional>

optional, string to show or to translate if omitted no new text is shown

isDismissable boolean <optional>

optional, set to true, if user should be able to dismiss the message

actionButton Object <optional>

optional to show an action button

Properties
Name Type Description
text string
action string | function

URL to site to open on link OR function to execute

args * <repeatable>

optional parameters for translation

Returns:
Type
void

(static) showInfo(messageopt, isDismissableopt, actionButtonopt, …args) → {void}

Source:

Show an info message.

Parameters:
Name Type Attributes Description
message string <optional>

optional, string to show or to translate if omitted no new text is shown

isDismissable boolean <optional>

optional, set to true, if user should be able to dismiss the message

actionButton Object <optional>

optional to show an action button

Properties
Name Type Description
text string
link string

URL to site to open on link

args * <repeatable>

optional parameters for translation

Returns:
Type
void

(static) showLoading(messageopt, isDismissableopt, actionButtonopt, …args) → {void}

Source:

Shows a loading message.

Parameters:
Name Type Attributes Description
message string <optional>

optional, string to show or to translate if omitted no new text is shown

isDismissable boolean <optional>

optional, set to true, if user should be able to dismiss the message

actionButton Object <optional>

optional to show an action button

Properties
Name Type Description
text string
action string | function

URL to site to open on link OR function to execute

args * <repeatable>

optional parameters for translation

Returns:
Type
void

(static) showSuccess(messageopt, isDismissableopt, actionButtonopt, …args) → {void}

Source:

Show a success message.

Parameters:
Name Type Attributes Description
message string <optional>

optional, string to show or to translate if omitted no new text is shown

isDismissable boolean <optional>

optional, set to true, if user should be able to dismiss the message

actionButton Object <optional>

optional to show an action button

Properties
Name Type Description
text string
action string | function

URL to site to open on link OR function to execute

args * <repeatable>

optional parameters for translation

Returns:
Type
void

(static) showWarning(messageopt, isDismissableopt, actionButtonopt, …args) → {void}

Source:

Show an warning message.

Parameters:
Name Type Attributes Description
message string <optional>

optional, string to show or to translate if omitted no new text is shown

isDismissable boolean <optional>

optional, set to true, if user should be able to dismiss the message

actionButton Object <optional>

optional to show an action button

Properties
Name Type Description
text string
action string | function

URL to site to open on link OR function to execute

args * <repeatable>

optional parameters for translation

Returns:
Type
void