diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 5feedd4ae..df1493d8c 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -1,4 +1,4 @@ -# Contributors +# Contributors This is a non-exhaustive list of definitions and their creators. If you created a definition but are not listed then feel free to send a pull request on this file with your name and url. @@ -314,7 +314,8 @@ All definitions files include a header with the author and editors, so at some p * [PDF.js](https://github.com/mozilla/pdf.js) (by [Josh Baldwin](https://github.com/jbaldwin)) * [PeerJS](http://peerjs.com/) (by [Toshiya Nakakura](https://github.com/nakakura)) * [PEG.js](http://pegjs.majda.cz/) (by [vvakame](https://github.com/vvakame)) -* [Persona](http://www.mozilla.org/en-US/persona) (by [James Frasca](https://github.com/Nycto)) +* [Persona](http://www.mozilla.org/en-US/persona) (by [James Frasca](https://github.com/Nycto)) +* [PgwModal](http://pgwjs.com/pgwmodal/) (by [Pine Mizune](https://github.com/pine613)) * [PhantomJS](http://phantomjs.org) (by [Jed Hunsaker](https://github.com/jedhunsaker)) * [PhoneGap](http://phonegap.com) (by [Boris Yankov](https://github.com/borisyankov)) * [Physijs](http://chandlerprall.github.io/Physijs/) (by [gyoh_k](https://github.com/gyohk)) diff --git a/pgwmodal/pgwmodal-test.ts b/pgwmodal/pgwmodal-test.ts new file mode 100644 index 000000000..eec99ed39 --- /dev/null +++ b/pgwmodal/pgwmodal-test.ts @@ -0,0 +1,34 @@ +/// + +var $j: JQueryStatic; +var $z: ZeptoStatic; + +function test_open(): void { + var r: boolean = $j.pgwModal({ + content: 'Modal Example 1' + }); + + $j.pgwModal({ + target: '#modalContent', + title: 'Modal title 2', + maxWidth: 800 + }); + + $j.pgwModal({ + url: 'modal-test.php', + loadingContent: 'Loading in progress', + closable: false, + titleBar: false + }); +} + +function test_action(): void { + var r1: boolean = $j.pgwModal('close'); + var r2: boolean = $j.pgwModal('reposition'); + var r3: boolean = $j.pgwModal('isOpen'); + var r4: any = $j.pgwModal('getData'); +} + +function test_equal(): void { + $j.pgwModal == $z.pgwModal; +} diff --git a/pgwmodal/pgwmodal.d.ts b/pgwmodal/pgwmodal.d.ts new file mode 100644 index 000000000..22b0e5147 --- /dev/null +++ b/pgwmodal/pgwmodal.d.ts @@ -0,0 +1,43 @@ +// Type definitions for PgwModal 2.0 +// Project: http://pgwjs.com/pgwmodal/ +// Definitions by: Pine Mizune +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +interface PgwModalOption { + content?: string; + target?: string; + url?: string; + title?: string; + titleBar?: boolean; + mainClassName?: string; + backdropClassName?: string; + maxWidth?: number; + angular?: boolean; + modalData?: any; + ajaxOptions?: any; + closable?: boolean; + closeContent?: string; + closeOnEscape?: boolean; + closeOnBackgroundClick?: boolean; + loadingContent?: string; + errorContent?: string; + pushContent?: string; +} + +interface PgwModalMethod { + (option: PgwModalOption): boolean; + (action: string): any; + (action: "close"): boolean; + (action: "reposition"): boolean; + (action: "getData"): any; + (action: "isOpen"): boolean; +} + +interface ZeptoStatic { + pgwModal: PgwModalMethod; +} + + +interface JQueryStatic { + pgwModal: PgwModalMethod; +}