website/reveal/js/reveal.js
/**
	 * Reads the current URL (hash) and navigates accordingly.
	 */
Reads the current URL (hash) and navigates accordingly.
Reads the current URL ( hash ) and navigates accordingly .
function readURL() {
		var hash = window.location.hash;
		var bits = hash.slice( 2 ).split( '/' ),
			name = hash.replace( /#|\//gi, '' );
		if( isNaN( parseInt( bits[0], 10 ) ) && name.length ) {
			var element = document.querySelector( '#' + name );
			if( element ) {
				var indices = Reveal.getIndices( element );
				slide( indices.h, indices.v );
			}
			else {
				slide( indexh || 0, indexv || 0 );
			}
		}
		else {
			var h = parseInt( bits[0], 10 ) || 0,
				v = parseInt( bits[1], 10 ) || 0;
			if( h !== indexh || v !== indexv ) {
				slide( h, v );
			}
		}
	}
function readURL ( ) { var hash = window . location . hash ; var bits = hash . slice ( 2 ) . split ( '/' ) , name = hash . replace ( / #|\/ / gi , '' ) ; if ( isNaN ( parseInt ( bits [ 0 ] , 10 ) ) && name . length ) { var element = document . querySelector ( '#' + name ) ; if ( element ) { var indices = Reveal . getIndices ( element ) ; slide ( indices . h , indices . v ) ; } else { slide ( indexh || 0 , indexv || 0 ) ; } } else { var h = parseInt ( bits [ 0 ] , 10 ) || 0 , v = parseInt ( bits [ 1 ] , 10 ) || 0 ; if ( h !== indexh || v !== indexv ) { slide ( h , v ) ; } } }
Reads the current URL (hash) and navigates accordingly.
Reads the current URL ( hash ) and navigates accordingly .
// Attempt to parse the hash as either an index or name // If the first bit is invalid and there is a name we can // assume that this is a named link // Find the slide with the specified name // Find the position of the named slide and navigate to it // If the slide doesn't exist, navigate to the current slide // Read the index components of the hash