aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpacien2018-07-21 17:01:32 +0200
committerpacien2018-07-21 17:01:32 +0200
commit79ccb5ac88a88d06713e8fe293e99d4f67e4a6d8 (patch)
tree8a97f9b1a0c3cf39ed09c223151fc29f65c69e40
parent29eba60e321667b73f9c97d73e55be69b344ef1b (diff)
downloadbeamer-viewer-79ccb5ac88a88d06713e8fe293e99d4f67e4a6d8.tar.gz
Add preemptive popup check
-rw-r--r--index.html2
-rw-r--r--pointless/viewer/init.js11
2 files changed, 12 insertions, 1 deletions
diff --git a/index.html b/index.html
index fa1ef21..ddcdbcf 100644
--- a/index.html
+++ b/index.html
@@ -43,7 +43,7 @@
43 <code>\setbeameroption{show notes on second screen=right}</code>) 43 <code>\setbeameroption{show notes on second screen=right}</code>)
44 </p> 44 </p>
45 45
46 <p class="warning"> 46 <p id="warning" class="warning">
47 <noscript>A web browser with JavaScript support is required to use this application.</noscript> 47 <noscript>A web browser with JavaScript support is required to use this application.</noscript>
48 </p> 48 </p>
49 49
diff --git a/pointless/viewer/init.js b/pointless/viewer/init.js
index a9294ea..cb01fab 100644
--- a/pointless/viewer/init.js
+++ b/pointless/viewer/init.js
@@ -28,8 +28,19 @@ function initCache() {
28 offlineCapableIndicator.style.visibility = "visible"; 28 offlineCapableIndicator.style.visibility = "visible";
29} 29}
30 30
31function checkPopupPermission() {
32 try {
33 const popup = window.open();
34 popup.close();
35 } catch(error) {
36 const warningMessage = document.getElementById("warning");
37 warningMessage.textContent = "A pop-up blocker is active. Make sure to allow pop-ups on this website.";
38 }
39}
40
31function init() { 41function init() {
32 initCache(); 42 initCache();
43 checkPopupPermission();
33 44
34 const viewer = new Viewer(); 45 const viewer = new Viewer();
35 46