mirror of
https://github.com/atom/atom.git
synced 2026-02-16 01:25:13 -05:00
Document all options for creating Notifications
The defaults for the 'icon' values come from Notification::getIcon[0]. [0]: https://github.com/atom/atom/blob/v1.0.7/src/notification.coffee#L79
This commit is contained in:
@@ -29,40 +29,65 @@ class NotificationManager
|
||||
# Public: Add a success notification.
|
||||
#
|
||||
# * `message` A {String} message
|
||||
# * `options` An options {Object} with optional keys such as:
|
||||
# * `detail` A {String} with additional details about the notification
|
||||
# * `options` (optional) An options {Object} with the following keys:
|
||||
# * `detail` (optional) A {String} with additional details about the
|
||||
# notification.
|
||||
# * `dismissable` (optional) A {Boolean} indicating whether this
|
||||
# notification can be dismissed by the user. Defaults to `false`.
|
||||
# * `icon` (optional) A {String} name of an icon from Octicons to display
|
||||
# in the notification header. Defaults to `'check'`.
|
||||
addSuccess: (message, options) ->
|
||||
@addNotification(new Notification('success', message, options))
|
||||
|
||||
# Public: Add an informational notification.
|
||||
#
|
||||
# * `message` A {String} message
|
||||
# * `options` An options {Object} with optional keys such as:
|
||||
# * `detail` A {String} with additional details about the notification
|
||||
# * `options` (optional) An options {Object} with the following keys:
|
||||
# * `detail` (optional) A {String} with additional details about the
|
||||
# notification.
|
||||
# * `dismissable` (optional) A {Boolean} indicating whether this
|
||||
# notification can be dismissed by the user. Defaults to `false`.
|
||||
# * `icon` (optional) A {String} name of an icon from Octicons to display
|
||||
# in the notification header. Defaults to `'info'`.
|
||||
addInfo: (message, options) ->
|
||||
@addNotification(new Notification('info', message, options))
|
||||
|
||||
# Public: Add a warning notification.
|
||||
#
|
||||
# * `message` A {String} message
|
||||
# * `options` An options {Object} with optional keys such as:
|
||||
# * `detail` A {String} with additional details about the notification
|
||||
# * `options` (optional) An options {Object} with the following keys:
|
||||
# * `detail` (optional) A {String} with additional details about the
|
||||
# notification.
|
||||
# * `dismissable` (optional) A {Boolean} indicating whether this
|
||||
# notification can be dismissed by the user. Defaults to `false`.
|
||||
# * `icon` (optional) A {String} name of an icon from Octicons to display
|
||||
# in the notification header. Defaults to `'alert'`.
|
||||
addWarning: (message, options) ->
|
||||
@addNotification(new Notification('warning', message, options))
|
||||
|
||||
# Public: Add an error notification.
|
||||
#
|
||||
# * `message` A {String} message
|
||||
# * `options` An options {Object} with optional keys such as:
|
||||
# * `detail` A {String} with additional details about the notification
|
||||
# * `options` (optional) An options {Object} with the following keys:
|
||||
# * `detail` (optional) A {String} with additional details about the
|
||||
# notification.
|
||||
# * `dismissable` (optional) A {Boolean} indicating whether this
|
||||
# notification can be dismissed by the user. Defaults to `false`.
|
||||
# * `icon` (optional) A {String} name of an icon from Octicons to display
|
||||
# in the notification header. Defaults to `'flame'`.
|
||||
addError: (message, options) ->
|
||||
@addNotification(new Notification('error', message, options))
|
||||
|
||||
# Public: Add a fatal error notification.
|
||||
#
|
||||
# * `message` A {String} message
|
||||
# * `options` An options {Object} with optional keys such as:
|
||||
# * `detail` A {String} with additional details about the notification
|
||||
# * `options` (optional) An options {Object} with the following keys:
|
||||
# * `detail` (optional) A {String} with additional details about the
|
||||
# notification.
|
||||
# * `dismissable` (optional) A {Boolean} indicating whether this
|
||||
# notification can be dismissed by the user. Defaults to `false`.
|
||||
# * `icon` (optional) A {String} name of an icon from Octicons to display
|
||||
# in the notification header. Defaults to `'bug'`.
|
||||
addFatalError: (message, options) ->
|
||||
@addNotification(new Notification('fatal', message, options))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user