lib/editTree/css.js
function extractPropertiesFromSource(source, offset) {
		offset = offset || 0;
		source = source.replace(reSpaceEnd, '');
		var out = [];

		if (!source) {
			return out;
		}

		var tokens = cssParser.parse(source);
		var it = tokenIterator.create(tokens);
		var property;

		while ((property = consumeSingleProperty(it, source))) {
			out.push({
				nameText: property.name.substring(source),
				name: property.name.shift(offset),

				valueText: property.value.substring(source),
				value: property.value.shift(offset),

				endText: property.end.substring(source),
				end: property.end.shift(offset)
			});
		}

		return out;
	}
function extractPropertiesFromSource(source, offset) {
		offset = offset || 0;
		source = source.replace(reSpaceEnd, '');
		var out = [];

		if (!source) {
			return out;
		}

		var tokens = cssParser.parse(source);
		var it = tokenIterator.create(tokens);
		var property;

		while ((property = consumeSingleProperty(it, source))) {
			out.push({
				nameText: property.name.substring(source),
				name: property.name.shift(offset),

				valueText: property.value.substring(source),
				value: property.value.shift(offset),

				endText: property.end.substring(source),
				end: property.end.shift(offset)
			});
		}

		return out;
	}
function extractPropertiesFromSource ( source , offset ) { offset = offset || 0 ; source = source . replace ( reSpaceEnd , '' ) ; var out = [ ] ; if ( ! source ) { return out ; } var tokens = cssParser . parse ( source ) ; var it = tokenIterator . create ( tokens ) ; var property ; while ( ( property = consumeSingleProperty ( it , source ) ) ) { out . push ( { nameText : property . name . substring ( source ) , name : property . name . shift ( offset ) , valueText : property . value . substring ( source ) , value : property . value . shift ( offset ) , endText : property . end . substring ( source ) , end : property . end . shift ( offset ) } ) ; } return out ; }
Parses given CSS source and returns list of ranges of located CSS properties.
Normally, CSS source must contain properties only, it must be,
for example, a content of CSS selector or text between nested
CSS sections
@param  {String} source CSS source
@param {Number} offset Offset of properties subset from original source.
Used to provide proper ranges of locates items
Parses given CSS source and returns list of ranges of located CSS properties . Normally CSS source must contain properties only it must be for example a content of CSS selector or text between nested CSS sections