@@ -14,46 +14,49 @@ var opts = {
1414 baseDir : __dirname + '/../../'
1515} ;
1616
17- io . sockets . on ( 'connection' , function ( socket ) {
18- socket . on ( 'slidechanged' , function ( slideData ) {
19- socket . broadcast . emit ( 'slidedata' , slideData ) ;
20- } ) ;
21- socket . on ( 'fragmentchanged' , function ( fragmentData ) {
22- socket . broadcast . emit ( 'fragmentdata' , fragmentData ) ;
17+ io . sockets . on ( 'connection' , function ( socket ) {
18+
19+ socket . on ( 'state' , function ( state ) {
20+ socket . broadcast . emit ( 'state' , state ) ;
2321 } ) ;
22+
2423} ) ;
2524
26- app . configure ( function ( ) {
27- [ 'css' , 'js' , 'images' , 'plugin' , 'lib' ] . forEach ( function ( dir ) {
28- app . use ( '/' + dir , staticDir ( opts . baseDir + dir ) ) ;
25+ app . configure ( function ( ) {
26+
27+ [ 'css' , 'js' , 'images' , 'plugin' , 'lib' ] . forEach ( function ( dir ) {
28+ app . use ( '/' + dir , staticDir ( opts . baseDir + dir ) ) ;
2929 } ) ;
30+
3031} ) ;
3132
32- app . get ( "/" , function ( req , res ) {
33- res . writeHead ( 200 , { 'Content-Type' : 'text/html' } ) ;
34- fs . createReadStream ( opts . baseDir + '/index.html' ) . pipe ( res ) ;
33+ app . get ( '/' , function ( req , res ) {
34+
35+ res . writeHead ( 200 , { 'Content-Type' : 'text/html' } ) ;
36+ fs . createReadStream ( opts . baseDir + '/index.html' ) . pipe ( res ) ;
37+
3538} ) ;
3639
37- app . get ( " /notes/:socketId" , function ( req , res ) {
40+ app . get ( ' /notes/:socketId' , function ( req , res ) {
3841
39- fs . readFile ( opts . baseDir + 'plugin/notes-server/notes.html' , function ( err , data ) {
40- res . send ( Mustache . to_html ( data . toString ( ) , {
42+ fs . readFile ( opts . baseDir + 'plugin/notes-server/notes.html' , function ( err , data ) {
43+ res . send ( Mustache . to_html ( data . toString ( ) , {
4144 socketId : req . params . socketId
4245 } ) ) ;
4346 } ) ;
44- // fs.createReadStream(opts.baseDir + 'notes-server/notes.html').pipe(res);
47+
4548} ) ;
4649
4750// Actually listen
48- app . listen ( opts . port || null ) ;
51+ app . listen ( opts . port || null ) ;
4952
5053var brown = '\033[33m' ,
5154 green = '\033[32m' ,
5255 reset = '\033[0m' ;
5356
54- var slidesLocation = " http://localhost" + ( opts . port ? ( ':' + opts . port ) : '' ) ;
57+ var slidesLocation = ' http://localhost' + ( opts . port ? ( ':' + opts . port ) : '' ) ;
5558
56- console . log ( brown + " reveal.js - Speaker Notes" + reset ) ;
57- console . log ( " 1. Open the slides at " + green + slidesLocation + reset ) ;
58- console . log ( " 2. Click on the link your JS console to go to the notes page" ) ;
59- console . log ( " 3. Advance through your slides and your notes will advance automatically" ) ;
59+ console . log ( brown + ' reveal.js - Speaker Notes' + reset ) ;
60+ console . log ( ' 1. Open the slides at ' + green + slidesLocation + reset ) ;
61+ console . log ( ' 2. Click on the link your JS console to go to the notes page' ) ;
62+ console . log ( ' 3. Advance through your slides and your notes will advance automatically' ) ;
0 commit comments