Class: Alert

Alert()

new Alert()

Alert/error manager
Source:

Methods

(private, static) handleNotification(id, $element, args, icon)

forwards a request to the i18n module and shows the element
Parameters:
Name Type Description
id int id of notification
$element jQuery jQuery object
args string | array
icon string | null optional, icon
Source:

(static) hideLoading()

hides the loading message
Source:

(static) hideMessages()

hides any status/error messages This does not include the loading message.
Source:

(static) init()

init status manager preloads jQuery elements
Source:

(static) setCustomHandler(newHandler)

set a custom handler, which gets all notifications. This handler gets the following arguments: alertType (see array), $element, args, icon If it returns true, the own processing will be stopped so the message will not be displayed. Otherwise it will continue. As an aditional feature it can return q jQuery element, which will then be used to add the message there. Icons are not supported in that case and will be ignored. Pass 'null' to reset/delete the custom handler. Note that there is no notification when a message is supposed to get hidden.
Parameters:
Name Type Description
newHandler function | null
Source:

(static) showError(message, icon)

display an error message This automatically passes the text to I18n for translation.
Parameters:
Name Type Description
message string | array string, use an array for %s/%d options
icon string | null optional, the icon to show, default: leave previous icon
Source:

(static) showLoading(message, icon)

shows a loading message, optionally with a percentage This automatically passes all texts to the i10s module.
Parameters:
Name Type Description
message string | array | null optional, use an array for %s/%d options, default: 'Loading…'
icon string | null optional, the icon to show, default: leave previous icon
Source:

(static) showRemaining(message)

display remaining message This automatically passes the text to I18n for translation.
Parameters:
Name Type Description
message string | array string, use an array for %s/%d options
Source:

(static) showStatus(message, icon)

display a status message This automatically passes the text to I18n for translation.
Parameters:
Name Type Description
message string | array string, use an array for %s/%d options
icon string | null optional, the icon to show, default: leave previous icon
Source:

(static) showWarning(message, icon)

display a warning message This automatically passes the text to I18n for translation.
Parameters:
Name Type Description
message string | array string, use an array for %s/%d options
icon string | null optional, the icon to show, default: leave previous icon
Source: