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")
DebugLayerExperiment40
10000.1748104186020447Wikicontroltrue
10000.0009552625362655231Wikicontroltrue
10005.983861298521046e-7Wikicontroltrue
10000.0000013900845237960275Wikicontroltrue
10000.05233476330280967Wikicontroltrue
10007.734058254055369e-13Wikicontroltrue
-----falsetruefalse0
worldis1:WorldMorph([0,0,1510,976])falsetruefalse0
Errorevaluatinginitializer:SyntaxError:Invalidreturnstatement.falsetruefalse0
startingWikiNavigatorfalsetruefalse0
status207onPROPFINDhttp://lively-kernel.org/repository/webwerkstatt/ContextJSDebugLayerExperiment.xhtmlfalsetruefalse0
http://lively-kernel.org/repository/webwerkstatt/anonymous_module_2loadedin25msfalsetruefalse0
http://lively-kernel.org/repository/webwerkstatt/anonymous_module_1loadedin298msfalsetruefalse0
fontHelvetica40:spacewidth11from51xWidth20falsetruefalse0
fitWidthfailureonTextMorph.getCharBoundsfalsetruefalse0
fontHelvetica18:spacewidth5from23xWidth9falsetruefalse0
fontHelvetica10:spacewidth3from13xWidth5falsetruefalse0
Warn:188757:HandMorph([0,0,9,9]),anemptyhand,local=true,id=188757:HandMorph.EventHandler([objectMouseEvent]):err:TypeError:Resultofexpression'this.ensureDebugLayerMorph().update'[undefined]isnotafunction.falsetruefalse0
==Stack==0:$logErrorsAdvice1:HandMorph.handleEvent2falsetruefalse0
Warn:188757:HandMorph([0,0,9,9]),anemptyhand,local=true,id=188757:HandMorph.EventHandler([objectMouseEvent]):err:TypeError:Resultofexpression'this.ensureDebugLayerMorph().update'[undefined]isnotafunction.falsetruefalse0
==Stack==0:$logErrorsAdvice1:HandMorph.handleEvent2falsetruefalse0
ResizingSVGcanvasfalsetruefalse0
Warn:188757:HandMorph([0,0,9,9]),anemptyhand,local=true,id=188757:HandMorph.EventHandler([objectMouseEvent]):err:TypeError:Resultofexpression'this.ensureDebugLayerMorph().update'[undefined]isnotafunction.falsetruefalse0
==Stack==0:$logErrorsAdvice1:HandMorph.handleEvent2falsetruefalse0
Warn:188757:HandMorph([0,0,9,9]),anemptyhand,local=true,id=188757:HandMorph.EventHandler([objectMouseEvent]):err:TypeError:Resultofexpression'this.ensureDebugLayerMorph().update'[undefined]isnotafunction.falsetruefalse0
==Stack==0:$logErrorsAdvice1:HandMorph.handleEvent2falsetruefalse0
Moduleloadcheckdone.26modulesloaded.falsetruefalse0
Warn:188757:HandMorph([0,0,9,9]),anemptyhand,local=true,id=188757:HandMorph.EventHandler([objectMouseEvent]):err:TypeError:Resultofexpression'this.ensureDebugLayerMorph().update'[undefined]isnotafunction.falsetruefalse0
==Stack==0:$logErrorsAdvice1:HandMorph.handleEvent2falsetruefalse0
Warn:188757:HandMorph([0,0,9,9]),anemptyhand,local=true,id=188757:HandMorph.EventHandler([objectMouseEvent]):err:TypeError:Resultofexpression'this.ensureDebugLayerMorph().update'[undefined]isnotafunction.falsetruefalse0
==Stack==0:$logErrorsAdvice1:HandMorph.handleEvent2falsetruefalse0
morphmenu:falsetruefalse0
morphmenu:falsetruefalse0
morphmenu:falsetruefalse0
-------------------------------------------falsetruefalse0
invoke189447:SelectionMorph([-371,-98,371,98])falsetruefalse0
Warn:188757:HandMorph([0,0,9,9]),anemptyhand,local=true,id=188757:HandMorph.EventHandler([objectMouseEvent]):err:TypeError:Resultofexpression'this.ensureDebugLayerMorph().update'[undefined]isnotafunction.falsetruefalse0
==Stack==0:$logErrorsAdvice1:HandMorph.handleEvent2falsetruefalse0
morphmenu:falsetruefalse0
-------------------------------------------falsetruefalse0
invoke189536:SelectionMorph([-345,-47,345,47])falsetruefalse0
morphmenu:falsetruefalse0
morphmenu:falsetruefalse0
-------------------------------------------falsetruefalse0
invoke1:WorldMorph([0,0,1510,976])falsetruefalse0
status200onGEThttp://lively-kernel.org/repository/webwerkstatt/ContextJSDebugLayerExperiment.xhtmlfalsetruefalse0
extendForSerializationundefinedfalsetruefalse0810-1nulltrue0falsetruetruefalse
false1truefalse
nullfalse
nullfalse
nullfalse
nullfalsefalsetruetruefalse
true100false
truefalse050
nullfalsetruenullfalse
Consolefalsenullfalse
false
false
falsenullfalsefalsenullnullnullnullfalse
this.setWithLayers([DebugMorphLayer])//this.setWithLayers([])this.ensureDebugLayerMorph().update(this);this.debugLayerMorph.setFill(Color.red);m.setExtent(pt(10,10));m.setFill(Color.red);m.setBorderWidth(0);WorldMorph.current().addMorph(m);m=newTextMorph()m.setTextString("HalloWelt")m.setFill(Color.red)m.setPosition(pt(100,100))t=Date.now();Date.now()-t>1000
nulltrue14 1000"]]>truetruefalse3truetruefalse
false1truefalsetruetruefalse
nullfalsetruenullfalse
falsenullfalse
false
false
falsenullfalsefalsenullnullnullnullfalse
secondtext-0.010550702753760466null1260880475127
DebugArea181260870828834
firsttextnull1260880475127
10000.06481147312419314Wikicontroltrue
Object.extend(Morph.prototype,LayerableObjectTrait);Morph.prototype.lookupLayersIn=["owner"];//DebuggingBehaviorcreateLayer("DebugMorphLayer");layerClass(DebugMorphLayer,Morph,{ensureDebugLayerMorph:function(){if(!this.debugLayerMorph){//console.log("createdebuglayermorph");this.debugLayerMorph=newDebugMorph();WorldMorph.current().addMorph(this.debugLayerMorph);};returnthis.debugLayerMorph},updateDebugMorph:function(proceed,msg){this.ensureDebugLayerMorph().update(this,msg);},removeDebugLayerMorph:function(){if(this.debugLayerMorph){this.debugLayerMorph.remove();deletethis.debugLayerMorph};},onMouseOver:function(proceed,evt){this.updateDebugMorph("onMouseOver:"+evt);returnproceed(evt);},});layerClass(DebugMorphLayer,TextMorph,{onKeyDown:function(proceed,evt){this.updateDebugMorph("onKeyDown:"+evt);returnproceed(evt);},})Morph.subclass("DebugMorph",{openForDragAndDrop:false,isEpimorph:true,initialize:function($super){$super(newlively.scene.Rectangle(newRectangle(0,0,100,25)));this.setWithoutLayers([DebugMorphLayer]);//don'tdebugdebugmorphsvarm=newTextMorph()m.setExtent(pt(300,10));//m.setTextString("Debug:");m.setBorderWidth(0);m.setFill(Color.red);m.setFillOpacity(0.5);m.setFontSize(10);m.ignoreEvents();this.ignoreEvents();this.text=m;this.setFill(null);this.setBorderWidth(0);this.addMorph(m);},update:function(morph,msg){//console.log("update");this.morph=morph;this.lastDebugEventTime=Date.now();varpos=morph.getGlobalTransform().transformPoint(morph.shape.bounds().bottomLeft());this.setPosition(pos);this.log(msg);this.checkForClose();},log:function(msg){this.text.setTextString(this.text.textString+msg+"\n")},checkForClose:function(){varself=this;//console.log("check"+((Date.now()-this.lastDebugEventTime)))Global.setTimeout(function(){if((Date.now()-self.lastDebugEventTime)>3000){//console.log("stop...");withLayers([DebugMorphLayer],function(){self.morph.removeDebugLayerMorph();})}else{self.checkForClose()}},400)},});//StaticInstrumentationcreateLayer("DebugMorphMenuLayer");layerClass(DebugMorphMenuLayer,Morph,{toggleDebugging:function(){varlayers=this.getWithLayers();if(layers&&layers.include(DebugMorphLayer)){console.log("disabledebuggingfor"+this);this.setWithLayers([]);}else{console.log("enabledebuggingfor"+this);this.setWithLayers([DebugMorphLayer]);}},morphMenu:function(proceed,evt){console.log("morphmenu:")varmenu=proceed(evt);if(menu){menu.addItem([(this.getWithLayers().include(DebugMorphLayer)?"disable":"enable")+"debugging",this,'toggleDebugging']);}returnmenu}})enableLayer(DebugMorphMenuLayer);//disableLayer(DebugMorphMenuLayer);14 3000) {\n\t\t\t\t// console.log(\"stop...\");\r\t\t\t\twithLayers([DebugMorphLayer], function() {\r\t\t\t\t\tself.morph.removeDebugLayerMorph();\r\t\t\t\t})\n\t\t\t} else {\n\t\t\t\tself.checkForClose()\n\t\t\t}\n\t\t}, 400)\n\t},\r});\r\r\r// Static Instrumentation\rcreateLayer(\"DebugMorphMenuLayer\");\rlayerClass(DebugMorphMenuLayer, Morph, {\r\r\ttoggleDebugging: function() {\r\t\tvar layers = this.getWithLayers();\r\t\tif (layers && layers.include(DebugMorphLayer)) {\r\t\t\tconsole.log(\"disable debugging for \" + this); \r\t\t\tthis.setWithLayers([]);\r\t\t} else {\r\t\t\tconsole.log(\"enable debugging for \" + this);\r\t\t\tthis.setWithLayers([DebugMorphLayer]);\r\t\t}\r\t},\r\r\tmorphMenu: function(proceed, evt) {\r\t\tconsole.log(\"morph menu : \")\r\t\tvar menu = proceed(evt);\r\t\tif (menu) {\r\t\t\tmenu.addItem([\r\t\t\t\t(this.getWithLayers().include(DebugMorphLayer) ?\r\t\t\t\t\t\"disable\" : \"enable\") + \" debugging\",\r\t\t\t\tthis, \r\t\t\t\t'toggleDebugging']);\r\t\t}\r\t\treturn menu\r\t}\r})\r\renableLayer(DebugMorphMenuLayer);\r// disableLayer(DebugMorphMenuLayer);\r"]]>truetruefalse7truetruetruefalse
false1truefalsenulltruetruefalse
nullfalsetruenullfalse
Workspacefalsenullfalse
false
false
falsenullfalsefalsenullnullnullnullfalse
10000.38032416639566796Wikicontroltrue
null57