diff --git a/README.md b/README.md index 11e46c7cde..03f2122102 100755 --- a/README.md +++ b/README.md @@ -40,6 +40,7 @@ List of Definitions * [async](https://github.com/caolan/async) (by [Boris Yankov](https://github.com/borisyankov)) * [Backbone.js](http://backbonejs.org/) (by [Boris Yankov](https://github.com/borisyankov)) * [Backbone Relational](http://backbonerelational.org/) (by [Eirik Hoem](https://github.com/eirikhm)) +* [BigScreen](http://brad.is/coding/BigScreen/) (by [Douglas Eichelberger](https://github.com/dduugg)) * [Bluebird](https://github.com/petkaantonov/bluebird) (by [Bart van der Schoor](https://github.com/Bartvds)) * [Bootbox](https://github.com/makeusabrew/bootbox) (by [Vincent Bortone](https://github.com/vbortone/)) * [Bootstrap](http://twitter.github.com/bootstrap/) (by [Boris Yankov](https://github.com/borisyankov)) diff --git a/bigscreen/bigscreen-tests.ts b/bigscreen/bigscreen-tests.ts new file mode 100644 index 0000000000..0ae13acd73 --- /dev/null +++ b/bigscreen/bigscreen-tests.ts @@ -0,0 +1,23 @@ +/// + +BigScreen.onchange = function(element: Element) { + console.log("Full-screen element " + element + " changed."); +} + +BigScreen.onenter = function(element: Element) { + console.log(BigScreen.element + " entered full-screen."); +}; + +BigScreen.onexit = function() { + console.log("Exited full-screen."); +} + +BigScreen.onerror = function(element: Element, reason: string) { + console.log("Error sending " + element + " into full-screen: " + reason); +} + +console.log("full-screen-enabled? " + BigScreen.enabled); + +BigScreen.request(document.documentElement); +BigScreen.exit(); +BigScreen.toggle(document.documentElement); diff --git a/bigscreen/bigscreen.d.ts b/bigscreen/bigscreen.d.ts new file mode 100644 index 0000000000..bdabdc101d --- /dev/null +++ b/bigscreen/bigscreen.d.ts @@ -0,0 +1,20 @@ +// Type definitions for BigScreen 2.0.4 +// Project: http://brad.is/coding/BigScreen/ +// Definitions by: Douglas Eichelberger +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +interface BigScreenStatic { + element: any; + enabled: boolean; + + exit(): void; + onchange(element: Element): void; + onenter(element: Element): void; + onerror(element: Element, reason: string): void; + onexit(): void; + request(element: Element, onEnter?: (element: Element) => void, onExit?: () => void, onError?: (element: Element, reason: string) => void): void; + toggle(element: Element, onEnter?: (element: Element) => void, onExit?: () => void, onError?: (element: Element, reason: string) => void): void; + videoEnabled(video: HTMLVideoElement): boolean; +} + +declare var BigScreen: BigScreenStatic;