Lively Kernel canvas // this script is evaluated on world load null http://www.lively-kernel.org/repository/webwerkstatt/webcollab-integration/chat-prototype-4.xhtmlnull1 template=newWebResource('http://www.lively-kernel.org/repository/webwerkstatt/BWINF/GruppeXX/start.xhtml')doc=template.getDocument()doc.getElementById('28236:TextMorph').childNodes[5].childNodes[0].databaseURL=newURL('http://www.lively-kernel.org/repository/webwerkstatt/BWINF/')//createdirsfor(vari=0;i<20;i++){varidx=i<10?'0'+i:i.toString()varname='Gruppe'+idx;vardir=newWebResource(baseURL.withFilename(name+'/'));dir.create();}baseURL=newURL('http://www.lively-kernel.org/repository/webwerkstatt/BWINF/')//createworldsfor(vari=0;i<20;i++){varidx=i<10?'0'+i:i.toString()varname='Gruppe'+idx;varworld=newWebResource(baseURL.withFilename(name+'/'+start.xhtml));doc.getElementById('28236:TextMorph').childNodes[5].childNodes[0].data=nameworld.setContent(Exporter.stringify(doc))}22truetruefalsetruetruefalse 00.11 true truetruefalse nullfalsetruenullfalse falsenullfalse false false false nullfalsefalsenullnullnullnullfalse codeBase=newURL('http://www.lively-kernel.org/repository/webwerkstatt/')url='http://www.lively-kernel.org/repository/webwerkstatt/'//url='http://www.lively-kernel.org/repository/webwerkstatt/migration-test/'configs=newWebResource(url).subDocuments('infinity').select(function(ea){returnea.getURL().filename()=='config.js'})configs.lengthconfigs[0].getContent()configs.forEach(function(ea){str=ea.getURL()+'\n';str+=ea.getContent();newTextMorph(newRectangle(0,0,600,400),str).openInWorld()})configs.invoke('del')17truetruefalsetruetruefalse 00.11 true truetruefalse nullfalsetruenullfalse falsenullfalse false false false nullfalsefalsenullnullnullnullfalse nullfalsetruenullfalse fixworldhelperfunctions[doit]falsenullfalse false false false nullfalse localrequirements[doit]falsefalsetruefalsetrue0false initializer[doit]falsefalsetruefalsetrue0false ArrayandURLextension[doit]falsefalsetruefalsetrue0false fixworldhelperfunctions[doit]falsefalsetruefalsetrue0false313null3nulltruetruetrue 00.11 true null null null nulltrue true -----falsefalsetruefalsetrue0false313null -1nullnulltruetruetrue 00.11 true null null null nulltrue true 20null findScriptEndingWith=function(string,scripts){return$A(scripts).detect(function(node){varurl=node.getAttribute('xlink:href');returnurl&&url.endsWith(string)})}removeScriptEndingWith=function(string,scripts){varscript=findScriptEndingWith(string,scripts);if(script)script.parentElement.removeChild(script)}removeNodes=function(nodes){nodes.forEach(function(node){node.parentElement.removeChild(node)})}createNode=function(doc,ns,tagName){returndoc.createElementNS(ns,tagName)}createCDATA=function(doc,data){returndoc.createCDATASection(data)}changeHrefFromLibToLively=function(scripts){$A(scripts).forEach(function(node){varhref=node.getAttribute('xlink:href')if(!href)return;href=href.replace('lib','lively')node.setAttribute('xlink:href',href);})}changeHrefToLively=function(scripts){$A(scripts).forEach(function(node){varhref=node.getAttribute('xlink:href')if(!href)return;href='lively/'+href;node.setAttribute('xlink:href',href);})}34truetrue2000000 0.5 nulltruetrue 00.11 true true 20null truetrue truetrue 00.11 true true Browseworld...falsenulltruefalsetrue Pushchangesbackfalsenulltruefalsetrue Refreshfalsenulltruefalsetrue Evalonfalsenulltruefalsetrue Sortfalsenulltruefalsetrue truetruenullfalsenullnullnullnullfalse //getallxhtmlfilescodeBase=URL.codeBase//url='http://www.lively-kernel.org/repository/webwerkstatt/migration-test/'worlds=newWebResource(codeBase).subDocuments('infinity').select(function(ea){returnea.getURL().toString().endsWith('.xhtml')})fixWorld=function(world){vardoc=world.getDocument()varscripts=doc.getElementsByTagName('script')//step1removeExample.jsandScratch.jsremoveScriptEndingWith('Examples.js',scripts);removeScriptEndingWith('Scratch.js',scripts);//step2removeconfig.jsscriptsvarconfigs=$A(scripts).select(function(node){varurl=node.getAttribute('xlink:href');returnurl&&(url.endsWith('/config.js')||url=='config.js')})removeNodes(configs);//step2addbaseUrlscriptbeforelocalconfig.jsscriptvarurl=world.getURL().getDirectory();varrelative=url.relativePathFrom(codeBase)if(relative.startsWith('/'))thrownewError('relativelooksdifferentthanexpected')varlevels=relative.split('/').length-1vartoCodeBase=range(1,levels).collect(function(){return'..'}).join('/')+'/';varsrc=Strings.format('Config.codeBase=Config.getDocumentDirectory()+"%s"',toCodeBase);varcodeBaseScripts=$A(scripts).select(function(ea){returnea.childElements&&ea.childElements.length>0&&ea.childElements[0].data==src});codeBaseScripts.forEach(function(ea){ea.parentElement.removeChild(ea)})varscript=createNode(doc,Namespace.SVG,'script')script.setAttribute('name','codeBase');script.appendChild(createCDATA(doc,src))varlocalConfigScript=findScriptEndingWith('localconfig.js',scripts)localConfigScript.parentElement.insertBefore(script,localConfigScript);localConfigScript.parentElement.insertBefore(doc.createTextNode("\n"),localConfigScript);//step3rewritelibinlively//changeHrefFromLibToLively(scripts)//changeHrefToLively(scripts)//step4findduplicates?//step5writeoutworld.setContent(Exporter.stringify(doc))}worlds.forEachShowingProgress($morph('progress'),function(w){fixWorld(w)},function(w){returnw.getURL().toString()}) 0 && ea.childElements[0].data == src });\n\tcodeBaseScripts.forEach(function(ea) { ea.parentElement.removeChild(ea) })\n\n\tvar script = createNode(doc, Namespace.SVG, 'script')\n\tscript.setAttribute('name', 'codeBase');\n\tscript.appendChild(createCDATA(doc, src))\n\tvar localConfigScript = findScriptEndingWith('localconfig.js', scripts)\n\tlocalConfigScript.parentElement.insertBefore(script, localConfigScript);\n\tlocalConfigScript.parentElement.insertBefore(doc.createTextNode(\"\\n\"), localConfigScript);\n\n\t// step 3 rewrite lib in lively\n\t//changeHrefFromLibToLively(scripts)\n\t//changeHrefToLively(scripts)\n\n\t// step 4 find duplicates?\n\n\t// step 5 write out\n\tworld.setContent(Exporter.stringify(doc))\n\n}\n\n\nworlds.forEachShowingProgress($morph('progress'), function(w) { fixWorld(w) }, function(w) { return w.getURL().toString() })"]]>truetruefalse54truetruefalse 00.11 true truetruefalse nullfalsetruenullfalse worldmigrationfalsenullfalse false false false nullfalsefalsenullnullnullnullfalse nullfalsetruenullfalse MigrationScripts.js:Migrator(extension):--all--:run(static)falsenulltruefalse Xfalsenulltrue false false Mfalsenulltrue false false falsenulltrue false falsenullfalse http://www.lively-kernel.org/repository/webwerkstatt/truetruetruetruetrue truetrue 00.11 true true codebasefalsenulltruefalsetrue localfalsenulltruefalsetrue Localcodefalsefalsetruefalsetrue0false test1.js(notparsed)falsefalsetruefalsetrue0false test2.js(notparsed)falsefalsetruefalsetrue0false208null-1nullnulltruetruetrue 00.11 true null null null nulltrue true -----falsefalsetruefalsetrue0false208null -1nullnulltruetruetrue 00.11 true null null null nulltrue true -----falsefalsetruefalsetrue0false208null -1nullnulltruetruetrue 00.11 true null null null nulltrue true -----falsefalsetruefalsetrue0false208null -1nullnulltruetruetrue 00.11 true null null null nulltrue true 20null truetrue2000000 0.5 truetrue 00.11 true true 20null truetrue truetrue 00.11 true true Addmodulefalsenulltruefalsetrue Loadallfalsenulltruefalsetrue LineNofalsenulltruefalsetrue Refreshfalsenulltruefalsetrue Evalonfalsenulltruefalsetrue Sortfalsenulltruefalsetrue Viewas...falsenulltruefalsetrue truetrue falsenullnullnullnullfalse Wikicontroltruetrue url=newURL('http://www.lively-kernel.org/repository/lively-wiki/')Migrator.run(url,['users/mzimmerm/'],url)draft/DraftTextMorph.xhtmlprojects/HTML5/foo2.xhtmlprojects/HTML5/foo4.xhtmlprojects/HTML5/foo6.xhtmlprojects/HTML5/foo3.xhtmlprojects/HTML5/foo5.xhtml truetruefalsetruetruefalse false0.126315799618032330.11 true false truefalse nullfalsetruenullfalse Workspacefalsenulltruefalse Xfalsenulltrue false false Mfalsenulltrue false false falsenulltrue false falsenullfalsefalsenullnullnullnullfalse null55