Merge pull request #8342 from mateusdemboski/patch-1

Added Notie definitions
This commit is contained in:
Masahiro Wakame
2016-03-04 21:28:33 +09:00
2 changed files with 34 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
/// <reference path='notie.d.ts' />
notie.alert(1, 'Success!', 1.5);
notie.alert(2, 'Warning<br><b>with</b><br><i>HTML</i><br><u>included.</u>', 2);
notie.alert(3, 'Error.', 2.5);
notie.alert(4, 'Information.', 2);
notie.confirm('Are you sure you want to do that?', 'Yes', 'Cancel', function() {
notie.alert(1, 'Good choice!', 2);
});
notie.confirm('Are you sure?', 'Yes', 'Cancel', function() {
notie.confirm('Are you <b>really</b> sure?', 'Yes', 'Cancel', function() {
notie.confirm('Are you really <b>really</b> sure?', 'Yes', 'Cancel', function() {
notie.alert(1, 'Okay, jeez...', 2);
});
});
});
notie.input('Please enter your email address:', 'Submit', 'Cancel', 'email', 'name@example.com', function(value_entered) {
notie.alert(1, 'You entered: ' + value_entered, 2);
});
notie.input('What city do you live in?', 'Submit', 'Cancel', 'text', 'Enter your city:', function(value_entered) {
notie.alert(1, 'You entered: ' + value_entered, 2);
}, 'New York');
+10
View File
@@ -0,0 +1,10 @@
// Type definitions for notie.js
// Project: https://github.com/jaredreich/notie.js
// Definitions by: Mateus Demboski <https://github.com/mateusdemboski>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare var notie: {
alert: (type: number, message: string, seconds: number) => void;
confirm: (title: string, yes_text: string, no_text: string, yes_callback: () => void) => void;
input: (title: string, submit_text: string, cancel_text: string, type: string, placeholder: string, submit_callback: (value_entered: string) => void, prefilled_value_optional?: string) => void;
};