Lively Kernel canvas
//
Issue:-CopyandPasteofMorphsisbrokenunderChrome161
-----falsetruefalse0
fontCourier12:spacewidth7from21xWidth7falsetruefalse0
worldis1:WorldMorph([[0,0,2000,1200]])falsetruefalse0
startingWikiNavigatorfalsetruefalse0
status207onPROPFINDhttp://lively-kernel.org/repository/webwerkstatt/draft/FixMorphCopyAndPasteTemp.xhtmlfalsetruefalse0
http://lively-kernel.org/repository/webwerkstatt/draft/../anonymous_module_3loadedin85msfalsetruefalse0
http://lively-kernel.org/repository/webwerkstatt/draft/../anonymous_module_2loadedin1594msfalsetruefalse0
fontHelvetica16:spacewidth4from20xWidth8falsetruefalse0
fontHelvetica16:spacewidth4from22xWidth9falsetruefalse0
fontHelvetica40:spacewidth11from51xWidth20falsetruefalse0
fontHelvetica20:spacewidth6from26xWidth10falsetruefalse0
ResizingSVGcanvasfalsetruefalse0
Moduleloadcheckdone.31modulesloaded.falsetruefalse0
LayerFixCopyAndPasteLayerisalreadytherefalsetruefalse0
-------------------------------------------falsetruefalse0
invoke1:WorldMorph([[0,0,2000,1200]])falsetruefalse0
status200onGEThttp://lively-kernel.org/repository/webwerkstatt/draft/FixMorphCopyAndPasteTemp.xhtmlfalsetruefalse0
problemstoparsehttp://lively-kernel.org/repository/webwerkstatt/draft/FixMorphCopyAndPasteTemp.xhtmlfalsetruefalse0
extendForSerializationundefinedfalsetruefalse0987-1nulltrue0false
truetruefalse
false1truefalse
nullfalse
nullfalse
nullfalse
nullfalsefalsetruetruefalse
truetrue100false
truefalsenull050
nullfalsetruenullfalse
Consolefalsenullfalse
false
false
falsenullfalsefalsenullnullnullnullfalse
ClipboardHack.ensurePasteBuffer().setAttribute("style","position:fixed;z-index:1;left:100px;top:10px;width:400px;height:50px;");1truetruefalsetruetruetruefalse
false1truefalsetruetruefalse
nullfalsetruenullfalse
MakeClipboardHackVisiblefordebuggingfalsenullfalse
false
false
falsenullfalsefalsenullnullnullnullfalse
Temp40
Hi20
falsetrue
10000.21673241138853735Wikicontroltrue
10002.3877583831707523Wikicontroltrue
-----falsetruefalse0
worldis1:WorldMorph([[0,0,2000,1200]])falsetruefalse0
startingWikiNavigatorfalsetruefalse0
status207onPROPFINDhttp://lively-kernel.org/repository/webwerkstatt/draft/FixMorphCopyAndPasteTemp.xhtmlfalsetruefalse0
http://lively-kernel.org/repository/webwerkstatt/draft/../anonymous_module_3loadedin85msfalsetruefalse0
http://lively-kernel.org/repository/webwerkstatt/draft/../anonymous_module_2loadedin1594msfalsetruefalse0
fontHelvetica16:spacewidth4from20xWidth8falsetruefalse0
fontHelvetica16:spacewidth4from22xWidth9falsetruefalse0
fontHelvetica40:spacewidth11from51xWidth20falsetruefalse0
fontHelvetica20:spacewidth6from26xWidth10falsetruefalse0
ResizingSVGcanvasfalsetruefalse0
Moduleloadcheckdone.31modulesloaded.falsetruefalse0
LayerFixCopyAndPasteLayerisalreadytherefalsetruefalse0
-------------------------------------------falsetruefalse0
invoke1:WorldMorph([[0,0,2000,1200]])falsetruefalse0
status200onGEThttp://lively-kernel.org/repository/webwerkstatt/draft/FixMorphCopyAndPasteTemp.xhtmlfalsetruefalse0
problemstoparsehttp://lively-kernel.org/repository/webwerkstatt/draft/FixMorphCopyAndPasteTemp.xhtmlfalsetruefalse0
extendForSerializationundefinedfalsetruefalse0830
-1nullnulltrue0falsetruetruefalse
false1truefalse
nullfalse
nullfalse
nullfalse
nullfalsefalsetruetruefalse
truetrue100false
truefalsenull050
nullfalsetruenullfalse
Consolefalsenullfalse
false
false
falsenullfalsefalsenullnullnullnullfalse
100016.50382160707188Wikicontroltrue
createLayer("FixCopyAndPasteLayer")enableLayer(FixCopyAndPasteLayer);layerClass(FixCopyAndPasteLayer,SelectionMorph,{onKeyPressed:function(proceed,evt){console.log("SelectionMorphonKeyPress"+this+"---"+evt)//returnClipboardHack.tryClipboardAction(evt,this);returnfalse},onKeyDown:function(proceed,evt){console.log("SelectionMorphonKeyDown"+this+"---"+evt)returnClipboardHack.tryClipboardAction(evt,this);},})SelectionMorph.addMethods({copyAsXMLString:function(){if(this.selectedMorphs.length==0){return};varcopier=newCopier();vardoc=newClipboardCopier().createBaseDocument();varworldNode=doc.childNodes[0].childNodes[0];varcontainer=newMorph.makeRectangle(newRectangle(0,0,10,10));container.isSelectionContainer=true;this.selectedMorphs.each(function(ea){console.log("copymorph"+ea)container.addMorph(ea.copy(copier));})varsystemDictionary=container.rawNode.appendChild(NodeFactory.create("defs"));systemDictionary.setAttribute("id","SystemDictionary");worldNode.appendChild(container.rawNode);varexporter=newExporter(container);varhelpers=exporter.extendForSerialization(systemDictionary);varresult=Exporter.stringify(container.rawNode);exporter.removeHelperNodes(helpers);returnresult},})Object.subclass('ClipboardCopier',{copyAsXMLString:function(component){varcomponentCopy=component.copy(newCopier());varcopy=componentCopy.panel;vardoc=this.createBaseDocument();varworldNode=doc.childNodes[0].childNodes[0];worldNode.appendChild(copy.rawNode);varexporter=newExporter(copy);//todo:whatabouttheSystemDictionaryvarhelpers=exporter.extendForSerialization();varresult=Exporter.stringify(copy.rawNode);exporter.removeHelperNodes(helpers);returnresult},createBaseDocument:function(source){returnnewDOMParser().parseFromString('<?xmlversion="1.0"standalone="no"?>'+'<svgxmlns="http://www.w3.org/2000/svg"id="canvas">'+'<gtype="WorldMorph"id="1:WorldMorph"transform="matrix(100100)"fill="rgb(255,255,255)">'+'<rectx="0"y="0"width="800"height="600"/>'+source+'</g>'+'</svg>',/*"text/xml"*/"application/xml");},loadMorphsWithWorldTrunkFromSource:function(source){console.log("loadMorphsWithWorldTrunkFromSource")varxml=this.createBaseDocument(source);varsystemDictionary=xml.getElementById("SystemDictionary");varglobalSystemDictionary=lively.data.Wrapper.prototype.dictionary();if(systemDictionary)console.log('SystemeDictionarysize:'+systemDictionary.childNodes.length)elseconsole.log('nosystemdictionaryfound')lastSystemDictionary=systemDictionary;if(systemDictionary){$A(systemDictionary.childNodes).each(function(ea){console.log('each'+ea)varresult=lively.data.FragmentURI.getElement(ea.id);console.log('bla')//TODO:givetheelementanewidandmapit,isthereanimplemnentationlayingaroundsomewherehere?if(result){console.log("foundelement"+ea)}else{console.log("copyelement"+ea)globalSystemDictionary.appendChild(ea.cloneNode(true))}})}varworld=newImporter().loadWorldContents(xml);//inspect(world)returnworld.submorphs},});' +\n\t\t\t'', /* \"text/xml\" */ \"application/xml\");\n\t},\n\n\tloadMorphsWithWorldTrunkFromSource: function(source) {\n\t\tconsole.log(\"loadMorphsWithWorldTrunkFromSource\")\n \tvar xml = this.createBaseDocument(source);\n\t\tvar systemDictionary = xml.getElementById(\"SystemDictionary\");\n\t\tvar globalSystemDictionary = lively.data.Wrapper.prototype.dictionary();\n\t\tif (systemDictionary)\n\t\t\tconsole.log('SystemeDictionary size: ' + systemDictionary.childNodes.length)\n\t\telse\n\t\t\tconsole.log('no system dictionary found')\n\t\tlastSystemDictionary = systemDictionary;\n\t\tif(systemDictionary) {\n\t\t\t$A(systemDictionary.childNodes).each(function(ea) {\n\t\t\t\tconsole.log('each ' + ea)\n\t\t\t\tvar result = lively.data.FragmentURI.getElement(ea.id);\n\t\t\t\tconsole.log('bla')\n\n\t\t\t\t// TODO: give the element a new id and map it, is there an implemnentation laying around somewhere here?\n\t\t\t\tif(result) {\n\t\t\t\t\tconsole.log(\"found element \" + ea)\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log(\"copy element \" + ea)\n\t\t\t\t\tglobalSystemDictionary.appendChild(ea.cloneNode(true))\t\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t\tvar world = new Importer().loadWorldContents(xml);\n\t\t// inspect(world)\n\t\treturn world.submorphs\n },\t\n});\n\n\n"]]>84truetruefalsetrue' +\n\t\t\t'', /* \"text/xml\" */ \"application/xml\");\n\t},\n\n\tloadMorphsWithWorldTrunkFromSource: function(source) {\n\t\tconsole.log(\"loadMorphsWithWorldTrunkFromSource\")\n \tvar xml = this.createBaseDocument(source);\n\t\tvar systemDictionary = xml.getElementById(\"SystemDictionary\");\n\t\tvar globalSystemDictionary = lively.data.Wrapper.prototype.dictionary();\n\t\tif (systemDictionary)\n\t\t\tconsole.log('SystemeDictionary size: ' + systemDictionary.childNodes.length)\n\t\telse\n\t\t\tconsole.log('no system dictionary found')\n\t\tlastSystemDictionary = systemDictionary;\n\t\tif(systemDictionary) {\n\t\t\t$A(systemDictionary.childNodes).each(function(ea) {\n\t\t\t\tconsole.log('each ' + ea)\n\t\t\t\tvar result = lively.data.FragmentURI.getElement(ea.id);\n\t\t\t\tconsole.log('bla')\n\n\t\t\t\t// TODO: give the element a new id and map it, is there an implemnentation laying around somewhere here?\n\t\t\t\tif(result) {\n\t\t\t\t\tconsole.log(\"found element \" + ea)\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log(\"copy element \" + ea)\n\t\t\t\t\tglobalSystemDictionary.appendChild(ea.cloneNode(true))\t\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t\tvar world = new Importer().loadWorldContents(xml);\n\t\t// inspect(world)\n\t\treturn world.submorphs\n },\t\n});\n\n\n"]]>truetruefalse
false1truefalsetruetruefalse
nullfalsetruenullfalse
LayerTextMorphforDebuggingfalsenullfalse
false
false
falsenullfalsefalsenullnullnullnullfalse
null74