diff --git a/index.html b/index.html index 5395e48..3d696e6 100644 --- a/index.html +++ b/index.html @@ -110,6 +110,9 @@ +
  • + Fullscreen +
  • diff --git a/user_css/main.css b/user_css/main.css index 64eddf5..3f94d5d 100644 --- a/user_css/main.css +++ b/user_css/main.css @@ -105,7 +105,7 @@ div#menu ul ul li { background-color: rgb(255, 255, 255); } -div#menu ul ul span, div#menu ul ul button { +div#menu ul ul a, div#menu ul ul span, div#menu ul ul button { line-height: 120%; padding: 10px 15px; } diff --git a/user_scripts/GUIGlueCode.js b/user_scripts/GUIGlueCode.js index fa8e96b..d1f2e97 100644 --- a/user_scripts/GUIGlueCode.js +++ b/user_scripts/GUIGlueCode.js @@ -54,6 +54,7 @@ function registerGUIEvents() { addEvent("click", document.getElementById("toggleDynamicSpeed"), function () { IodineGUI.Iodine.toggleDynamicSpeed(this.checked); }); + addEvent("click", document.getElementById("fullscreen"), toggleFullScreen); addEvent("change", document.getElementById("import"), function (e) { if (typeof this.files != "undefined") { try { diff --git a/user_scripts/JoyPadGlueCode.js b/user_scripts/JoyPadGlueCode.js index 9a51e92..1ec95f1 100644 --- a/user_scripts/JoyPadGlueCode.js +++ b/user_scripts/JoyPadGlueCode.js @@ -1,11 +1,11 @@ "use strict"; /* Copyright (C) 2012-2015 Grant Galitz - + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ function keyDown(e) { @@ -53,8 +53,41 @@ function keyUpPreprocess(e) { case 53: IodineGUI.Iodine.setSpeed(1); break; + case 54: + toggleFullScreen(); + break; default: //Control keys / other - keyUp(keyCode); + keyUp(keyCode | 0); + } +} +function toggleFullScreen() { + if (!document.fullscreenElement && !document.mozFullScreenElement && !document.webkitFullscreenElement && !document.msFullscreenElement ) { + if (document.documentElement.requestFullscreen) { + document.documentElement.requestFullscreen(); + } + else if (document.documentElement.msRequestFullscreen) { + document.documentElement.msRequestFullscreen(); + } + else if (document.documentElement.mozRequestFullScreen) { + document.documentElement.mozRequestFullScreen(); + } + else if (document.documentElement.webkitRequestFullscreen) { + document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT); + } } -} \ No newline at end of file + else { + if (document.exitFullscreen) { + document.exitFullscreen(); + } + else if (document.msExitFullscreen) { + document.msExitFullscreen(); + } + else if (document.mozCancelFullScreen) { + document.mozCancelFullScreen(); + } + else if (document.webkitExitFullscreen) { + document.webkitExitFullscreen(); + } +} +}