mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Add typings for notify
http://notifyjs.com/ - Notify.js is a jQuery plugin to provide simple yet fully customisable notifications. Not to be confused with "notifyjs" at https://github.com/alexgibson/notify.js
This commit is contained in:
committed by
Adi Dahiya
parent
570b760130
commit
6b892eacd8
@@ -0,0 +1,60 @@
|
||||
/// <reference path="notify.d.ts" />
|
||||
|
||||
$.notify.addStyle("bootstrap", {
|
||||
html: "<div>\n<span data-notify-text></span>\n</div>",
|
||||
classes: {
|
||||
base: {
|
||||
"font-weight": "bold",
|
||||
"padding": "8px 15px 8px 14px",
|
||||
},
|
||||
error: {
|
||||
"color": "#B94A48",
|
||||
},
|
||||
info: {
|
||||
"color": "#3A87AD",
|
||||
"background-color": "#D9EDF7",
|
||||
"border-color": "#BCE8F1",
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$.notify.addStyle('foo', {
|
||||
html:
|
||||
"<div>" +
|
||||
"<div class='clearfix'>" +
|
||||
"<div class='title' data-notify-html='title'/>" +
|
||||
"<div class='buttons'>" +
|
||||
"<button class='no'>Cancel</button>" +
|
||||
"<button class='yes' data-notify-text='button'></button>" +
|
||||
"</div>" +
|
||||
"</div>" +
|
||||
"</div>"
|
||||
});
|
||||
|
||||
$.notify.defaults({
|
||||
style: "bootstrap",
|
||||
className: "info"
|
||||
});
|
||||
|
||||
$.notify("Hello world!");
|
||||
|
||||
$.notify("Error text", "error");
|
||||
|
||||
$(".my-element").notify("Hello Box", {
|
||||
arrowSize: 25,
|
||||
autoHide: false,
|
||||
elementPosition: "top center",
|
||||
showAnimation: "slideDown",
|
||||
showDuration: 100,
|
||||
hideAnimation: "slideUp",
|
||||
hideDuration: 5000,
|
||||
gap: 20
|
||||
});
|
||||
|
||||
$.notify({
|
||||
title: 'Would you like some Foo ?',
|
||||
button: 'Confirm'
|
||||
}, {
|
||||
style: 'foo',
|
||||
clickToHide: false
|
||||
});
|
||||
Reference in New Issue
Block a user