aboutsummaryrefslogtreecommitdiffstats
path: root/packages/notificationbox/doc/main.md
diff options
context:
space:
mode:
authorNik Nyby <nikolas@gnu.org>2015-01-17 17:12:36 -0500
committerNik Nyby <nikolas@gnu.org>2015-01-17 17:12:36 -0500
commitada88090ead2c3b9d0804794c5f20f9b24d1c2b1 (patch)
tree2838a7eee6c5d74094216acebd86915e0ea1de42 /packages/notificationbox/doc/main.md
downloadlibrejsxul-ada88090ead2c3b9d0804794c5f20f9b24d1c2b1.tar.lz
librejsxul-ada88090ead2c3b9d0804794c5f20f9b24d1c2b1.tar.xz
librejsxul-ada88090ead2c3b9d0804794c5f20f9b24d1c2b1.zip
Import to new git repository
The old repository was using almost 100mb of space because of all the unnecessary files in the history. So I've imported the code to a new git repository. Unfortunately the history isn't viewable from this repository anymore. To see what happened with LibreJS before 2015, see the old Bazaar repo here: http://bzr.savannah.gnu.org/lh/librejs/
Diffstat (limited to 'packages/notificationbox/doc/main.md')
-rw-r--r--packages/notificationbox/doc/main.md46
1 files changed, 46 insertions, 0 deletions
diff --git a/packages/notificationbox/doc/main.md b/packages/notificationbox/doc/main.md
new file mode 100644
index 0000000..2c28c3a
--- /dev/null
+++ b/packages/notificationbox/doc/main.md
@@ -0,0 +1,46 @@
+NotificationBox implements some of the notificationbox element functionality in Firefox and Mozilla-based browsers using the Addon SDK. For any question or feedback please email lduros--at--member.fsf.org
+
+You can create a notification as follows:
+```javascript
+var self = require("self");
+var notification = require("notification-box").NotificationBox({
+ 'value': 'important-message',
+ 'label': 'This is a very important message!',
+ 'priority': 'CRITICAL_BLOCK',
+ 'image': self.data.url("gnu-icon.png"),
+ 'buttons': [{'label': "Do something about it!",
+ 'onClick': function () { console.log("You clicked the important button!"); }}]
+});
+```
+
+It implements the following options:
+
+ - value: value used to identify the notification
+ - label: label to appear on the notification
+ - image: URL of image to appear on the notification. You can also
+ load a local image from the data folder, like in the example
+ - priority: notification priority. Use one of the following:
+ - INFO_LOW
+ - INFO_MEDIUM
+ - INFO_HIGH
+ - WARNING_LOW
+ - WARNING_MEDIUM
+ - WARNING_HIGH
+ - CRITICAL_LOW
+ - CRITICAL_MEDIUM
+ - CRITICAL_HIGH
+ - CRITICAL_BLOCK
+ - buttons: array of buttons to appear on the notification.
+ You can use the following options:
+ - accessKey: the accesskey to appear on the button
+ - onClick: the callback function to trigger when button is activated.
+ - label: the text to display on the button
+
+
+Here is an overview of what the example above with the critical notification looks like:
+![The Critical notification](https://raw.github.com/lduros/notificationbox/master/doc/images/critical-notification.png)
+
+When using 'INFO_LOW' for the priority instead, you would see:
+![Info Low notification](https://raw.github.com/lduros/notificationbox/master/doc/images/info-low-priority.png)
+
+For more information on notificationbox: https://developer.mozilla.org/en-US/docs/XUL/notificationbox