Lively Kernel canvas
//\n\
\n\
\n\
\n\
\n\
']]>
FixUndoBUG40
10002.2390829785081108
10001.0461347948539654
10001.629
10001.1629506928329005
10000.8816288138215692
10004.4533202591632755
10004.10714173330075
10000.3062884020401528
10000.7270449511081163
10000.9850004298447806
10000.9827265144049383
10000.9776922168464638
10000.5904900000000002
10008.635610830038289
10001.7042328224035315
10000.007244617795359922
10001.726714174909855
10004.375840524664096
savefalsenull
truenulltruetrue
Reproducethebug:-commenoutlines3-4-undo-alts3
//disableLayer(UndoLayer)//enableLayer(UndoLayer)lively.ide.BasicBrowser.addMethods({allChanged:function(keepUnsavedChanges,changedNode){//optimization:ifnonodelookslikethechangednodeinmybrowserdonothingif(changedNode&&this.allNodes().every(function(ea){return!changedNode.hasSimilarTarget(ea)}))return;//FIXMEremoveduplicationvaroldN1=this.getPane1Selection();varoldN2=this.getPane2Selection();varoldN3=this.getPane3Selection();varsrc=keepUnsavedChanges&&this.hasUnsavedChanges()&&this.panel.sourcePane.innerMorph().textString;if(this.hasUnsavedChanges())this.setSourceString(this.emptyText);varrevertStateOfPane=function(paneName,oldNode){if(!oldNode)return;varnodes=this.nodesInPane(paneName);varnewNode=nodes.detect(function(ea){returnea&&ea.target&&(ea.target==oldNode.target||(ea.target.eq&&ea.target.eq(oldNode.target)))});if(!newNode)newNode=nodes.detect(function(ea){returnea&&ea.asString()===oldNode.asString()});this['set'+paneName+'Selection'](newNode,true);}.bind(this);this.start();//selectrootNodeandgeneratenewsubnodesrevertStateOfPane('Pane1',oldN1);revertStateOfPane('Pane2',oldN2);revertStateOfPane('Pane3',oldN3);if(!src)return;//this.setSourceString(src);vartext=this.panel.sourcePane.innerMorph();text.setTextString(src);//text.changed()text.showChangeClue();//FIXME},})
nulltrue53truetruefalsetruetruefalse
false1truefalsetruetruefalse
nullfalsetruenullfalse
falsenullfalse
false
false
falsenullfalsefalsenullnullnullnullfalse
module("lively.Undo").requires('cop.Layers','lively.Text').toRun(function(){Object.subclass("UndoHistory",{initialize:function(){this.undoStack=[];this.redoStack=[];},addCommand:function(cmd){this.undoStack.push(cmd);this.redoStack=[];//redostackisinvalidnow},undo:function(){if(!this.hasUndoableCommand())return;varcmd=this.undoStack.pop();cmd.undo();this.redoStack.push(cmd);},redo:function(){if(!this.hasRedoableCommand())return;varcmd=this.redoStack.pop();cmd.redo();this.undoStack.push(cmd);},hasUndoableCommand:function(){returnthis.undoStack.length>0},hasRedoableCommand:function(){returnthis.redoStack.length>0},});Object.subclass("UndoableCommand",{undo:function(){},redo:function(){},});UndoableCommand.subclass("ReplaceTextCommand",{initialize:function(morph,index,oldText,newText){console.log("newcommand")this.morph=morph;this.index=index;this.oldText=oldText;this.newText=newText;},undo:function(){//console.log("undofrom"+this.index+"to"+this.newText.size())withoutLayers([UndoLayer],function(){this.morph.setSelectionRange(this.index,this.index+this.newText.size());this.morph.replaceSelectionWith(this.oldText);}.bind(this))},redo:function(){withoutLayers([UndoLayer],function(){this.morph.setSelectionRange(this.index,this.index+this.oldText.size());this.morph.replaceSelectionWith(this.newText);varpos=this.index+this.newText.size();this.morph.setSelectionRange(pos,pos);}.bind(this))},});createLayer("UndoLayer")layerClass(UndoLayer,TextMorph,{getUndoHistory:function(){if(!this.undoHistory)this.undoHistory=newUndoHistory();returnthis.undoHistory},processCommandKeys:function(proceed,evt){varkey=evt.getKeyChar();if(key)key=key.toLowerCase();if(key=='z'&&evt.isShiftDown()){this.doRedo();returntrue;};returnproceed(evt)},doRedo:function(proceed){varundoHistory=this.getUndoHistory();if(undoHistory){returnundoHistory.redo()}},doUndo:function(proceed){varundoHistory=this.getUndoHistory();if(undoHistory){returnundoHistory.undo()}else{returnproceed()}},textSliceFromTo:function(proceed,from,to){varstring=this.textString.substring(from,to+1);if(this.textStyle){varstyle=this.textStyle.slice(from,to+1);}returnnewlively.Text.Text(string,style);},replaceSelectionWith:function(proceed,replacement){varundoHistory=this.getUndoHistory();if(undoHistory){varfrom=this.selectionRange[0];varto=this.selectionRange[1];varoldText=this.textSliceFromTo(from,to);varcmd=newReplaceTextCommand(this,from,oldText,replacement)undoHistory.addCommand(cmd);};withoutLayers([UndoLayer],function(){returnproceed(replacement);})},emphasizeFromTo:function(proceed,emph,from,to){varundoHistory=this.getUndoHistory();varoldText=this.textSliceFromTo(from,to);withoutLayers([UndoLayer],function(){proceed(emph,from,to);})varnewText=this.textSliceFromTo(from,to);if(undoHistory){varcmd=newReplaceTextCommand(this,from,oldText,newText)this.getUndoHistory().addCommand(cmd);}},setTextString:function(proceed,string){varundoHistory=this.getUndoHistory();if(undoHistory){varfrom=0;varto=this.textString.size()-1;varoldText=this.textSliceFromTo(from,to);varcmd=newReplaceTextCommand(this,from,oldText,string)undoHistory.addCommand(cmd);};withoutLayers([UndoLayer],function(){proceed(string);})},});//enableLayer(UndoLayer);}) 0\n\t},\n\n\thasRedoableCommand: function() {\n\t\treturn this.redoStack.length > 0\n\t},\n\n});\n\nObject.subclass(\"UndoableCommand\", {\n\n\tundo: function() {},\n\n\tredo: function() {},\n});\n\nUndoableCommand.subclass(\"ReplaceTextCommand\", {\n\tinitialize: function(morph, index, oldText, newText) {\n\t\tconsole.log(\"new command\")\n\t\tthis.morph = morph;\n\t\tthis.index = index;\n\t\tthis.oldText = oldText;\n\t\tthis.newText = newText;\n\t},\n\n\tundo: function() {\n\t\t// console.log(\"undo from \" + this.index + \" to \" + this.newText.size())\n\t\twithoutLayers([UndoLayer], function() {\n\t\t\tthis.morph.setSelectionRange(this.index, this.index + this.newText.size());\n\t\t\tthis.morph.replaceSelectionWith(this.oldText);\n\t\t}.bind(this))\n\t},\t\n\tredo: function() {\n\t\twithoutLayers([UndoLayer], function() {\n\t\t\tthis.morph.setSelectionRange(this.index, this.index + this.oldText.size());\n\t\t\tthis.morph.replaceSelectionWith(this.newText);\n\t\t\tvar pos = this.index + this.newText.size();\n\t\t\tthis.morph.setSelectionRange(pos, pos);\n\t\t}.bind(this))\n\t},\t\n});\n\ncreateLayer(\"UndoLayer\")\nlayerClass(UndoLayer, TextMorph, {\n\n\tgetUndoHistory: function() {\n\t\tif (!this.undoHistory)\n\t\t\tthis.undoHistory = new UndoHistory();\n\t\treturn this.undoHistory\n\t},\n\n\tprocessCommandKeys: function(proceed, evt) {\n\t\tvar key = evt.getKeyChar();\n\t\tif (key) key = key.toLowerCase();\n\t\tif (key == 'z' && evt.isShiftDown()) {\n\t\t\tthis.doRedo(); return true;\n\t\t};\n\t\treturn proceed(evt)\n\t},\n\n\tdoRedo: function(proceed) {\n\t\tvar undoHistory = this.getUndoHistory();\n\t\tif (undoHistory) {\n\t\t\treturn undoHistory.redo()\n\t\t}\n\t},\n\n\tdoUndo: function(proceed) {\n\t\tvar undoHistory = this.getUndoHistory();\n\t\tif (undoHistory) {\n\t\t\treturn undoHistory.undo()\n\t\t} else {\n\t\t\treturn proceed()\n\t\t}\n\t},\n\ttextSliceFromTo: function(proceed, from, to) {\n\t\tvar string = this.textString.substring(from, to + 1);\n\t\tif (this.textStyle) {\n\t\t\tvar style = this.textStyle.slice(from, to + 1);\n\t\t}\n\t\treturn new lively.Text.Text(string, style);\n\t},\t\n\n\treplaceSelectionWith: function(proceed, replacement) {\n\t\tvar undoHistory = this.getUndoHistory();\n\t\tif (undoHistory) {\n\t\t\tvar from = this.selectionRange[0];\n\t\t\tvar to = this.selectionRange[1];\n\t\t\tvar oldText = this.textSliceFromTo(from, to);\n\t\t\tvar cmd = new ReplaceTextCommand(this, from, oldText, replacement)\n\t\t\tundoHistory.addCommand(cmd);\n\t\t};\n\t\twithoutLayers([UndoLayer], function(){\n\t\t\treturn proceed(replacement);\n\t\t})\n\t},\n\n\temphasizeFromTo: function(proceed, emph, from, to) {\n\t\tvar undoHistory = this.getUndoHistory();\n\t\tvar oldText = this.textSliceFromTo(from, to);\n\t\twithoutLayers([UndoLayer], function(){\n\t\t\tproceed(emph, from, to);\n\t\t})\n\t\tvar newText = this.textSliceFromTo(from, to);\n\t\tif (undoHistory) {\n\n\t\t\tvar cmd = new ReplaceTextCommand(this, from, oldText, newText)\n\t\t\tthis.getUndoHistory().addCommand(cmd);\n\t\t}\n \t},\n\n\tsetTextString: function(proceed, string) {\n\t\tvar undoHistory = this.getUndoHistory();\n\t\tif (undoHistory) {\n\t\t\tvar from = 0;\n\t\t\tvar to = this.textString.size() - 1;\n\t\t\tvar oldText = this.textSliceFromTo(from, to);\n\t\t\tvar cmd = new ReplaceTextCommand(this, from, oldText, string)\n\t\t\tundoHistory.addCommand(cmd);\n\t\t};\n\t\twithoutLayers([UndoLayer], function(){\n\t\t\tproceed(string);\n\t\t})\n \t},\n});\n//enableLayer(UndoLayer);\n})"]]>156truetruefalse 0\n\t},\n\n\thasRedoableCommand: function() {\n\t\treturn this.redoStack.length > 0\n\t},\n\n});\n\nObject.subclass(\"UndoableCommand\", {\n\n\tundo: function() {},\n\n\tredo: function() {},\n});\n\nUndoableCommand.subclass(\"ReplaceTextCommand\", {\n\tinitialize: function(morph, index, oldText, newText) {\n\t\tconsole.log(\"new command\")\n\t\tthis.morph = morph;\n\t\tthis.index = index;\n\t\tthis.oldText = oldText;\n\t\tthis.newText = newText;\n\t},\n\n\tundo: function() {\n\t\t// console.log(\"undo from \" + this.index + \" to \" + this.newText.size())\n\t\twithoutLayers([UndoLayer], function() {\n\t\t\tthis.morph.setSelectionRange(this.index, this.index + this.newText.size());\n\t\t\tthis.morph.replaceSelectionWith(this.oldText);\n\t\t}.bind(this))\n\t},\t\n\tredo: function() {\n\t\twithoutLayers([UndoLayer], function() {\n\t\t\tthis.morph.setSelectionRange(this.index, this.index + this.oldText.size());\n\t\t\tthis.morph.replaceSelectionWith(this.newText);\n\t\t\tvar pos = this.index + this.newText.size();\n\t\t\tthis.morph.setSelectionRange(pos, pos);\n\t\t}.bind(this))\n\t},\t\n});\n\ncreateLayer(\"UndoLayer\")\nlayerClass(UndoLayer, TextMorph, {\n\n\tgetUndoHistory: function() {\n\t\tif (!this.undoHistory)\n\t\t\tthis.undoHistory = new UndoHistory();\n\t\treturn this.undoHistory\n\t},\n\n\tprocessCommandKeys: function(proceed, evt) {\n\t\tvar key = evt.getKeyChar();\n\t\tif (key) key = key.toLowerCase();\n\t\tif (key == 'z' && evt.isShiftDown()) {\n\t\t\tthis.doRedo(); return true;\n\t\t};\n\t\treturn proceed(evt)\n\t},\n\n\tdoRedo: function(proceed) {\n\t\tvar undoHistory = this.getUndoHistory();\n\t\tif (undoHistory) {\n\t\t\treturn undoHistory.redo()\n\t\t}\n\t},\n\n\tdoUndo: function(proceed) {\n\t\tvar undoHistory = this.getUndoHistory();\n\t\tif (undoHistory) {\n\t\t\treturn undoHistory.undo()\n\t\t} else {\n\t\t\treturn proceed()\n\t\t}\n\t},\n\ttextSliceFromTo: function(proceed, from, to) {\n\t\tvar string = this.textString.substring(from, to + 1);\n\t\tif (this.textStyle) {\n\t\t\tvar style = this.textStyle.slice(from, to + 1);\n\t\t}\n\t\treturn new lively.Text.Text(string, style);\n\t},\t\n\n\treplaceSelectionWith: function(proceed, replacement) {\n\t\tvar undoHistory = this.getUndoHistory();\n\t\tif (undoHistory) {\n\t\t\tvar from = this.selectionRange[0];\n\t\t\tvar to = this.selectionRange[1];\n\t\t\tvar oldText = this.textSliceFromTo(from, to);\n\t\t\tvar cmd = new ReplaceTextCommand(this, from, oldText, replacement)\n\t\t\tundoHistory.addCommand(cmd);\n\t\t};\n\t\twithoutLayers([UndoLayer], function(){\n\t\t\treturn proceed(replacement);\n\t\t})\n\t},\n\n\temphasizeFromTo: function(proceed, emph, from, to) {\n\t\tvar undoHistory = this.getUndoHistory();\n\t\tvar oldText = this.textSliceFromTo(from, to);\n\t\twithoutLayers([UndoLayer], function(){\n\t\t\tproceed(emph, from, to);\n\t\t})\n\t\tvar newText = this.textSliceFromTo(from, to);\n\t\tif (undoHistory) {\n\n\t\t\tvar cmd = new ReplaceTextCommand(this, from, oldText, newText)\n\t\t\tthis.getUndoHistory().addCommand(cmd);\n\t\t}\n \t},\n\n\tsetTextString: function(proceed, string) {\n\t\tvar undoHistory = this.getUndoHistory();\n\t\tif (undoHistory) {\n\t\t\tvar from = 0;\n\t\t\tvar to = this.textString.size() - 1;\n\t\t\tvar oldText = this.textSliceFromTo(from, to);\n\t\t\tvar cmd = new ReplaceTextCommand(this, from, oldText, string)\n\t\t\tundoHistory.addCommand(cmd);\n\t\t};\n\t\twithoutLayers([UndoLayer], function(){\n\t\t\tproceed(string);\n\t\t})\n \t},\n});\n//enableLayer(UndoLayer);\n})"]]>truetruefalse
false1truefalsetruetruefalse
nullfalsetruenullfalse
falsenullfalse
false
false
falsenullfalsefalsenullnullnullnullfalse
http://lively-kernel.org/repository/webwerkstatt/draft/../anonymous_module_3loadedin56msfalsetruefalse0
http://lively-kernel.org/repository/webwerkstatt/draft/../anonymous_module_2loadedin1650msfalsetruefalse0
fontHelvetica40:spacewidth11from51xWidth20falsetruefalse0
fontHelvetica12:spacewidth3from17xWidth7falsetruefalse0
fitWidthfailureonTextMorph.getCharBoundsfalsetruefalse0
fitWidthfailureonTextMorph.getCharBoundsfalsetruefalse0
fitWidthfailureonTextMorph.getCharBoundsfalsetruefalse0
ResizingSVGcanvasfalsetruefalse0
Moduleloadcheckdone.35modulesloaded.falsetruefalse0
statusmsg:ReferenceError:Can'tfindvariable:morphLine:11falsetruefalse0
status:ReferenceError:Can'tfindvariable:morphfalsetruefalse0
fontHelvetica16:spacewidth4from20xWidth8falsetruefalse0
statusmsg:TypeError:Resultofexpression'morph.textStyle'[undefined]isnotanobject.Line:171falsetruefalse0
status:TypeError:Resultofexpression'morph.textStyle'[undefined]isnotanobject.falsetruefalse0
Finishedparsingin0.021sfalsetruefalse0
ConvertingpropertyDef(tearDown:function($super){$super();this.removeFile(this.plainTextFileURL);this.removeFile(this.xmlFileName);},)tochange4falsetruefalse0
BrowserstatusMessage:SavingtearDown...SuccessfullysavedSuccessfullyevaluatedtearDown2falsetruefalse0
updated1browsersin0sfalsetruefalse0
LayerBugFixLayerisalreadytherefalsetruefalse0
LayerBugFixLayer2isalreadytherefalsetruefalse0
statusmsg:TypeError:Resultofexpression'morph.textStyle'[null]isnotanobject.Line:201falsetruefalse0
status:TypeError:Resultofexpression'morph.textStyle'[null]isnotanobject.falsetruefalse0
LayerBugFixLayerisalreadytherefalsetruefalse0
LayerBugFixLayer2isalreadytherefalsetruefalse0
status200onGEThttp://lively-kernel.org/repository/webwerkstatt/draft/FixUndoBug.xhtmlfalsetruefalse0
problemstoparsehttp://lively-kernel.org/repository/webwerkstatt/draft/FixUndoBug.xhtmlfalsetruefalse0
extendForSerializationundefinedfalsetruefalse0Warn:unexpected:#<Relay{{"SourceString":"SourceString","StatusMessage":"StatusMessage","RootFilters":"RootFilters","Pane1Content":"Pane1Content","Pane1Selection":"Pane1Selection","Pane1Menu":"Pane1Menu","Pane1Filters":"Pane1Filters","Pane2Content":"Pane2Content","Pane2Selection":"Pane2Selection","Pane2Menu":"Pane2Menu","Pane2Filters":"Pane2Filters"}}>sdelegateis#<Record{{"Pane1Content":{},"Pane1Selection":{},"Pane1Menu":{},"Pane1Filters":{},"Pane2Content":{},"Pane2Selection":{},"Pane2Menu":{},"Pane2Filters":{},"Pane3Content":{},"Pane3Selection":{},"Pane3Menu":{},"Pane3Filters":{},"SourceString":{},"StatusMessage":{},"RootFilters":{}}}>ERRORSerializingiteminarraybuttonCommandsof#<lively.ide.LocalCodeBrowser:[objectSVGElement]>ERRORSerializingiteminarraybuttonCommandsof#<lively.ide.LocalCodeBrowser:[objectSVGElement]>ERRORSerializingiteminarraybuttonCommandsof#<lively.ide.LocalCodeBrowser:[objectSVGElement]>ERRORSerializingiteminarraybuttonCommandsof#<lively.ide.LocalCodeBrowser:[objectSVGElement]>ERRORSerializingiteminarraybuttonCommandsof#<lively.ide.LocalCodeBrowser:[objectSVGElement]>ERRORSerializingiteminarrayitemListof157740:FilterableListMorph([[1,1,295,218]])ERRORSerializingiteminarrayitemListof157740:FilterableListMorph([[1,1,295,218]])ERRORSerializingiteminarrayitemListof157740:FilterableListMorph([[1,1,295,218]])Warn:unexpected:#<Relay{{"List":"-Pane1Content","Selection":"Pane1Selection","Menu":"-Pane1Menu"}}>sdelegateis#<Record{{"Pane1Content":{},"Pane1Selection":{},"Pane1Menu":{},"Pane1Filters":{},"Pane2Content":{},"Pane2Selection":{},"Pane2Menu":{},"Pane2Filters":{},"Pane3Content":{},"Pane3Selection":{},"Pane3Menu":{},"Pane3Filters":{},"SourceString":{},"StatusMessage":{},"RootFilters":{}}}>ERRORSerializingiteminarrayitemListof157753:FilterableListMorph([[1,1,295,218]])ERRORSerializingiteminarrayitemListof157753:FilterableListMorph([[1,1,295,218]])ERRORSerializingiteminarrayitemListof157753:FilterableListMorph([[1,1,295,218]])ERRORSerializingiteminarrayitemListof157753:FilterableListMorph([[1,1,295,218]])ERRORSerializingiteminarrayitemListof157753:FilterableListMorph([[1,1,295,218]])ERRORSerializingiteminarrayitemListof157753:FilterableListMorph([[1,1,295,218]])Warn:unexpected:#<Relay{{"List":"-Pane2Content","Selection":"Pane2Selection","Menu":"-Pane2Menu"}}>sdelegateis#<Record{{"Pane1Content":{},"Pane1Selection":{},"Pane1Menu":{},"Pane1Filters":{},"Pane2Content":{},"Pane2Selection":{},"Pane2Menu":{},"Pane2Filters":{},"Pane3Content":{},"Pane3Selection":{},"Pane3Menu":{},"Pane3Filters":{},"SourceString":{},"StatusMessage":{},"RootFilters":{}}}>Warn:unexpected:#<Relay{{"Text":"SourceString"}}>sdelegateis#<Record{{"Pane1Content":{},"Pane1Selection":{},"Pane1Menu":{},"Pane1Filters":{},"Pane2Content":{},"Pane2Selection":{},"Pane2Menu":{},"Pane2Filters":{},"Pane3Content":{},"Pane3Selection":{},"Pane3Menu":{},"Pane3Filters":{},"SourceString":{},"StatusMessage":{},"RootFilters":{}}}>wha',norawnodeon#<ModelPlug{setValue:action,setIsActive:setIsActive,getIsActive:getIsActive}>wha',norawnodeon#<ModelPlug{setValue:action,setIsActive:setIsActive,getIsActive:getIsActive}>wha',norawnodeon#<ModelPlug{setValue:action,setIsActive:setIsActive,getIsActive:getIsActive}>wha',norawnodeon#<ModelPlug{setValue:action,setIsActive:setIsActive,getIsActive:getIsActive}>wha',norawnodeon#<ModelPlug{setValue:action,setIsActive:setIsActive,getIsActive:getIsActive}>848
-1nullnulltrue0falsetruetruefalse
false1truefalse
nullfalse
nullfalse
nullfalse
nullfalsefalsetruetruefalse
truetrue100truefalse
truefalsenull050"]]]>
nullfalsetruenullfalse
Consolefalsenullfalse
false
false
falsenullfalsefalsenullnullnullnullfalse
100013.834503029496577Wikicontroltrue
nullfalsetruenullfalse
Tests.NetworkTest.WebResourceTest[class]:tearDown[proto]falsenullfalse
false
false
falsenullfalse
localrequirements[doit]falsetruefalse0false
initializer[doit]falsetruefalse0false
Tests.NetworkTest.WebResourceTest[class]falsetruefalse0false3102nullnulltruetruetrue
1true
null
null
null
nulltruetrue
plainTextString[proto]falsetruefalse0false
xmlString[proto]falsetruefalse0false
writeFile[proto]falsetruefalse0false
removeFile[proto]falsetruefalse0false
setUp[proto]falsetruefalse0false
tearDown[proto]falsetruefalse0false3105nullnulltruetruetrue
1true
null
null
null
nulltruetrue
20null
tearDown:function($super){$super();this.removeFile(this.plainTextFileURL);this.removeFile(this.xmlFileName);},3truetrue2000000
nullnulltruetrue
1truetruetrue
20null
truetruetruetrue
1truetruetrue
Browseworld...falsenullfalsetrue
Pushchangesbackfalsenullfalsetrue
Refreshfalsenullfalsetrue
Evalonfalsenullfalsetrue
Sortfalsenullfalsetrue
truetruenullfalsenullnullnullnullfalse
disableLayer(UndoLayer)createLayer('BugFixLayer');createLayer('BugFixLayer2');//this.setWithLayers([BugFixLayer])enableLayer(UndoLayer)w=WorldMorph.current().submorphs.detect(function(ea){return(eainstanceofWindowMorph)&&(ea.getExtent().x==622.0)})morph=w.submorphs[1].submorphs[3].submorphs[0].submorphs[0];//morph.setWithLayers([BugFixLayer,UndoLayer])//morph.setWithLayers([])//morph.setWithoutLayers([UndoLayer])//morph.textStyle=null//morph.undoHistory=null//morph.undoHistory.undoStack.length//oldText=morph.textString//oldStyle=morph.textStyle.clone()//morph.textString.length//oldText==morph.textString//morph.textStyle=null//layerClass(BugFixLayer2,TextMorph,{//hasUnsavedChanges:function(){//returnfalse//},//})enableLayer(BugFixLayer2);layerClass(BugFixLayer,TextMorph,{onTextUpdate:function(proceed,string){console.log("ontextupdate")this.updateTextString(string);this.textBeforeChanges=string;this.hideChangeClue();},saveContents:function(proceed,contentString){console.log("donothing...")this.savedTextString=contentString;console.log("savetextstring")debuggerif(!this.modelPlug&&!this.formalModel&&!this.noEval){console.log("evalstring")this.tryBoundEval(contentString);this.world().changed();return;//Hackforbrowserdemo}elseif(!this.autoAccept){console.log("seText")this.setText(contentString,true);}},})lively.ide.BrowserNode.addMethods({onSourceStringUpdate:function(methodString,source){returnif(!methodString||methodString==this.emptyText)return;if(this.selectedNode().sourceString()==methodString&&source!==this.panel.sourcePane.innerMorph())return;this.selectedNode().newSource(methodString);this.nodeChanged(this.selectedNode());},newSource:function(newSource){returnvarerrorOccurred=false;varfailureOccurred=false;varmsg='Saving'+this.target.getName()+'...\n';//savesourcetry{if(this.saveSource(newSource,tools.SourceControl)){msg+='Successfullysaved';}else{msg+='Couldn\'tsave';failureOccurred=true;}}catch(e){dbgOn(true)msg+='Errorwhilesaving:'+e;errorOccurred=true;}msg+='\n';//evalsourcetry{if(this.evalSource(newSource)){msg+='Successfullyevaluated'+this.target.getName();}else{msg+='Evaldisabledfor'+this.target.getName();failureOccurred=true;}}catch(e){msg+='Errorevaluating'+e;errorOccurred=true;}varcolor=errorOccurred?Color.red:(failureOccurred?Color.black:Color.green);vardelay=errorOccurred?5:null;this.statusMessage(msg,color,delay);this.browser.signalNewSource(this);},})truetruefalse1truetruefalse
false1truefalsetruetruefalse
nullfalsetruenullfalse
falsenullfalse
false
false
falsenullfalsefalsenullnullnullnullfalsenull82