examples/template_stealjs/steal/steal.js
function( url ) {
			var parts = this.path.split('/'),
				other_parts = url.split('/'),
				result = '';
			while ( parts.length > 0 && other_parts.length > 0 && parts[0] == other_parts[0] ) {
				parts.shift();
				other_parts.shift();
			}
			each(other_parts, function(){ result += '../'; })
			return result + parts.join('/');
		}
function( url ) {
			var parts = this.path.split('/'),
				other_parts = url.split('/'),
				result = '';
			while ( parts.length > 0 && other_parts.length > 0 && parts[0] == other_parts[0] ) {
				parts.shift();
				other_parts.shift();
			}
			each(other_parts, function(){ result += '../'; })
			return result + parts.join('/');
		}
function ( url ) { var parts = this . path . split ( '/' ) , other_parts = url . split ( '/' ) , result = '' ; while ( parts . length > 0 && other_parts . length > 0 && parts [ 0 ] == other_parts [ 0 ] ) { parts . shift ( ) ; other_parts . shift ( ) ; } each ( other_parts , function ( ) { result += '../' ; } ) return result + parts . join ( '/' ) ; }
Returns the relative path between two paths with common folders.
@codestart
new steal.File('a/b/c/x/y').toReferenceFromSameDomain('a/b/c/d/e')//-> ../../x/y
@codeend
@param {Object} url
@return {String}
Returns the relative path between two paths with common folders .