mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-31 11:40:47 +08:00
Merge pull request #2390 from zaneli/jquery.notifyBar
Add definitions for jQuery Notify bar
This commit is contained in:
@@ -158,6 +158,7 @@ All definitions files include a header with the author and editors, so at some p
|
||||
* [jQuery.jNotify](http://jnotify.codeplex.com) (by [James Curran](https://github.com/jamescurran/))
|
||||
* [jQuery.joyride](http://zurb.com/playground/jquery-joyride-feature-tour-plugin) (by [Vincent Bortone](https://github.com/vbortone))
|
||||
* [jQuery.jSignature](https://github.com/willowsystems/jSignature) (by [Patrick Magee](https://github.com/pjmagee))
|
||||
* [jQuery.notifyBar](http://www.whoop.ee/posts/2013-04-05-the-resurrection-of-jquery-notify-bar/) (by [Shunsuke Ohtani](https://github.com/zaneli))
|
||||
* [jQuery.noty](http://needim.github.io/noty/) (by [Aaron King](https://github.com/kingdango/))
|
||||
* [jQuery.payment](http://needim.github.io/noty/) (by [Eric J. Smith](https://github.com/ejsmith/))
|
||||
* [jQuery.pickadate](https://github.com/amsul/pickadate.js) (by [Theodore Brown](https://github.com/theodorejb))
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
/// <reference path="jquery.notifyBar.d.ts" />
|
||||
|
||||
$(function() {
|
||||
$.notifyBar({
|
||||
html: "Autostart"
|
||||
});
|
||||
|
||||
$("#common").click(function () {
|
||||
$.notifyBar();
|
||||
});
|
||||
$("#error").click(function () {
|
||||
$.notifyBar({ cssClass: "error", html: "Error occurred!" });
|
||||
});
|
||||
$("#success").click(function () {
|
||||
$.notifyBar({ cssClass: "success", html: "Your data has been changed!" });
|
||||
});
|
||||
$("#warning").click(function() {
|
||||
$.notifyBar({ cssClass: "warning", html: "Settings aren't changed!" });
|
||||
})
|
||||
$("#custom").click(function () {
|
||||
$.notifyBar({ cssClass: "custom", html: "Your data has been changed!" });
|
||||
});
|
||||
$("#close").click(function () {
|
||||
$.notifyBar({ html: "Click 'close' to hide notify bar", close: true, closeOnClick: false });
|
||||
});
|
||||
$("#position").click(function () {
|
||||
$.notifyBar({ html: "At bottom", position: "bottom" });
|
||||
});
|
||||
|
||||
$("#events").click(function () {
|
||||
$.notifyBar({
|
||||
html: "Test events",
|
||||
onBeforeShow: function () {
|
||||
$("#onBeforeShow").html("onBeforeShow - ok");
|
||||
},
|
||||
onShow: function () {
|
||||
$("#onShow").html("onShow - ok");
|
||||
},
|
||||
onBeforeHide: function () {
|
||||
$("#onBeforeHide").html("onBeforeHide - ok");
|
||||
},
|
||||
onHide: function () {
|
||||
$("#onHide").html("onHide - ok");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#delay").click(function () {
|
||||
$.notifyBar({ html: "delay 1000000", delay: 1000000 });
|
||||
});
|
||||
$("#speed-string").click(function () {
|
||||
$.notifyBar({ html: "speed normal", animationSpeed: "normal" });
|
||||
});
|
||||
$("#speed-number").click(function () {
|
||||
$.notifyBar({ html: "speed normal", animationSpeed: 500 });
|
||||
});
|
||||
$("#jqObject").click(function () {
|
||||
$.notifyBar({ html: "set jqObject", jqObject: $("#jqObject") });
|
||||
});
|
||||
$("#closeText").click(function () {
|
||||
$.notifyBar({ html: "set close text", closeText: "close" });
|
||||
});
|
||||
$("#closeOnOver").click(function () {
|
||||
$.notifyBar({ html: "enable close on over", close: false, closeOnClick: false, closeOnOver: true });
|
||||
});
|
||||
});
|
||||
+99
@@ -0,0 +1,99 @@
|
||||
// Type definitions for jQuery Notify Bar 1.4
|
||||
// Project: http://www.whoop.ee/posts/2013-04-05-the-resurrection-of-jquery-notify-bar/
|
||||
// Definitions by: Shunsuke Ohtani <https://github.com/zaneli>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../jquery/jquery.d.ts" />
|
||||
|
||||
declare module JQueryNotifyBar {
|
||||
|
||||
interface NotifyBarOptions {
|
||||
/**
|
||||
* What text will be inside bar. Can be HTML or just text.
|
||||
*/
|
||||
html?: string;
|
||||
|
||||
/**
|
||||
* How long bar will be delayed, doesn't count animation time.
|
||||
*/
|
||||
delay?: number;
|
||||
|
||||
/**
|
||||
* Custom jQuery object for notify bar.
|
||||
*/
|
||||
jqObject?: JQuery;
|
||||
|
||||
/**
|
||||
* You can define own CSS class for Notify bar. There are too premade classes "error", "warning" and "success".
|
||||
*/
|
||||
cssClass?: string;
|
||||
|
||||
/**
|
||||
* If set to true close button will be displayed.
|
||||
*/
|
||||
close?: boolean;
|
||||
|
||||
/**
|
||||
* Sets the text to close button.
|
||||
*/
|
||||
closeText?: string;
|
||||
|
||||
/**
|
||||
* If enabled, user can hide notify bar just by click on it.
|
||||
*/
|
||||
closeOnClick?: boolean;
|
||||
|
||||
/**
|
||||
* If enabled, user can hide notify bar just by moving mouse cursor on it.
|
||||
*/
|
||||
closeOnOver?: boolean;
|
||||
|
||||
/**
|
||||
* Callback on before show.
|
||||
*/
|
||||
onBeforeShow?: () => any;
|
||||
|
||||
/**
|
||||
* Callback on show.
|
||||
*/
|
||||
onShow?: () => any;
|
||||
|
||||
/**
|
||||
* Callback on before hide.
|
||||
*/
|
||||
onBeforeHide?: () => any;
|
||||
|
||||
/**
|
||||
* Callback on hide.
|
||||
*/
|
||||
onHide?: () => any;
|
||||
|
||||
/**
|
||||
* Set the position of notify bar. Possible values are "top", "bottom".
|
||||
*/
|
||||
position?: string;
|
||||
}
|
||||
|
||||
interface NotifyBarOptionsForAnimationSpeedString extends NotifyBarOptions {
|
||||
/**
|
||||
* How long this bar will be slided up and down. Possible values are "slow", "default", "normal", "fast".
|
||||
*/
|
||||
animationSpeed?: string;
|
||||
}
|
||||
|
||||
interface NotifyBarOptionsForAnimationSpeedNumber extends NotifyBarOptions {
|
||||
/**
|
||||
* How long this bar will be slided up and down.
|
||||
*/
|
||||
animationSpeed?: number;
|
||||
}
|
||||
}
|
||||
|
||||
interface JQueryStatic {
|
||||
/**
|
||||
* Show notify bar.
|
||||
*
|
||||
* @param options notify bar options
|
||||
*/
|
||||
notifyBar(options?: JQueryNotifyBar.NotifyBarOptions): void;
|
||||
}
|
||||
Reference in New Issue
Block a user