Skip to content

Commit

Permalink
2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Dec 22, 2014
1 parent 0910a39 commit 7e15983
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 33 deletions.
5 changes: 2 additions & 3 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
"fullscreen"
],
"ignore": [
"**/.*",
"package.json",
"src"
"**/*",
"!dist/screenfull.js"
]
}
12 changes: 1 addition & 11 deletions dist/screenfull.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* screenfull
* v1.2.0 - 2014-04-29
* v2.0.0 - 2014-12-22
* (c) Sindre Sorhus; MIT License
*/
(function () {
Expand Down Expand Up @@ -103,8 +103,6 @@
this.request(elem);
}
},
onchange: function () {},
onerror: function () {},
raw: fn
};

Expand Down Expand Up @@ -139,14 +137,6 @@
}
});

document.addEventListener(fn.fullscreenchange, function (e) {
screenfull.onchange.call(screenfull, e);
});

document.addEventListener(fn.fullscreenerror, function (e) {
screenfull.onerror.call(screenfull, e);
});

if (isCommonjs) {
module.exports = screenfull;
} else {
Expand Down
4 changes: 2 additions & 2 deletions dist/screenfull.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 5 additions & 9 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@
<html lang="en" itemscope itemtype="http://schema.org/Product">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="author" content="Sindre Sorhus">
<meta name="description" content="JavaScript Fullscreen API demo">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta itemprop="name" content="screenfull.js">
<meta itemprop="description" content="Simple wrapper for cross-browser usage of the JavaScript Fullscreen API, which lets you bring the page or any element into fullscreen. Smoothens out the browser implementation differences, so you don't have too.">
<title>screenfull.js demo</title>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<style>
html {
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
Expand Down Expand Up @@ -153,7 +149,7 @@ <h1>screenfull<span>.js</span></h1>
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="src/screenfull.js"></script>
<script>
$(function () {
Expand Down Expand Up @@ -219,12 +215,12 @@ <h1>screenfull<span>.js</span></h1>
}
});

$(document).on(screenfull.raw.fullscreenchange, function () {
$(document).on(screenfull.raw.fullscreenchange, function screenfullChange() {
console.log('Fullscreen change');
});

// trigger the onchange() to set the initial values
screenfull.onchange();
// set the initial values
screenfullChange();
});
</script>
<script>
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "screenfull",
"version": "1.2.1",
"version": "2.0.0",
"description": "Simple wrapper for cross-browser usage of the JavaScript Fullscreen API, which lets you bring the page or any element into fullscreen.",
"license": "MIT",
"repository": "sindresorhus/screenfull.js",
Expand All @@ -21,10 +21,10 @@
"fullscreen"
],
"devDependencies": {
"grunt": "^0.4.1",
"grunt-contrib-concat": "^0.4.0",
"grunt": "^0.4.5",
"grunt-contrib-concat": "^0.5.0",
"grunt-contrib-jshint": "^0.10.0",
"grunt-contrib-uglify": "^0.4.0",
"load-grunt-tasks": "^0.4.0"
"grunt-contrib-uglify": "^0.6.0",
"load-grunt-tasks": "^1.0.0"
}
}
5 changes: 2 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ if (document.fullscreenEnabled) {

[Supported browsers](http://caniuse.com/fullscreen)

Safari 5.1+ doesn't support use of the keyboard in fullscreen.
Safari doesn't support use of the keyboard in fullscreen.


## Documentation
Expand Down Expand Up @@ -139,11 +139,10 @@ if (screenfull.enabled) {
console.error('Failed to enable fullscreen', event);
});
}
```

See the [demo](http://sindresorhus.com/screenfull.js) for more examples, and view the source.

You can check for fullscreen support by checking the truthy/falsy value of `screenfull` as done in the example above.


### Methods

Expand Down

0 comments on commit 7e15983

Please sign in to comment.