aboutsummaryrefslogtreecommitdiff
path: root/beamer/viewer/stage
diff options
context:
space:
mode:
authorpacien2023-10-23 21:58:06 +0200
committerpacien2023-10-23 21:58:06 +0200
commit3af33091d66197d2b14ab0ed7962d79b3a17d6e1 (patch)
treec3f12d599c72f05415db9522c6126ec7bf81292d /beamer/viewer/stage
parent7249325100ce5d373d7da8b3e14ea8283a56eef9 (diff)
downloadbeamer-viewer-3af33091d66197d2b14ab0ed7962d79b3a17d6e1.tar.gz
presentation,stage: split object init and start
Diffstat (limited to 'beamer/viewer/stage')
-rw-r--r--beamer/viewer/stage/stage.js17
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 }