Lively Kernel canvas
// this script is evaluated on world load
10000.9876608797264309Wikicontroltrue
10000.5314814865415742Wikicontroltrue
10001.995785336831416e-10Wikicontroltrue
10008.577329165932161e-11Wikicontroltrue
10000.00010449567633244187Wikicontroltrue
10000.011001291773334004Wikicontroltrue
10001.5178814654146384e-14Wikicontroltrue
10000.1853020188851842Wikicontroltrue
10003.479597728084421e-8Wikicontroltrue
10006.216920996669012e-33Wikicontroltrue
10003.909842021703036e-21Wikicontroltrue
10008.268546441923664e-14Wikicontroltrue
10008.430154905015939e-19Wikicontroltrue
10009.677749120240556e-10Wikicontroltrue
0.0003359840065110508
MasterTopics30
WebWerkstatt30
LivelyRoadmapIdeas.xhtml
DraftLinkBehavior40
LivelyRoadmapIdeas30
10000.2245584879544964Wikicontroltrue
-----falsetruefalse0
worldis1:WorldMorph([0,0,2000,1200])falsetruefalse0
startingWikiNavigatorfalsetruefalse0
status207onPROPFINDhttp://lively-kernel.org/repository/webwerkstatt/DraftLinkBehavior.xhtmlfalsetruefalse0
http://lively-kernel.org/repository/webwerkstatt/anonymous_module_2loadedin33msfalsetruefalse0
http://lively-kernel.org/repository/webwerkstatt/anonymous_module_1loadedin409msfalsetruefalse0
fontHelvetica30:spacewidth8from38xWidth15falsetruefalse0
fontHelvetica40:spacewidth11from51xWidth20falsetruefalse0
fontHelvetica14.399999999999999:spacewidth4from18xWidth7falsetruefalse0
fontHelvetica14:spacewidth4from18xWidth7falsetruefalse0
fitWidthfailureonTextMorph.getCharBoundsfalsetruefalse0
fontHelvetica14:spacewidth4from18xWidth7falsetruefalse0
ResizingSVGcanvasfalsetruefalse0
Moduleloadcheckdone.28modulesloaded.falsetruefalse0
-------------------------------------------falsetruefalse0
invoke1:WorldMorph([0,0,2000,1200])falsetruefalse0
status200onGEThttp://lively-kernel.org/repository/webwerkstatt/DraftLinkBehavior.xhtml?1265032882927falsetruefalse0
extendForSerializationundefinedfalsetruefalse0807-1nulltrue0falsetruetruefalse
false1truefalse
nullfalse
nullfalse
nullfalse
nullfalsefalsetruetruefalse
truetrue100false
truefalsenull050
nullfalsetruenullfalse
Consolefalsenullfalse
false
false
falsenullfalsefalsenullnullnullnullfalse
1.Thefirstideatovisualizethelinkingbehaviorwastointroducealinkhalo,thatshowsthatthereisalinkandwhereitisgoing2.Butthemousecursordidthejobofidicatingalready3.soweshowthelinkinthemousenow4.andweshowthatholding"ctrl"allowstoeditthelink14.3999999999999994
createLayer("TextLinkLayer");enableLayer(TextLinkLayer);layerClass(TextLinkLayer,TextMorph,{removeLinkHalo:function(){if(this.linkHalo){this.linkHalo.remove();}this.linkHalo=undefined;},ensureLinkHalo:function(proceed,link,evt){if(this.linkHalo)return;varm=Morph.makeRectangle(this.shape.bounds())m.name="LinkHalo";m.ignoreEvents();m.isEpimorph=true;m.setFill(null);m.setBorderWidth(2);m.setBorderColor(Color.blue);m.setStrokeOpacity(0.3);this.linkHalo=m;this.addMorph(m);varlinkText=newTextMorph(newRectangle(0,0,m.shape.bounds().width,0));linkText.ignoreEvents();linkText.isEpimorph=true;linkText.setTextString("goto"+link);linkText.setFill(Color.white);linkText.setFillOpacity(0.3);linkText.setBorderWidth(0);linkText.setPosition(m.shape.bounds().bottomLeft());linkText.setTextColor(Color.blue);//evt.hand.addMorph(linkText);m.linkText=linkText;m.addMorph(linkText);},visitLink:function(proceed,link){varurl=URL.ensureAbsoluteURL(link);varisExternalLink=url.hostname!=document.location.hostname;if(isExternalLink)window.location.assign(url.toString());elsewindow.location.assign(url.toString()+'?'+newDate().getTime());},onMouseMove:function(proceed,evt){proceed(evt);//console.log("onMouseMove"+newDate());varlink=this.linkUnderMouse(evt);if(link){if(evt.isCtrlDown()){evt.hand.removeHandInfoTextMorph();evt.hand.ensusreHandInfoTextMorph().setTextString("edit");}else{varmorph=evt.hand.ensusreHandInfoTextMorph();morph.setTextString(link);morph.setExtent(pt(300,20));morph.setTextColor(Color.blue);this.ensureLinkHalo(link,evt);}}},onMouseOut:function(proceed,evt){evt.hand.lookNormal();this.removeLinkHalo();evt.hand.removeHandInfoTextMorph();proceed(evt);},});//Config.showGrabHalo=falseTextMorph.addMethods({doLinkThing:function(evt,link){//LaterthisshouldsetaflaglikeisSelecting,sothatwecanhighlightthe//linkduringmouseDownandthenactonmouseUp.//Fornow,wejustactonmouseDownevt.hand.lookNormal();evt.hand.setMouseFocus(null);evt.stop();//elseweirdthingshappenwhenreturnfromthislinkbybrowserbackbuttonvarurl=URL.ensureAbsoluteURL(link);//addrequiretoLKWiki.jsherevarwikiNav=Global['WikiNavigator']&&newWikiNavigator(url,null,-1/*FIXMEdon'taskfortheheadrevision*/);varisExternalLink=url.hostname!=document.location.hostname;varfollowLink=function(answer){Config.askBeforeQuit=false;if(isExternalLink)window.location.assign(url.toString());elsewindow.location.assign(url.toString()+'?'+newDate().getTime());}.bind(this);if(Config.quietFollowLink)returnfollowLink();if(wikiNav&&wikiNav.isActive()&&!isExternalLink)wikiNav.askToSaveAndNavigateToUrl(this.world());elsethis.world().confirm("Pleaseconfirmlinkto"+url.toString(),followLink);},})Config.quietFollowLink=trueHandMorph.addMethods({removeHandInfoTextMorph:function(){if(!this.infoTextMorph)return;this.infoTextMorph.remove();this.infoTextMorph=undefined;},ensusreHandInfoTextMorph:function(){if(this.infoTextMorph)returnthis.infoTextMorph;varmorph=newTextMorph(newRectangle(0,0,100,20));morph.setPosition(this.shape.bounds().bottomRight().addPt(pt(-5,-5)))morph.ignoreEvents();morph.isEpimorph=true;morph.setBorderWidth(0);morph.setFill(null);this.infoTextMorph=morph;this.addMorph(morph);returnmorph},forgetKeyDown:function(evt){this.keysDown[evt.getKeyChar()]=false;//hack,aroundweiredeventswhencommandispressedif(evt.getKeyCode()==91){//console.log("clearkeydownlist...")this.keysDown={};};//evt.hand.removeHandInfoTextMorph()},rememberKeyDown:function(evt){//console.log("rememberKeyDown"+evt.getKeyChar())//if(!this.keysDown[evt.getKeyChar()])//evt.hand.ensusreHandInfoTextMorph().setTextString(evt.getKeyChar());this.keysDown[evt.getKeyChar()]=true;},handleKeyboardEvent:function(evt){//console.log("event:"+evt)if(evt.type=="KeyUp"){//console.log("handleKeyboardEventKeyUp"+evt.getKeyChar());this.forgetKeyDown(evt);};if(this.hasSubmorphs()){if(evt.type=="KeyDown"&&this.moveSubmorphs(evt))return;elseif(evt.type=="KeyPress"&&this.transformSubmorphs(evt))return;}//manualbubblingupb/ctheeventwon'tbubblebyitselffor(varresponder=this.keyboardFocus;responder!=null;responder=responder.owner){if(responder.takesKeyboardFocus()){varhandler=responder[evt.handlerName()];if(handler){if(handler.call(responder,evt))break;//eventconsumed?}}}//rememberkeydownformouseeventsif(!this.keysDown){this.keysDown={};};if(evt.type=="KeyDown"){this.rememberKeyDown(evt);};this.blockBrowserKeyBindings(evt);},hasSubmorphs:function(){if(this.submorphs.length==0)returnfalse;elsereturnthis.submorphs.reject(function(ea){returnea.isEpimorph}).length!=0;},handleEvent:functionHandMorph$handleEvent(rawEvt){//console.log("event"+rawEvt.type);varevt=newEvent(rawEvt);evt.hand=this;lively.lang.Execution.resetDebuggingStack();switch(evt.type){case"MouseWheel":case"MouseMove":case"MouseDown":case"MouseUp":this.handleMouseEvent(evt);break;case"KeyDown":case"KeyPress":case"KeyUp":this.handleKeyboardEvent(evt);break;default:console.log("unknowneventtype"+evt.type);}evt.stopPropagation();}.logErrors('EventHandler'),})69truetruefalsetruetruetruefalse
false1truefalsetruetruefalse
nullfalsetruenullfalse
falsenullfalse
false
false
falsenullfalsefalsenullnullnullnullfalse
Meta:Howdowepreservethebehaviorinthispage,whenthefinalbehaviorisintegrated?14.3999999999999992
10008.005371930890801Wikicontroltrue
null60