function writeURL()

in js/reveal.js [4344:4372]


	function writeURL( delay ) {

		// Make sure there's never more than one timeout running
		clearTimeout( writeURLTimeout );

		// If a delay is specified, timeout this call
		if( typeof delay === 'number' ) {
			writeURLTimeout = setTimeout( writeURL, delay );
		}
		else if( currentSlide ) {
			// If we're configured to push to history OR the history
			// API is not avaialble.
			if( config.history || !window.history ) {
				window.location.hash = locationHash();
			}
			// If we're configured to reflect the current slide in the
			// URL without pushing to history.
			else if( config.hash ) {
				window.history.replaceState( null, null, '#' + locationHash() );
			}
			// If history and hash are both disabled, a hash may still
			// be added to the URL by clicking on a href with a hash
			// target. Counter this by always removing the hash.
			else {
				window.history.replaceState( null, null, window.location.pathname + window.location.search );
			}
		}

	}