Module: notifications_js

Members

(inner, constant) facilities :object

Notification facilities
Type:
  • object
Source:

(inner, constant) severities :object

Notification severities
Type:
  • object
Source:

Methods

(inner) createSeverityIcon(severity) → {HTMLElement}

Creates a severity icon
Parameters:
Name Type Description
severity string severity
Source:
Returns:
severity icon
Type
HTMLElement

(inner) hideAlert(target) → {void}

Hides a dismissible alert
Parameters:
Name Type Description
target EventTarget close button of the alert
Source:
Returns:
Type
void

(inner) hideModalAlert(el) → {void}

Removes all alerts in a modal
Parameters:
Name Type Description
el HTMLElement | Element the modal element
Source:
Returns:
Type
void

(inner) logMessage(message, facility, severity) → {void}

Appends a log message to the log buffer
Parameters:
Name Type Description
message string message
facility string facility
severity string one off info, warn, error
Source:
Returns:
Type
void

(inner) notificationsSupported() → {boolean}

Checks for web notification support
Source:
Returns:
true if web notifications are supported, else false
Type
boolean

(inner) setStateIcon() → {void}

Sets the background color of the myMPD logo according to the websocket state
Source:
Returns:
Type
void

(inner) showModalAlert(obj) → {void}

Shows an alert in a modal
Parameters:
Name Type Description
obj object jsonrpc error response
Source:
Returns:
Type
void

(inner) showModalInfo(message) → {void}

Shows an info in a modal
Parameters:
Name Type Description
message string message to display
Source:
Returns:
Type
void

(inner) showNotification(message, facility, severity) → {void}

Shows a toast notification or an appinit alert
Parameters:
Name Type Description
message string message
facility string facility
severity string one off info, warn, error
Source:
Returns:
Type
void

(inner) toggleAlert(alertBoxId, state, msg) → {void}

Toggles and sets/clears the message of the top alertBox
Parameters:
Name Type Description
alertBoxId string the id of alertBox to toggle
state boolean false = hides the alertBox, true = shows the alertBox
msg string already translated message
Source:
Returns:
Type
void

(inner) toggleUI() → {void}

Toggles the ui state
Source:
Returns:
Type
void