mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-08 08:04:19 +08:00
Merge pull request #907 from jonegerton/jquery.are-you-sure
Add typings for jQuery.areYouSure
This commit is contained in:
@@ -96,6 +96,7 @@ List of Definitions
|
||||
* [jQuery](http://jquery.com/) (from TypeScript samples)
|
||||
* [jQuery Mobile](http://jquerymobile.com) (by [Boris Yankov](https://github.com/borisyankov))
|
||||
* [jQuery UI](http://jqueryui.com/) (by [Boris Yankov](https://github.com/borisyankov))
|
||||
* [jQuery.areYouSure](https://github.com/codedance/jquery.AreYouSure) (by [Jon Egerton](https://github.com/jonegerton))
|
||||
* [jQuery.autosize](http://www.jacklmoore.com/autosize/) (by [Jack Moore](http://www.jacklmoore.com/))
|
||||
* [jQuery.BBQ](http://benalman.com/projects/jquery-bbq-plugin/) (by [Adam R. Smith](https://github.com/sunetos))
|
||||
* [jQuery.contextMenu](http://medialize.github.com/jQuery-contextMenu/) (by [Natan Vivo](https://github.com/nvivo/))
|
||||
|
||||
18
jquery.are-you-sure/jquery.are-you-sure-tests.ts
Normal file
18
jquery.are-you-sure/jquery.are-you-sure-tests.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
// Type definitions for jquery.are-you-sure.js
|
||||
// Project: https://github.com/codedance/jquery.AreYouSure
|
||||
// Definitions by: Jon Egerton <https://github.com/jonegerton>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../jquery/jquery.d.ts"/>
|
||||
/// <reference path="jquery.are-you-sure.d.ts"/>
|
||||
|
||||
//Use defaults
|
||||
$("test").areYouSure();
|
||||
|
||||
//Use all settings
|
||||
$("test").areYouSure({
|
||||
message: "Oops - sure you wanna leave?",
|
||||
dirtyClass: "soiled",
|
||||
fieldSelector: "input[type='text']",
|
||||
change: function () { alert("changed");}
|
||||
})
|
||||
31
jquery.are-you-sure/jquery.are-you-sure.d.ts
vendored
Normal file
31
jquery.are-you-sure/jquery.are-you-sure.d.ts
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
// Type definitions for jquery.are-you-sure.js
|
||||
// Project: https://github.com/codedance/jquery.AreYouSure
|
||||
// Definitions by: Jon Egerton <https://github.com/jonegerton>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../jquery/jquery.d.ts" />
|
||||
|
||||
/**Options available to control dirty form checking*/
|
||||
interface AreYouSureOptions {
|
||||
|
||||
/**Message to show when attempting to quit a dirty form without saving*/
|
||||
message?: string;
|
||||
|
||||
/**Class to assign to the form when dirty*/
|
||||
dirtyClass?: string;
|
||||
|
||||
/**Callback when form is found to be dirty - allows control of submit/reset buttons etc*/
|
||||
change?: Function;
|
||||
|
||||
/**Jquery selector to use to find input elements*/
|
||||
fieldSelector?: string;
|
||||
}
|
||||
|
||||
interface AreYouSure {
|
||||
(): JQuery;
|
||||
(options: AreYouSureOptions): JQuery;
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
areYouSure: AreYouSure;
|
||||
}
|
||||
Reference in New Issue
Block a user