{"id":0,"registry":{"0":{"submorphs":[{"__isSmartRef__":true,"id":1}],"scripts":[],"id":3087,"shape":{"__isSmartRef__":true,"id":25},"droppingEnabled":true,"halosEnabled":true,"registeredForMouseEvents":true,"_Position":{"__isSmartRef__":true,"id":31},"showsHalos":false,"partsBinMetaInfo":{"__isSmartRef__":true,"id":32},"__SourceModuleName__":"Global.lively.morphic.Core","renderContextTable":{"__isSmartRef__":true,"id":33},"eventHandler":{"__isSmartRef__":true,"id":34},"attributeConnections":[{"__isSmartRef__":true,"id":35}],"doNotSerialize":["$$name"],"doNotCopyProperties":["$$name"],"layout":{"__isSmartRef__":true,"id":36},"priorExtent":{"__isSmartRef__":true,"id":37},"scriptAnnotations":{"__isSmartRef__":true,"id":38},"addresses":[],"connections":{"__isSmartRef__":true,"id":43},"name":"AddressExtractor","_Rotation":0,"_Scale":1,"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":46},"__LivelyClassName__":"lively.morphic.Box"},"1":{"submorphs":[],"scripts":[],"id":3088,"shape":{"__isSmartRef__":true,"id":2},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"fixedWidth":true,"fixedHeight":false,"allowsInput":true,"_OverflowMode":"visible","_FontFamily":"Arial, sans-serif","registeredForMouseEvents":true,"_Position":{"__isSmartRef__":true,"id":7},"_MaxTextWidth":161.12746528553419,"_MaxTextHeight":null,"textColor":{"__isSmartRef__":true,"id":5},"showsHalos":false,"_FontSize":14,"__SourceModuleName__":"Global.lively.morphic.TextCore","name":"nameLabel1","partsBinMetaInfo":{"__isSmartRef__":true,"id":8},"textChunks":[{"__isSmartRef__":true,"id":9}],"charsReplaced":"Grr","lastFindLoc":-3,"priorSelectionRange":[10,10],"prevScroll":[0,0],"priorExtent":{"__isSmartRef__":true,"id":11},"attributeConnections":[{"__isSmartRef__":true,"id":12},{"__isSmartRef__":true,"id":13}],"doNotSerialize":["$$owner","$$savedTextString"],"doNotCopyProperties":["$$owner","$$savedTextString"],"isInputLine":true,"renderContextTable":{"__isSmartRef__":true,"id":14},"eventHandler":{"__isSmartRef__":true,"id":15},"_Align":"center","layout":{"__isSmartRef__":true,"id":16},"_WhiteSpaceHandling":"pre-wrap","_TextColor":{"__isSmartRef__":true,"id":17},"oldOwner":{"__isSmartRef__":true,"id":0},"owner":{"__isSmartRef__":true,"id":0},"savedTextString":"TopLeft","_Rotation":0,"_Scale":0.9999999999999997,"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":18},"__LivelyClassName__":"lively.morphic.Text"},"2":{"fill":null,"__SourceModuleName__":"Global.lively.morphic.Shapes","_Position":{"__isSmartRef__":true,"id":3},"_Extent":{"__isSmartRef__":true,"id":4},"_BorderWidth":0,"_BorderColor":{"__isSmartRef__":true,"id":5},"renderContextTable":{"__isSmartRef__":true,"id":6},"_BorderRadius":0,"_Opacity":1,"_BorderStyle":"solid","__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"3":{"x":0,"y":0,"__SourceModuleName__":"Global","__LivelyClassName__":"Point"},"4":{"x":161.12746528553419,"y":22,"__LivelyClassName__":"Point","__SourceModuleName__":"Global"},"5":{"r":0,"g":0,"b":0,"a":1,"__SourceModuleName__":"Global","__LivelyClassName__":"Color"},"6":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"7":{"x":16,"y":16,"__SourceModuleName__":"Global","__LivelyClassName__":"Point"},"8":{"partsSpaceName":"PartsBin/Widgets/","__SourceModuleName__":"Global.lively.PartsBin","migrationLevel":2,"comment":"Label that shows the name of a morph. Updates automatically.","partName":"NameLabel","__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo"},"9":{"style":{"__isSmartRef__":true,"id":10},"chunkOwner":{"__isSmartRef__":true,"id":1},"storedString":"AddressExtractor","__LivelyClassName__":"lively.morphic.TextChunk","__SourceModuleName__":"Global.lively.morphic.TextCore"},"10":{"__LivelyClassName__":"lively.morphic.TextEmphasis","__SourceModuleName__":"Global.lively.morphic.TextCore"},"11":{"x":161.12746528553419,"y":22,"__LivelyClassName__":"Point","__SourceModuleName__":"Global"},"12":{"sourceObj":{"__isSmartRef__":true,"id":1},"sourceAttrName":"owner","targetObj":{"__isSmartRef__":true,"id":1},"targetMethodName":"updateLabel","converter":null,"converterString":null,"updater":null,"updaterString":null,"__SourceModuleName__":"Global.lively.bindings","__LivelyClassName__":"AttributeConnection"},"13":{"sourceObj":{"__isSmartRef__":true,"id":1},"sourceAttrName":"savedTextString","targetObj":{"__isSmartRef__":true,"id":1},"targetMethodName":"renameOwner","__SourceModuleName__":"Global.lively.bindings","__LivelyClassName__":"AttributeConnection"},"14":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","setOrigin":"setOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","updateText":"updateTextHTML","setTextExtent":"setTextExtentHTML","setMaxTextWidth":"setMaxTextWidthHTML","setMaxTextHeight":"setMaxTextHeightHTML","getTextExtent":"getTextExtentHTML","getTextString":"getTextStringHTML","ignoreTextEvents":"ignoreTextEventsHTML","enableTextEvents":"enableTextEventsHTML","setFontFamily":"setFontFamilyHTML","setFontSize":"setFontSizeHTML","setTextColor":"setTextColorHTML","setPadding":"setPaddingHTML","setAlign":"setAlignHTML","setVerticalAlign":"setVerticalAlignHTML","setDisplay":"setDisplayHTML","setWhiteSpaceHandling":"setWhiteSpaceHandlingHTML"},"15":{"morph":{"__isSmartRef__":true,"id":1},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"16":{"resizeHeight":false,"resizeWidth":true},"17":{"r":1,"g":1,"b":1,"a":1,"__SourceModuleName__":"Global","__LivelyClassName__":"Color"},"18":{"updateLabel":{"__isSmartRef__":true,"id":19},"renameOwner":{"__isSmartRef__":true,"id":22}},"19":{"varMapping":{"__isSmartRef__":true,"id":20},"source":"function updateLabel() {\n\t// observe name changes in owner\n\tif (this.owner !== this.oldOwner) {\n\t\tif (this.oldOwner)\n\t\t\tdisconnect(this.oldOwner, 'name', this, 'updateLabel')\n\t\tif (this.owner)\n\t\t\tconnect(this.owner, 'name', this, 'updateLabel')\n\t\tthis.oldOwner = this.owner\n\t}\n\tvar name = (this.owner ? this.owner.name : \"no owner\")\n\tif (this.textString != name)\n\tthis.setTextString(name)\n}","funcProperties":{"__isSmartRef__":true,"id":21},"__SourceModuleName__":"Global","__LivelyClassName__":"lively.Closure"},"20":{"this":{"__isSmartRef__":true,"id":1}},"21":{},"22":{"varMapping":{"__isSmartRef__":true,"id":23},"source":"function renameOwner(name) {\n\tif (this.owner && this.owner.name != name) {\n\t\talertOK(\"renamed \" + this.owner + \" to \" + name)\n\t\tthis.owner.setName(name);\n\t}\n}","funcProperties":{"__isSmartRef__":true,"id":24},"__SourceModuleName__":"Global","__LivelyClassName__":"lively.Closure"},"23":{"this":{"__isSmartRef__":true,"id":1}},"24":{},"25":{"position":{"__isSmartRef__":true,"id":26},"_Extent":{"__isSmartRef__":true,"id":27},"_BorderWidth":0,"_BorderColor":{"__isSmartRef__":true,"id":28},"_Fill":{"__isSmartRef__":true,"id":29},"__SourceModuleName__":"Global.lively.morphic.Shapes","renderContextTable":{"__isSmartRef__":true,"id":30},"_BorderRadius":32.565,"_Opacity":1,"_BorderStyle":"solid","__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"26":{"x":0,"y":0,"__SourceModuleName__":"Global","__LivelyClassName__":"Point"},"27":{"x":192,"y":56,"__SourceModuleName__":"Global","__LivelyClassName__":"Point"},"28":{"r":0,"g":0,"b":0,"a":1,"__SourceModuleName__":"Global","__LivelyClassName__":"Color"},"29":{"r":0.753,"g":0.753,"b":0.753,"a":1,"__LivelyClassName__":"Color","__SourceModuleName__":"Global"},"30":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"31":{"x":0,"y":0,"__LivelyClassName__":"Point","__SourceModuleName__":"Global"},"32":{"partsSpaceName":"PartsBin/Maps/","__SourceModuleName__":"Global.lively.PartsBin","comment":"Get addresses from  a string","migrationLevel":2,"partName":"AddressExtractor","__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo"},"33":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","setOrigin":"setOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML"},"34":{"morph":{"__isSmartRef__":true,"id":0},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"35":{"sourceObj":{"__isSmartRef__":true,"id":0},"sourceAttrName":"name","targetObj":{"__isSmartRef__":true,"id":1},"targetMethodName":"updateLabel","__SourceModuleName__":"Global.lively.bindings","__LivelyClassName__":"AttributeConnection"},"36":{},"37":{"x":192,"y":57,"__SourceModuleName__":"Global","__LivelyClassName__":"Point"},"38":{"extractAddresses":{"__isSmartRef__":true,"id":39},"reset":{"__isSmartRef__":true,"id":41}},"39":{"time":{"__isSmartRef__":true,"id":40},"user":"robertkrahn"},"40":{"isSerializedDate":true,"string":"Thu Jul 21 2011 14:12:55 GMT+0200 (CEST)"},"41":{"time":{"__isSmartRef__":true,"id":42},"user":"robertkrahn"},"42":{"isSerializedDate":true,"string":"Thu Jul 21 2011 12:28:54 GMT+0200 (CEST)"},"43":{"extractAddresses":{"__isSmartRef__":true,"id":44},"addresses":{"__isSmartRef__":true,"id":45}},"44":{},"45":{},"46":{"extractAddresses":{"__isSmartRef__":true,"id":47},"reset":{"__isSmartRef__":true,"id":50}},"47":{"varMapping":{"__isSmartRef__":true,"id":48},"source":"function extractAddresses(string) {\n    // find country\n    var match = string.match(/country:.*/ig),\n        countryMatch = match && match.uniq()[0],\n        country = countryMatch ? countryMatch.split(':').last() : '';\n    // find addresses\n    var match = string.match(/address:.*/ig),\n        adresses = match && match.uniq().collect(function(s) { return s.split(':').last() });\n    if (!adresses || adresses.length == 0) {\n        match = string.match(/street.:.*/ig),\n        adresses = match && [match.uniq().collect(function(s) { return s.split(':').last() }).join(' ')];\n    }\n    adresses = adresses || [];\n    this.addresses = adresses.collect(function(ea) { return ea + ' ' + country}) || []\n}","funcProperties":{"__isSmartRef__":true,"id":49},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global"},"48":{"this":{"__isSmartRef__":true,"id":0}},"49":{},"50":{"varMapping":{"__isSmartRef__":true,"id":51},"source":"function reset() {\n    this.addresses = [];\n    this.connections = {extractAddresses: {}, addresses: {}}\n}","funcProperties":{"__isSmartRef__":true,"id":52},"__SourceModuleName__":"Global","__LivelyClassName__":"lively.Closure"},"51":{"this":{"__isSmartRef__":true,"id":0}},"52":{},"isSimplifiedRegistry":true}}