forked from mikaelbr/node-notifier
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Support SnoreToast "-b" flag for action buttons * Communicate with SnoreToast using unique named pipes * Parse result from pipe into data object before calling the actionJackerDecorator * Sanitizing data now changes "timedout" to "timeout" * Sample file
- Loading branch information
Showing
7 changed files
with
198 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
const notifier = require('../index'); | ||
const path = require('path'); | ||
|
||
notifier.notify( | ||
{ | ||
message: 'Are you sure you want to continue?', | ||
icon: path.join(__dirname, 'coulson.jpg'), | ||
actions: ['OK', 'Cancel'] | ||
}, | ||
(err, data) => { | ||
// Will also wait until notification is closed. | ||
console.log('Waited'); | ||
console.log(JSON.stringify({ err, data }, null, '\t')); | ||
} | ||
); | ||
|
||
// Built-in actions: | ||
notifier.on('timeout', () => { | ||
console.log('Timed out!'); | ||
}); | ||
notifier.on('activate', () => { | ||
console.log('Clicked!'); | ||
}); | ||
notifier.on('dismissed', () => { | ||
console.log('Dismissed!'); | ||
}); | ||
|
||
// Buttons actions (lower-case): | ||
notifier.on('ok', () => { | ||
console.log('"Ok" was pressed'); | ||
}); | ||
notifier.on('cancel', () => { | ||
console.log('"Cancel" was pressed'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.