Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Add support for priority. #5

Merged
merged 1 commit into from

2 participants

@smh
smh commented

growlnotify has support for setting the priority of the notification. This adds an option for setting this priority.

@tj tj merged commit b811ea5 into tj:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 6, 2011
  1. @smh

    Add support for priority.

    smh authored
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 0 deletions.
  1. +3 −0  Readme.md
  2. +2 −0  lib/growl.js
  3. +1 −0  test.js
View
3  Readme.md
@@ -16,6 +16,7 @@ Callback functions are optional
growl.notify('You have mail!')
growl.notify('5 new messages', { sticky: true })
growl.notify('5 new emails', { title: 'Email Client', image: 'Safari', sticky: true })
+ growl.notify('Set priority', { priority: 2 })
growl.notify('Show Safari icon', { image: 'Safari' })
growl.notify('Show icon', { image: 'path/to/icon.icns' })
growl.notify('Show image', { image: 'path/to/my.image.png' })
@@ -31,6 +32,8 @@ Callback functions are optional
- notification title
- name
- application name
+ - priority
+ - priority for the notification (default is 0)
- sticky
- weither or not the notification should remainin until closed
- image
View
2  lib/growl.js
@@ -36,6 +36,7 @@ exports.binVersion = function(fn) {
*
* - title Notification title
* - sticky Make the notification stick (defaults to false)
+ * - priority Specify an int or named key (default is 0)
* - name Application name (defaults to growlnotify)
* - image
* - path to an icon sets --iconpath
@@ -75,6 +76,7 @@ exports.notify = function(msg, options, fn) {
args.push('--' + flag, image)
}
if (options.sticky) args.push('--sticky');
+ if (options.priority) args.push('--priority', options.priority);
if (options.name) args.push('--name', options.name);
if (options.title) args.push(options.title);
exec(args.join(' '), fn);
View
1  test.js
@@ -7,6 +7,7 @@ growl.binVersion(function(err, version){
growl.notify('You have mail!')
growl.notify('5 new messages', { sticky: true })
growl.notify('5 new emails', { title: 'Email Client', image: 'Safari', sticky: true })
+growl.notify('Set priority', { priority: 2 })
growl.notify('Show Safari icon', { image: 'Safari' })
growl.notify('Show icon', { image: 'path/to/icon.icns' })
growl.notify('Show image', { image: 'path/to/my.image.png' })
Something went wrong with that request. Please try again.