use head.js to script load everything, fixes bug with inclusion of notes server js #57
This commit is contained in:
parent
32f0d328ff
commit
e7c5de23d7
110
index.html
110
index.html
|
@ -264,68 +264,64 @@ linkify( 'a' );
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Optional libraries for code syntax highlighting and classList support in IE9 -->
|
<!-- Optional libraries for code syntax highlighting and classList support in IE9 -->
|
||||||
<script src="lib/highlight/highlight.js"></script>
|
<script src="lib/head/head.min.js"></script>
|
||||||
<script src="lib/polyfills/classList.js"></script>
|
|
||||||
|
|
||||||
<script src="js/reveal.js"></script>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// Parse the query string into a key/value object
|
// Load the main reveal.js script
|
||||||
var query = {};
|
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) {
|
location.search.replace( /[A-Z0-9]+?=(\w*)/gi, function(a) {
|
||||||
query[ a.split( '=' ).shift() ] = a.split( '=' ).pop();
|
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 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,
|
||||||
|
|
||||||
|
// Display a presentation progress bar
|
||||||
|
progress: true,
|
||||||
|
|
||||||
|
// If true; each slide will be pushed to the browser history
|
||||||
|
history: true,
|
||||||
|
|
||||||
|
// Loops the presentation, defaults to false
|
||||||
|
loop: false,
|
||||||
|
|
||||||
|
// Flags if mouse wheel navigation should be enabled
|
||||||
|
mouseWheel: true,
|
||||||
|
|
||||||
|
// Apply a 3D roll to links on hover
|
||||||
|
rollingLinks: true,
|
||||||
|
|
||||||
|
// UI style
|
||||||
|
theme: query.theme || 'default', // default/neon
|
||||||
|
|
||||||
|
// 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();
|
||||||
} );
|
} );
|
||||||
|
|
||||||
// Fires when a slide with data-state=customevent is activated
|
// If we're runnning the notes server we need to include some additional JS
|
||||||
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
|
|
||||||
} );
|
|
||||||
|
|
||||||
Reveal.initialize({
|
|
||||||
// Display controls in the bottom right corner
|
|
||||||
controls: true,
|
|
||||||
|
|
||||||
// Display a presentation progress bar
|
|
||||||
progress: true,
|
|
||||||
|
|
||||||
// If true; each slide will be pushed to the browser history
|
|
||||||
history: true,
|
|
||||||
|
|
||||||
// Loops the presentation, defaults to false
|
|
||||||
loop: false,
|
|
||||||
|
|
||||||
// Flags if mouse wheel navigation should be enabled
|
|
||||||
mouseWheel: true,
|
|
||||||
|
|
||||||
// Apply a 3D roll to links on hover
|
|
||||||
rollingLinks: true,
|
|
||||||
|
|
||||||
// UI style
|
|
||||||
theme: query.theme || 'default', // default/neon
|
|
||||||
|
|
||||||
// Transition style
|
|
||||||
transition: query.transition || 'default' // default/cube/page/concave/linear(2d)
|
|
||||||
});
|
|
||||||
|
|
||||||
// Fire off syntax highlighting for potential code samples in the slides
|
|
||||||
hljs.initHighlightingOnLoad();
|
|
||||||
|
|
||||||
// If we're runnning the notes node server we need to include some
|
|
||||||
// additional JS
|
|
||||||
if( window.location.host === 'localhost:1947' ) {
|
if( window.location.host === 'localhost:1947' ) {
|
||||||
var notes_socket = document.createElement( 'script' );
|
head.js( 'socket.io/socket.io.js', 'lib/slidenotes/client.js' );
|
||||||
notes_socket.setAttribute( 'src', 'socket.io/socket.io.js' );
|
|
||||||
document.body.appendChild( notes_socket );
|
|
||||||
|
|
||||||
var notes_client = document.createElement( 'script' );
|
|
||||||
notes_client.setAttribute( 'src', 'lib/slidenotes/client.js' );
|
|
||||||
document.body.appendChild( notes_client );
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
8
lib/head/head.min.js
vendored
Normal file
8
lib/head/head.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user