From ac51a90f6cb52df6138d6bdb63c0dce6621f5fcd Mon Sep 17 00:00:00 2001 From: Emil Ivov Date: Sun, 9 Feb 2014 12:21:18 +0100 Subject: [PATCH] Adds full screen toggling in the tool bar as suggested by @deleolajide . --- app.js | 31 +++++++++++++++++++++++++++++++ index.html | 4 +++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/app.js b/app.js index 5f0c8502e5..a8f114d0c6 100644 --- a/app.js +++ b/app.js @@ -1110,3 +1110,34 @@ function scrollChatToBottom() { $('#chatconversation').scrollTop($('#chatconversation')[0].scrollHeight); }, 5); } + + +/* + * Toggles the application in and out of full screen mode + * (a.k.a. presentation mode in Chrome). + */ +function toggleFullScreen() { + var fsElement = document.documentElement; + + if (!document.mozFullScreen && !document.webkitFullScreen){ + + //Enter Full Screen + if (fsElement.mozRequestFullScreen) { + + fsElement.mozRequestFullScreen(); + + } + else { + fsElement.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT); + } + + } else { + + //Exit Full Screen + if (document.mozCancelFullScreen) { + document.mozCancelFullScreen(); + } else { + document.webkitCancelFullScreen(); + } + } +} diff --git a/index.html b/index.html index 0313c597c4..e7a9f36d4d 100644 --- a/index.html +++ b/index.html @@ -7,7 +7,7 @@ - + @@ -35,6 +35,8 @@
+
+