src/skrollr.stylesheets.js
function(input, startIndex) {
		var begin;
		var end = startIndex;

		//First find the curly bracket that opens this block.
		while(end-- && input.charAt(end) !== '{') {}

		//The end is now fixed to the right of the selector.
		//Now start there to find the begin of the selector.
		begin = end;

		//Now walk farther backwards until we grabbed the whole selector.
		//This either ends at beginning of string or at end of next block.
		while(begin-- && input.charAt(begin - 1) !== '}') {}

		//Return the cleaned selector.
		return input.substring(begin, end).replace(/[\n\r\t]/g, '');
	}
function(input, startIndex) {
		var begin;
		var end = startIndex;

		//First find the curly bracket that opens this block.
		while(end-- && input.charAt(end) !== '{') {}

		//The end is now fixed to the right of the selector.
		//Now start there to find the begin of the selector.
		begin = end;

		//Now walk farther backwards until we grabbed the whole selector.
		//This either ends at beginning of string or at end of next block.
		while(begin-- && input.charAt(begin - 1) !== '}') {}

		//Return the cleaned selector.
		return input.substring(begin, end).replace(/[\n\r\t]/g, '');
	}
function ( input , startIndex ) { var begin ; var end = startIndex ; //First find the curly bracket that opens this block. while ( end -- && input . charAt ( end ) !== '{' ) { } //The end is now fixed to the right of the selector. //Now start there to find the begin of the selector. begin = end ; //Now walk farther backwards until we grabbed the whole selector. //This either ends at beginning of string or at end of next block. while ( begin -- && input . charAt ( begin - 1 ) !== '}' ) { } //Return the cleaned selector. return input . substring ( begin , end ) . replace ( / [\n\r\t] / g , '' ) ; }
Extracts the selector of the given block by walking backwards to the start of the block.
Extracts the selector of the given block by walking backwards to the start of the block .