Lively Kernel canvas
// this script is evaluated on world loadfunction(doc) {
return new Query('./*/*[local-name()="code"]').findFirst(doc);
}function(doc) {
var n = this.findMisplacedCodeNode(doc);
if (!n) return;
var targetNode = this.findOrCreateDefNodeOfWorld(doc);
targetNode.appendChild(n);
}function(doc) {
var defNode = new Query('.//*[@type="WorldMorph"]/*[local-name()="defs"]').findFirst(doc);
if (!defNode) {
var worldNode = new Query('.//*[@type="WorldMorph"]').findFirst(doc);
defNode = NodeFactory.create('defs');
worldNode.appendChild(defNode); // null Namespace?
}
return defNode;
}function(wikiUrl) {
var a = WikiNetworkAnalyzer.forRepo(wikiUrl);
var self = this;
var listWorlds = function() {
result = [];
a.getWorldProxies().forEach(function(proxy) {
if (!proxy.localName().endsWith('xhtml'))
return;
var doc = proxy.getDocument();
if (!doc)
return;
if (self.findMisplacedCodeNode(doc))
result.push(proxy.localName());
});
console.log(result);
};
a.fetchFileList(listWorlds)
}
null
0.1
60
151.04642427494502
1.5046816972274002
null
null
false
null
true
document.getElementsByTagName('g').lengthx=newQuery('//*[@type="WorldMorph"]//lively:defs').findAll(document)x=newQuery('//svg:defs').findAll(document)a=LivelyNS.create('defs')b=LivelyNS.create('test')a=NodeFactory.create('defs')b=NodeFactory.create('test')c=NodeFactory.create('bla');c.appendChild(b)b.appendChild(a)Exporter.stringify(b)b.namespaceURIb=stringToXML('<test><defs/></test>')b.ownerDocumentx=newQuery('.//*[@type="WorldMorph"]/*[local-name()="defs"]').findFirst(document)x=newQuery('//*[local-name()="defs"]').findAll(WorldMorph.current().rawNode)codeAddedToDoc=newQuery('./*/*[local-name()="code"]').findFirst(document)x.appendChild(codeAddedToDoc)codeAddedToDoc.parentElement.tagNameExporter.stringify()$A(document.documentElement.childNodes).collect(function(ea){returnea.tagName})')\nb.ownerDocument\nx=new Query('.//*[@type=\"WorldMorph\"]/*[local-name()=\"defs\"]').findFirst(document)\n\nx=new Query('//*[local-name()=\"defs\"]').findAll(WorldMorph.current().rawNode)\n\ncodeAddedToDoc=new Query('./*/*[local-name()=\"code\"]').findFirst(document)\nx.appendChild(codeAddedToDoc)\ncodeAddedToDoc.parentElement.tagName\n\nExporter.stringify()\n\n$A(document.documentElement.childNodes).collect(function(ea) {return ea.tagName})"]]>
30
true
true
false
13
true
null
844
')\nb.ownerDocument\nx=new Query('.//*[@type=\"WorldMorph\"]/*[local-name()=\"defs\"]').findFirst(document)\n\nx=new Query('//*[local-name()=\"defs\"]').findAll(WorldMorph.current().rawNode)\n\ncodeAddedToDoc=new Query('./*/*[local-name()=\"code\"]').findFirst(document)\nx.appendChild(codeAddedToDoc)\ncodeAddedToDoc.parentElement.tagName\n\nExporter.stringify()\n\n$A(document.documentElement.childNodes).collect(function(ea) {return ea.tagName})"]]>
null
true
true
false
false
1
true
false
true
true
false
null
false
true
null
false
null
false
1
null
false
false
false
false
null
false
false
null
null
null
null
false
null
null
false
null
true
r=newWorldRepair();url=URL.source.getDirectory();r.checkWorlds(url);resultallworldsok:-)Nevermind....
2
null
true
true
false
73
false
null
81
null
true
true
false
false
1
true
false
true
true
false
null
false
true
null
false
null
false
1
null
false
false
false
false
null
false
false
null
null
null
null
false
null
1240098369686
359689
1
17
null
1240098369
null