aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rw-r--r--js/slide-controller.js29
-rw-r--r--js/slide-deck.js22
2 files changed, 31 insertions, 20 deletions
diff --git a/js/slide-controller.js b/js/slide-controller.js
index efb0097..bef37c4 100644
--- a/js/slide-controller.js
+++ b/js/slide-controller.js
@@ -13,6 +13,7 @@
13 this.mode = null; 13 this.mode = null;
14 this.remoteSocket = null; 14 this.remoteSocket = null;
15 this.isPresenter = window.opener; 15 this.isPresenter = window.opener;
16 this.isController = window.opener;
16 17
17 this.keyLock = null; 18 this.keyLock = null;
18 19
@@ -20,7 +21,7 @@
20 } 21 }
21 22
22 23
23 SlideController.MODES = ['local', 'remote', 'controller']; 24 SlideController.MODES = ['local', 'remote', 'controller', 'presenter'];
24 25
25 SlideController.prototype.setup = function() { 26 SlideController.prototype.setup = function() {
26 27
@@ -80,9 +81,12 @@
80 81
81 break; 82 break;
82 83
83 case 'controller': 84 case 'presenter':
84 this.isPresenter = true; 85 this.isPresenter = true;
85 document.body.classList.add('popup'); 86 document.body.classList.add('popup');
87
88 case 'controller':
89 this.isController = true;
86 document.body.classList.add('with-notes'); 90 document.body.classList.add('with-notes');
87 var password = prompt("Broadcaster password"); 91 var password = prompt("Broadcaster password");
88 92
@@ -192,6 +196,11 @@
192 return; 196 return;
193 } 197 }
194 198
199 // don't toggle speaker's notes for viewers
200 if (msg.keyCode === 80) {
201 return;
202 }
203
195 console.log("Sending: " + JSON.stringify(msg)); 204 console.log("Sending: " + JSON.stringify(msg));
196 205
197 // // Send message to popup window. 206 // // Send message to popup window.
@@ -200,13 +209,15 @@
200 // } 209 // }
201 210
202 // Send message to main window. 211 // Send message to main window.
203 if (this.isPresenter) { 212 if (this.isController) {
204 if (this.mode === 'local') { 213 switch (this.mode) {
205 // TODO: It would be dope if FF implemented location.origin. 214 case 'local':
206 window.opener.postMessage(msg, '*'); 215 // TODO: It would be dope if FF implemented location.origin.
207 } 216 window.opener.postMessage(msg, '*');
208 if (this.mode === 'controller') { 217 break;
209 this.remoteSocket.emit('message', msg.keyCode); 218 case 'controller':
219 case 'presenter':
220 this.remoteSocket.emit('message', msg.keyCode);
210 } 221 }
211 } 222 }
212 }; 223 };
diff --git a/js/slide-deck.js b/js/slide-deck.js
index f5d21c6..2943658 100644
--- a/js/slide-deck.js
+++ b/js/slide-deck.js
@@ -177,7 +177,7 @@ SlideDeck.prototype.onBodyKeyDown_ = function(e) {
177 } 177 }
178 178
179 // Forward keydowns to the main slides if we're the popup. 179 // Forward keydowns to the main slides if we're the popup.
180 if (this.controller && this.controller.isPresenter) { 180 if (this.controller && this.controller.isController) {
181 this.controller.sendMsg({ 181 this.controller.sendMsg({
182 keyCode : e.keyCode 182 keyCode : e.keyCode
183 }); 183 });
@@ -504,11 +504,11 @@ SlideDeck.prototype.prevSlide = function(opt_dontPush) {
504 // Toggle off speaker notes if they're showing when we move backwards on 504 // Toggle off speaker notes if they're showing when we move backwards on
505 // the 505 // the
506 // main slides. If we're the speaker notes popup, leave them up. 506 // main slides. If we're the speaker notes popup, leave them up.
507 if (this.controller && !this.controller.isPresenter) { 507 // if (this.controller && !this.controller.isPresenter) {
508 bodyClassList.remove('with-notes'); 508 // bodyClassList.remove('with-notes');
509 } else if (!this.controller) { 509 // } else if (!this.controller) {
510 bodyClassList.remove('with-notes'); 510 // bodyClassList.remove('with-notes');
511 } 511 // }
512 512
513 this.prevSlide_ = this.curSlide_--; 513 this.prevSlide_ = this.curSlide_--;
514 514
@@ -532,11 +532,11 @@ SlideDeck.prototype.nextSlide = function(opt_dontPush) {
532 // Toggle off speaker notes if they're showing when we advanced on the 532 // Toggle off speaker notes if they're showing when we advanced on the
533 // main 533 // main
534 // slides. If we're the speaker notes popup, leave them up. 534 // slides. If we're the speaker notes popup, leave them up.
535 if (this.controller && !this.controller.isPresenter) { 535 // if (this.controller && !this.controller.isPresenter) {
536 bodyClassList.remove('with-notes'); 536 // bodyClassList.remove('with-notes');
537 } else if (!this.controller) { 537 // } else if (!this.controller) {
538 bodyClassList.remove('with-notes'); 538 // bodyClassList.remove('with-notes');
539 } 539 // }
540 540
541 this.prevSlide_ = this.curSlide_++; 541 this.prevSlide_ = this.curSlide_++;
542 542