Remove full screen dependencies
This commit is contained in:
parent
db075f0adf
commit
bdf660c458
120
app/ui.js
120
app/ui.js
|
|
@ -144,19 +144,19 @@ const UI = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
initFullscreen() {
|
// initFullscreen() {
|
||||||
// Only show the button if fullscreen is properly supported
|
// // Only show the button if fullscreen is properly supported
|
||||||
// * Safari doesn't support alphanumerical input while in fullscreen
|
// // * Safari doesn't support alphanumerical input while in fullscreen
|
||||||
if (!isSafari() &&
|
// if (!isSafari() &&
|
||||||
(document.documentElement.requestFullscreen ||
|
// (document.documentElement.requestFullscreen ||
|
||||||
document.documentElement.mozRequestFullScreen ||
|
// document.documentElement.mozRequestFullScreen ||
|
||||||
document.documentElement.webkitRequestFullscreen ||
|
// document.documentElement.webkitRequestFullscreen ||
|
||||||
document.body.msRequestFullscreen)) {
|
// document.body.msRequestFullscreen)) {
|
||||||
document.getElementById('noVNC_fullscreen_button')
|
// document.getElementById('noVNC_fullscreen_button')
|
||||||
.classList.remove("noVNC_hidden");
|
// .classList.remove("noVNC_hidden");
|
||||||
UI.addFullscreenHandlers();
|
// UI.addFullscreenHandlers();
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
|
|
||||||
initSettings() {
|
initSettings() {
|
||||||
// Logging selection dropdown
|
// Logging selection dropdown
|
||||||
|
|
@ -381,15 +381,15 @@ const UI = {
|
||||||
UI.addSettingChangeHandler('reconnect_delay');
|
UI.addSettingChangeHandler('reconnect_delay');
|
||||||
},
|
},
|
||||||
|
|
||||||
addFullscreenHandlers() {
|
// addFullscreenHandlers() {
|
||||||
document.getElementById("noVNC_fullscreen_button")
|
// document.getElementById("noVNC_fullscreen_button")
|
||||||
.addEventListener('click', UI.toggleFullscreen);
|
// .addEventListener('click', UI.toggleFullscreen);
|
||||||
|
|
||||||
window.addEventListener('fullscreenchange', UI.updateFullscreenButton);
|
// window.addEventListener('fullscreenchange', UI.updateFullscreenButton);
|
||||||
window.addEventListener('mozfullscreenchange', UI.updateFullscreenButton);
|
// window.addEventListener('mozfullscreenchange', UI.updateFullscreenButton);
|
||||||
window.addEventListener('webkitfullscreenchange', UI.updateFullscreenButton);
|
// window.addEventListener('webkitfullscreenchange', UI.updateFullscreenButton);
|
||||||
window.addEventListener('msfullscreenchange', UI.updateFullscreenButton);
|
// window.addEventListener('msfullscreenchange', UI.updateFullscreenButton);
|
||||||
},
|
// },
|
||||||
|
|
||||||
/* ------^-------
|
/* ------^-------
|
||||||
* /EVENT HANDLERS
|
* /EVENT HANDLERS
|
||||||
|
|
@ -1293,46 +1293,46 @@ const UI = {
|
||||||
* FULLSCREEN
|
* FULLSCREEN
|
||||||
* ------v------*/
|
* ------v------*/
|
||||||
|
|
||||||
toggleFullscreen() {
|
// toggleFullscreen() {
|
||||||
if (document.fullscreenElement || // alternative standard method
|
// if (document.fullscreenElement || // alternative standard method
|
||||||
document.mozFullScreenElement || // currently working methods
|
// document.mozFullScreenElement || // currently working methods
|
||||||
document.webkitFullscreenElement ||
|
// document.webkitFullscreenElement ||
|
||||||
document.msFullscreenElement) {
|
// document.msFullscreenElement) {
|
||||||
if (document.exitFullscreen) {
|
// if (document.exitFullscreen) {
|
||||||
document.exitFullscreen();
|
// document.exitFullscreen();
|
||||||
} else if (document.mozCancelFullScreen) {
|
// } else if (document.mozCancelFullScreen) {
|
||||||
document.mozCancelFullScreen();
|
// document.mozCancelFullScreen();
|
||||||
} else if (document.webkitExitFullscreen) {
|
// } else if (document.webkitExitFullscreen) {
|
||||||
document.webkitExitFullscreen();
|
// document.webkitExitFullscreen();
|
||||||
} else if (document.msExitFullscreen) {
|
// } else if (document.msExitFullscreen) {
|
||||||
document.msExitFullscreen();
|
// document.msExitFullscreen();
|
||||||
}
|
// }
|
||||||
} else {
|
// } else {
|
||||||
if (document.documentElement.requestFullscreen) {
|
// if (document.documentElement.requestFullscreen) {
|
||||||
document.documentElement.requestFullscreen();
|
// document.documentElement.requestFullscreen();
|
||||||
} else if (document.documentElement.mozRequestFullScreen) {
|
// } else if (document.documentElement.mozRequestFullScreen) {
|
||||||
document.documentElement.mozRequestFullScreen();
|
// document.documentElement.mozRequestFullScreen();
|
||||||
} else if (document.documentElement.webkitRequestFullscreen) {
|
// } else if (document.documentElement.webkitRequestFullscreen) {
|
||||||
document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
|
// document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
|
||||||
} else if (document.body.msRequestFullscreen) {
|
// } else if (document.body.msRequestFullscreen) {
|
||||||
document.body.msRequestFullscreen();
|
// document.body.msRequestFullscreen();
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
UI.updateFullscreenButton();
|
// UI.updateFullscreenButton();
|
||||||
},
|
// },
|
||||||
|
|
||||||
updateFullscreenButton() {
|
// updateFullscreenButton() {
|
||||||
if (document.fullscreenElement || // alternative standard method
|
// if (document.fullscreenElement || // alternative standard method
|
||||||
document.mozFullScreenElement || // currently working methods
|
// document.mozFullScreenElement || // currently working methods
|
||||||
document.webkitFullscreenElement ||
|
// document.webkitFullscreenElement ||
|
||||||
document.msFullscreenElement ) {
|
// document.msFullscreenElement ) {
|
||||||
document.getElementById('noVNC_fullscreen_button')
|
// document.getElementById('noVNC_fullscreen_button')
|
||||||
.classList.add("noVNC_selected");
|
// .classList.add("noVNC_selected");
|
||||||
} else {
|
// } else {
|
||||||
document.getElementById('noVNC_fullscreen_button')
|
// document.getElementById('noVNC_fullscreen_button')
|
||||||
.classList.remove("noVNC_selected");
|
// .classList.remove("noVNC_selected");
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
|
|
||||||
/* ------^-------
|
/* ------^-------
|
||||||
* /FULLSCREEN
|
* /FULLSCREEN
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue