From aeb793f2c444dfaa69d7444ccbf1a018883c0b81 Mon Sep 17 00:00:00 2001 From: Yota Ichino <www.irda@gmail.com> Date: Tue, 28 May 2019 21:14:05 +0900 Subject: [PATCH 1/3] Fix fullscreen button of slide #1069 --- src/main/webapp/js/slide.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/webapp/js/slide.js b/src/main/webapp/js/slide.js index cfe926344..ac99d6010 100644 --- a/src/main/webapp/js/slide.js +++ b/src/main/webapp/js/slide.js @@ -84,7 +84,7 @@ var showSlide = function(parent) {// eslint-disable-line no-unused-vars slidehtml += '<a class="next" onclick="plusSlides(1, \'' + slideId + '\')">next ❯</a>'; slidehtml += '<div style="text-align:center">'; slidehtml += '<div class="numbertext"><span class="current">1</span> / ' + data.files.length; - slidehtml += ' <a onclick="requestFullscreen(\'' + slideId + '\');">'; + slidehtml += ' <a onclick="window.requestFullscreen(\'' + slideId + '\');">'; slidehtml += '<i class="full fa fa-television fa-2x" aria-hidden="true"></i></a></div>'; if (data.files.length < 60) { slidehtml += '<div class="dotArea">'; From 544545acae5faa05d941613d26ad9dea35486ad7 Mon Sep 17 00:00:00 2001 From: Yota Ichino <www.irda@gmail.com> Date: Tue, 28 May 2019 21:14:44 +0900 Subject: [PATCH 2/3] Fix fullscreen button of presentation #1069 --- src/main/webapp/js/presentation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/webapp/js/presentation.js b/src/main/webapp/js/presentation.js index 790a2270b..cf46fd5fd 100644 --- a/src/main/webapp/js/presentation.js +++ b/src/main/webapp/js/presentation.js @@ -112,7 +112,7 @@ var createPresentation = function(contentJqObj) {// eslint-disable-line no-unuse slidehtml += '<div style="text-align:center">'; slidehtml += '<div class="numbertext"><span class="current">1</span> / ' + slideLength; - slidehtml += ' <a onclick="requestFullscreen(\'' + slideId + '\');">'; + slidehtml += ' <a onclick="window.requestFullscreen(\'' + slideId + '\');">'; slidehtml += '<i class="full fa fa-television fa-2x" aria-hidden="true"></i></a>'; /* いったんPDFダウンロードボタンはコメントアウト From 28eff205aa8b300ab20f05772a7085428ab7a8cc Mon Sep 17 00:00:00 2001 From: Yota Ichino <www.irda@gmail.com> Date: Tue, 28 May 2019 21:39:56 +0900 Subject: [PATCH 3/3] Change a condition of switching fullscreen When a user pressed the escape key, the value of `full` shows missing value. --- src/main/webapp/js/slide.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/main/webapp/js/slide.js b/src/main/webapp/js/slide.js index ac99d6010..7b091f5ed 100644 --- a/src/main/webapp/js/slide.js +++ b/src/main/webapp/js/slide.js @@ -1,36 +1,27 @@ var indexMap = {}; -var full = false; var slideCount = 0; var requestFullscreen = function(id) {// eslint-disable-line no-unused-vars - if (full) { + if (document.fullscreenElement) { if (document.webkitCancelFullScreen) { document.webkitCancelFullScreen(); - full = false; } else if (document.mozCancelFullScreen) { document.mozCancelFullScreen(); - full = false; } else if (document.msExitFullscreen) { document.msExitFullscreen(); - full = false; } else if (document.exitFullscreen) { document.exitFullscreen(); - full = false; } } else { var target = document.getElementById(id); if (target.requestFullscreen) { target.requestFullscreen(); // HTML5 Fullscreen API仕様 - full = true; } else if (target.webkitRequestFullscreen) { target.webkitRequestFullscreen(); //Chrome15+, Safari5.1+, Opera15+ - full = true; } else if (target.mozRequestFullScreen) { target.mozRequestFullScreen(); //FF10+ - full = true; } else if (target.msRequestFullscreen) { target.msRequestFullscreen(); //IE11+ - full = true; } else { $.notify('Fullscreen view is not supported.', 'warn'); return;