aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpacien2018-07-19 01:20:39 +0200
committerpacien2018-07-19 01:20:39 +0200
commit4ece01c6e7a2dd6c09c7b3f7f631f828a8d6c0f0 (patch)
tree05912c1c3ff9e2f60a2849068cf61aae67bf81d4
parent662ab91908969a973bd8f3c7c6f3b8a961dec7b5 (diff)
downloadbeamer-viewer-4ece01c6e7a2dd6c09c7b3f7f631f828a8d6c0f0.tar.gz
Add pop-up blocker warning
-rw-r--r--pointless/viewer/stage.js14
1 files changed, 10 insertions, 4 deletions
diff --git a/pointless/viewer/stage.js b/pointless/viewer/stage.js
index 7995de6..f8d6e09 100644
--- a/pointless/viewer/stage.js
+++ b/pointless/viewer/stage.js
@@ -15,10 +15,13 @@ class Stage {
15 this.audienceScreen = null; 15 this.audienceScreen = null;
16 this.presenterScreen = null; 16 this.presenterScreen = null;
17 17
18 this._setMessage(window, "Please allow pop-ups on this page");
19
18 var self = this; 20 var self = this;
19 this.projector.addEventListener("load", function() { 21 this.projector.addEventListener("load", function() {
20 self.audienceScreen = new Screen(self.projector, false, false); 22 self.audienceScreen = new Screen(self.projector, false, false);
21 self.presenterScreen = new Screen(window, true, true); 23 self.presenterScreen = new Screen(window, true, true);
24 self._setMessage(window, null);
22 self._watchDetach(); 25 self._watchDetach();
23 onReady(); 26 onReady();
24 }); 27 });
@@ -56,13 +59,16 @@ class Stage {
56 _watchDetach() { 59 _watchDetach() {
57 var self = this; 60 var self = this;
58 window.addEventListener("beforeunload", function() { 61 window.addEventListener("beforeunload", function() {
59 var messageBar = self.projector.document.getElementById("message"); 62 self._setMessage(self.projector, "Controller detached");
60 messageBar.textContent = "Controller detached";
61 }); 63 });
62 64
63 this.projector.addEventListener("beforeunload", function() { 65 this.projector.addEventListener("beforeunload", function() {
64 var messageBar = document.getElementById("message"); 66 self._setMessage(window, "Viewer detached");
65 messageBar.textContent = "Viewer detached";
66 }); 67 });
67 } 68 }
69
70 _setMessage(window, message) {
71 var messageBar = window.document.getElementById("message");
72 messageBar.textContent = message;
73 }
68} 74}