MessageHandler

Provides access to the most common message types.

Source:
Source:

Methods

(static) getHtmlElement(messageType) → {HTMLElement}

Source:

Returns the message element by the given message type.

Parameters:
Name Type Description
messageType int | string
Returns:
Type
HTMLElement

(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) setGlobalHook(hookType, hookFunction) → {void}

Source:

Add a global hook that is triggered for all messages.

Parameters:
Name Type Description
hookType string
hookFunction function | null

the callback to run

Throws:

if invalid hook type is used

Type
TypeError | Error
Returns:
Type
void

(static) setHook(messageType, hookType, hookFunction) → {void}

Source:

Let's other functions set a hook to be called when a message type 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.

Pass "null" to it to unset it.

Parameters:
Name Type Description
messageType MESSAGE_LEVEL | HtmlElement
hookType string
hookFunction function | null

the callback to run

Throws:

if invalid hook type is used

Type
TypeError | Error
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

Shows and hides messages to the user.

Source:
Source:

Methods

(static) getHtmlElement(messageType) → {HTMLElement}

Source:

Returns the message element by the given message type.

Parameters:
Name Type Description
messageType int | string
Returns:
Type
HTMLElement

(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) setGlobalHook(hookType, hookFunction) → {void}

Source:

Add a global hook that is triggered for all messages.

Parameters:
Name Type Description
hookType string
hookFunction function | null

the callback to run

Throws:

if invalid hook type is used

Type
TypeError | Error
Returns:
Type
void

(static) setHook(messageType, hookType, hookFunction) → {void}

Source:

Let's other functions set a hook to be called when a message type 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.

Pass "null" to it to unset it.

Parameters:
Name Type Description
messageType MESSAGE_LEVEL | HtmlElement
hookType string
hookFunction function | null

the callback to run

Throws:

if invalid hook type is used

Type
TypeError | Error
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