diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..a8b9ad0 --- /dev/null +++ b/.npmignore @@ -0,0 +1,5 @@ +/demo +/externs +/bower.json +/.npmignore +/.gitignore diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index dff5f3a..0000000 --- a/.travis.yml +++ /dev/null @@ -1 +0,0 @@ -language: java diff --git a/LICENSE.txt b/LICENSE similarity index 100% rename from LICENSE.txt rename to LICENSE diff --git a/README.md b/README.md index edae0b5..ab72f03 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,10 @@ jQuery Fullscreen Plugin ======================== +[![npm version](https://badge.fury.io/js/jquery-fullscreen-plugin.svg)](https://badge.fury.io/js/jquery-fullscreen-plugin) + +[![CDNJS](https://img.shields.io/cdnjs/v/jquery-fullscreen-plugin.svg)](https://cdnjs.com/libraries/jquery-fullscreen-plugin) + Description ----------- @@ -15,13 +19,13 @@ Usage ----- ### Entering Fullscreen mode - + You can either switch the whole page or a single HTML element to fullscreen mode: - +```js $(document).fullScreen(true); $("#myVideo").fullScreen(true); - +``` This only works when the code was triggered by a user interaction (For example a onclick event on a button). Browsers don't allow entering fullscreen mode without user interaction. @@ -32,10 +36,10 @@ fullscreen mode without user interaction. Fullscreen mode is always exited via the document but this plugin allows it also via any HTML element. The owner document of the selected HTML element is used then: - +```js $(document).fullScreen(false); $("#myVideo").fullScreen(false); - +``` ### Querying Fullscreen mode @@ -45,16 +49,16 @@ browser doesn't support this) when fullscreen mode is active, `false` if not active or `null` when the browser does not support fullscreen mode at all. So you can use this method also to display a fullscreen button only when the browser supports fullscreen mode: - +```js $("#fullscreenButton").toggle($(document).fullScreen() != null)) - +``` ### Toggling Fullscreen mode The plugin provides another method for simple fullscreen mode toggling: - +```js $(document).toggleFullScreen(); - +``` ### Notifications @@ -62,7 +66,7 @@ The plugin triggers a `fullscreenchange` event on the document when the fullscreen mode has been changed. If the browser rejected a fullscreen state change then the plugin triggers a `fullscreenerror` event on the document. Example: - +```js $(document).bind("fullscreenchange", function() { console.log("Fullscreen " + ($(document).fullScreen() ? "on" : "off")); }); @@ -70,16 +74,16 @@ document. Example: $(document).bind("fullscreenerror", function() { alert("Browser rejected fullscreen change"); }); - +``` ### Fullscreen iframe Entering fullscreen mode from within an iframe is not allowed by default but it can be enabled with a few attributes on the iframe: - +```html - +``` ### Known issues * In IE 11 an empty page is displayed when entering fullscreen from within an diff --git a/bower.json b/bower.json index 4e85de5..3e728ce 100644 --- a/bower.json +++ b/bower.json @@ -2,5 +2,5 @@ "name": "jquery-fullscreen-plugin", "homepage": "https://github.com/kayahr/jquery-fullscreen-plugin", "main": "jquery.fullscreen.js", - "version": "1.1.4" + "version": "1.1.5" } diff --git a/build.xml b/build.xml deleted file mode 100644 index 45b51fd..0000000 --- a/build.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/demo/iframe.html b/demo/iframe.html index 728b4e2..8c6cd27 100644 --- a/demo/iframe.html +++ b/demo/iframe.html @@ -3,7 +3,7 @@ Test iframe - + diff --git a/demo/index.html b/demo/index.html index a949fb9..8c7005b 100644 --- a/demo/index.html +++ b/demo/index.html @@ -3,7 +3,7 @@ jQuery Fullscreen Plugin demo - +