Файл: Space race/libs/fullscreen.js
Строк: 147
<?php
document.cancelFullScreen = document.cancelFullScreen || document.webkitCancelFullScreen || document.mozCancelFullScreen;
function onFullScreenEnter() {
console.log("Enter fullscreen initiated from iframe");
};
function onFullScreenExit() {
console.log("Exit fullscreen initiated from iframe");
};
// Note: FF nightly needs about:config full-screen-api.enabled set to true.
function enterFullscreen(id) {
onFullScreenEnter(id);
var el = document.getElementById(id);
var onfullscreenchange = function(e){
var fullscreenElement = document.fullscreenElement || document.mozFullscreenElement || document.webkitFullscreenElement;
var fullscreenEnabled = document.fullscreenEnabled || document.mozFullscreenEnabled || document.webkitFullscreenEnabled;
console.log( 'fullscreenEnabled = ' + fullscreenEnabled, ', fullscreenElement = ', fullscreenElement, ', e = ', e);
}
el.addEventListener("webkitfullscreenchange", onfullscreenchange);
el.addEventListener("mozfullscreenchange", onfullscreenchange);
el.addEventListener("fullscreenchange", onfullscreenchange);
if (el.webkitRequestFullScreen) {
el.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
} else {
el.mozRequestFullScreen();
}
document.querySelector('#'+id + ' button').onclick = function(){
exitFullscreen(id);
}
}
function exitFullscreen(id) {
onFullScreenExit(id);
document.cancelFullScreen();
document.querySelector('#'+id + ' button').onclick = function(){
enterFullscreen(id);
}
}
//var message="!";
//function click(e) {
// if (document.all) {
// if (event.button == 2) {
// alert(message);
// return false;}
//}
//if (document.layers) {
//if (e.which == 3) {
// alert(message);
//return false;}
//}
//}
//if (document.layers)
// {document.captureEvents(Event.MOUSEDOWN);}
//document.onmousedown=click;
//document.oncontextmenu=function(e){return false};
?>