Lively Kernel canvas Fix-URL.relativePathFrom()40true savefalsenulltruenull Wikicontroltruetrue url1=newURL('http://www.lively-kernel.org/repository/webwerkstatt/projects/../marko/ObjectExplorer/ObjectExplorerTreeNode.js');url2=URL.source;//url1.relativePathFrom(url2)relativePathFrom=function(origin){functioncheckPathes(path1,path2){varpaths1=path1.split('/');varpaths2=path2.split('/');paths1.shift();paths2.shift();for(vari=0;i<paths2.length;i++){if(!paths1[i]||(paths1[i]!=paths2[i]))break;}console.log('Stoppedcomparingat:'+i);console.log('Path1:'+paths1);console.log('Path2:'+paths2);varresult='../'.times(paths2.length-i-1)+paths1.splice(i).join('/');console.log(''+result);returnresult;}varrel;if(origin.normalizedHostname()!=this.normalizedHostname()||!(rel=checkPathes(this.withRelativePartsResolved().pathname,origin.withRelativePartsResolved().pathname)))thrownewError('badorigin'+origin+'vs'+this);returnrel;}.bind(url1);relativePathFrom(url2)34truetruefalsetruetrue false00.11 true false true nullfalsetruenull Workspacefalsenulltruefalse Xfalsenulltrue false false Mfalsenulltrue false false falsenulltrue false falsenullfalsefalsenullnullnullnullfalse null223