From 2869f8a4ee23b061d293f927742a8daa1495246b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Ku=CC=88hnel?= Date: Sun, 14 Oct 2012 10:26:40 +0200 Subject: [PATCH 1/4] Add fullscreen mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Handling the fullscreen functionality via the fullscreen JavaScript API. Press »f« on the keyboard to enter fullscreen mode. --- js/reveal.js | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/js/reveal.js b/js/reveal.js index 3dcedf0..e95092e 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -435,6 +435,8 @@ var Reveal = (function(){ case 13: isOverviewActive() ? deactivateOverview() : triggered = false; break; // b, period case 66: case 190: togglePause(); break; + // f + case 70: enterFullscreen(); break; default: triggered = false; } @@ -1192,7 +1194,25 @@ var Reveal = (function(){ // another timeout cueAutoSlide(); } - + + /** + * Handling the fullscreen functionality via the fullscreen API + * @see http://fullscreen.spec.whatwg.org/ + * @see https://developer.mozilla.org/en-US/docs/DOM/Using_fullscreen_mode + */ + function enterFullscreen() { + var element = document.body; + + // Check which implementation is available + var requestMethod = element.requestFullScreen || + element.webkitRequestFullScreen || + element.mozRequestFullScreen || + element.msRequestFullScreen; + if (requestMethod) { + requestMethod.apply(element); + } + } + // Expose some methods publicly return { initialize: initialize, From a23868804e2f7cd8c34fe1e0d197da4b1e6fe0bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Ku=CC=88hnel?= Date: Sun, 14 Oct 2012 10:33:25 +0200 Subject: [PATCH 2/4] Change source from reveal.min.js to reveal.js for testing purposes --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 5dba9a4..0708aa6 100644 --- a/index.html +++ b/index.html @@ -323,7 +323,7 @@ function linkify( selector ) { - + - +