Lively Kernel canvas
//
Issue:-CopyandPasteofMorphsisbrokenunderChrome161
ClipboardHack.ensurePasteBuffer().setAttribute("style","position:fixed;z-index:1;left:100px;top:10px;width:400px;height:50px;");1truetruefalsetruetruetruefalse
false1truefalsetruetruefalse
nullfalsetruenullfalse
MakeClipboardHackVisiblefordebuggingfalsenullfalse
false
false
falsenullfalsefalsenullnullnullnullfalse
FixMorphCopyandPaste40
SelectionMorphonKeyDown113971:SelectionMorph([[0,-4,0,4]])---#<Event:KeyDown86>"]]>falsetruefalse0
ResizingSVGcanvasfalsetruefalse0
SelectionMorphonKeyDown113971:SelectionMorph([[0,-4,0,4]])---#<Event:KeyDown91>"]]>falsetruefalse0
SelectionMorphonKeyDown113971:SelectionMorph([[0,-4,0,4]])---#<Event:KeyDown91>"]]>falsetruefalse0
-------------------------------------------falsetruefalse0
invoke1:WorldMorph([[0,0,2000,1200]])falsetruefalse0
status200onGEThttp://lively-kernel.org/repository/webwerkstatt/draft/FixMorphCopyAndPaste.xhtmlfalsetruefalse0
problemstoparsehttp://lively-kernel.org/repository/webwerkstatt/draft/FixMorphCopyAndPaste.xhtmlfalsetruefalse0
extendForSerializationundefinedfalsetruefalse0
status204onPUThttp://lively-kernel.org/repository/webwerkstatt/draft/FixMorphCopyAndPaste.xhtmlfalsetruefalse0
successpublishingworldathttp://lively-kernel.org/repository/webwerkstatt/draft/FixMorphCopyAndPaste.xhtml,status204falsetruefalse0
statusmsg:worldsavedtoFixMorphCopyAndPaste.xhtmlin3728msfalsetruefalse0
SelectionMorphonKeyDown114308:SelectionMorph([[0,0,183,94]])---#<Event:KeyDown91>"]]>falsetruefalse0
SelectionMorphonKeyDown114308:SelectionMorph([[0,0,183,94]])---#<Event:KeyDown67>"]]>falsetruefalse0
copymorph113984:ScriptableButtonMorph([[0,0,120,20]])falsetruefalse0
extendForSerialization[objectSVGDefsElement]falsetruefalse0
SelectionMorphonKeyDown114361:SelectionMorph([[0,0,191,63]])---#<Event:KeyDown91>"]]>falsetruefalse0
SelectionMorphonKeyDown114361:SelectionMorph([[0,0,191,63]])---#<Event:KeyDown67>"]]>falsetruefalse0
copymorph113984:ScriptableButtonMorph([[0,0,120,20]])falsetruefalse0
extendForSerialization[objectSVGDefsElement]falsetruefalse0
SelectionMorphonKeyDown114410:SelectionMorph([[0,-97,118,97]])---#<Event:KeyDown91>"]]>falsetruefalse0
SelectionMorphonKeyDown114410:SelectionMorph([[0,-97,118,97]])---#<Event:KeyDown67>"]]>falsetruefalse0
copymorph109475:Morph([[7,9,58,53]])falsetruefalse0
extendForSerialization[objectSVGDefsElement]falsetruefalse0
SelectionMorphonKeyDown114471:SelectionMorph([[0,0,182,64]])---#<Event:KeyDown91>"]]>falsetruefalse0
SelectionMorphonKeyDown114471:SelectionMorph([[0,0,182,64]])---#<Event:KeyDown67>"]]>falsetruefalse0
copymorph113984:ScriptableButtonMorph([[0,0,120,20]])falsetruefalse0
extendForSerialization[objectSVGDefsElement]falsetruefalse0
SelectionMorphonKeyDown114513:SelectionMorph([[0,0,188,54]])---#<Event:KeyDown91>"]]>falsetruefalse0
SelectionMorphonKeyDown114513:SelectionMorph([[0,0,188,54]])---#<Event:KeyDown67>"]]>falsetruefalse0
copymorph113984:ScriptableButtonMorph([[0,0,120,20]])falsetruefalse0
extendForSerialization[objectSVGDefsElement]falsetruefalse0
SelectionMorphonKeyDown114553:SelectionMorph([[0,0,159,43]])---#<Event:KeyDown91>"]]>falsetruefalse0
SelectionMorphonKeyDown114553:SelectionMorph([[0,0,159,43]])---#<Event:KeyDown67>"]]>falsetruefalse0
copymorph113984:ScriptableButtonMorph([[0,0,120,20]])falsetruefalse0
extendForSerialization[objectSVGDefsElement]falsetruefalse0
SelectionMorphonKeyDown114599:SelectionMorph([[0,0,164,77]])---#<Event:KeyDown91>"]]>falsetruefalse0
SelectionMorphonKeyDown114599:SelectionMorph([[0,0,164,77]])---#<Event:KeyDown67>"]]>falsetruefalse0
copymorph113984:ScriptableButtonMorph([[0,0,120,20]])falsetruefalse0
extendForSerialization[objectSVGDefsElement]falsetruefalse0
SelectionMorphonKeyDown114645:SelectionMorph([[0,0,220,72]])---#<Event:KeyDown91>"]]>falsetruefalse0
SelectionMorphonKeyDown114645:SelectionMorph([[0,0,220,72]])---#<Event:KeyDown67>"]]>falsetruefalse0
copymorph113984:ScriptableButtonMorph([[0,0,120,20]])falsetruefalse0
extendForSerialization[objectSVGDefsElement]falsetruefalse0
LayerFixCopyAndPasteLayerisalreadytherefalsetruefalse0
-------------------------------------------falsetruefalse0
invoke1:WorldMorph([[0,0,2000,1200]])falsetruefalse0
status200onGEThttp://lively-kernel.org/repository/webwerkstatt/draft/FixMorphCopyAndPaste.xhtmlfalsetruefalse0
problemstoparsehttp://lively-kernel.org/repository/webwerkstatt/draft/FixMorphCopyAndPaste.xhtmlfalsetruefalse0
extendForSerializationundefinedfalsetruefalse0810- "]]>
- "]]>
- "]]>
- "]]>
- "]]>
- "]]>
- "]]>
- "]]>
- "]]>
- "]]>
- "]]>
- "]]>
- "]]>
- "]]>
- "]]>
- "]]>
- "]]>
- "]]>
- "]]>
-1nullnulltrue0falsetruetruefalse
false1truefalse
nullfalse
nullfalse
nullfalse
nullfalsefalsetruetruefalse
truetrue100false
truefalse050
nullfalsetruenullfalse
Consolefalsenullfalse
false
false
falsenullfalsefalsenullnullnullnullfalse
Hi20
falsetrue
10000.7046908276082531Wikicontroltrue
null
null
nullnull
100015.75621069552284Wikicontroltrue
fixlibdirfalsenullnullfalse
fixlibdirfalsenullfalse
fixlibdirfalsenullfalse
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"]]>93truetruefalsetrue' +\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
null72