Browse Source

merge full screen key binding (f)

Hakim El Hattab 12 years ago
parent
commit
e15beb47f0
2 changed files with 23 additions and 1 deletions
  1. 23 1
      js/reveal.js
  2. 0 0
      js/reveal.min.js

+ 23 - 1
js/reveal.js

@@ -439,6 +439,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;
 		}
@@ -740,6 +742,26 @@ var Reveal = (function(){
 		return dom.wrapper.classList.contains( 'overview' );
 	}
 
+	/**
+	 * 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 );
+		}
+	}
+
 	/**
 	 * Enters the paused mode which fades everything on screen to 
 	 * black.
@@ -1209,7 +1231,7 @@ var Reveal = (function(){
 		// another timeout
 		cueAutoSlide();
 	}
-	
+
 	// Expose some methods publicly
 	return {
 		initialize: initialize,

File diff suppressed because it is too large
+ 0 - 0
js/reveal.min.js


Some files were not shown because too many files changed in this diff