Added multiplexing server

This commit is contained in:
David Banham
2012-08-05 23:48:55 +10:00
parent 79299d0071
commit 976536d15e
9 changed files with 285 additions and 30 deletions

View File

@ -278,6 +278,15 @@ function linkify( selector ) {
<script src="lib/js/head.min.js"></script>
<script>
var multiplex = {
id: null
, secret: null
, url: 'revealjs.jit.su'
};
var notes = false;
head.ready( function() {
// Fires when a slide with data-state=customevent is activated
@ -326,11 +335,20 @@ function linkify( selector ) {
// If we're runnning the notes server we need to include some additional JS
// TODO Is there a better way to determine if we're running the notes server?
if( window.location.host === 'localhost:1947' ) {
if( window.location.host === 'localhost:1947' || notes === true) {
scripts.push( 'socket.io/socket.io.js' );
scripts.push( 'plugin/speakernotes/client.js' );
}
if( multiplex.id !== null ) {
scripts.push( 'socket.io/socket.io.js' );
scripts.push( 'plugin/multiplex/client.js' );
if( multiplex.secret !== null ) {
scripts.push( 'plugin/multiplex/master.js' );
}
}
// Load the scripts and, when completed, initialize reveal.js
head.js.apply( null, scripts );