XUL:NotificationBox: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
 
Line 20: Line 20:
; appendNotification( label , value , image , priority , buttons ) : Create a new notification and display it. If another notification is already present with a higher priority, the new notification will be added behind it. This method returns the notification.
; appendNotification( label , value , image , priority , buttons ) : Create a new notification and display it. If another notification is already present with a higher priority, the new notification will be added behind it. This method returns the notification.


  Arguments:
: Arguments:
    priority - notification priority
:* <code>label</code> - label to appear on the notification
    label - label to appear on the notification
:* <code>value</code> - value used to identify the notification
    value - value used to identify the notification
:* <code>image</code> - URL of image to appear on the notification
    image - url of image to appear on the notification
:* <code>priority</code> - notification priority, see [[#Priority Levels|Priority Levels]].
    buttons - array of buttons to appear on the notification
:* <code>buttons</code> - array of button descriptions to appear on the notification, see below for details.
; getNotificationWithValue ( value ) : Retrieve the notification with a particular value. The value is specified when adding the notification with appendNotification.
; getNotificationWithValue ( value ) : Retrieve the notification with a particular value. The value is specified when adding the notification with appendNotification.
; removeAllNotifications ( immediate ) : Remove all notifications. If immediate is true, the messages are removed immediately. If immediate is false, the notification is slid away.
; removeAllNotifications ( immediate ) : Remove all notifications. If immediate is true, the messages are removed immediately. If immediate is false, the notification is slid away.
Line 31: Line 31:
; removeNotification( item ) : Remove a notification, displaying the next one if the removed item is the current one
; removeNotification( item ) : Remove a notification, displaying the next one if the removed item is the current one


The buttons argument to appendNotification is an array of button descriptions. Each description is an object of the following form:
=== Button Descriptions ===
 
The <code>buttons</code> argument to <code>appendNotification</code> is an array of button descriptions. Each description is an object with the following properties:
<pre>
* accesskey - the accesskey to appear on the button
button {
* callback - function to be called when the button is activated. This function is passed two arguments:
  accesskey,
** the &lt;notification&gt; the button is associated with
  callback,
** the button description as passed to <code>appendNotification</code>.
  label,
* label - the label to appear on the button
  popup
* popup - the id of a popup for the button. If <code>null</code>, the button is a button popup.
}
</pre>
 
accesskey - the accesskey to appear on the button
callback - function to be called when the button is activated.
            This function is passed two arguments, the &lt;notification&gt;
            the button is associated with and the button description as passed
            to appendNotification.
label - the label to appear on the button
popup - the id of a popup for the button. If null, the button is a button popup.


= &lt;notification&gt; =
= &lt;notification&gt; =
Line 65: Line 55:
; image : URL of an image to appear on the notification.
; image : URL of an image to appear on the notification.
; label : The label displayed on the notification.
; label : The label displayed on the notification.
; priority : The message priority, used by the enclosing &lt;notificationbox&gt;
; priority : The message priority, used by the enclosing &lt;notificationbox&gt;. See [[#Priority Levels|Priority Levels]].
; type : Notification type. There are three types, which specify the importance of the notification.
; type : Notification type (string). There are three types, which specify the importance of the notification.
  info - informative message
:* "info" - informative message
  warning - warning message
:* "warning" - warning message
  critical - critical message
:* "critical" - critical message
; value : A value associated with the notification.
; value : A value associated with the notification.


== Methods ==
== Methods ==


; close : Closes the notification and removes it from its enclosing &lt;notificationbox&gt;
; close ( ) : Closes the notification and removes it from its enclosing &lt;notificationbox&gt;


= Priority Levels =
= Priority Levels =
Confirmed users
162

edits

Navigation menu