Lively Kernel canvas
\n' +
'\n' +
'\n' +
'\n' +
'Developer\'s Journal - Lively HTML\n' +
'\n' +
'\n' +
'\n' +
'\n' +
'\n' +
'\n' +
'\n' +
'');
}]]>
Savefalsenullnulltrue
RunTestfalsenull>' + result.selector;\n\t\t\tmsg += '\\n';\n\t\t\tmsg += result.err.message;\n\t\t\treturn msg;\n\t\t}).join('\\n---------\\n');\n\t\t$morph('testResult').setExtent(pt(400,20))\n\t\t$morph('testResult').setFill(Color.red);\n\t\t$morph('testResult').setTextString(failStr);\n\t} /* runFinished */"]]>nullfalse
73true
abc
PageSavingtrue
x=Tests.PageSaving.PageSaveTest.prototype.exampleDoc()x.getElementsByTagName('scripts')
nulltruetruetruefalse6truetruefalse
false1truefalsenulltruetruefalse
nullfalsetruenullfalse
falsenullfalse
false
false
falsenullfalsefalsenullnullnullnullfalse
10005.625052420191808Wikicontroltrue
nullfalsetruenullfalse
Tests.PageSaving.DocLinkConversionTest[class]:test03ComputeRelativePathFromBase[proto]falsenulltruefalse
false
false
falsenullfalse
localrequirements[doit]falsetruefalsetrue0false
initializer[doit]falsetruefalsetrue0false
Tests.PageSaving.DocLinkConversionTest[class]falsetruefalsetrue0false
DocLinkConverter[class]falsetruefalsetrue0false3102nullnulltruefalsenullnulltruetrue
1true
null
null
null
nulltruetrue
exampleDoc[proto]falsetruefalsetrue0false
test01ConvertDepth[proto]falsetruefalsetrue0false
test02ConvertPath[proto]falsetruefalsetrue0false
test03ComputeRelativePathFromBase[proto]falsetruefalsetrue0false
test04ExtractFilename[proto]falsetruefalsetrue0false
test05CreateCodeBaseDef[proto]falsetruefalsetrue0false3103nullnulltruefalsenullnulltruetrue
1true
null
null
null
nulltruetrue
20null
test03ComputeRelativePathFromBase:function(){varcodeBase='http://foo.org/bar/';vartoDir='http://www.foo.org/bar/baz/';varsut=newDocLinkConverter(codeBase,toDir);varresult=sut.relativeLivelyPathFrom(codeBase,toDir);this.assertEquals('../lively/',result);toDir='http://www.foo.org/bar/baz/xxx/xxx/';result=sut.relativeLivelyPathFrom(codeBase,toDir);this.assertEquals('../../../lively/',result);toDir=codeBase;result=sut.relativeLivelyPathFrom(codeBase,toDir);this.assertEquals('',result);},11truetrue2000000truetrue
1truetruetrue
20null
truetruetruetrue
1truetruetrue
Browseworld...falsenulltruefalsetrue
Pushchangesbackfalsenulltruefalsetrue
Refreshfalsenulltruefalsetrue
Evalonfalsenulltruefalsetrue
Sortfalsenulltruefalsetrue
truetruenullfalsenullnullnullnullfalse
nullfalsetruenullfalse
DocLinkConverter[class]falsenulltruefalse
false
false
falsenullfalse
localrequirements[doit]falsetruefalsetrue0false
initializer[doit]falsetruefalsetrue0false
Tests.PageSaving.DocLinkConversionTest[class]falsetruefalsetrue0false310-1nullnullnulltruefalsenullnulltruetrue
1true
null
null
null
nulltruetrue
-----falsetruefalsetrue0false310
-1nullnullnulltruefalsenullnulltruetrue
1true
null
null
null
nulltruetrue
20null
Object.subclass('DocLinkConverter',{initialize:function(codeBase,toDir){this.codeBase=newURL(codeBase);this.toDir=newURL(toDir).withRelativePartsResolved();},convert:function(doc){varscripts=$A(doc.getElementsByTagName('script'));if(scripts.length<=0){console.warn('couldnotconvertscriptsindocinDocLinkConverterbecausenoscriptsfound!');returndoc;}this.convertLinks(scripts);this.convertAndRemoveCodeBaseDefs(scripts);returndoc;},convertAndRemoveCodeBaseDefs:function(scripts){varcodeBaseDefs=scripts.select(function(el){returnel.firstChild&&el.firstChild.data&&el.firstChild.data.startsWith('Config.codeBase=');});varcodeBaseDef=this.createCodeBaseDef(this.relativeCodeBaseFrom(this.codeBase,this.toDir));if(codeBaseDefs.length==0){varscript=NodeFactory.create('script');script.setAttribute('name','codeBase');script.appendChild(NodeFactory.createCDATA(codeBaseDef));varlocalConfigScript=this.findScriptEndingWith('localconfig.js',scripts);if(localConfigScript)localConfigScript.parentNode.insertBefore(script,localConfigScript);return;}if(codeBaseDefs.length>1)codeBaseDefs[0].firstChild.data=codeBaseDef;//removeremainingfor(vari=1;i<codeBaseDefs.length;i++)codeBaseDefs[i].parentNode.removeChild(codeBaseDefs[i]);},convertLinks:function(scripts){varlinks=scripts.select(function(el){returnthis.getURLFrom(el)!=null},this);links.forEach(function(el){varurl=this.getURLFrom(el);varnewUrl=this.convertPath(url);this.setURLTo(el,newUrl);},this);},convertPath:function(path){varfn=this.extractFilename(path);varrelative=this.relativeLivelyPathFrom(this.codeBase,this.toDir);returnrelative+fn;},relativeCodeBaseFrom:function(codeBase,toDir){codeBase=newURL(codeBase);toDir=newURL(toDir);varrelative=toDir.relativePathFrom(codeBase);if(relative.startsWith('/'))thrownewError('relativelooksdifferentthanexpected')varlevels=relative.split('/').length-1varresult=range(1,levels).collect(function(){return'..'}).join('/')+'/';returnresult;},relativeLivelyPathFrom:function(codeBase,toDir){returnthis.relativeCodeBaseFrom(codeBase,toDir)+'lively/';},extractFilename:function(url){returnurl.substring(url.lastIndexOf('/')+1,url.length);},createCodeBaseDef:function(relPath){returnStrings.format('Config.codeBase=Config.getDocumentDirectory()+\'%s\'',relPath);},findScriptEndingWith:function(str,scripts){returnscripts.detect(function(node){varurl=this.getURLFrom(node);returnurl&&url.endsWith(str)},this);},getURLFrom:function(el){returnel.getAttribute('xlink:href')},setURLTo:function(el,url){el.setAttribute('xlink:href',url)},}); 1)\n\t\t\tcodeBaseDefs[0].firstChild.data = codeBaseDef;\n\n\t\t// remove remaining\n\t\tfor (var i = 1; i < codeBaseDefs.length; i++)\n\t\t\tcodeBaseDefs[i].parentNode.removeChild(codeBaseDefs[i]);\n\t},\n\nconvertLinks: function(scripts) {\n\t\tvar links = scripts.select(function(el) { return this.getURLFrom(el) != null }, this);\n\t\tlinks.forEach(function(el) {\n\t\t\tvar url = this.getURLFrom(el);\n\t\t\tvar newUrl = this.convertPath(url);\n\t\t\tthis.setURLTo(el, newUrl);\n\t\t}, this);\n\t},\n\nconvertPath: function(path) {\n\t\tvar fn = this.extractFilename(path);\n\t\tvar relative = this.relativeLivelyPathFrom(this.codeBase, this.toDir);\n\t\treturn relative + fn;\n\t},\n\nrelativeCodeBaseFrom: function(codeBase, toDir) {\n\t\tcodeBase = new URL(codeBase);\n\t\ttoDir = new URL(toDir);\n\t\tvar relative = toDir.relativePathFrom(codeBase);\n\t\tif (relative.startsWith('/')) throw new Error('relative looks different than expected')\n\t\tvar levels = relative.split('/').length -1\n\t\tvar result = range(1, levels).collect(function() { return '..' }).join('/') + '/';\n\t\treturn result;\n\t},\n\nrelativeLivelyPathFrom: function(codeBase, toDir) {\n\t\treturn this.relativeCodeBaseFrom(codeBase, toDir) + 'lively/';\n\t},\n\nextractFilename: function(url) {\n\t\treturn url.substring(url.lastIndexOf('/') + 1, url.length);\n\t},\n\ncreateCodeBaseDef: function(relPath) {\n\t\treturn Strings.format('Config.codeBase=Config.getDocumentDirectory()+\\'%s\\'', relPath);\n\t},\n\nfindScriptEndingWith: function(str, scripts) {\n\t\treturn scripts.detect(function(node) {\n\t\t\t\tvar url = this.getURLFrom(node);\n\t\t\t\treturn url && url.endsWith(str)\n\t\t\t}, this);\n\t},\n\ngetURLFrom: function(el) {\n\t\treturn el.getAttribute('xlink:href')\n\t},\n\nsetURLTo: function(el, url) {\n\t\tel.setAttribute('xlink:href', url)\n\t},\n\n});"]]>truetrue2000000 1)\n\t\t\tcodeBaseDefs[0].firstChild.data = codeBaseDef;\n\n\t\t// remove remaining\n\t\tfor (var i = 1; i < codeBaseDefs.length; i++)\n\t\t\tcodeBaseDefs[i].parentNode.removeChild(codeBaseDefs[i]);\n\t},\n\nconvertLinks: function(scripts) {\n\t\tvar links = scripts.select(function(el) { return this.getURLFrom(el) != null }, this);\n\t\tlinks.forEach(function(el) {\n\t\t\tvar url = this.getURLFrom(el);\n\t\t\tvar newUrl = this.convertPath(url);\n\t\t\tthis.setURLTo(el, newUrl);\n\t\t}, this);\n\t},\n\nconvertPath: function(path) {\n\t\tvar fn = this.extractFilename(path);\n\t\tvar relative = this.relativeLivelyPathFrom(this.codeBase, this.toDir);\n\t\treturn relative + fn;\n\t},\n\nrelativeCodeBaseFrom: function(codeBase, toDir) {\n\t\tcodeBase = new URL(codeBase);\n\t\ttoDir = new URL(toDir);\n\t\tvar relative = toDir.relativePathFrom(codeBase);\n\t\tif (relative.startsWith('/')) throw new Error('relative looks different than expected')\n\t\tvar levels = relative.split('/').length -1\n\t\tvar result = range(1, levels).collect(function() { return '..' }).join('/') + '/';\n\t\treturn result;\n\t},\n\nrelativeLivelyPathFrom: function(codeBase, toDir) {\n\t\treturn this.relativeCodeBaseFrom(codeBase, toDir) + 'lively/';\n\t},\n\nextractFilename: function(url) {\n\t\treturn url.substring(url.lastIndexOf('/') + 1, url.length);\n\t},\n\ncreateCodeBaseDef: function(relPath) {\n\t\treturn Strings.format('Config.codeBase=Config.getDocumentDirectory()+\\'%s\\'', relPath);\n\t},\n\nfindScriptEndingWith: function(str, scripts) {\n\t\treturn scripts.detect(function(node) {\n\t\t\t\tvar url = this.getURLFrom(node);\n\t\t\t\treturn url && url.endsWith(str)\n\t\t\t}, this);\n\t},\n\ngetURLFrom: function(el) {\n\t\treturn el.getAttribute('xlink:href')\n\t},\n\nsetURLTo: function(el, url) {\n\t\tel.setAttribute('xlink:href', url)\n\t},\n\n});"]]> 1)\n\t\t\tcodeBaseDefs[0].firstChild.data = codeBaseDef;\n\n\t\t// remove remaining\n\t\tfor (var i = 1; i < codeBaseDefs.length; i++)\n\t\t\tcodeBaseDefs[i].parentNode.removeChild(codeBaseDefs[i]);\n\t},\n\nconvertLinks: function(scripts) {\n\t\tvar links = scripts.select(function(el) { return this.getURLFrom(el) != null }, this);\n\t\tlinks.forEach(function(el) {\n\t\t\tvar url = this.getURLFrom(el);\n\t\t\tvar newUrl = this.convertPath(url);\n\t\t\tthis.setURLTo(el, newUrl);\n\t\t}, this);\n\t},\n\nconvertPath: function(path) {\n\t\tvar fn = this.extractFilename(path);\n\t\tvar relative = this.relativeLivelyPathFrom(this.codeBase, this.toDir);\n\t\treturn relative + fn;\n\t},\n\nrelativeCodeBaseFrom: function(codeBase, toDir) {\n\t\tcodeBase = new URL(codeBase);\n\t\ttoDir = new URL(toDir);\n\t\tvar relative = toDir.relativePathFrom(codeBase);\n\t\tif (relative.startsWith('/')) throw new Error('relative looks different than expected')\n\t\tvar levels = relative.split('/').length -1\n\t\tvar result = range(1, levels).collect(function() { return '..' }).join('/') + '/';\n\t\treturn result;\n\t},\n\nrelativeLivelyPathFrom: function(codeBase, toDir) {\n\t\treturn this.relativeCodeBaseFrom(codeBase, toDir) + 'lively/';\n\t},\n\nextractFilename: function(url) {\n\t\treturn url.substring(url.lastIndexOf('/') + 1, url.length);\n\t},\n\ncreateCodeBaseDef: function(relPath) {\n\t\treturn Strings.format('Config.codeBase=Config.getDocumentDirectory()+\\'%s\\'', relPath);\n\t},\n\nfindScriptEndingWith: function(str, scripts) {\n\t\treturn scripts.detect(function(node) {\n\t\t\t\tvar url = this.getURLFrom(node);\n\t\t\t\treturn url && url.endsWith(str)\n\t\t\t}, this);\n\t},\n\ngetURLFrom: function(el) {\n\t\treturn el.getAttribute('xlink:href')\n\t},\n\nsetURLTo: function(el, url) {\n\t\tel.setAttribute('xlink:href', url)\n\t},\n\n});"]]>truetrue
1truetruetrue
20null
truetruetruetrue
1truetruetrue
Browseworld...falsenulltruefalsetrue
Pushchangesbackfalsenulltruefalsetrue
Refreshfalsenulltruefalsetrue
Evalonfalsenulltruefalsetrue
Sortfalsenulltruefalsetrue
truetruenullfalsenullnullnullnullfalsenull49