Merge pull request #2967 from pine613/feature/pgwmodal

Added PgwModal library
This commit is contained in:
Masahiro Wakame
2014-10-14 11:29:41 +09:00
3 changed files with 80 additions and 2 deletions
+3 -2
View File
@@ -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))
+34
View File
@@ -0,0 +1,34 @@
/// <reference path="pgwmodal.d.ts" />
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: '<span style="text-align:center">Loading in progress</span>',
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;
}
+43
View File
@@ -0,0 +1,43 @@
// Type definitions for PgwModal 2.0
// Project: http://pgwjs.com/pgwmodal/
// Definitions by: Pine Mizune <https://github.com/pine613>
// 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;
}