mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
| .. | ||
| css | ||
| dist | ||
| img | ||
| lib | ||
| .bower.json | ||
| bower.json | ||
| ChangeLog | ||
| LICENSE | ||
| package.json | ||
| README.md | ||
Smalltalk

Simple Promise-based replacement of native Alert, Confirm and Prompt.
Install
With help of bower.
bower install smalltalk
Or npm:
npm i smalltalk
API
In every method of smalltalk last parameter options is optional and could be used
for preventing of handling cancel event.
{
cancel: true /* default */
}
smalltalk.alert(title, message)
smalltalk.alert('Error', 'There was an error!').then(function() {
console.log('ok');
});
smalltalk.confirm(title, message [, options])
smalltalk.confirm('Question', 'Are you sure?').then(function() {
console.log('yes');
}, function() {
console.log('no');
});
smalltalk.prompt(title, message, value [, options])
smalltalk.prompt('Question', 'How old are you?', '10').then(function(value) {
console.log(value);
}, function() {
console.log('cancel');
});
#License MIT


