Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
87 additions
and
81 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 |
---|---|---|
@@ -1,21 +1,24 @@ | ||
var notifier = require('../index'); | ||
var path = require('path'); | ||
|
||
notifier.notify({ | ||
message: 'Hello. This is a longer text\nWith "some" newlines.', | ||
wait: true, | ||
icon: path.join(__dirname, 'coulson.jpg'), | ||
sound: true | ||
}, function(err, data) { | ||
// Will also wait until notification is closed. | ||
console.log('Waited'); | ||
console.log(err, data); | ||
}); | ||
notifier.notify( | ||
{ | ||
message: 'Hello. This is a longer text\nWith "some" newlines.', | ||
wait: true, | ||
icon: path.join(__dirname, 'coulson.jpg'), | ||
sound: true | ||
}, | ||
function(err, data) { | ||
// Will also wait until notification is closed. | ||
console.log('Waited'); | ||
console.log(err, data); | ||
} | ||
); | ||
|
||
notifier.on('timeout', function () { | ||
notifier.on('timeout', function() { | ||
console.log('Timed out!'); | ||
}); | ||
|
||
notifier.on('click', function () { | ||
notifier.on('click', function() { | ||
console.log('Clicked!'); | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,14 @@ | ||
|
||
|
||
module.exports.argsListHas = function argsListHas (args, field) { | ||
return args.filter(function (item) { | ||
module.exports.argsListHas = function argsListHas(args, field) { | ||
return args.filter(function(item) { | ||
return item === field; | ||
}).length > 0; | ||
}; | ||
|
||
module.exports.getOptionValue = function getOptionValue (args, field) { | ||
for(var i = 0; i < args.length; i++){ | ||
module.exports.getOptionValue = function getOptionValue(args, field) { | ||
for (var i = 0; i < args.length; i++) { | ||
if (args[i] === field && i < args.length - 1) { | ||
return args[i + 1]; | ||
} | ||
} | ||
return void 0; | ||
}; | ||
|
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