use head.js to script load everything, fixes bug with inclusion of notes server js #57
[reveal.js.git] / index.html
index d4420ac22168ba55891d8ebc96605af3370eeda2..4441cce0f4d80cbd0f3153fb1797fa4b2058c125 100644 (file)
@@ -4,7 +4,7 @@
        <head>
                <meta charset="utf-8">
                
-               <title>reveal.js</title>
+               <title>reveal.js - HTML5 Presentations</title>
 
                <meta name="description" content="An easy to use CSS 3D slideshow tool for quickly creating good looking HTML presentations.">
                <meta name="author" content="Hakim El Hattab">
@@ -18,7 +18,7 @@
                <link rel="stylesheet" href="css/main.css">
                <link rel="stylesheet" href="css/print.css" type="text/css" media="print">
 
-               <link rel="stylesheet" href="lib/zenburn.css">
+               <link rel="stylesheet" href="lib/highlight/zenburn.css">
        </head>
        
        <body>
@@ -264,60 +264,66 @@ linkify( 'a' );
                </div>
 
                <!-- Optional libraries for code syntax highlighting and classList support in IE9 -->
-               <script src="lib/highlight.js"></script>
-               <script src="lib/classList.js"></script>
-               
-               <script src="js/reveal.js"></script>
-               
+               <script src="lib/head/head.min.js"></script>
+
                <script>
-                       // Parse the query string into a key/value object
-                       var query = {};
+                       // Load the main reveal.js script
+                       head.js( 'js/reveal.js', function() {
+                               // Parse the query string into a key/value object
+                               var query = {};
 
-                       location.search.replace( /[A-Z0-9]+?=(\w*)/gi, function(a) {
-                               query[ a.split( '=' ).shift() ] = a.split( '=' ).pop();
-                       } );
+                               location.search.replace( /[A-Z0-9]+?=(\w*)/gi, function(a) {
+                                       query[ a.split( '=' ).shift() ] = a.split( '=' ).pop();
+                               } );
 
-                       // Fires when a slide with data-state=customevent is activated
-                       Reveal.addEventListener( 'customevent', function() {
-                               alert( '"customevent" has fired' );
-                       } );
+                               // Fires when a slide with data-state=customevent is activated
+                               Reveal.addEventListener( 'customevent', function() {
+                                       alert( '"customevent" has fired' );
+                               } );
 
-                       // Fires each time a new slide is activated
-                       Reveal.addEventListener( 'slidechanged', function( event ) {
-                               // event.previousSlide, event.currentSlide, event.indexh, event.indexv
-                       } );
+                               // Fires each time a new slide is activated
+                               Reveal.addEventListener( 'slidechanged', function( event ) {
+                                       // event.previousSlide, event.currentSlide, event.indexh, event.indexv
+                               } );
 
-                       Reveal.initialize({
-                               // Display controls in the bottom right corner
-                               controls: true,
+                               Reveal.initialize({
+                                       // Display controls in the bottom right corner
+                                       controls: true,
 
-                               // Display a presentation progress bar
-                               progress: true,
+                                       // Display a presentation progress bar
+                                       progress: true,
 
-                               // If true; each slide will be pushed to the browser history
-                               history: true,
+                                       // If true; each slide will be pushed to the browser history
+                                       history: true,
 
-                               // Loops the presentation, defaults to false
-                               loop: false,
+                                       // Loops the presentation, defaults to false
+                                       loop: false,
 
-                               // Flags if mouse wheel navigation should be enabled
-                               mouseWheel: true,
+                                       // Flags if mouse wheel navigation should be enabled
+                                       mouseWheel: true,
 
-                               // Apply a 3D roll to links on hover
-                               rollingLinks: true,
+                                       // Apply a 3D roll to links on hover
+                                       rollingLinks: true,
 
-                               // UI style
-                               theme: query.theme || 'default', // default/neon
+                                       // UI style
+                                       theme: query.theme || 'default', // default/neon
 
-                               // Transition style
-                               transition: query.transition || 'default' // default/cube/page/concave/linear(2d)
-                       });
+                                       // Transition style
+                                       transition: query.transition || 'default' // default/cube/page/concave/linear(2d)
+                               });
+                       } );
+                       
+                       // Load third party scripts
+                       head.js( 'lib/highlight/highlight.js', 'lib/polyfills/classList.js', function() {
+                               // Fire off syntax highlighting for potential code samples in the slides
+                               hljs.initHighlightingOnLoad();
+                       } );
 
-                       hljs.initHighlightingOnLoad();
+                       // If we're runnning the notes server we need to include some additional JS
+                       if( window.location.host === 'localhost:1947' ) {
+                               head.js( 'socket.io/socket.io.js', 'lib/slidenotes/client.js' );
+                       }
                </script>
-
-               <!-- the next two lines enable the speaker notes server -->
-               <script src="socket.io/socket.io.js"></script>
-               <script src="js/slidenotes.js"></script>
+               
        </body>
 </html>
\ No newline at end of file