diff options
Diffstat (limited to 'pointless')
-rw-r--r-- | pointless/viewer/stage.js | 14 |
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 | } |