function locationHash()

in js/reveal.js [2628:2658]


	function locationHash() {

		var url = '/';

		// Attempt to create a named link based on the slide's ID
		var id = currentSlide ? currentSlide.getAttribute( 'id' ) : null;
		if( id ) {
			id = encodeURIComponent( id );
		}

		var indexf;
		if( config.fragmentInURL ) {
			indexf = getIndices().f;
		}

		// If the current slide has an ID, use that as a named link,
		// but we don't support named links with a fragment index
		if( typeof id === 'string' && id.length && indexf === undefined ) {
			url = '/' + id;
		}
		// Otherwise use the /h/v index
		else {
			var hashIndexBase = config.hashOneBasedIndex ? 1 : 0;
			if( indexh > 0 || indexv > 0 || indexf !== undefined ) url += indexh + hashIndexBase;
			if( indexv > 0 || indexf !== undefined ) url += '/' + (indexv + hashIndexBase );
			if( indexf !== undefined ) url += '/' + indexf;
		}

		return url;

	}