Lively Kernel canvas
// this script is evaluated on world load
MyConsole = WorldMorph.current().submorphs.detect(function(ea){return ea.name == "MyConsole"});
if(!MyConsole) return;
MyConsole = MyConsole.component;
MyConsole.setText("-- start --");
MyConsole.log = function(s) {
this.setText(this.formalModel.getText() + "\n" + s);
};
MyConsole.log("My Console initialized!");
MyConsole.morph.resetScrollPane = function() {
var sp = this.enclosingScrollPane();
if (sp) sp.scrollToBottom();
};
// console.consumers seems to be broken... so we go the hard waz
console.log = console.log.wrap(function(proceed, s) {
MyConsole.log(s)
proceed(s)})
console.log("wrapped console for MyConsole successfully")
10000.6561220857681379Wikicontroltrue
LayerPersonExample30
10000.001815060231605013Wikicontroltrue
10000.5314442292603228Wikicontroltrue
10000.00000182212948540758Wikicontroltrue
employer=newEmployer("DoenerAG","AnderEcke,124Berlin");person=newPerson("HansPeter","AmKiez49,123Berlin",employer);console.log(person.print());withLayers([AddressLayer],function(){console.log(person.print());});withLayers([EmploymentLayer],function(){console.log(person.print());});withLayers([EmploymentLayer,AddressLayer],function(){console.log(person.print());});14
10002.769032594229851Wikicontroltrue
createLayer('AddressLayer');createLayer('EmploymentLayer');Object.subclass('Person',{initialize:function(newName,newAddress,newEmployer){this.name=newName;this.address=newAddress;this.employer=newEmployer;},print:function(){return"Name:"+this.name;},AddressLayer$print:function(proceed){returnproceed()+";Address:"+this.address;},EmploymentLayer$print:function(proceed){returnproceed()+";[Employer]"+this.employer.print();},toString:function(){return"Person:"+this.name;}});Object.subclass('Employer',{initialize:function(newName,newAddress){this.name=newName;this.address=newAddress;},print:function(){return"Name:"+this.name;},toString:function(){return"Employer:"+this.name;}});layerClass(AddressLayer,Employer,{print:function(proceed){returnproceed()+";Address:"+this.address;}});1522truetruefalsetruetruefalse
false1truefalsetruetruefalse
nullfalsetruenullfalse
falsenullfalse
false
false
falsenullfalsefalsenullnullnullnullfalse
-----falsetruefalse0
worldis1:WorldMorph([0,0,1353,970])falsetruefalse0
Errorevaluatinginitializer:SyntaxError:Invalidreturnstatement.falsetruefalse0
startingWikiNavigatorfalsetruefalse0
status207onPROPFINDhttp://lively-kernel.org/repository/webwerkstatt/LayerPersonExample.xhtmlfalsetruefalse0
http://lively-kernel.org/repository/webwerkstatt/anonymous_module_2loadedin41msfalsetruefalse0
http://lively-kernel.org/repository/webwerkstatt/anonymous_module_1loadedin423msfalsetruefalse0
ResizingSVGcanvasfalsetruefalse0
fontHelvetica30:spacewidth8from38xWidth15falsetruefalse0
fontCourier14:spacewidth8from24xWidth8falsetruefalse0
fontCourier14:spacewidth8from24xWidth8falsetruefalse0
fitWidthfailureonTextMorph.getCharBoundsfalsetruefalse0
Moduleloadcheckdone.26modulesloaded.falsetruefalse0
status:ReferenceError:Can'tfindvariable:personfalsetruefalse0
removestatusfalsetruefalse0
status:ReferenceError:Can'tfindvariable:Employerfalsetruefalse0
fontCourier15:spacewidth9from27xWidth9falsetruefalse0
fontCourier15:spacewidth9from27xWidth9falsetruefalse0
removestatusfalsetruefalse0
Name:HansPeterfalsetruefalse0
Name:HansPeter;Address:AmKiez49,123Berlinfalsetruefalse0
-------------------------------------------falsetruefalse0
invoke1:WorldMorph([0,0,1353,970])falsetruefalse0
status200onGEThttp://lively-kernel.org/repository/webwerkstatt/LayerPersonExample.xhtml?1259659065760falsetruefalse0
extendForSerializationundefinedfalsetruefalse080913nulltrue0falsefalsetruetruefalse
false1truefalse
nullfalse
nullfalse
nullfalse
nullfalsefalsetruetruefalse
true100false
truefalsenull050
nullfalsetruenullfalse
Consolefalsenullfalse
false
false
falsenullfalsefalsenullnullnullnullfalsenull15