diff options
Diffstat (limited to 'beamer/viewer/stage')
-rw-r--r-- | beamer/viewer/stage/stage.js | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/beamer/viewer/stage/stage.js b/beamer/viewer/stage/stage.js index 201f7b4..cb94231 100644 --- a/beamer/viewer/stage/stage.js +++ b/beamer/viewer/stage/stage.js | |||
@@ -23,6 +23,15 @@ class Stage { | |||
23 | this.audienceScreen = null; | 23 | this.audienceScreen = null; |
24 | this.presenterScreen = null; | 24 | this.presenterScreen = null; |
25 | 25 | ||
26 | this.onReady = onReady; | ||
27 | this.eventHandlers = [ | ||
28 | new KeyboardEventHandler(onNext, onPrevious), | ||
29 | new MouseClickEventHandler(onNext, onPrevious), | ||
30 | new TouchSwipeEventHandler(onNext, onPrevious) | ||
31 | ]; | ||
32 | } | ||
33 | |||
34 | start() { | ||
26 | this.projector = window.open(window.location.href, "_blank", "toolbar=0,location=0,menubar=0"); | 35 | this.projector = window.open(window.location.href, "_blank", "toolbar=0,location=0,menubar=0"); |
27 | if (this.projector == null) | 36 | if (this.projector == null) |
28 | alert("Please allow pop-ups, then refresh this page."); | 37 | alert("Please allow pop-ups, then refresh this page."); |
@@ -32,15 +41,9 @@ class Stage { | |||
32 | self.audienceScreen = new Screen(self.projector, false, false); | 41 | self.audienceScreen = new Screen(self.projector, false, false); |
33 | self.presenterScreen = new Screen(window, true, true); | 42 | self.presenterScreen = new Screen(window, true, true); |
34 | self._watchDetach(); | 43 | self._watchDetach(); |
35 | onReady(); | 44 | self.onReady(); |
36 | }); | 45 | }); |
37 | 46 | ||
38 | this.eventHandlers = [ | ||
39 | new KeyboardEventHandler(onNext, onPrevious), | ||
40 | new MouseClickEventHandler(onNext, onPrevious), | ||
41 | new TouchSwipeEventHandler(onNext, onPrevious) | ||
42 | ]; | ||
43 | |||
44 | this._registerEventHandler(window); | 47 | this._registerEventHandler(window); |
45 | this._registerEventHandler(this.projector); | 48 | this._registerEventHandler(this.projector); |
46 | } | 49 | } |