From 580a72c4449c57cb743e09f44eeeb374cd00f172 Mon Sep 17 00:00:00 2001
From: David Banham
Date: Fri, 8 Mar 2013 11:51:58 +1100
Subject: Bring multiplex up to date

---
 plugin/multiplex/client.js | 3 ++-
 plugin/multiplex/index.js  | 7 -------
 plugin/multiplex/master.js | 3 ++-
 3 files changed, 4 insertions(+), 9 deletions(-)

(limited to 'plugin/multiplex')

diff --git a/plugin/multiplex/client.js b/plugin/multiplex/client.js
index 6fc0d4d..cb7b27a 100644
--- a/plugin/multiplex/client.js
+++ b/plugin/multiplex/client.js
@@ -1,4 +1,5 @@
 (function() {
+	var multiplex = window.globals.multiplex;
 	var socketId = multiplex.id;
 	var socket = io.connect(multiplex.url);
 
@@ -7,6 +8,6 @@
 		if (data.socketId !== socketId) { return; }
 		if( window.location.host === 'localhost:1947' ) return;
 
-		Reveal.navigateTo(data.indexh, data.indexv, 'remote');
+		Reveal.slide(data.indexh, data.indexv, null, 'remote');
 	});
 }());
diff --git a/plugin/multiplex/index.js b/plugin/multiplex/index.js
index 4665639..aa8a55a 100644
--- a/plugin/multiplex/index.js
+++ b/plugin/multiplex/index.js
@@ -15,7 +15,6 @@ var opts = {
 
 io.sockets.on('connection', function(socket) {
 	socket.on('slidechanged', function(slideData) {
-		console.log(slideData);
 		if (createHash(slideData.secret) === slideData.socketId) {
 			slideData.secret = null;
 			socket.broadcast.emit(slideData.socketId, slideData);
@@ -32,12 +31,6 @@ app.configure(function() {
 app.get("/", function(req, res) {
 	fs.createReadStream(opts.baseDir + '/index.html').pipe(res);
 });
-app.get("/fixed.html", function(req, res) {
-	fs.createReadStream(opts.baseDir + '/fixed.html').pipe(res);
-});
-app.get("/fixedmaster.html", function(req, res) {
-	fs.createReadStream(opts.baseDir + '/fixedmaster.html').pipe(res);
-});
 
 app.get("/token", function(req,res) {
 	var ts = new Date().getTime();
diff --git a/plugin/multiplex/master.js b/plugin/multiplex/master.js
index 3704fa4..a896244 100644
--- a/plugin/multiplex/master.js
+++ b/plugin/multiplex/master.js
@@ -1,6 +1,7 @@
 (function() {
 	// don't emit events from inside the previews themselves
 	if ( window.location.search.match( /receiver/gi ) ) { return; }
+	var multiplex = window.globals.multiplex;
 
 	var socket = io.connect(multiplex.url);
 	
@@ -27,6 +28,6 @@
 			socketId : multiplex.id
 		};
 
-		if( event.origin !== 'remote') socket.emit('slidechanged', slideData);
+		if( typeof event.origin === 'undefined' && event.origin !== 'remote') socket.emit('slidechanged', slideData);
 	} );
 }());
-- 
cgit v1.2.3