Lively Kernel canvas
//
RelatedWork20
http://code.google.com/p/syntaxhighlighter/16
http://shjs.sourceforge.net/16
http://code.google.com/p/google-code-prettify/16
RawSourceCode20
HighlightSourceCode20
http://www.webdesignbooth.com/9-useful-javascript-syntax-highlighting-scripts/16
DraftSyntaxHighlighting40
/**SyntaxHighlightSampleCode*/Morph.subclass("FooMorph",{hello:function(){//verysimpleexamplereturn"HelloWorld"+47}})1710
/**SyntaxHighlightSampleCode*/Morph.subclass("FooMorph",{hello:function(){//verysimpleexamplereturn"HelloWorld"+47}})1710
replace1226msreplace1233msreplace1223msreplace1231msreplace1721msreplace1228msreplace1226msreplace1239msreplace1225msreplace1157msreplace1224msreplace1691msreplace1226msreplace1222msreplace1230msreplace1223msreplace1225msreplace1228msreplace1231msreplace142msreplace1157msreplace1156msreplace146msreplace1213msreplace1162msreplace142msreplace1210msreplace1200msreplace1206msreplace1142msreplace1202msreplace1151msreplace149msreplace1147msreplace1200msreplace1207msreplace1143msreplace148msreplace1161msreplace176msreplace17msreplace04msreplace06msreplace15msreplace05msreplace06msreplace15msreplace15msreplace15msreplace16msreplace15msreplace05msreplace05msreplace15msreplace15msreplace15msreplace16msreplace16msreplace05msreplace15msreplace16msreplace15msreplace17msreplace010msreplace010msreplace010msreplace011msreplace010msreplace013msreplace111msreplace110msreplace113msreplace110msreplace112msreplace011msreplace013msreplace19msreplace113msreplace110msreplace110msreplace1142msreplace1141msreplace0143msreplace1316msreplace0314msreplace152msreplace1221msreplace049msreplace050msreplace151msreplace151msreplace055msreplace153msreplace151msreplace152msreplace149msreplace180msreplace182msreplace183msreplace1256msreplace181msreplace180msreplace182msreplace079msreplace184msreplace149msreplace150msreplace150msreplace156msreplace149msreplace149msreplace150msreplace150msreplace149msreplace150msreplace150msreplace150msreplace151msreplace152msreplace151msreplace151msreplace1226msreplace150msreplace150msreplace050msreplace150msreplace154msreplace152msreplace149msreplace151msreplace149msreplace151msreplace152msreplace150msreplace151msreplace151msreplace152msreplace051msreplace150msreplace150msreplace149msreplace1222msreplace1141msreplace0140msreplace21152msreplace21150msreplace21151msreplace21145msreplace21143msreplace21145msreplace21138msreplace21139msreplace21133msreplace21131msreplace21130msreplace21127msreplace21125msreplace21125msreplace21124msreplace21120msreplace21116msreplace21113msreplace112msreplace111msreplace113msreplace011msreplace110msreplace113msreplace014msreplace012msreplace011msreplace011msreplace114msreplace111msreplace111msreplace111msreplace113msreplace113msreplace110msreplace110msreplace115msreplace110msreplace111msreplace112msreplace112msreplace110msreplace022msreplace122msreplace123msreplace122msreplace121msreplace046msreplace046msreplace020msreplace022msreplace023msreplace021msreplace122msreplace123msreplace120msreplace119msreplace121msreplace143msreplace142msreplace139msreplace134msreplace132msreplace036msreplace137msreplace134msreplace130msreplace130msreplace130msreplace129msreplace1198msreplace129msreplace130msreplace130msreplace130msreplace129msreplace131msreplace129msreplace129msreplace128msreplace130msreplace129msreplace130msreplace128msreplace124msreplace125msreplace126msreplace125msreplace125msreplace120msreplace116msreplace115msreplace116msreplace116msreplace014msreplace115msreplace014msreplace016msreplace1182msreplace114msreplace015msreplace016msreplace014msreplace020msreplace022msreplace022msreplace022msreplace124msreplace121msreplace118msreplace118msreplace121msreplace114msreplace116msreplace116msreplace114msreplace115msreplace114msreplace116msreplace114msreplace112msreplace112msreplace012msreplace012msreplace010msreplace012msreplace110msreplace19msreplace111msreplace111msreplace19msreplace010msreplace010msreplace111msreplace112msreplace018msreplace118msreplace110msreplace112msreplace110msreplace110msreplace112msreplace112msreplace110msreplace19msreplace112msreplace110msreplace012msreplace012msreplace012msreplace011msreplace011msreplace012msreplace110msreplace110msreplace111msreplace111msreplace110msreplace05msreplace04msreplace06msreplace06msreplace05msreplace05msreplace06msreplace06msreplace04msreplace15msreplace16msreplace16msreplace14msreplace14msreplace15msreplace15msreplace14msreplace15msreplace05msreplace05msreplace15msreplace16msreplace05msreplace05msreplace04msreplace16msreplace14msreplace16msreplace174msreplace176msreplace174msreplace180msreplace175msreplace176msreplace175msreplace1242msreplace173msreplace176msreplace176msreplace174msreplace1243msreplace165msreplace063msreplace065msreplace064msreplace068msreplace066msreplace0235msreplace063msreplace063msreplace065msreplace065msreplace066msreplace066msreplace1232msreplace164msreplace164msreplace167msreplace165msreplace066msreplace168msreplace069msreplace064msreplace068msreplace068msreplace065msreplace168msreplace166msreplace168msreplace166msreplace1233msreplace168msreplace167msreplace165msreplace167msreplace165msreplace165msreplace168msreplace067msreplace067msreplace067msreplace067msreplace065msreplace067msreplace067msreplace165msreplace167msreplace166msreplace165msreplace167msEditabletext392truetruefalsetruetrue
false00.11truefalsetruetrue
nullfalsetruenull
falsenulltruefalse
false
false
falsenullfalsefalsenullnullnullnullfalse
lively.lang.Execution.trace(function(){this.getPosition()}.bind(this.world()))func=function(){this.replaceSelectionWith('A')}.bind($morph('LargeSourceCodeSample'))lively.lang.Execution.trace(func)times=function(n,func){varresult=[]for(vari=0;i<n;i++){result.push(func(i))}returnresult}morph.activeLayers=undefinedtimes(10,function(){returnFunctions.timeToRun(func)})//[679,738,731,725,1158,729,720,732,1196,727]morph.activeLayers=function(){return[]}times(10,function(){returnFunctions.timeToRun(func)})//[153,41,40,42,42,38,260,41,41,41]morph.setWithLayers([])morph.activeLayers=undefinedtimes(10,function(){returnFunctions.timeToRun(func)})[46,43,42,42,43,43,42,44,141,41]morph.setWithLayers([SyntaxHighlightLayer])morph.activeLayers=undefinedtimes(10,function(){returnFunctions.timeToRun(func)})[944,765,765,772,772,1367,783,780,784,790][46,43,42,42,43,43,42,44,141,41]func2=function(){this.textStyle=undefined;this.highlightJavaScriptSyntax()}.bind($morph('LargeSourceCodeSample'))morph.setWithLayers([SyntaxHighlightLayer])morph.activeLayers=undefinedlively.lang.Execution.trace(func2)times(1,function(){returnFunctions.timeToRun(func2)})console.profile("syntax")func2()console.profileEnd("syntax")52
Executionprofile(ticks/tally):optionsspecified={repeat:1,sortBy:"ticks",threshold:2}-(217/1)TextMorph.replaceSelectionWith--(178/1)TextMorph.setTextString---(156/1)TextMorph.pvtUpdateTextString----(156/1)TextMorph.composeAfterEdits----|(155/1)TextMorph.renderAfterReplacement----|-(87/1)TextMorph.composeLines----|--(12/861)RunArray.runLengthAt----|--(9/342)RunArray.valueAt----|--(6/462)Rectangle.withX----|--(3/77)Point.extent----|--(2/503)Rectangle.initialize----|-(3/1)TextMorph.bounds----|--(2/1)Morph.bounds---(22/1)TextMorph.pvtReplaceBadControlCharactersInString--(38/1)TextMorph.showChangeClue---(38/1)Morph.addMorph----(38/1)Morph.addMorphFrontOrBack----|(35/1)Morph.transformForNewOwner----|-(35/1)Morph.transformToMorphLeafnodessortedbytickswithinthatmethod(ticks/tallies):(65/1)TextMorph.renderAfterReplacement(53/1)TextMorph.composeLines(35/1)Morph.transformToMorph(22/1)TextMorph.pvtReplaceBadControlCharactersInString(12/861)RunArray.runLengthAt(9/347)RunArray.valueAt(6/462)Rectangle.withX(3/77)Point.extent(2/1055)Rectangle.initialize(1/2)RunArray.slice(1/1)Morph.insertMorph(1/2)Morph.removeMorph(1/977)Rectangle.maxX(1/77)Point.addXY(1/1)Rectangle.insetByRect(1/2)Rectangle.unionPts(1/80)TextMorph.lineNumberForIndex(1/7)Rectangle.bottomRight(1/2)Rectangle.union41truetruefalsetruetruefalse
false00.11truefalsetruetruefalse
nullfalsetruenullfalse
falsenulltruefalse
false
false
falsenullfalsefalsenullnullnullnullfalse
Executionprofile(ticks/tally):optionsspecified={repeat:1,sortBy:"ticks",threshold:12}-(377/1581)RunArray.slice-(321/1)TextMorph.composeAfterEdits--(320/1)TextMorph.renderAfterReplacement---(261/1)TextMorph.composeLines----(65/2651)RunArray.runLengthAt----(27/1188)RunArray.valueAt-(279/1)TextMorph.emphasizeFromTo--(277/1)TextMorph.composeAfterEdits---(277/1)Morph.changed----(276/1)TextMorph.bounds----|(175/1)TextMorph.fitText----|-(175/1)TextMorph.fitHeight----|--(174/1)TextMorph.getCharBounds----|---(174/1)TextMorph.ensureRendered----|----(174/1)TextMorph.renderText----|----|(162/1)TextMorph.composeLines----|----|-(36/1380)RunArray.runLengthAt----|----|-(14/1713)Rectangle.withX----|(100/1)TextMorph.resetRendering-(112/1054)RunArray.concat--(48/2108)RunArray.valueAt-(43/527)RunArray.mergeAllStyle-(20/1054)RunArray.length-(17/1)RunArray.coalesceLeafnodessortedbytickswithinthatmethod(ticks/tallies):(373/1583)RunArray.slice(234/2)TextMorph.composeLines(101/4031)RunArray.runLengthAt(100/1)TextMorph.resetRendering(80/3579)RunArray.valueAt(57/1)TextMorph.renderAfterReplacement(44/1054)RunArray.concat(31/528)RunArray.mergeAllStyle(31/2109)RunArray.length(23/3428)Rectangle.withX(20/530)RunArray.coalesce(12/1)TextMorph.renderText(9/5831)Rectangle.maxX(9/2062)RunArray.equalValues(9/10776)RunArray.markAt(7/644)Point.extent(5/528)TextEmphasis.merge(5/645)Point.addXY45truetruefalsetruetruefalse
false00.11truefalsetruetruefalse
nullfalsetruenullfalse
falsenulltruefalse
false
false
falsenullfalsefalsenullnullnullnullfalse
Wikicontroltruetrue
times=function(n,func){varresult=[]for(vari=0;i<n;i++){result.push(func(i))}returnresult}func1=function(){$morph('LargeSourceCodeSample').emphasizeFromTo({color:Color.blue},0,$morph('LargeSourceCodeSample').textString.indexOf('*/')+1)}.bind($morph('LargeSourceCodeSample'))//lively.lang.Execution.trace(func)$morph('RawSourceCode').activeLayers=function(){return[]}//lively.lang.Execution.trace(func1)//times(10,function(){returnFunctions.timeToRun(func1)})times(10,function(i){$morph('LargeSourceCodeSample').setTextString($morph('RawSourceCode').textString)times(i,function(){$morph('LargeSourceCodeSample').setTextString($morph('LargeSourceCodeSample').textString+$morph('RawSourceCode').textString)})returntimes(10,function(){returnFunctions.timeToRun(func1)})}).join('\n')//formattingtimeofasinglewordgrowslinearlywithlengthofdocument3,4,3,3,4,3,4,3,1010,46,7,6,7,7,6,7,6,7,610,9,10,10,9,10,10,9,10,913,13,12,13,13,12,13,13,12,1316,15,16,16,16,16,15,16,16,1619,18,19,19,19,19,19,18,19,1922,22,21,22,22,22,22,22,22,2225,25,25,25,25,25,25,25,25,2528,28,28,28,29,28,28,28,28,2831,31,31,31,31,31,32,31,31,1029console.profile("syntax")func1()console.profileEnd("syntax")12truetruefalsetruetruefalse
false00.11truefalsetruetruefalse
nullfalsetruenullfalse
Workspacefalsenulltruefalse
false
false
falsenullfalsefalsenullnullnullnullfalse
varrgb=Color.rgb;Color.web={maroon:rgb(128,0,0),darkred:rgb(139,0,0),firebrick:rgb(178,34,34),brown:rgb(165,42,42),crimson:rgb(220,20,60),red:rgb(255,0,0),orangered:rgb(255,69,0),indianred:rgb(205,92,92),darksalmon:rgb(233,150,122),lightsalmon:rgb(255,160,122),coral:rgb(255,127,80),tomato:rgb(253,99,71),salmon:rgb(250,128,114),lightcoral:rgb(240,128,128),palevioletred:rgb(219,112,147),mediumvioletred:rgb(199,21,133),deeppink:rgb(255,20,147),fuchsia:rgb(255,0,255),magenta:rgb(255,0,255),hotpink:rgb(255,105,180),lightpink:rgb(255,182,193),pink:rgb(255,192,203),thistle:rgb(216,191,216),plum:rgb(221,160,221),violet:rgb(238,130,238),orchid:rgb(218,112,214),mediumorchid:rgb(186,85,211),darkorchid:rgb(153,50,204),darkviolet:rgb(148,0,211),purple:rgb(128,0,128),darkmagenta:rgb(139,0,139),indigo:rgb(75,0,130),blueviolet:rgb(138,43,226),mediumpurple:rgb(147,112,219),mediumslateblue:rgb(123,104,238),slateblue:rgb(106,90,205),darkslateblue:rgb(72,61,139),midnightblue:rgb(25,25,112),navy:rgb(0,0,128),darkblue:rgb(0,0,139),mediumblue:rgb(0,0,205),blue:rgb(0,0,255),royalblue:rgb(65,105,225),cornflowerblue:rgb(100,149,237),steelblue:rgb(70,130,180),dodgerblue:rgb(30,144,255),deepskyblue:rgb(0,191,255),lightskyblue:rgb(135,206,250),skyblue:rgb(135,206,235),lightsteelblue:rgb(176,196,222),lightblue:rgb(173,216,230),powderblue:rgb(176,224,230),paleturquoise:rgb(175,238,238),mediumturquoise:rgb(72,209,204),lightseagreen:rgb(32,178,170),darkcyan:rgb(0,139,139),teal:rgb(0,128,128),cadetblue:rgb(95,158,160),darkturquoise:rgb(0,206,209),aqua:rgb(0,255,255),cyan:rgb(0,255,255),turquoise:rgb(64,224,208),aquamarine:rgb(127,255,212),mediumaquamarine:rgb(102,205,170),darkseagreen:rgb(143,188,143),mediumseagreen:rgb(60,179,113),seagreen:rgb(46,139,87),darkgreen:rgb(0,100,0),green:rgb(0,128,0),forestgreen:rgb(34,139,34),limegreen:rgb(50,205,50),springgreen:rgb(0,255,127),mediumspringgreen:rgb(0,250,154),palegreen:rgb(152,251,152),lightgreen:rgb(144,238,144),lime:rgb(0,255,0),chartreuse:rgb(127,255,0),lawngreen:rgb(124,252,0),greenyellow:rgb(173,255,47),yellowgreen:rgb(154,205,50),darkolivegreen:rgb(85,107,47),olivedrab:rgb(107,142,35),olive:rgb(128,128,0),darkkhaki:rgb(189,183,107),darkgoldenrod:rgb(184,134,11),goldenrod:rgb(218,165,32),gold:rgb(255,215,0),yellow:rgb(255,255,0),khaki:rgb(240,230,140),palegoldenrod:rgb(238,232,170),sandybrown:rgb(244,164,96),orange:rgb(255,165,0),darkorange:rgb(255,140,0),chocolate:rgb(210,105,30),saddlebrown:rgb(139,69,19),sienna:rgb(160,82,45),peru:rgb(205,133,63),burlywood:rgb(222,184,135),tan:rgb(210,180,140),wheat:rgb(245,222,179),navajowhite:rgb(255,222,173),moccasin:rgb(255,228,181),blanchedalmond:rgb(255,255,205),rosybrown:rgb(188,143,143),mistyrose:rgb(255,228,225),lavenderblush:rgb(255,240,245),lavender:rgb(230,230,250),ghostwhite:rgb(248,248,255),azure:rgb(240,255,255),lightcyan:rgb(224,255,255),aliceblue:rgb(240,248,255),mintcream:rgb(245,255,250),honeydew:rgb(240,255,240),lightgoldenrodyellow:rgb(250,250,210),lemonchiffon:rgb(255,250,205),beige:rgb(245,245,220),lightyellow:rgb(255,255,224),ivory:rgb(255,240,240),floralwhite:rgb(255,250,240),linen:rgb(250,240,230),oldlace:rgb(253,245,230),cornsilk:rgb(255,248,220),antiquewhite:rgb(250,235,215),bisque:rgb(255,228,196),peachpuff:rgb(255,239,213),papayawhip:rgb(255,239,213),seashell:rgb(255,245,238),snow:rgb(255,250,250),white:rgb(255,255,255),whitesmoke:rgb(245,245,245),gainsboro:rgb(220,220,220),lightgrey:rgb(211,211,211),silver:rgb(192,192,192),darkgray:rgb(169,169,169),gray:rgb(128,128,128),dimgray:rgb(105,105,105),lightslategray:rgb(119,136,153),slategray:rgb(112,128,144),darkslategray:rgb(47,79,79),black:rgb(0,0,0)}Object.extend(Color,{webColorTableMorph:function(){varcolors=Properties.own(Color.web)varh=20vary=0;varx=0;container=Morph.makeRectangle(0,0,600,480);container.name="WebColors"container.setFill(Color.gray)colors.each(function(name){varmorph=newTextMorph(newRectangle(x,y,100,h),name)morph.ignoreEvents()y+=h;morph.setFill(Color.web[name])container.addMorph(morph);if(y>460){y=0;x+=100;}})returncontainer},showWebColorTable:function(){this.webColorTableMorph().openInWorld()}})//Color.showWebColorTable() 460) {\n\t\t\t\ty = 0;\n\t\t\t\tx += 100;\n\t\t\t}\n\n\t\t})\n\t\treturn container\n\t},\n\t\t\n\tshowWebColorTable: function(){\n\t\tthis.webColorTableMorph().openInWorld()\n\t}\n})\n\n// Color.showWebColorTable()\n\n\n"]]>140truetruefalse 460) {\n\t\t\t\ty = 0;\n\t\t\t\tx += 100;\n\t\t\t}\n\n\t\t})\n\t\treturn container\n\t},\n\t\t\n\tshowWebColorTable: function(){\n\t\tthis.webColorTableMorph().openInWorld()\n\t}\n})\n\n// Color.showWebColorTable()\n\n\n"]]>truetrue
false00.11truefalsetruetrue
nullfalsetruenull
Workspacefalsenulltruefalse
false
false
falsenullfalsefalsenullnullnullnullfalse
Object.subclass("SyntaxHighlighter",{})Object.extend(SyntaxHighlighter,{JavaScriptRules:{//basedonhttp://code.google.com/p/jquery-chili-js/regexandcolorsml_comment:{match:/\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\//g,style:{color:Color.web.gray}},sl_comment:{match:/\/\/.*/g,style:{color:Color.web.green}},string:{match:/(?:\'[^\'\\\n]*(?:\\.[^\'\\\n]*)*\')|(?:\"[^\"\\\n]*(?:\\.[^\"\\\n]*)*\")/g,style:{color:Color.web.teal}},num:{match:/\b[+-]?(?:\d*\.?\d+|\d+\.?\d*)(?:[eE][+-]?\d+)?\b/g,style:{color:Color.web.red}},reg_exp:{match:/\/[^\/\\\n]*(?:\\.[^\/\\\n]*)*\/[gim]*/g,style:{color:Color.web.maroon}},brace:{match:/[\{\}]/g,style:{color:Color.web.red,style:"bold"}},statement:{match:/\b(with|while|var|try|throw|switch|return|if|for|finally|else|do|default|continue|const|catch|case|break)\b/g,style:{color:Color.web.navy,style:"bold"}},superclassOrLayer:{match:/([A-Z][A-Za-z.]+)(?=\.(subclass|refineClass|addMethods))/g,style:{color:Color.web.navy,style:"bold"}},methodName:{match:/([A-Za-z]+:)(?=function)/g,style:{color:Color.web.orange,style:"bold"}},lively:{match:/\b(subclass|refineClass|addMethods)\b/g,style:{color:Color.web.gray}},error:{match:/\b(URIError|TypeError|SyntaxError|ReferenceError|RangeError|EvalError|Error)\b/g,style:{color:Color.web.coral}},object:{match:/\b(String|RegExp|Object|Number|Math|Function|Date|Boolean|Array)\b/g,style:{color:Color.web.deepPink}},property:{match:/\b(undefined|arguments|NaN|Infinity)\b/g,style:{color:Color.web.purple,style:"bold"}},'function':{match:/\b(parseInt|parseFloat|isNaN|isFinite|eval|encodeURIComponent|encodeURI|decodeURIComponent|decodeURI)\b/g,style:{color:Color.web.olive}},operator:{match:/\b(void|typeof|this|new|instanceof|in|function|delete)\b/g,style:{color:Color.web.royalBlue,style:"bold"}}}})//$morph('HighlightSourceCode').setTextString($morph('RawSourceCode').textString)varmorph=$morph('LargeSourceCodeSample');//varmorph=$morph('HighlightSourceCode');morph.textStyle=undefined;vartime=Functions.timeToRun(function(){morph.highlightJavaScriptSyntax()})WorldMorph.current().setStatusMessage('highlightin'+time+'ms')49truetruefalsenull1truetruefalse
false00.11truefalsetruetruefalse
nullfalsetruenullfalse
Workspacefalsenulltruefalse
false
false
falsenullfalsefalsenullnullnullnullfalse
/**SyntaxHighlightSampleCode*/Morph.subclass("FooMorph",{hello:function(){//verysimpleexamplereturn"HelloWorld"+47}})//HelloWorld,wassolls//Nagut,wassolls/**SyntaxHighlightSampleCode*/Morph.subclass("FooMorph",{hello:function(){//verysimpleexamplereturn"HelloWorld"+47}})/**SyntaxHighlightSampleCode*/Morph.subclass("FooMorph",{hello:function(){//verysimpleexamplereturn"HelloWorld"+47}})/**SyntaxHighlightSampleCode*/Morph.subclass("FooMorph",{hello:function(){//verysimpleexamplereturn"HelloWorld"+47}})/**SyntaxHighlightSampleCode*/Morph.subclass("FooMorph",{hello:function(){//verysimpleexamplereturn"HelloWorld"+47}})/**SyntaxHighlightSampleCode*/Morph.subclass("FooMorph",{hello:function(){//verysimpleexamplereturn"HelloWorld"+47}})/**SyntaxHighlightSampleCode*/Morph.subclass("FooMorph",{hello:function(){//verysimpleexamplereturn"HelloWorld"+47}})/**SyntaxHighlightSampleCode*/Morph.subclass("FooMorph",{hello:function(){//verysimpleexamplereturn"HelloWorld"+47}})/**SyntaxHighlightSampleCode*/Morph.subclass("FooMorph",{hello:function(){//verysimpleexamplereturn"HelloWorld"+47}})/**SyntaxHighlightSampleCode*/Morph.subclass("FooMorph",{hello:function(){//verysimpleexamplereturn"HelloWorld"+47}})29truetruefalse
truetruefalse
false00.11truefalsetruetruefalse
nullfalsetruenullfalse
Workspacefalsenulltruefalse
false
false
falsenullfalsefalsenullnullnullnullfalse
nullfalsetruenull
Text.js:RunArrayfalsenulltruefalse
false
false
falsenullfalse
http://www.lively-kernel.org/repository/webwerkstatt/lively/truetruetruetruetrue
truetrue
00.11truetruetrue
codebasefalsenulltruefalsetrue
null
localfalsenulltruefalsetrue
Base.jsfalsetruefalsetrue0false
bindings.jsfalsetruefalsetrue0false
CanvasExpt.jsfalsetruefalsetrue0false
ChangeSet.jsfalsetruefalsetrue0false
Connector.jsfalsetruefalsetrue0false
Contributions.jsfalsetruefalsetrue0false
Core.jsfalsetruefalsetrue0false
Data.jsfalsetruefalsetrue0false
defaultconfig.jsfalsetruefalsetrue0false
demofx.jsfalsetruefalsetrue0false
EmuDom.jsfalsetruefalsetrue0false
Examples.jsfalsetruefalsetrue0false
Fabrik.jsfalsetruefalsetrue0false
FileUploadWidget.jsfalsetruefalsetrue0false
Graffle.jsfalsetruefalsetrue0false
GridLayout.jsfalsetruefalsetrue0false
Helper.jsfalsetruefalsetrue0false
ide.jsfalsetruefalsetrue0false
JSON.jsfalsetruefalsetrue0false
LayerableMorphs.jsfalsetruefalsetrue0false
lk-js-parser.ometafalsetruefalsetrue0false
LKFileParser.jsfalsetruefalsetrue0false
LKFileParser.ometafalsetruefalsetrue0false
LKWiki.jsfalsetruefalsetrue0false
Localcodefalsetruefalsetrue0false
localconfig.jsfalsetruefalsetrue0false
Main.jsfalsetruefalsetrue0false
miniprototype.jsfalsetruefalsetrue0false
Network.jsfalsetruefalsetrue0false
obsolete.jsfalsetruefalsetrue0false
Ometa.jsfalsetruefalsetrue0false
phone.jsfalsetruefalsetrue0false
Presentation.jsfalsetruefalsetrue0false
rhino-compat.jsfalsetruefalsetrue0false
scene.jsfalsetruefalsetrue0false
Serialization.jsfalsetruefalsetrue0false
simpleMain.jsfalsetruefalsetrue0false
SmalltalkParser.jsfalsetruefalsetrue0false
SmalltalkParser.ometafalsetruefalsetrue0false
SmalltalkParserSupport.jsfalsetruefalsetrue0false
Storage.jsfalsetruefalsetrue0false
Styles.jsfalsetruefalsetrue0false
TabCompletion.jsfalsetruefalsetrue0false
TestFramework.jsfalsetruefalsetrue0false
TestRunnerExtensions.jsfalsetruefalsetrue0false
Text.jsfalsetruefalsetrue0false
TileScripting.jsfalsetruefalsetrue0false
Tools.jsfalsetruefalsetrue0false
TouchSupport.jsfalsetruefalsetrue0false
Undo.jsfalsetruefalsetrue0false
WebPIM.jsfalsetruefalsetrue0false
Widgets.jsfalsetruefalsetrue0false
WikiParser.jsfalsetruefalsetrue0false
WikiParser.ometafalsetruefalsetrue0false
WikiWidget.jsfalsetruefalsetrue0false205-1nullnullnulltruetruetrue
00.11true
null
null
null
nulltruetrue
-----falsetruefalsetrue0false205
-1nullnullnulltruetruetrue
00.11true
null
null
null
nulltruetrue
-----falsetruefalsetrue0false205
-1nullnullnulltruetruetrue
00.11true
null
null
null
nulltruetrue
-----falsetruefalsetrue0false205
-1nullnullnulltruetruetrue
00.11true
null
null
null
nulltruetrue
20null
truetrue2000000truetrue
00.11truetruetrue
20null
truetruetruetrue
00.11truetruetrue
Addmodulefalsenulltruefalsetrue
Loadallfalsenulltruefalsetrue
null
LineNofalsenulltruefalsetrue
Refreshfalsenulltruefalsetrue
Evalonfalsenulltruefalsetrue
Sortfalsenulltruefalsetrue
Viewas...falsenulltruefalsetrue
truetrue
nullfalsenullnullnullnullfalse
s=$morph('RawSourceCode').textString$morph('HighlightSourceCode').setTextString('')$morph('HighlightSourceCode').setTextString($morph('RawSourceCode').textString)$morph('HighlightSourceCode').setWithLayers([])$morph('HighlightSourceCode').setWithLayers([SyntaxHighlightLayer,BenchmarkReplaceTextSelectionLayer])//$morph('HighlightSourceCode').setWithLayers([BenchmarkReplaceTextSelectionLayer])$morph('HighlightSourceCode').setWithLayers([SyntaxHighlightLayer])$morph('HighlightSourceCode').highlightJavaScriptSyntax()$morph('HighlightSourceCode').setTextString($morph('RawSourceCode').textString)//$morph('HighlightSourceCode').emphasizeAll({Color:Color.black,style:'unbold'})Functions.timeToRun(function(){line=$morph('HighlightSourceCode').lines[6]$morph('HighlightSourceCode').highlightJavaScriptSyntaxFromTo(line.startIndex,line.getStopIndex())})t=$morph('HighlightSourceCode')n=t.lineNumberForIndex(t.getCursorPos())prevLine=t.lines[n-1]nextLine=t.lines[n+1]$morph('HighlightSourceCode').setTextString($morph('RawSourceCode').textString)t.textString.lastIndexOf("\n",100)t.textString.indexOf("\n",100)pos=t.getCursorPos();Functions.timeToRun(function(){$morph('HighlightSourceCode').highlightJavaScriptSyntax()})//BenchmarkReplaceTextSelectionLayer$morph('LargeSourceCodeSample').setWithLayers([])$morph('LargeSourceCodeSample').setWithLayers([SyntaxHighlightLayer])varmorph=$morph('LargeSourceCodeSample');//varmorph=$morph('HighlightSourceCode');morph.textStyle=undefined;vartime=Functions.timeToRun(function(){morph.highlightJavaScriptSyntax()})WorldMorph.current().setStatusMessage('highlightin'+time+'ms')4truetruefalsetruetruefalse
false00.11truefalsetruetruefalse
nullfalsetruenullfalse
Workspacefalsenulltruefalse
false
false
falsenullfalsefalsenullnullnullnullfalse
RunArray.addMethods('SyntaxHighlight',{//doesnotcoercesimpleMergeStyle:function(emph,start,stop){varnewRun=this.slice(start,stop+1).mergeAllStyle(emph);if(start>0)newRun=this.slice(0,start).concat(newRun);if(stop<this.length()-1)newRun=newRun.concat(this.slice(stop+1,this.length()));returnnewRun;},})TextMorph.addMethods('SyntaxHighlight',{//doesnotcomposeaftereditsimpleEmphasizeFromTo:function(emph,from,to){vartxt=newlively.Text.Text(this.textString,this.textStyle);txt.emphasize(emph,from,to);this.textStyle=txt.style;},highlightJavaScriptSyntaxFromTo:function(from,to){this.simpleEmphasizeFromTo({Color:Color.black,style:'unbold'},from,to)varstring=this.textString.substring(from,to)//varstyle=newRunArray([s.length],[newTextEmphasis({})]);varstyle=this.textStyle;Properties.own(SyntaxHighlighter.JavaScriptRules).each(function(ea){varrule=SyntaxHighlighter.JavaScriptRules[ea];//varexp=newRegExp(r.match);varexp=rule.match;varm;while(m=exp.exec(string)){//this.emphasizeFromTo(rule.style,from+m.index,from+m.index+m[0].length-1)style=style.simpleMergeStyle(newTextEmphasis(rule.style),from+m.index,from+m.index+m[0].length-1)//TODOckeck"-1"}},this);//overrideallotherstyles...toberefactored//this.textStyle=this.textStyle.mergeStyle(style,from,to)this.textStyle=style.coalesce();varreplacementHints={selStart:from,selStop:to,repLength:string.length};this.composeAfterEdits(replacementHints);},highlightJavaScriptSyntax:function(){this.highlightJavaScriptSyntaxFromTo(0,this.textString.length);},delayedSyntaxHighlighting:function(optFrom,optTo){//console.log("delayedSyntaxHig...."+optFrom+","+optTo)varstring=this.textString;varself=this;varfrom=optFrom||0;varto=optTo||self.textString.length;this.highlightJavaScriptMinFrom=Math.min(this.highlightJavaScriptMinFrom,from)||fromthis.highlightJavaScriptMaxTo=Math.max(this.highlightJavaScriptMaxTo,to)||to//console.log("to"+to)//console.log("highlightJavaScriptMaxTo"+this.highlightJavaScriptMaxTo)varlastHighlightJavaScriptProgress=this.highlightJavaScriptProgress;this.highlightJavaScriptProgress={last:Date.now()};if((Date.now()-lastHighlightJavaScriptProgress<2000)){//WorldMorph.current().setStatusMessage("delayedhightlightinProgress",Color.darkGray,3)return}varfunc=function(){if((Date.now()-self.highlightJavaScriptProgress)<500){//WorldMorph.current().setStatusMessage("delayhightlight",Color.red,2)func.delay(0);}else{vartime=Functions.timeToRun(function(){self.highlightJavaScriptSyntaxFromTo(self.highlightJavaScriptMinFrom,self.highlightJavaScriptMaxTo)});//WorldMorph.current().setStatusMessage("delayedhightlightin"+time+"ms"+//self.highlightJavaScriptMinFrom+","+self.highlightJavaScriptMaxTo,Color.blue,3)deleteself.highlightJavaScriptProgressdeleteself.highlightJavaScriptMinFromdeleteself.highlightJavaScriptMaxTo}};func(0)},})cop.create("SyntaxHighlightLayer").refineClass(TextMorph,{//replaceSelectionWith:function(proceed,replacement){//varresult=proceed(replacement);//varcursorPos=t.getCursorPos();//this.delayedSyntaxHighlighting(this.textString.lastIndexOf("\n",cursorPos-1),this.textString.indexOf("\n",cursorPos));//returnresult;//},tryBoundEval:function(proceed,str,offset){varresult=proceed(str,offset);this.delayedSyntaxHighlighting(offset,offset+str.length)returnresult},})cop.create("BenchmarkReplaceTextSelectionLayer").refineClass(TextMorph,{replaceSelectionWith:function(proceed,replacement){varm=$morph('BenchmarkReplaceTextSelectionResultMorph');varresult;console.profile("replaceSelectionWith")vartime=Functions.timeToRun(function(){result=proceed(replacement)}.bind(this));console.profileEnd("replaceSelectionWith")m.setTextString("replace"+replacement.length+""+time+"ms"+'\n'+m.textString)returnresult;}}) 0) newRun = this.slice(0, start).concat(newRun);\n\t\tif (stop < this.length()-1) newRun = newRun.concat(this.slice(stop+1, this.length()));\n\t\treturn newRun;\n\t},\n})\n\nTextMorph.addMethods('SyntaxHighlight',{\n\t// does not compose after edit\n\tsimpleEmphasizeFromTo: function(emph, from, to) {\n\t\tvar txt = new lively.Text.Text(this.textString, this.textStyle);\n\t\ttxt.emphasize(emph, from, to);\n\t\tthis.textStyle = txt.style;\n\t},\n\n\thighlightJavaScriptSyntaxFromTo: function(from, to) {\n\t\tthis.simpleEmphasizeFromTo({Color: Color.black, style: 'unbold'}, from, to)\n\t\tvar string = this.textString.substring(from,to)\n\t\t// var style = new RunArray([s.length],\t[new TextEmphasis({})]);\n\t\tvar style = this.textStyle;\n\n\t\tProperties.own(SyntaxHighlighter.JavaScriptRules).each(function(ea) {\n\t\t\tvar rule = SyntaxHighlighter.JavaScriptRules[ea];\n\t\t\t// var exp = new RegExp(r.match);\n\t\t\tvar exp = rule.match;\n\t\t\tvar m;\n\t\t\twhile(m = exp.exec(string)) {\n\t\t\t\t// this.emphasizeFromTo(rule.style, from + m.index, from + m.index + m[0].length - 1 )\n\t\t\t\tstyle = style.simpleMergeStyle(new TextEmphasis(rule.style), from + m.index, from + m.index + m[0].length - 1) // TODO ckeck \"-1\"\n\t\t\t}\n\t\t}, this);\n\t\t// override all other styles... to be refactored\n\t\t// this.textStyle = this.textStyle.mergeStyle(style, from, to)\t\n\t\tthis.textStyle = style.coalesce();\n\t\tvar replacementHints = {selStart: from, selStop: to, repLength: string.length};\n\t\tthis.composeAfterEdits(replacementHints);\n\t},\n\n\thighlightJavaScriptSyntax: function() {\n\t\tthis.highlightJavaScriptSyntaxFromTo(0, this.textString.length);\n\t},\n\n\tdelayedSyntaxHighlighting: function(optFrom, optTo) {\n\t\t// console.log(\"delayedSyntaxHig....\" + optFrom + \",\" + optTo)\n\t\tvar string = this.textString;\n\t\tvar self = this;\n\t\tvar from = optFrom || 0;\n\t\tvar to = optTo || self.textString.length;\t\t\t\n\n\t\tthis.highlightJavaScriptMinFrom = Math.min(this.highlightJavaScriptMinFrom, from) || from\n\t\tthis.highlightJavaScriptMaxTo = Math.max(this.highlightJavaScriptMaxTo, to) || to\n\n\t\t// console.log(\"to \" + to)\n\t\t// console.log(\"highlightJavaScriptMaxTo \" + this.highlightJavaScriptMaxTo)\n\n\t\tvar lastHighlightJavaScriptProgress = this.highlightJavaScriptProgress;\n\t\tthis.highlightJavaScriptProgress = {last: Date.now()};\n\n\t\tif ((Date.now() - lastHighlightJavaScriptProgress < 2000)) {\n\t\t\t// WorldMorph.current().setStatusMessage(\"delayed hightlight in Progress\", Color.darkGray, 3)\n\t\t\treturn\n\t\t}\n\t\tvar func = function() {\n\t\t\tif ((Date.now() - self.highlightJavaScriptProgress) < 500) {\n\t\t\t\t// WorldMorph.current().setStatusMessage(\"delay hightlight\", Color.red, 2)\n\t\t\t\tfunc.delay(0);\n\t\t\t} else {\t\n\t\t\t\tvar time = Functions.timeToRun(function() {\n\t\t\t\t\t\tself.highlightJavaScriptSyntaxFromTo(\n\t\t\t\t\t\t\tself.highlightJavaScriptMinFrom, self.highlightJavaScriptMaxTo)});\n\t\t\t\t// WorldMorph.current().setStatusMessage(\"delayed hightlight in \" + time +\"ms \" + \n\t\t\t\t//\tself.highlightJavaScriptMinFrom + \",\" + self.highlightJavaScriptMaxTo, Color.blue, 3)\n\t\t\t\tdelete self.highlightJavaScriptProgress\n\t\t\t\tdelete self.highlightJavaScriptMinFrom\n\t\t\t\tdelete self.highlightJavaScriptMaxTo\n\t\t\t}\n\t\t};\n\t\tfunc(0)\n\t},\n})\n\ncop.create(\"SyntaxHighlightLayer\").refineClass(TextMorph, {\n\n\t// replaceSelectionWith: function(proceed, replacement) {\n\t//\tvar result = proceed(replacement);\n\t//\tvar cursorPos = t.getCursorPos();\n\t//\tthis.delayedSyntaxHighlighting(this.textString.lastIndexOf(\"\\n\", cursorPos - 1), this.textString.indexOf(\"\\n\", cursorPos));\n\t//\treturn result;\t\n\t// },\n\n \ttryBoundEval: function(proceed, str, offset) {\n\t\tvar result = proceed(str, offset);\n\t\tthis.delayedSyntaxHighlighting(offset, offset + str.length)\t\n\t\treturn result\n\t},\n\n})\n\n\ncop.create(\"BenchmarkReplaceTextSelectionLayer\").refineClass(TextMorph, {\n\t\n\treplaceSelectionWith: function(proceed, replacement) {\n\t\tvar m = $morph('BenchmarkReplaceTextSelectionResultMorph');\n\t\tvar result;\n\t\tconsole.profile(\"replaceSelectionWith\")\n\t\tvar time = Functions.timeToRun(function() {\n\n\t\t\tresult = proceed(replacement) \n\t\t}.bind(this));\n\t\tconsole.profileEnd(\"replaceSelectionWith\")\n\t\tm.setTextString(\"replace\t\" + replacement.length + \"\t\"+ time + \"ms\" + '\\n' + m.textString)\n\t\treturn result;\t\n\t}\n\n})\n\n\n\n"]]>truetruefalse 0) newRun = this.slice(0, start).concat(newRun);\n\t\tif (stop < this.length()-1) newRun = newRun.concat(this.slice(stop+1, this.length()));\n\t\treturn newRun;\n\t},\n})\n\nTextMorph.addMethods('SyntaxHighlight',{\n\t// does not compose after edit\n\tsimpleEmphasizeFromTo: function(emph, from, to) {\n\t\tvar txt = new lively.Text.Text(this.textString, this.textStyle);\n\t\ttxt.emphasize(emph, from, to);\n\t\tthis.textStyle = txt.style;\n\t},\n\n\thighlightJavaScriptSyntaxFromTo: function(from, to) {\n\t\tthis.simpleEmphasizeFromTo({Color: Color.black, style: 'unbold'}, from, to)\n\t\tvar string = this.textString.substring(from,to)\n\t\t// var style = new RunArray([s.length],\t[new TextEmphasis({})]);\n\t\tvar style = this.textStyle;\n\n\t\tProperties.own(SyntaxHighlighter.JavaScriptRules).each(function(ea) {\n\t\t\tvar rule = SyntaxHighlighter.JavaScriptRules[ea];\n\t\t\t// var exp = new RegExp(r.match);\n\t\t\tvar exp = rule.match;\n\t\t\tvar m;\n\t\t\twhile(m = exp.exec(string)) {\n\t\t\t\t// this.emphasizeFromTo(rule.style, from + m.index, from + m.index + m[0].length - 1 )\n\t\t\t\tstyle = style.simpleMergeStyle(new TextEmphasis(rule.style), from + m.index, from + m.index + m[0].length - 1) // TODO ckeck \"-1\"\n\t\t\t}\n\t\t}, this);\n\t\t// override all other styles... to be refactored\n\t\t// this.textStyle = this.textStyle.mergeStyle(style, from, to)\t\n\t\tthis.textStyle = style.coalesce();\n\t\tvar replacementHints = {selStart: from, selStop: to, repLength: string.length};\n\t\tthis.composeAfterEdits(replacementHints);\n\t},\n\n\thighlightJavaScriptSyntax: function() {\n\t\tthis.highlightJavaScriptSyntaxFromTo(0, this.textString.length);\n\t},\n\n\tdelayedSyntaxHighlighting: function(optFrom, optTo) {\n\t\t// console.log(\"delayedSyntaxHig....\" + optFrom + \",\" + optTo)\n\t\tvar string = this.textString;\n\t\tvar self = this;\n\t\tvar from = optFrom || 0;\n\t\tvar to = optTo || self.textString.length;\t\t\t\n\n\t\tthis.highlightJavaScriptMinFrom = Math.min(this.highlightJavaScriptMinFrom, from) || from\n\t\tthis.highlightJavaScriptMaxTo = Math.max(this.highlightJavaScriptMaxTo, to) || to\n\n\t\t// console.log(\"to \" + to)\n\t\t// console.log(\"highlightJavaScriptMaxTo \" + this.highlightJavaScriptMaxTo)\n\n\t\tvar lastHighlightJavaScriptProgress = this.highlightJavaScriptProgress;\n\t\tthis.highlightJavaScriptProgress = {last: Date.now()};\n\n\t\tif ((Date.now() - lastHighlightJavaScriptProgress < 2000)) {\n\t\t\t// WorldMorph.current().setStatusMessage(\"delayed hightlight in Progress\", Color.darkGray, 3)\n\t\t\treturn\n\t\t}\n\t\tvar func = function() {\n\t\t\tif ((Date.now() - self.highlightJavaScriptProgress) < 500) {\n\t\t\t\t// WorldMorph.current().setStatusMessage(\"delay hightlight\", Color.red, 2)\n\t\t\t\tfunc.delay(0);\n\t\t\t} else {\t\n\t\t\t\tvar time = Functions.timeToRun(function() {\n\t\t\t\t\t\tself.highlightJavaScriptSyntaxFromTo(\n\t\t\t\t\t\t\tself.highlightJavaScriptMinFrom, self.highlightJavaScriptMaxTo)});\n\t\t\t\t// WorldMorph.current().setStatusMessage(\"delayed hightlight in \" + time +\"ms \" + \n\t\t\t\t//\tself.highlightJavaScriptMinFrom + \",\" + self.highlightJavaScriptMaxTo, Color.blue, 3)\n\t\t\t\tdelete self.highlightJavaScriptProgress\n\t\t\t\tdelete self.highlightJavaScriptMinFrom\n\t\t\t\tdelete self.highlightJavaScriptMaxTo\n\t\t\t}\n\t\t};\n\t\tfunc(0)\n\t},\n})\n\ncop.create(\"SyntaxHighlightLayer\").refineClass(TextMorph, {\n\n\t// replaceSelectionWith: function(proceed, replacement) {\n\t//\tvar result = proceed(replacement);\n\t//\tvar cursorPos = t.getCursorPos();\n\t//\tthis.delayedSyntaxHighlighting(this.textString.lastIndexOf(\"\\n\", cursorPos - 1), this.textString.indexOf(\"\\n\", cursorPos));\n\t//\treturn result;\t\n\t// },\n\n \ttryBoundEval: function(proceed, str, offset) {\n\t\tvar result = proceed(str, offset);\n\t\tthis.delayedSyntaxHighlighting(offset, offset + str.length)\t\n\t\treturn result\n\t},\n\n})\n\n\ncop.create(\"BenchmarkReplaceTextSelectionLayer\").refineClass(TextMorph, {\n\t\n\treplaceSelectionWith: function(proceed, replacement) {\n\t\tvar m = $morph('BenchmarkReplaceTextSelectionResultMorph');\n\t\tvar result;\n\t\tconsole.profile(\"replaceSelectionWith\")\n\t\tvar time = Functions.timeToRun(function() {\n\n\t\t\tresult = proceed(replacement) \n\t\t}.bind(this));\n\t\tconsole.profileEnd(\"replaceSelectionWith\")\n\t\tm.setTextString(\"replace\t\" + replacement.length + \"\t\"+ time + \"ms\" + '\\n' + m.textString)\n\t\treturn result;\t\n\t}\n\n})\n\n\n\n"]]>NaN72truetrue
false00.11truefalsenulltruetrue
nullfalsetruenull
Workspacefalsenulltruefalse
false
false
falsenullfalsefalsenullnullnullnullfalse
null79