IDE.js 99 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655
  1. smalltalk.addClass('TabManager', smalltalk.Widget, ['selectedTab', 'tabs', 'opened'], 'IDE');
  2. smalltalk.addMethod(
  3. '_initialize',
  4. smalltalk.method({
  5. selector: 'initialize',
  6. category: 'initialization',
  7. fn: function (){
  8. var self=this;
  9. self.klass.superclass.fn.prototype['_initialize'].apply(self, []);
  10. self['@opened']=true;
  11. (function($rec){smalltalk.send($rec, "_append_", [self]);smalltalk.send($rec, "_append_", [(function(html){return smalltalk.send(smalltalk.send(html, "_div", []), "_id_", ["jtalk"]);})]);return smalltalk.send($rec, "_addClass_", ["jtalkBody"]);})(smalltalk.send("body", "_asJQuery", []));
  12. (function($rec){smalltalk.send($rec, "_addTab_", [smalltalk.send(smalltalk.Transcript, "_current", [])]);return smalltalk.send($rec, "_addTab_", [smalltalk.send(smalltalk.Workspace, "_new", [])]);})(self);
  13. smalltalk.send(self, "_selectTab_", [smalltalk.send(smalltalk.send(self, "_tabs", []), "_last", [])]);
  14. (function($rec){smalltalk.send($rec, "_onResize_", [(function(){return (function($rec){smalltalk.send($rec, "_updateBodyMargin", []);return smalltalk.send($rec, "_updatePosition", []);})(self);})]);return smalltalk.send($rec, "_onWindowResize_", [(function(){return smalltalk.send(self, "_updatePosition", []);})]);})(self);
  15. return self;},
  16. source: unescape('initialize%0A%20%20%20%20super%20initialize.%0A%20%20%20%20opened%20%3A%3D%20true.%0A%20%20%20%20%27body%27%20asJQuery%20%0A%09append%3A%20self%3B%0A%09append%3A%20%5B%3Ahtml%20%7C%20html%20div%20id%3A%20%27jtalk%27%5D%3B%0A%09addClass%3A%20%27jtalkBody%27.%0A%20%20%20%20self%20%0A%09addTab%3A%20Transcript%20current%3B%0A%09addTab%3A%20Workspace%20new.%0A%20%20%20%20self%20selectTab%3A%20self%20tabs%20last.%0A%20%20%20%20self%20%0A%09onResize%3A%20%5Bself%20updateBodyMargin%3B%20updatePosition%5D%3B%0A%09onWindowResize%3A%20%5Bself%20updatePosition%5D%0A')}),
  17. smalltalk.TabManager);
  18. smalltalk.addMethod(
  19. '_tabs',
  20. smalltalk.method({
  21. selector: 'tabs',
  22. category: 'accessing',
  23. fn: function (){
  24. var self=this;
  25. return smalltalk.send(self['@tabs'], "_ifNil_", [(function(){return self['@tabs']=smalltalk.send(smalltalk.Array, "_new", []);})]);
  26. return self;},
  27. source: unescape('tabs%0A%20%20%20%20%5Etabs%20ifNil%3A%20%5Btabs%20%3A%3D%20Array%20new%5D%0A')}),
  28. smalltalk.TabManager);
  29. smalltalk.addMethod(
  30. '_addTab_',
  31. smalltalk.method({
  32. selector: 'addTab:',
  33. category: 'adding/Removing',
  34. fn: function (aWidget){
  35. var self=this;
  36. smalltalk.send(smalltalk.send(self, "_tabs", []), "_add_", [aWidget]);
  37. smalltalk.send(smalltalk.send(unescape("%23jtalk"), "_asJQuery", []), "_append_", [aWidget]);
  38. smalltalk.send(smalltalk.send(smalltalk.send(aWidget, "_root", []), "_asJQuery", []), "_hide", []);
  39. return self;},
  40. source: unescape('addTab%3A%20aWidget%0A%20%20%20%20self%20tabs%20add%3A%20aWidget.%0A%20%20%20%20%27%23jtalk%27%20asJQuery%20append%3A%20aWidget.%0A%20%20%20%20aWidget%20root%20asJQuery%20hide%0A')}),
  41. smalltalk.TabManager);
  42. smalltalk.addMethod(
  43. '_removeTab_',
  44. smalltalk.method({
  45. selector: 'removeTab:',
  46. category: 'adding/Removing',
  47. fn: function (aWidget){
  48. var self=this;
  49. smalltalk.send(smalltalk.send(self, "_tabs", []), "_remove_", [aWidget]);
  50. smalltalk.send(self, "_update", []);
  51. return self;},
  52. source: unescape('removeTab%3A%20aWidget%0A%20%20%20%20self%20tabs%20remove%3A%20aWidget.%0A%20%20%20%20self%20update%0A')}),
  53. smalltalk.TabManager);
  54. smalltalk.addMethod(
  55. '_updateBodyMargin',
  56. smalltalk.method({
  57. selector: 'updateBodyMargin',
  58. category: 'actions',
  59. fn: function (){
  60. var self=this;
  61. smalltalk.send(self, "_setBodyMargin_", [smalltalk.send(smalltalk.send(smalltalk.send(unescape("%23jtalk"), "_asJQuery", []), "_height", []), "__plus", [(27)])]);
  62. return self;},
  63. source: unescape('updateBodyMargin%0A%20%20%20%20self%20setBodyMargin%3A%20%27%23jtalk%27%20asJQuery%20height%20+%2027%0A')}),
  64. smalltalk.TabManager);
  65. smalltalk.addMethod(
  66. '_updatePosition',
  67. smalltalk.method({
  68. selector: 'updatePosition',
  69. category: 'actions',
  70. fn: function (){
  71. var self=this;
  72. jQuery('#jtalk').css('top', '').css('bottom', '27px');;
  73. return self;},
  74. source: unescape('updatePosition%0A%20%20%20%20%7B%27jQuery%28%27%27%23jtalk%27%27%29.css%28%27%27top%27%27%2C%20%27%27%27%27%27%27%29.css%28%27%27bottom%27%27%2C%20%27%2727px%27%27%29%3B%27%7D%0A')}),
  75. smalltalk.TabManager);
  76. smalltalk.addMethod(
  77. '_removeBodyMargin',
  78. smalltalk.method({
  79. selector: 'removeBodyMargin',
  80. category: 'actions',
  81. fn: function (){
  82. var self=this;
  83. smalltalk.send(self, "_setBodyMargin_", [(0)]);
  84. return self;},
  85. source: unescape('removeBodyMargin%0A%20%20%20%20self%20setBodyMargin%3A%200%0A')}),
  86. smalltalk.TabManager);
  87. smalltalk.addMethod(
  88. '_setBodyMargin_',
  89. smalltalk.method({
  90. selector: 'setBodyMargin:',
  91. category: 'actions',
  92. fn: function (anInteger){
  93. var self=this;
  94. smalltalk.send(smalltalk.send(".jtalkBody", "_asJQuery", []), "_cssAt_put_", [unescape("margin-bottom"), smalltalk.send(smalltalk.send(anInteger, "_asString", []), "__comma", ["px"])]);
  95. return self;},
  96. source: unescape('setBodyMargin%3A%20anInteger%0A%20%20%20%20%27.jtalkBody%27%20asJQuery%20cssAt%3A%20%27margin-bottom%27%20put%3A%20anInteger%20asString%2C%20%27px%27%0A')}),
  97. smalltalk.TabManager);
  98. smalltalk.addMethod(
  99. '_onResize_',
  100. smalltalk.method({
  101. selector: 'onResize:',
  102. category: 'actions',
  103. fn: function (aBlock){
  104. var self=this;
  105. jQuery('#jtalk').resizable({
  106. handles: 'n',
  107. resize: aBlock,
  108. minHeight: 230
  109. });;
  110. return self;},
  111. source: unescape('onResize%3A%20aBlock%0A%20%20%20%20%7B%27jQuery%28%27%27%23jtalk%27%27%29.resizable%28%7B%0A%09handles%3A%20%27%27n%27%27%2C%20%0A%09resize%3A%20aBlock%2C%0A%09minHeight%3A%20230%0A%7D%29%3B%27%7D%0A')}),
  112. smalltalk.TabManager);
  113. smalltalk.addMethod(
  114. '_onWindowResize_',
  115. smalltalk.method({
  116. selector: 'onWindowResize:',
  117. category: 'actions',
  118. fn: function (aBlock){
  119. var self=this;
  120. jQuery(window).resize(aBlock);
  121. return self;},
  122. source: unescape('onWindowResize%3A%20aBlock%0A%20%20%20%20%7B%27jQuery%28window%29.resize%28aBlock%29%27%7D%0A')}),
  123. smalltalk.TabManager);
  124. smalltalk.addMethod(
  125. '_open',
  126. smalltalk.method({
  127. selector: 'open',
  128. category: 'actions',
  129. fn: function (){
  130. var self=this;
  131. smalltalk.send(self['@opened'], "_ifFalse_", [(function(){smalltalk.send(smalltalk.send(smalltalk.send(self, "_root", []), "_asJQuery", []), "_show", []);smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_addClass_", ["jtalkBody"]);smalltalk.send(smalltalk.send(unescape("%23jtalk"), "_asJQuery", []), "_show", []);smalltalk.send(self, "_updateBodyMargin", []);smalltalk.send(smalltalk.send(smalltalk.send(self['@selectedTab'], "_root", []), "_asJQuery", []), "_show", []);return self['@opened']=true;})]);
  132. return self;},
  133. source: unescape('open%0A%20%20%20%20opened%20ifFalse%3A%20%5B%0A%09self%20root%20asJQuery%20show.%0A%09%27body%27%20asJQuery%20addClass%3A%20%27jtalkBody%27.%0A%09%27%23jtalk%27%20asJQuery%20show.%0A%09self%20updateBodyMargin.%0A%09selectedTab%20root%20asJQuery%20show.%0A%09opened%20%3A%3D%20true%5D%0A')}),
  134. smalltalk.TabManager);
  135. smalltalk.addMethod(
  136. '_close',
  137. smalltalk.method({
  138. selector: 'close',
  139. category: 'actions',
  140. fn: function (){
  141. var self=this;
  142. smalltalk.send(self['@opened'], "_ifTrue_", [(function(){smalltalk.send(smalltalk.send(smalltalk.send(self, "_root", []), "_asJQuery", []), "_hide", []);smalltalk.send(smalltalk.send(unescape("%23jtalk"), "_asJQuery", []), "_hide", []);smalltalk.send(self, "_removeBodyMargin", []);smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_removeClass_", ["jtalkBody"]);return self['@opened']=false;})]);
  143. return self;},
  144. source: unescape('close%0A%20%20%20%20opened%20ifTrue%3A%20%5B%0A%09self%20root%20asJQuery%20hide.%0A%09%27%23jtalk%27%20asJQuery%20hide.%0A%09self%20removeBodyMargin.%0A%09%27body%27%20asJQuery%20removeClass%3A%20%27jtalkBody%27.%0A%09opened%20%3A%3D%20false%5D%0A')}),
  145. smalltalk.TabManager);
  146. smalltalk.addMethod(
  147. '_newBrowserTab',
  148. smalltalk.method({
  149. selector: 'newBrowserTab',
  150. category: 'actions',
  151. fn: function (){
  152. var self=this;
  153. smalltalk.send(smalltalk.Browser, "_open", []);
  154. return self;},
  155. source: unescape('newBrowserTab%0A%20%20%20%20Browser%20open%0A')}),
  156. smalltalk.TabManager);
  157. smalltalk.addMethod(
  158. '_selectTab_',
  159. smalltalk.method({
  160. selector: 'selectTab:',
  161. category: 'actions',
  162. fn: function (aWidget){
  163. var self=this;
  164. smalltalk.send(self, "_open", []);
  165. self['@selectedTab']=aWidget;
  166. smalltalk.send(smalltalk.send(self, "_tabs", []), "_do_", [(function(each){return smalltalk.send(smalltalk.send(smalltalk.send(each, "_root", []), "_asJQuery", []), "_hide", []);})]);
  167. smalltalk.send(smalltalk.send(smalltalk.send(aWidget, "_root", []), "_asJQuery", []), "_show", []);
  168. smalltalk.send(self, "_update", []);
  169. return self;},
  170. source: unescape('selectTab%3A%20aWidget%0A%20%20%20%20self%20open.%0A%20%20%20%20selectedTab%20%3A%3D%20aWidget.%0A%20%20%20%20self%20tabs%20do%3A%20%5B%3Aeach%20%7C%0A%09each%20root%20asJQuery%20hide%5D.%0A%20%20%20%20aWidget%20root%20asJQuery%20show.%0A%20%20%20%20self%20update%0A')}),
  171. smalltalk.TabManager);
  172. smalltalk.addMethod(
  173. '_closeTab_',
  174. smalltalk.method({
  175. selector: 'closeTab:',
  176. category: 'actions',
  177. fn: function (aWidget){
  178. var self=this;
  179. smalltalk.send(self, "_removeTab_", [aWidget]);
  180. smalltalk.send(self, "_selectTab_", [smalltalk.send(smalltalk.send(self, "_tabs", []), "_last", [])]);
  181. smalltalk.send(smalltalk.send(smalltalk.send(aWidget, "_root", []), "_asJQuery", []), "_remove", []);
  182. smalltalk.send(self, "_update", []);
  183. return self;},
  184. source: unescape('closeTab%3A%20aWidget%0A%20%20%20%20self%20removeTab%3A%20aWidget.%0A%20%20%20%20self%20selectTab%3A%20self%20tabs%20last.%0A%20%20%20%20aWidget%20root%20asJQuery%20remove.%0A%20%20%20%20self%20update%0A')}),
  185. smalltalk.TabManager);
  186. smalltalk.addMethod(
  187. '_renderOn_',
  188. smalltalk.method({
  189. selector: 'renderOn:',
  190. category: 'rendering',
  191. fn: function (html){
  192. var self=this;
  193. (function($rec){smalltalk.send($rec, "_id_", ["jtalkTabs"]);return smalltalk.send($rec, "_with_", [(function(){(function($rec){smalltalk.send($rec, "_class_", ["closeAll"]);smalltalk.send($rec, "_with_", ["x"]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_close", []);})]);})(smalltalk.send(html, "_li", []));smalltalk.send(smalltalk.send(self, "_tabs", []), "_do_", [(function(each){return smalltalk.send(self, "_renderTabFor_on_", [each, html]);})]);return (function($rec){smalltalk.send($rec, "_class_", ["newtab"]);smalltalk.send($rec, "_with_", [unescape("%20+%20")]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_newBrowserTab", []);})]);})(smalltalk.send(html, "_li", []));})]);})(smalltalk.send(html, "_ul", []));
  194. return self;},
  195. source: unescape('renderOn%3A%20html%0A%20%20%20%20html%20ul%0A%09id%3A%20%27jtalkTabs%27%3B%0A%09with%3A%20%5B%0A%09%20%20%20%20html%20li%20%0A%09%09class%3A%20%27closeAll%27%3B%0A%09%09with%3A%20%27x%27%3B%0A%09%09onClick%3A%20%5Bself%20close%5D.%0A%09%20%20%20%20self%20tabs%20do%3A%20%5B%3Aeach%20%7C%0A%09%09self%20renderTabFor%3A%20each%20on%3A%20html%5D.%0A%09%20%20%20%20html%20li%0A%09%09class%3A%20%27newtab%27%3B%0A%09%09with%3A%20%27%20+%20%27%3B%0A%09%09onClick%3A%20%5Bself%20newBrowserTab%5D%5D%0A')}),
  196. smalltalk.TabManager);
  197. smalltalk.addMethod(
  198. '_renderTabFor_on_',
  199. smalltalk.method({
  200. selector: 'renderTabFor:on:',
  201. category: 'rendering',
  202. fn: function (aWidget, html){
  203. var self=this;
  204. var li=nil;
  205. li=smalltalk.send(html, "_li", []);
  206. smalltalk.send(smalltalk.send(self['@selectedTab'], "__eq", [aWidget]), "_ifTrue_", [(function(){return smalltalk.send(li, "_class_", ["selected"]);})]);
  207. smalltalk.send(li, "_with_", [(function(){(function($rec){smalltalk.send($rec, "_with_", [smalltalk.send(aWidget, "_label", [])]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_selectTab_", [aWidget]);})]);})(smalltalk.send(html, "_span", []));return smalltalk.send(smalltalk.send(aWidget, "_canBeClosed", []), "_ifTrue_", [(function(){return (function($rec){smalltalk.send($rec, "_class_", ["close"]);smalltalk.send($rec, "_with_", ["x"]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_closeTab_", [aWidget]);})]);})(smalltalk.send(html, "_span", []));})]);})]);
  208. return self;},
  209. source: unescape('renderTabFor%3A%20aWidget%20on%3A%20html%0A%20%20%20%20%7C%20li%20%7C%0A%20%20%20%20li%20%3A%3D%20html%20li.%0A%20%20%20%20selectedTab%20%3D%20aWidget%20ifTrue%3A%20%5B%0A%09li%20class%3A%20%27selected%27%5D.%0A%20%20%20%20li%20with%3A%20%5B%0A%09html%20span%0A%09%20%20%20%20with%3A%20aWidget%20label%3B%0A%09%20%20%20%20onClick%3A%20%5Bself%20selectTab%3A%20aWidget%5D.%0A%09aWidget%20canBeClosed%20ifTrue%3A%20%5B%0A%09%20%20%20%20html%20span%20%0A%09%09class%3A%20%27close%27%3B%0A%09%09with%3A%20%27x%27%3B%0A%09%09onClick%3A%20%5Bself%20closeTab%3A%20aWidget%5D%5D%5D%0A')}),
  210. smalltalk.TabManager);
  211. smalltalk.TabManager.klass.iVarNames = ['current'];
  212. smalltalk.addMethod(
  213. '_current',
  214. smalltalk.method({
  215. selector: 'current',
  216. category: 'instance creation',
  217. fn: function (){
  218. var self=this;
  219. return smalltalk.send(self['@current'], "_ifNil_", [(function(){return self['@current']=self.klass.superclass.fn.prototype['_new'].apply(self, []);})]);
  220. return self;},
  221. source: unescape('current%0A%20%20%20%20%5Ecurrent%20ifNil%3A%20%5Bcurrent%20%3A%3D%20super%20new%5D%0A')}),
  222. smalltalk.TabManager.klass);
  223. smalltalk.addMethod(
  224. '_new',
  225. smalltalk.method({
  226. selector: 'new',
  227. category: 'instance creation',
  228. fn: function (){
  229. var self=this;
  230. smalltalk.send(self, "_shouldNotImplement", []);
  231. return self;},
  232. source: unescape('new%0A%20%20%20%20self%20shouldNotImplement%0A')}),
  233. smalltalk.TabManager.klass);
  234. smalltalk.addClass('TabWidget', smalltalk.Widget, [], 'IDE');
  235. smalltalk.addMethod(
  236. '_label',
  237. smalltalk.method({
  238. selector: 'label',
  239. category: 'accessing',
  240. fn: function (){
  241. var self=this;
  242. smalltalk.send(self, "_subclassResponsibility", []);
  243. return self;},
  244. source: unescape('label%0A%20%20%20%20self%20subclassResponsibility%0A')}),
  245. smalltalk.TabWidget);
  246. smalltalk.addMethod(
  247. '_open',
  248. smalltalk.method({
  249. selector: 'open',
  250. category: 'actions',
  251. fn: function (){
  252. var self=this;
  253. (function($rec){smalltalk.send($rec, "_addTab_", [self]);return smalltalk.send($rec, "_selectTab_", [self]);})(smalltalk.send(smalltalk.TabManager, "_current", []));
  254. return self;},
  255. source: unescape('open%0A%20%20%20%20TabManager%20current%0A%09addTab%3A%20self%3B%0A%09selectTab%3A%20self%0A')}),
  256. smalltalk.TabWidget);
  257. smalltalk.addMethod(
  258. '_canBeClosed',
  259. smalltalk.method({
  260. selector: 'canBeClosed',
  261. category: 'testing',
  262. fn: function (){
  263. var self=this;
  264. return false;
  265. return self;},
  266. source: unescape('canBeClosed%0A%20%20%20%20%5Efalse%0A')}),
  267. smalltalk.TabWidget);
  268. smalltalk.addMethod(
  269. '_renderOn_',
  270. smalltalk.method({
  271. selector: 'renderOn:',
  272. category: 'rendering',
  273. fn: function (html){
  274. var self=this;
  275. (function($rec){smalltalk.send($rec, "_class_", ["jtalkTool"]);return smalltalk.send($rec, "_with_", [(function(){(function($rec){smalltalk.send($rec, "_class_", ["jt_box"]);return smalltalk.send($rec, "_with_", [(function(){return smalltalk.send(self, "_renderBoxOn_", [html]);})]);})(smalltalk.send(html, "_div", []));return (function($rec){smalltalk.send($rec, "_class_", ["jt_buttons"]);return smalltalk.send($rec, "_with_", [(function(){return smalltalk.send(self, "_renderButtonsOn_", [html]);})]);})(smalltalk.send(html, "_div", []));})]);})(smalltalk.send(html, "_root", []));
  276. return self;},
  277. source: unescape('renderOn%3A%20html%0A%20%20%20%20html%20root%0A%09class%3A%20%27jtalkTool%27%3B%0A%09with%3A%20%5B%0A%09%20%20%20%20html%20div%0A%09%09class%3A%20%27jt_box%27%3B%0A%09%09with%3A%20%5Bself%20renderBoxOn%3A%20html%5D.%0A%09%20%20%20%20html%20div%0A%09%09class%3A%20%27jt_buttons%27%3B%0A%09%09with%3A%20%5Bself%20renderButtonsOn%3A%20html%5D%5D%0A')}),
  278. smalltalk.TabWidget);
  279. smalltalk.addMethod(
  280. '_renderBoxOn_',
  281. smalltalk.method({
  282. selector: 'renderBoxOn:',
  283. category: 'rendering',
  284. fn: function (html){
  285. var self=this;
  286. return self;},
  287. source: unescape('renderBoxOn%3A%20html%0A')}),
  288. smalltalk.TabWidget);
  289. smalltalk.addMethod(
  290. '_renderButtonsOn_',
  291. smalltalk.method({
  292. selector: 'renderButtonsOn:',
  293. category: 'rendering',
  294. fn: function (html){
  295. var self=this;
  296. return self;},
  297. source: unescape('renderButtonsOn%3A%20html%0A')}),
  298. smalltalk.TabWidget);
  299. smalltalk.addMethod(
  300. '_open',
  301. smalltalk.method({
  302. selector: 'open',
  303. category: 'instance creation',
  304. fn: function (){
  305. var self=this;
  306. return smalltalk.send(smalltalk.send(self, "_new", []), "_open", []);
  307. return self;},
  308. source: unescape('open%0A%20%20%20%20%5Eself%20new%20open%0A')}),
  309. smalltalk.TabWidget.klass);
  310. smalltalk.addClass('Workspace', smalltalk.TabWidget, ['textarea'], 'IDE');
  311. smalltalk.addMethod(
  312. '_label',
  313. smalltalk.method({
  314. selector: 'label',
  315. category: 'accessing',
  316. fn: function (){
  317. var self=this;
  318. return unescape("%5BWorkspace%5D");
  319. return self;},
  320. source: unescape('label%0A%20%20%20%20%5E%27%5BWorkspace%5D%27%0A')}),
  321. smalltalk.Workspace);
  322. smalltalk.addMethod(
  323. '_selection',
  324. smalltalk.method({
  325. selector: 'selection',
  326. category: 'accessing',
  327. fn: function (){
  328. var self=this;
  329. return document.selection;
  330. return self;},
  331. source: unescape('selection%0A%20%20%20%20%7B%27return%20document.selection%27%7D%0A')}),
  332. smalltalk.Workspace);
  333. smalltalk.addMethod(
  334. '_selectionStart',
  335. smalltalk.method({
  336. selector: 'selectionStart',
  337. category: 'accessing',
  338. fn: function (){
  339. var self=this;
  340. return jQuery('.jt_workspace')[0].selectionStart;
  341. return self;},
  342. source: unescape('selectionStart%0A%20%20%20%20%7B%27return%20jQuery%28%27%27.jt_workspace%27%27%29%5B0%5D.selectionStart%27%7D%0A')}),
  343. smalltalk.Workspace);
  344. smalltalk.addMethod(
  345. '_selectionEnd',
  346. smalltalk.method({
  347. selector: 'selectionEnd',
  348. category: 'accessing',
  349. fn: function (){
  350. var self=this;
  351. return jQuery('.jt_workspace')[0].selectionEnd;
  352. return self;},
  353. source: unescape('selectionEnd%0A%20%20%20%20%7B%27return%20jQuery%28%27%27.jt_workspace%27%27%29%5B0%5D.selectionEnd%27%7D%0A')}),
  354. smalltalk.Workspace);
  355. smalltalk.addMethod(
  356. '_selectionStart_',
  357. smalltalk.method({
  358. selector: 'selectionStart:',
  359. category: 'accessing',
  360. fn: function (anInteger){
  361. var self=this;
  362. jQuery('.jt_workspace')[0].selectionStart = anInteger;
  363. return self;},
  364. source: unescape('selectionStart%3A%20anInteger%0A%20%20%20%20%7B%27jQuery%28%27%27.jt_workspace%27%27%29%5B0%5D.selectionStart%20%3D%20anInteger%27%7D%0A')}),
  365. smalltalk.Workspace);
  366. smalltalk.addMethod(
  367. '_selectionEnd_',
  368. smalltalk.method({
  369. selector: 'selectionEnd:',
  370. category: 'accessing',
  371. fn: function (anInteger){
  372. var self=this;
  373. jQuery('.jt_workspace')[0].selectionEnd = anInteger;
  374. return self;},
  375. source: unescape('selectionEnd%3A%20anInteger%0A%20%20%20%20%7B%27jQuery%28%27%27.jt_workspace%27%27%29%5B0%5D.selectionEnd%20%3D%20anInteger%27%7D%0A')}),
  376. smalltalk.Workspace);
  377. smalltalk.addMethod(
  378. '_currentLine',
  379. smalltalk.method({
  380. selector: 'currentLine',
  381. category: 'accessing',
  382. fn: function (){
  383. var self=this;
  384. try{var lines=nil;
  385. var startLine=nil;
  386. var endLine=nil;
  387. lines=smalltalk.send(smalltalk.send(smalltalk.send(self['@textarea'], "_asJQuery", []), "_val", []), "_tokenize_", [smalltalk.send(smalltalk.String, "_cr", [])]);
  388. startLine=endLine=(0);
  389. smalltalk.send(lines, "_do_", [(function(each){endLine=smalltalk.send(startLine, "__plus", [smalltalk.send(each, "_size", [])]);startLine=smalltalk.send(endLine, "__plus", [(1)]);return smalltalk.send(smalltalk.send(endLine, "__gt_eq", [smalltalk.send(self, "_selectionStart", [])]), "_ifTrue_", [(function(){smalltalk.send(self, "_selectionEnd_", [endLine]);return (function(){throw({name: 'stReturn', selector: '_currentLine', fn: function(){return each}})})();})]);})]);
  390. return self;
  391. } catch(e) {if(e.name === 'stReturn' && e.selector === '_currentLine'){return e.fn()} throw(e)}},
  392. source: unescape('currentLine%0A%20%20%20%20%7C%20lines%20startLine%20endLine%7C%0A%20%20%20%20lines%20%3A%3D%20textarea%20asJQuery%20val%20tokenize%3A%20String%20cr.%0A%20%20%20%20startLine%20%3A%3D%20endLine%20%3A%3D%200.%0A%20%20%20%20lines%20do%3A%20%5B%3Aeach%20%7C%0A%09endLine%20%3A%3D%20startLine%20+%20each%20size.%0A%09startLine%20%3A%3D%20endLine%20+%201.%0A%09endLine%20%3E%3D%20self%20selectionStart%20ifTrue%3A%20%5B%0A%09%20%20%20%20self%20selectionEnd%3A%20endLine.%0A%09%20%20%20%20%5Eeach%5D%5D%0A')}),
  393. smalltalk.Workspace);
  394. smalltalk.addMethod(
  395. '_handleKeyDown_',
  396. smalltalk.method({
  397. selector: 'handleKeyDown:',
  398. category: 'actions',
  399. fn: function (anEvent){
  400. var self=this;
  401. if(anEvent.ctrlKey) {
  402. if(anEvent.keyCode === 80) { //ctrl+p
  403. self._printIt();
  404. anEvent.preventDefault();
  405. return false;
  406. }
  407. if(anEvent.keyCode === 68) { //ctrl+d
  408. self._doIt();
  409. anEvent.preventDefault();
  410. return false;
  411. }
  412. if(anEvent.keyCode === 73) { //ctrl+i
  413. self._inspectIt();
  414. anEvent.preventDefault();
  415. return false;
  416. }
  417. };
  418. return self;},
  419. source: unescape('handleKeyDown%3A%20anEvent%0A%20%20%20%20%7B%27if%28anEvent.ctrlKey%29%20%7B%0A%09%09if%28anEvent.keyCode%20%3D%3D%3D%2080%29%20%7B%20//ctrl+p%0A%09%09%09self._printIt%28%29%3B%0A%09%09%09anEvent.preventDefault%28%29%3B%0A%09%09%09return%20false%3B%0A%09%09%7D%0A%09%09if%28anEvent.keyCode%20%3D%3D%3D%2068%29%20%7B%20//ctrl+d%0A%09%09%09self._doIt%28%29%3B%0A%09%09%09anEvent.preventDefault%28%29%3B%0A%09%09%09return%20false%3B%0A%09%09%7D%0A%09%09if%28anEvent.keyCode%20%3D%3D%3D%2073%29%20%7B%20//ctrl+i%0A%09%09%09self._inspectIt%28%29%3B%0A%09%09%09anEvent.preventDefault%28%29%3B%0A%09%09%09return%20false%3B%0A%09%09%7D%0A%09%7D%27%7D%0A')}),
  420. smalltalk.Workspace);
  421. smalltalk.addMethod(
  422. '_clearWorkspace',
  423. smalltalk.method({
  424. selector: 'clearWorkspace',
  425. category: 'actions',
  426. fn: function (){
  427. var self=this;
  428. smalltalk.send(smalltalk.send(self['@textarea'], "_asJQuery", []), "_val_", [""]);
  429. return self;},
  430. source: unescape('clearWorkspace%0A%20%20%20%20textarea%20asJQuery%20val%3A%20%27%27%0A')}),
  431. smalltalk.Workspace);
  432. smalltalk.addMethod(
  433. '_doIt',
  434. smalltalk.method({
  435. selector: 'doIt',
  436. category: 'actions',
  437. fn: function (){
  438. var self=this;
  439. var selection=nil;
  440. smalltalk.send(smalltalk.send(self['@textarea'], "_asJQuery", []), "_focus", []);
  441. smalltalk.send(smalltalk.send(smalltalk.send(self, "_selectionStart", []), "__eq", [smalltalk.send(self, "_selectionEnd", [])]), "_ifTrue_ifFalse_", [(function(){return selection=smalltalk.send(self, "_currentLine", []);}), (function(){return selection=smalltalk.send(smalltalk.send(smalltalk.send(self['@textarea'], "_asJQuery", []), "_val", []), "_copyFrom_to_", [smalltalk.send(smalltalk.send(self, "_selectionStart", []), "__plus", [(1)]), smalltalk.send(smalltalk.send(self, "_selectionEnd", []), "__plus", [(1)])]);})]);
  442. return smalltalk.send(self, "_eval_", [selection]);
  443. return self;},
  444. source: unescape('doIt%0A%20%20%20%20%7C%20selection%20%7C%0A%20%20%20%20textarea%20asJQuery%20focus.%0A%20%20%20%20self%20selectionStart%20%3D%20self%20selectionEnd%0A%09ifTrue%3A%20%5Bselection%20%3A%3D%20self%20currentLine%5D%0A%09ifFalse%3A%20%5B%0A%09%20%20%20%20selection%20%3A%3D%20textarea%20asJQuery%20val%20copyFrom%3A%20self%20selectionStart%20+%201%20to%3A%20self%20selectionEnd%20+%201%5D.%0A%20%20%20%20%5Eself%20eval%3A%20selection')}),
  445. smalltalk.Workspace);
  446. smalltalk.addMethod(
  447. '_printIt',
  448. smalltalk.method({
  449. selector: 'printIt',
  450. category: 'actions',
  451. fn: function (){
  452. var self=this;
  453. smalltalk.send(self, "_print_", [smalltalk.send(smalltalk.send(self, "_doIt", []), "_printString", [])]);
  454. return self;},
  455. source: unescape('printIt%0A%20%20%20%20self%20print%3A%20self%20doIt%20printString%0A')}),
  456. smalltalk.Workspace);
  457. smalltalk.addMethod(
  458. '_print_',
  459. smalltalk.method({
  460. selector: 'print:',
  461. category: 'actions',
  462. fn: function (aString){
  463. var self=this;
  464. var start=nil;
  465. start=smalltalk.send(self, "_selectionEnd", []);
  466. smalltalk.send(smalltalk.send(self['@textarea'], "_asJQuery", []), "_val_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self['@textarea'], "_asJQuery", []), "_val", []), "_copyFrom_to_", [(1), start]), "__comma", [" "]), "__comma", [aString]), "__comma", [" "]), "__comma", [smalltalk.send(smalltalk.send(smalltalk.send(self['@textarea'], "_asJQuery", []), "_val", []), "_copyFrom_to_", [smalltalk.send(start, "__plus", [(1)]), smalltalk.send(smalltalk.send(smalltalk.send(self['@textarea'], "_asJQuery", []), "_val", []), "_size", [])])])]);
  467. smalltalk.send(self, "_selectionStart_", [start]);
  468. smalltalk.send(self, "_selectionEnd_", [smalltalk.send(smalltalk.send(start, "__plus", [smalltalk.send(aString, "_size", [])]), "__plus", [(2)])]);
  469. return self;},
  470. source: unescape('print%3A%20aString%0A%20%20%20%20%7C%20start%20%7C%0A%20%20%20%20start%20%3A%3D%20self%20selectionEnd.%0A%20%20%20%20textarea%20asJQuery%20val%3A%20%28%0A%09%28textarea%20asJQuery%20val%20copyFrom%3A%201%20to%3A%20start%29%2C%0A%09%27%20%27%2C%20aString%2C%20%27%20%27%2C%0A%09%28textarea%20asJQuery%20val%20copyFrom%3A%20start%20+%201%20to%3A%20textarea%20asJQuery%20val%20size%29%29.%0A%20%20%20%20self%20selectionStart%3A%20start.%0A%20%20%20%20self%20selectionEnd%3A%20start%20+%20aString%20size%20+%202%0A')}),
  471. smalltalk.Workspace);
  472. smalltalk.addMethod(
  473. '_eval_',
  474. smalltalk.method({
  475. selector: 'eval:',
  476. category: 'actions',
  477. fn: function (aString){
  478. var self=this;
  479. try{var compiler=nil;
  480. var node=nil;
  481. compiler=smalltalk.send(smalltalk.Compiler, "_new", []);
  482. node=smalltalk.send(compiler, "_parseExpression_", [aString]);
  483. smalltalk.send(smalltalk.send(node, "_isParseFailure", []), "_ifTrue_", [(function(){return (function(){throw({name: 'stReturn', selector: '_eval_', fn: function(){return smalltalk.send(self, "_alert_", [smalltalk.send(smalltalk.send(smalltalk.send(node, "_reason", []), "__comma", [unescape("%2C%20position%3A%20")]), "__comma", [smalltalk.send(node, "_position", [])])])}})})();})]);
  484. (function(){throw({name: 'stReturn', selector: '_eval_', fn: function(){return smalltalk.send(compiler, "_loadExpression_", [aString])}})})();
  485. return self;
  486. } catch(e) {if(e.name === 'stReturn' && e.selector === '_eval_'){return e.fn()} throw(e)}},
  487. source: unescape('eval%3A%20aString%0A%20%20%20%20%7C%20compiler%20node%20%7C%0A%20%20%20%20compiler%20%3A%3D%20Compiler%20new.%0A%20%20%20%20node%20%3A%3D%20compiler%20parseExpression%3A%20aString.%0A%20%20%20%20node%20isParseFailure%20ifTrue%3A%20%5B%0A%09%5Eself%20alert%3A%20node%20reason%2C%20%27%2C%20position%3A%20%27%2C%20node%20position%5D.%0A%20%20%20%20%5Ecompiler%20loadExpression%3A%20aString%0A')}),
  488. smalltalk.Workspace);
  489. smalltalk.addMethod(
  490. '_renderBoxOn_',
  491. smalltalk.method({
  492. selector: 'renderBoxOn:',
  493. category: 'rendering',
  494. fn: function (html){
  495. var self=this;
  496. self['@textarea']=smalltalk.send(html, "_textarea", []);
  497. smalltalk.send(smalltalk.send(self['@textarea'], "_asJQuery", []), "_call_", ["tabby"]);
  498. smalltalk.send(self['@textarea'], "_onKeyDown_", [(function(e){return smalltalk.send(self, "_handleKeyDown_", [e]);})]);
  499. (function($rec){smalltalk.send($rec, "_class_", ["jt_workspace"]);return smalltalk.send($rec, "_at_put_", ["spellcheck", "false"]);})(self['@textarea']);
  500. return self;},
  501. source: unescape('renderBoxOn%3A%20html%0A%20%20%20%20textarea%20%3A%3D%20html%20textarea.%0A%20%20%20%20textarea%20asJQuery%20call%3A%20%27tabby%27.%0A%20%20%20%20textarea%20onKeyDown%3A%20%5B%3Ae%20%7C%20self%20handleKeyDown%3A%20e%5D.%0A%20%20%20%20textarea%20%0A%09class%3A%20%27jt_workspace%27%3B%0A%09at%3A%20%27spellcheck%27%20put%3A%20%27false%27%0A')}),
  502. smalltalk.Workspace);
  503. smalltalk.addMethod(
  504. '_renderButtonsOn_',
  505. smalltalk.method({
  506. selector: 'renderButtonsOn:',
  507. category: 'rendering',
  508. fn: function (html){
  509. var self=this;
  510. (function($rec){smalltalk.send($rec, "_with_", ["DoIt"]);smalltalk.send($rec, "_title_", [unescape("ctrl+d")]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_doIt", []);})]);})(smalltalk.send(html, "_button", []));
  511. (function($rec){smalltalk.send($rec, "_with_", ["PrintIt"]);smalltalk.send($rec, "_title_", [unescape("ctrl+p")]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_printIt", []);})]);})(smalltalk.send(html, "_button", []));
  512. (function($rec){smalltalk.send($rec, "_with_", ["InspectIt"]);smalltalk.send($rec, "_title_", [unescape("ctrl+i")]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_inspectIt", []);})]);})(smalltalk.send(html, "_button", []));
  513. (function($rec){smalltalk.send($rec, "_with_", ["Clear workspace"]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_clearWorkspace", []);})]);})(smalltalk.send(html, "_button", []));
  514. return self;},
  515. source: unescape('renderButtonsOn%3A%20html%0A%20%20%20%20html%20button%0A%09with%3A%20%27DoIt%27%3B%0A%09title%3A%20%27ctrl+d%27%3B%0A%09onClick%3A%20%5Bself%20doIt%5D.%0A%20%20%20%20html%20button%0A%09with%3A%20%27PrintIt%27%3B%0A%09title%3A%20%27ctrl+p%27%3B%0A%09onClick%3A%20%5Bself%20printIt%5D.%0A%20%20%20%20html%20button%0A%09with%3A%20%27InspectIt%27%3B%0A%09title%3A%20%27ctrl+i%27%3B%0A%09onClick%3A%20%5Bself%20inspectIt%5D.%0A%20%20%20%20html%20button%0A%09with%3A%20%27Clear%20workspace%27%3B%0A%09onClick%3A%20%5Bself%20clearWorkspace%5D%0A')}),
  516. smalltalk.Workspace);
  517. smalltalk.addMethod(
  518. '_inspectIt',
  519. smalltalk.method({
  520. selector: 'inspectIt',
  521. category: 'actions',
  522. fn: function (){
  523. var self=this;
  524. smalltalk.send(smalltalk.send(self, "_doIt", []), "_inspect", []);
  525. return self;},
  526. source: unescape('inspectIt%0A%20%20%20%20self%20doIt%20inspect%0A')}),
  527. smalltalk.Workspace);
  528. smalltalk.addClass('Transcript', smalltalk.TabWidget, ['textarea'], 'IDE');
  529. smalltalk.addMethod(
  530. '_label',
  531. smalltalk.method({
  532. selector: 'label',
  533. category: 'accessing',
  534. fn: function (){
  535. var self=this;
  536. return unescape("%5BTranscript%5D");
  537. return self;},
  538. source: unescape('label%0A%20%20%20%20%5E%27%5BTranscript%5D%27%0A')}),
  539. smalltalk.Transcript);
  540. smalltalk.addMethod(
  541. '_show_',
  542. smalltalk.method({
  543. selector: 'show:',
  544. category: 'actions',
  545. fn: function (anObject){
  546. var self=this;
  547. smalltalk.send(smalltalk.send(self['@textarea'], "_asJQuery", []), "_val_", [smalltalk.send(smalltalk.send(smalltalk.send(self['@textarea'], "_asJQuery", []), "_val", []), "__comma", [smalltalk.send(anObject, "_asString", [])])]);
  548. return self;},
  549. source: unescape('show%3A%20anObject%0A%20%20%20%20textarea%20asJQuery%20val%3A%20textarea%20asJQuery%20val%2C%20anObject%20asString.%0A%0A')}),
  550. smalltalk.Transcript);
  551. smalltalk.addMethod(
  552. '_cr',
  553. smalltalk.method({
  554. selector: 'cr',
  555. category: 'actions',
  556. fn: function (){
  557. var self=this;
  558. smalltalk.send(smalltalk.send(self['@textarea'], "_asJQuery", []), "_val_", [smalltalk.send(smalltalk.send(smalltalk.send(self['@textarea'], "_asJQuery", []), "_val", []), "__comma", [smalltalk.send(smalltalk.String, "_cr", [])])]);
  559. return self;},
  560. source: unescape('cr%0A%20%20%20%20textarea%20asJQuery%20val%3A%20textarea%20asJQuery%20val%2C%20String%20cr.%0A')}),
  561. smalltalk.Transcript);
  562. smalltalk.addMethod(
  563. '_clear',
  564. smalltalk.method({
  565. selector: 'clear',
  566. category: 'actions',
  567. fn: function (){
  568. var self=this;
  569. smalltalk.send(smalltalk.send(self['@textarea'], "_asJQuery", []), "_val_", [""]);
  570. return self;},
  571. source: unescape('clear%0A%20%20%20%20textarea%20asJQuery%20val%3A%20%27%27%0A')}),
  572. smalltalk.Transcript);
  573. smalltalk.addMethod(
  574. '_renderBoxOn_',
  575. smalltalk.method({
  576. selector: 'renderBoxOn:',
  577. category: 'rendering',
  578. fn: function (html){
  579. var self=this;
  580. self['@textarea']=smalltalk.send(html, "_textarea", []);
  581. smalltalk.send(smalltalk.send(self['@textarea'], "_asJQuery", []), "_call_", ["tabby"]);
  582. (function($rec){smalltalk.send($rec, "_class_", ["jt_transcript"]);return smalltalk.send($rec, "_at_put_", ["spellcheck", "false"]);})(self['@textarea']);
  583. return self;},
  584. source: unescape('renderBoxOn%3A%20html%0A%20%20%20%20textarea%20%3A%3D%20html%20textarea.%0A%20%20%20%20textarea%20asJQuery%20call%3A%20%27tabby%27.%0A%20%20%20%20textarea%20%0A%09class%3A%20%27jt_transcript%27%3B%0A%09at%3A%20%27spellcheck%27%20put%3A%20%27false%27%0A')}),
  585. smalltalk.Transcript);
  586. smalltalk.addMethod(
  587. '_renderButtonsOn_',
  588. smalltalk.method({
  589. selector: 'renderButtonsOn:',
  590. category: 'rendering',
  591. fn: function (html){
  592. var self=this;
  593. (function($rec){smalltalk.send($rec, "_with_", ["Clear transcript"]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_clear", []);})]);})(smalltalk.send(html, "_button", []));
  594. return self;},
  595. source: unescape('renderButtonsOn%3A%20html%0A%20%20%20%20html%20button%0A%09with%3A%20%27Clear%20transcript%27%3B%0A%09onClick%3A%20%5Bself%20clear%5D%0A')}),
  596. smalltalk.Transcript);
  597. smalltalk.Transcript.klass.iVarNames = ['current'];
  598. smalltalk.addMethod(
  599. '_open',
  600. smalltalk.method({
  601. selector: 'open',
  602. category: 'instance creation',
  603. fn: function (){
  604. var self=this;
  605. smalltalk.send(smalltalk.send(self, "_current", []), "_open", []);
  606. return self;},
  607. source: unescape('open%0A%20%20%20%20self%20current%20open%0A')}),
  608. smalltalk.Transcript.klass);
  609. smalltalk.addMethod(
  610. '_new',
  611. smalltalk.method({
  612. selector: 'new',
  613. category: 'instance creation',
  614. fn: function (){
  615. var self=this;
  616. smalltalk.send(self, "_shouldNotImplement", []);
  617. return self;},
  618. source: unescape('new%0A%20%20%20%20self%20shouldNotImplement%0A')}),
  619. smalltalk.Transcript.klass);
  620. smalltalk.addMethod(
  621. '_current',
  622. smalltalk.method({
  623. selector: 'current',
  624. category: 'instance creation',
  625. fn: function (){
  626. var self=this;
  627. return smalltalk.send(self['@current'], "_ifNil_", [(function(){return self['@current']=self.klass.superclass.fn.prototype['_new'].apply(self, []);})]);
  628. return self;},
  629. source: unescape('current%0A%20%20%20%20%5Ecurrent%20ifNil%3A%20%5Bcurrent%20%3A%3D%20super%20new%5D%0A')}),
  630. smalltalk.Transcript.klass);
  631. smalltalk.addMethod(
  632. '_show_',
  633. smalltalk.method({
  634. selector: 'show:',
  635. category: 'printing',
  636. fn: function (anObject){
  637. var self=this;
  638. smalltalk.send(smalltalk.send(self, "_current", []), "_show_", [anObject]);
  639. return self;},
  640. source: unescape('show%3A%20anObject%0A%20%20%20%20self%20current%20show%3A%20anObject%0A')}),
  641. smalltalk.Transcript.klass);
  642. smalltalk.addMethod(
  643. '_cr',
  644. smalltalk.method({
  645. selector: 'cr',
  646. category: 'printing',
  647. fn: function (){
  648. var self=this;
  649. smalltalk.send(smalltalk.send(self, "_current", []), "_show_", [smalltalk.send(smalltalk.String, "_cr", [])]);
  650. return self;},
  651. source: unescape('cr%0A%20%20%20%20self%20current%20show%3A%20String%20cr%0A')}),
  652. smalltalk.Transcript.klass);
  653. smalltalk.addMethod(
  654. '_clear',
  655. smalltalk.method({
  656. selector: 'clear',
  657. category: 'printing',
  658. fn: function (){
  659. var self=this;
  660. smalltalk.send(smalltalk.send(self, "_current", []), "_clear", []);
  661. return self;},
  662. source: unescape('clear%0A%20%20%20%20self%20current%20clear%0A')}),
  663. smalltalk.Transcript.klass);
  664. smalltalk.addClass('Browser', smalltalk.TabWidget, ['selectedCategory', 'selectedClass', 'selectedProtocol', 'selectedMethod', 'commitButton', 'categoriesList', 'classesList', 'protocolsList', 'methodsList', 'sourceTextarea', 'tabsList', 'selectedTab', 'saveButton', 'classButtons', 'methodButtons', 'unsavedChanges'], 'IDE');
  665. smalltalk.addMethod(
  666. '_initialize',
  667. smalltalk.method({
  668. selector: 'initialize',
  669. category: 'initialization',
  670. fn: function (){
  671. var self=this;
  672. self.klass.superclass.fn.prototype['_initialize'].apply(self, []);
  673. self['@selectedTab']="instance";
  674. self['@unsavedChanges']=false;
  675. return self;},
  676. source: unescape('initialize%0A%20%20%20%20super%20initialize.%0A%20%20%20%20selectedTab%20%3A%3D%20%23instance.%0A%20%20%20%20unsavedChanges%20%3A%3D%20false%0A')}),
  677. smalltalk.Browser);
  678. smalltalk.addMethod(
  679. '_label',
  680. smalltalk.method({
  681. selector: 'label',
  682. category: 'accessing',
  683. fn: function (){
  684. var self=this;
  685. return smalltalk.send(self['@selectedClass'], "_ifNil_ifNotNil_", [(function(){return unescape("Browser%20%28nil%29");}), (function(){return smalltalk.send(self['@selectedClass'], "_name", []);})]);
  686. return self;},
  687. source: unescape('label%0A%20%20%20%20%5EselectedClass%20%0A%09ifNil%3A%20%5B%27Browser%20%28nil%29%27%5D%0A%09ifNotNil%3A%20%5BselectedClass%20name%5D%0A')}),
  688. smalltalk.Browser);
  689. smalltalk.addMethod(
  690. '_categories',
  691. smalltalk.method({
  692. selector: 'categories',
  693. category: 'accessing',
  694. fn: function (){
  695. var self=this;
  696. var categories=nil;
  697. categories=smalltalk.send(smalltalk.Array, "_new", []);
  698. smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.Smalltalk, "_current", []), "_classes", []), "_do_", [(function(each){return smalltalk.send(smalltalk.send(categories, "_includes_", [smalltalk.send(each, "_category", [])]), "_ifFalse_", [(function(){return smalltalk.send(categories, "_add_", [smalltalk.send(each, "_category", [])]);})]);})]);
  699. return smalltalk.send(categories, "_sort", []);
  700. return self;},
  701. source: unescape('categories%0A%20%20%20%20%7C%20categories%20%7C%0A%20%20%20%20categories%20%3A%3D%20Array%20new.%0A%20%20%20%20Smalltalk%20current%20classes%20do%3A%20%5B%3Aeach%20%7C%0A%09%28categories%20includes%3A%20each%20category%29%20ifFalse%3A%20%5B%0A%09%20%20%20%20categories%20add%3A%20each%20category%5D%5D.%0A%20%20%20%20%5Ecategories%20sort%0A')}),
  702. smalltalk.Browser);
  703. smalltalk.addMethod(
  704. '_classes',
  705. smalltalk.method({
  706. selector: 'classes',
  707. category: 'accessing',
  708. fn: function (){
  709. var self=this;
  710. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.Smalltalk, "_current", []), "_classes", []), "_select_", [(function(each){return smalltalk.send(smalltalk.send(each, "_category", []), "__eq", [self['@selectedCategory']]);})]), "_sort_", [(function(a, b){return smalltalk.send(smalltalk.send(a, "_name", []), "__gt", [smalltalk.send(b, "_name", [])]);})]);
  711. return self;},
  712. source: unescape('classes%0A%20%20%20%20%5E%28Smalltalk%20current%20classes%20%0A%09select%3A%20%5B%3Aeach%20%7C%20each%20category%20%3D%20selectedCategory%5D%29%0A%09sort%3A%20%5B%3Aa%20%3Ab%20%7C%20a%20name%20%3E%20b%20name%5D%0A')}),
  713. smalltalk.Browser);
  714. smalltalk.addMethod(
  715. '_protocols',
  716. smalltalk.method({
  717. selector: 'protocols',
  718. category: 'accessing',
  719. fn: function (){
  720. var self=this;
  721. try{var klass=nil;
  722. var protocols=nil;
  723. protocols=smalltalk.send(smalltalk.Array, "_new", []);
  724. smalltalk.send(self['@selectedClass'], "_ifNotNil_", [(function(){smalltalk.send(smalltalk.send(self['@selectedTab'], "__eq", ["comment"]), "_ifTrue_", [(function(){return (function(){throw({name: 'stReturn', selector: '_protocols', fn: function(){return []}})})();})]);klass=smalltalk.send(smalltalk.send(self['@selectedTab'], "__eq", ["instance"]), "_ifTrue_ifFalse_", [(function(){return self['@selectedClass'];}), (function(){return smalltalk.send(self['@selectedClass'], "_class", []);})]);smalltalk.send(smalltalk.send(smalltalk.send(klass, "_methodDictionary", []), "_isEmpty", []), "_ifTrue_", [(function(){return smalltalk.send(protocols, "_add_", ["not yet classified"]);})]);return smalltalk.send(smalltalk.send(klass, "_methodDictionary", []), "_do_", [(function(each){return smalltalk.send(smalltalk.send(protocols, "_includes_", [smalltalk.send(each, "_category", [])]), "_ifFalse_", [(function(){return smalltalk.send(protocols, "_add_", [smalltalk.send(each, "_category", [])]);})]);})]);})]);
  725. (function(){throw({name: 'stReturn', selector: '_protocols', fn: function(){return smalltalk.send(protocols, "_sort", [])}})})();
  726. return self;
  727. } catch(e) {if(e.name === 'stReturn' && e.selector === '_protocols'){return e.fn()} throw(e)}},
  728. source: unescape('protocols%0A%20%20%20%20%7C%20klass%20protocols%20%7C%0A%20%20%20%20protocols%20%3A%3D%20Array%20new.%0A%20%20%20%20selectedClass%20ifNotNil%3A%20%5B%0A%09selectedTab%20%3D%20%23comment%20ifTrue%3A%20%5B%5E%23%28%29%5D.%0A%09klass%20%3A%3D%20selectedTab%20%3D%20%23instance%0A%09%20%20%20%20ifTrue%3A%20%5BselectedClass%5D%0A%09%20%20%20%20ifFalse%3A%20%5BselectedClass%20class%5D.%0A%09klass%20methodDictionary%20isEmpty%20ifTrue%3A%20%5B%0A%09%20%20%20%20protocols%20add%3A%20%27not%20yet%20classified%27%5D.%0A%09klass%20methodDictionary%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20%28protocols%20includes%3A%20each%20category%29%20ifFalse%3A%20%5B%0A%09%09protocols%20add%3A%20each%20category%5D%5D%5D.%0A%20%20%20%20%5Eprotocols%20sort%0A')}),
  729. smalltalk.Browser);
  730. smalltalk.addMethod(
  731. '_methods',
  732. smalltalk.method({
  733. selector: 'methods',
  734. category: 'accessing',
  735. fn: function (){
  736. var self=this;
  737. try{var klass=nil;
  738. smalltalk.send(smalltalk.send(self['@selectedTab'], "__eq", ["comment"]), "_ifTrue_", [(function(){return (function(){throw({name: 'stReturn', selector: '_methods', fn: function(){return []}})})();})]);
  739. smalltalk.send(self['@selectedClass'], "_ifNotNil_", [(function(){return klass=smalltalk.send(smalltalk.send(self['@selectedTab'], "__eq", ["instance"]), "_ifTrue_ifFalse_", [(function(){return self['@selectedClass'];}), (function(){return smalltalk.send(self['@selectedClass'], "_class", []);})]);})]);
  740. (function(){throw({name: 'stReturn', selector: '_methods', fn: function(){return smalltalk.send(smalltalk.send(self['@selectedProtocol'], "_ifNil_ifNotNil_", [(function(){return smalltalk.send(klass, "_ifNil_ifNotNil_", [(function(){return [];}), (function(){return smalltalk.send(smalltalk.send(klass, "_methodDictionary", []), "_values", []);})]);}), (function(){return smalltalk.send(smalltalk.send(smalltalk.send(klass, "_methodDictionary", []), "_values", []), "_select_", [(function(each){return smalltalk.send(smalltalk.send(each, "_category", []), "__eq", [self['@selectedProtocol']]);})]);})]), "_sort_", [(function(a, b){return smalltalk.send(smalltalk.send(a, "_selector", []), "__gt", [smalltalk.send(b, "_selector", [])]);})])}})})();
  741. return self;
  742. } catch(e) {if(e.name === 'stReturn' && e.selector === '_methods'){return e.fn()} throw(e)}},
  743. source: unescape('methods%0A%20%20%20%20%7C%20klass%20%7C%0A%20%20%20%20selectedTab%20%3D%20%23comment%20ifTrue%3A%20%5B%5E%23%28%29%5D.%0A%20%20%20%20selectedClass%20ifNotNil%3A%20%5B%0A%09klass%20%3A%3D%20selectedTab%20%3D%20%23instance%0A%09%20%20%20%20ifTrue%3A%20%5BselectedClass%5D%0A%09%20%20%20%20ifFalse%3A%20%5BselectedClass%20class%5D%5D.%0A%20%20%20%20%5E%28selectedProtocol%20%0A%09ifNil%3A%20%5B%0A%09%20%20%20%20klass%20%0A%09%09ifNil%3A%20%5B%23%28%29%5D%20%0A%09%09ifNotNil%3A%20%5Bklass%20methodDictionary%20values%5D%5D%0A%09ifNotNil%3A%20%5B%0A%09%20%20%20%20klass%20methodDictionary%20values%20select%3A%20%5B%3Aeach%20%7C%0A%09%09each%20category%20%3D%20selectedProtocol%5D%5D%29%20sort%3A%20%5B%3Aa%20%3Ab%20%7C%20a%20selector%20%3E%20b%20selector%5D%0A')}),
  744. smalltalk.Browser);
  745. smalltalk.addMethod(
  746. '_source',
  747. smalltalk.method({
  748. selector: 'source',
  749. category: 'accessing',
  750. fn: function (){
  751. var self=this;
  752. try{smalltalk.send(smalltalk.send(self['@selectedTab'], "__eq", ["comment"]), "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '_source', fn: function(){return smalltalk.send(smalltalk.send(smalltalk.send(self['@selectedProtocol'], "_notNil", []), "_or_", [(function(){return smalltalk.send(self['@selectedMethod'], "_notNil", []);})]), "_ifFalse_ifTrue_", [(function(){return smalltalk.send(self, "_declarationSource", []);}), (function(){return smalltalk.send(self, "_methodSource", []);})])}})})();})]);
  753. (function(){throw({name: 'stReturn', selector: '_source', fn: function(){return smalltalk.send(self['@selectedClass'], "_ifNil_ifNotNil_", [(function(){return "";}), (function(){return smalltalk.send(self, "_classCommentSource", []);})])}})})();
  754. return self;
  755. } catch(e) {if(e.name === 'stReturn' && e.selector === '_source'){return e.fn()} throw(e)}},
  756. source: unescape('source%0A%20%20%20%20selectedTab%20%3D%20%23comment%20ifFalse%3A%20%5B%0A%09%5E%28selectedProtocol%20notNil%20or%3A%20%5BselectedMethod%20notNil%5D%29%0A%09%20%20%20%20ifFalse%3A%20%5Bself%20declarationSource%5D%0A%09%20%20%20%20ifTrue%3A%20%5Bself%20methodSource%5D%5D.%0A%20%20%20%20%5EselectedClass%0A%09ifNil%3A%20%5B%27%27%5D%0A%09ifNotNil%3A%20%5Bself%20classCommentSource%5D%0A')}),
  757. smalltalk.Browser);
  758. smalltalk.addMethod(
  759. '_methodSource',
  760. smalltalk.method({
  761. selector: 'methodSource',
  762. category: 'accessing',
  763. fn: function (){
  764. var self=this;
  765. return smalltalk.send(self['@selectedMethod'], "_ifNil_ifNotNil_", [(function(){return smalltalk.send(self, "_dummyMethodSource", []);}), (function(){return smalltalk.send(self['@selectedMethod'], "_source", []);})]);
  766. return self;},
  767. source: unescape('methodSource%0A%20%20%20%20%5EselectedMethod%0A%09ifNil%3A%20%5Bself%20dummyMethodSource%5D%0A%09ifNotNil%3A%20%5BselectedMethod%20source%5D%0A')}),
  768. smalltalk.Browser);
  769. smalltalk.addMethod(
  770. '_dummyMethodSource',
  771. smalltalk.method({
  772. selector: 'dummyMethodSource',
  773. category: 'accessing',
  774. fn: function (){
  775. var self=this;
  776. return unescape("messageSelectorAndArgumentNames%0A%09%22comment%20stating%20purpose%20of%20message%22%0A%0A%09%7C%20temporary%20variable%20names%20%7C%0A%09statements");
  777. return self;},
  778. source: unescape('dummyMethodSource%0A%20%20%20%20%5E%27messageSelectorAndArgumentNames%0A%09%22comment%20stating%20purpose%20of%20message%22%0A%0A%09%7C%20temporary%20variable%20names%20%7C%0A%09statements%27%0A')}),
  779. smalltalk.Browser);
  780. smalltalk.addMethod(
  781. '_declarationSource',
  782. smalltalk.method({
  783. selector: 'declarationSource',
  784. category: 'accessing',
  785. fn: function (){
  786. var self=this;
  787. return smalltalk.send(smalltalk.send(self['@selectedTab'], "__eq", ["instance"]), "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_classDeclarationSource", []);}), (function(){return smalltalk.send(self, "_metaclassDeclarationSource", []);})]);
  788. return self;},
  789. source: unescape('declarationSource%0A%20%20%20%20%5EselectedTab%20%3D%20%23instance%0A%09ifTrue%3A%20%5Bself%20classDeclarationSource%5D%0A%09ifFalse%3A%20%5Bself%20metaclassDeclarationSource%5D%0A')}),
  790. smalltalk.Browser);
  791. smalltalk.addMethod(
  792. '_classDeclarationSource',
  793. smalltalk.method({
  794. selector: 'classDeclarationSource',
  795. category: 'accessing',
  796. fn: function (){
  797. var self=this;
  798. var stream=nil;
  799. stream=smalltalk.send("", "_writeStream", []);
  800. smalltalk.send(self['@selectedClass'], "_ifNotNil_", [(function(){(function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(self['@selectedClass'], "_superclass", []), "_asString", [])]);smalltalk.send($rec, "_nextPutAll_", [unescape("%20subclass%3A%20%23")]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self['@selectedClass'], "_name", [])]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.String, "_cr", []), "__comma", [smalltalk.send(smalltalk.String, "_tab", [])])]);return smalltalk.send($rec, "_nextPutAll_", [unescape("instanceVariableNames%3A%20%27")]);})(stream);smalltalk.send(smalltalk.send(self['@selectedClass'], "_instanceVariableNames", []), "_do_separatedBy_", [(function(each){return smalltalk.send(stream, "_nextPutAll_", [each]);}), (function(){return smalltalk.send(stream, "_nextPutAll_", [" "]);})]);return (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(unescape("%27"), "__comma", [smalltalk.send(smalltalk.String, "_cr", [])]), "__comma", [smalltalk.send(smalltalk.String, "_tab", [])])]);smalltalk.send($rec, "_nextPutAll_", [unescape("category%3A%20%27")]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self['@selectedClass'], "_category", [])]);return smalltalk.send($rec, "_nextPutAll_", [unescape("%27")]);})(stream);})]);
  801. return smalltalk.send(stream, "_contents", []);
  802. return self;},
  803. source: unescape('classDeclarationSource%0A%20%20%20%20%7C%20stream%20%7C%0A%20%20%20%20stream%20%3A%3D%20%27%27%20writeStream.%0A%20%20%20%20selectedClass%20ifNotNil%3A%20%5B%0A%09stream%20%0A%09%20%20%20%20nextPutAll%3A%20selectedClass%20superclass%20asString%3B%0A%09%20%20%20%20nextPutAll%3A%20%27%20subclass%3A%20%23%27%3B%0A%09%20%20%20%20nextPutAll%3A%20selectedClass%20name%3B%0A%09%20%20%20%20nextPutAll%3A%20String%20cr%2C%20String%20tab%3B%0A%09%20%20%20%20nextPutAll%3A%20%27instanceVariableNames%3A%20%27%27%27.%0A%09selectedClass%20instanceVariableNames%20%0A%09%20%20%20%20do%3A%20%5B%3Aeach%20%7C%20stream%20nextPutAll%3A%20each%5D%20%0A%09%20%20%20%20separatedBy%3A%20%5Bstream%20nextPutAll%3A%20%27%20%27%5D.%0A%09stream%0A%09%20%20%20%20nextPutAll%3A%20%27%27%27%27%2C%20String%20cr%2C%20String%20tab%3B%0A%09%20%20%20%20nextPutAll%3A%20%27category%3A%20%27%27%27%3B%0A%09%20%20%20%20nextPutAll%3A%20selectedClass%20category%3B%0A%09%20%20%20%20nextPutAll%3A%20%27%27%27%27%5D.%0A%20%20%20%20%5Estream%20contents%0A')}),
  804. smalltalk.Browser);
  805. smalltalk.addMethod(
  806. '_metaclassDeclarationSource',
  807. smalltalk.method({
  808. selector: 'metaclassDeclarationSource',
  809. category: 'accessing',
  810. fn: function (){
  811. var self=this;
  812. var stream=nil;
  813. stream=smalltalk.send("", "_writeStream", []);
  814. smalltalk.send(self['@selectedClass'], "_ifNotNil_", [(function(){(function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self['@selectedClass'], "_asString", [])]);smalltalk.send($rec, "_nextPutAll_", [" class "]);return smalltalk.send($rec, "_nextPutAll_", [unescape("instanceVariableNames%3A%20%27")]);})(stream);smalltalk.send(smalltalk.send(smalltalk.send(self['@selectedClass'], "_class", []), "_instanceVariableNames", []), "_do_separatedBy_", [(function(each){return smalltalk.send(stream, "_nextPutAll_", [each]);}), (function(){return smalltalk.send(stream, "_nextPutAll_", [" "]);})]);return smalltalk.send(stream, "_nextPutAll_", [unescape("%27")]);})]);
  815. return smalltalk.send(stream, "_contents", []);
  816. return self;},
  817. source: unescape('metaclassDeclarationSource%0A%20%20%20%20%7C%20stream%20%7C%0A%20%20%20%20stream%20%3A%3D%20%27%27%20writeStream.%0A%20%20%20%20selectedClass%20ifNotNil%3A%20%5B%0A%09stream%20%0A%09%20%20%20%20nextPutAll%3A%20selectedClass%20asString%3B%0A%09%20%20%20%20nextPutAll%3A%20%27%20class%20%27%3B%0A%09%20%20%20%20nextPutAll%3A%20%27instanceVariableNames%3A%20%27%27%27.%0A%09selectedClass%20class%20instanceVariableNames%0A%09%20%20%20%20do%3A%20%5B%3Aeach%20%7C%20stream%20nextPutAll%3A%20each%5D%0A%09%20%20%20%20separatedBy%3A%20%5Bstream%20nextPutAll%3A%20%27%20%27%5D.%0A%09stream%20nextPutAll%3A%20%27%27%27%27%5D.%0A%20%20%20%20%5Estream%20contents%0A')}),
  818. smalltalk.Browser);
  819. smalltalk.addMethod(
  820. '_classCommentSource',
  821. smalltalk.method({
  822. selector: 'classCommentSource',
  823. category: 'accessing',
  824. fn: function (){
  825. var self=this;
  826. return smalltalk.send(self['@selectedClass'], "_comment", []);
  827. return self;},
  828. source: unescape('classCommentSource%0A%20%20%20%20%5EselectedClass%20comment%0A')}),
  829. smalltalk.Browser);
  830. smalltalk.addMethod(
  831. '_enableSaveButton',
  832. smalltalk.method({
  833. selector: 'enableSaveButton',
  834. category: 'actions',
  835. fn: function (){
  836. var self=this;
  837. smalltalk.send(self['@saveButton'], "_removeAt_", ["disabled"]);
  838. self['@unsavedChanges']=true;
  839. return self;},
  840. source: unescape('enableSaveButton%0A%20%20%20%20saveButton%20removeAt%3A%20%27disabled%27.%0A%20%20%20%20unsavedChanges%20%3A%3D%20true%0A')}),
  841. smalltalk.Browser);
  842. smalltalk.addMethod(
  843. '_disableSaveButton',
  844. smalltalk.method({
  845. selector: 'disableSaveButton',
  846. category: 'actions',
  847. fn: function (){
  848. var self=this;
  849. smalltalk.send(self['@saveButton'], "_ifNotNil_", [(function(){return smalltalk.send(self['@saveButton'], "_at_put_", ["disabled", true]);})]);
  850. self['@unsavedChanges']=false;
  851. return self;},
  852. source: unescape('disableSaveButton%0A%20%20%20%20saveButton%20ifNotNil%3A%20%5B%0A%09saveButton%20at%3A%20%27disabled%27%20put%3A%20true%5D.%0A%20%20%20%20unsavedChanges%20%3A%3D%20false%0A')}),
  853. smalltalk.Browser);
  854. smalltalk.addMethod(
  855. '_hideClassButtons',
  856. smalltalk.method({
  857. selector: 'hideClassButtons',
  858. category: 'actions',
  859. fn: function (){
  860. var self=this;
  861. smalltalk.send(smalltalk.send(self['@classButtons'], "_asJQuery", []), "_hide", []);
  862. return self;},
  863. source: unescape('hideClassButtons%0A%20%20%20%20classButtons%20asJQuery%20hide%0A')}),
  864. smalltalk.Browser);
  865. smalltalk.addMethod(
  866. '_showClassButtons',
  867. smalltalk.method({
  868. selector: 'showClassButtons',
  869. category: 'actions',
  870. fn: function (){
  871. var self=this;
  872. smalltalk.send(smalltalk.send(self['@classButtons'], "_asJQuery", []), "_show", []);
  873. return self;},
  874. source: unescape('showClassButtons%0A%20%20%20%20classButtons%20asJQuery%20show%0A')}),
  875. smalltalk.Browser);
  876. smalltalk.addMethod(
  877. '_hideMethodButtons',
  878. smalltalk.method({
  879. selector: 'hideMethodButtons',
  880. category: 'actions',
  881. fn: function (){
  882. var self=this;
  883. smalltalk.send(smalltalk.send(self['@methodButtons'], "_asJQuery", []), "_hide", []);
  884. return self;},
  885. source: unescape('hideMethodButtons%0A%20%20%20%20methodButtons%20asJQuery%20hide%0A')}),
  886. smalltalk.Browser);
  887. smalltalk.addMethod(
  888. '_showMethodButtons',
  889. smalltalk.method({
  890. selector: 'showMethodButtons',
  891. category: 'actions',
  892. fn: function (){
  893. var self=this;
  894. smalltalk.send(smalltalk.send(self['@methodButtons'], "_asJQuery", []), "_show", []);
  895. return self;},
  896. source: unescape('showMethodButtons%0A%20%20%20%20methodButtons%20asJQuery%20show%0A')}),
  897. smalltalk.Browser);
  898. smalltalk.addMethod(
  899. '_compile',
  900. smalltalk.method({
  901. selector: 'compile',
  902. category: 'actions',
  903. fn: function (){
  904. var self=this;
  905. smalltalk.send(self, "_disableSaveButton", []);
  906. smalltalk.send(smalltalk.send(self['@selectedTab'], "__eq", ["comment"]), "_ifTrue_", [(function(){return smalltalk.send(self['@selectedClass'], "_ifNotNil_", [(function(){return smalltalk.send(self, "_compileClassComment", []);})]);})]);
  907. smalltalk.send(smalltalk.send(smalltalk.send(self['@selectedProtocol'], "_notNil", []), "_or_", [(function(){return smalltalk.send(self['@selectedMethod'], "_notNil", []);})]), "_ifFalse_ifTrue_", [(function(){return smalltalk.send(self, "_compileDefinition", []);}), (function(){return smalltalk.send(self, "_compileMethodDefinition", []);})]);
  908. return self;},
  909. source: unescape('compile%0A%20%20%20%20self%20disableSaveButton.%0A%20%20%20%20selectedTab%20%3D%20%23comment%20ifTrue%3A%20%5B%0A%09selectedClass%20ifNotNil%3A%20%5B%0A%09%20%20%20%20self%20compileClassComment%5D%5D.%0A%20%20%20%20%28selectedProtocol%20notNil%20or%3A%20%5BselectedMethod%20notNil%5D%29%0A%09ifFalse%3A%20%5Bself%20compileDefinition%5D%0A%09ifTrue%3A%20%5Bself%20compileMethodDefinition%5D%0A')}),
  910. smalltalk.Browser);
  911. smalltalk.addMethod(
  912. '_compileClassComment',
  913. smalltalk.method({
  914. selector: 'compileClassComment',
  915. category: 'actions',
  916. fn: function (){
  917. var self=this;
  918. smalltalk.send(self['@selectedClass'], "_comment_", [smalltalk.send(smalltalk.send(self['@sourceTextarea'], "_asJQuery", []), "_val", [])]);
  919. return self;},
  920. source: unescape('compileClassComment%0A%20%20%20%20selectedClass%20comment%3A%20sourceTextarea%20asJQuery%20val%0A')}),
  921. smalltalk.Browser);
  922. smalltalk.addMethod(
  923. '_compileMethodDefinition',
  924. smalltalk.method({
  925. selector: 'compileMethodDefinition',
  926. category: 'actions',
  927. fn: function (){
  928. var self=this;
  929. smalltalk.send(smalltalk.send(self['@selectedTab'], "__eq", ["instance"]), "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_compileMethodDefinitionFor_", [self['@selectedClass']]);}), (function(){return smalltalk.send(self, "_compileMethodDefinitionFor_", [smalltalk.send(self['@selectedClass'], "_class", [])]);})]);
  930. return self;},
  931. source: unescape('compileMethodDefinition%0A%20%20%20%20selectedTab%20%3D%20%23instance%0A%09ifTrue%3A%20%5Bself%20compileMethodDefinitionFor%3A%20selectedClass%5D%0A%09ifFalse%3A%20%5Bself%20compileMethodDefinitionFor%3A%20selectedClass%20class%5D%0A')}),
  932. smalltalk.Browser);
  933. smalltalk.addMethod(
  934. '_compileMethodDefinitionFor_',
  935. smalltalk.method({
  936. selector: 'compileMethodDefinitionFor:',
  937. category: 'actions',
  938. fn: function (aClass){
  939. var self=this;
  940. try{var compiler=nil;
  941. var method=nil;
  942. var source=nil;
  943. var node=nil;
  944. source=smalltalk.send(smalltalk.send(self['@sourceTextarea'], "_asJQuery", []), "_val", []);
  945. smalltalk.send(self['@selectedProtocol'], "_ifNil_", [(function(){return self['@selectedProtocol']=smalltalk.send(self['@selectedMethod'], "_category", []);})]);
  946. compiler=smalltalk.send(smalltalk.Compiler, "_new", []);
  947. node=smalltalk.send(compiler, "_parse_", [source]);
  948. smalltalk.send(smalltalk.send(node, "_isParseFailure", []), "_ifTrue_", [(function(){return (function(){throw({name: 'stReturn', selector: '_compileMethodDefinitionFor_', fn: function(){return smalltalk.send(self, "_alert_", [smalltalk.send(smalltalk.send(smalltalk.send("PARSE ERROR: ", "__comma", [smalltalk.send(node, "_reason", [])]), "__comma", [unescape("%2C%20position%3A%20")]), "__comma", [smalltalk.send(smalltalk.send(node, "_position", []), "_asString", [])])])}})})();})]);
  949. smalltalk.send(compiler, "_currentClass_", [self['@selectedClass']]);
  950. method=smalltalk.send(compiler, "_eval_", [smalltalk.send(compiler, "_compileNode_", [node])]);
  951. smalltalk.send(method, "_category_", [self['@selectedProtocol']]);
  952. smalltalk.send(smalltalk.send(compiler, "_unknownVariables", []), "_do_", [(function(each){return smalltalk.send(smalltalk.send(self, "_confirm_", [smalltalk.send(smalltalk.send(unescape("Declare%20%27"), "__comma", [each]), "__comma", [unescape("%27%20as%20instance%20variable%3F")])]), "_ifTrue_", [(function(){smalltalk.send(self, "_addInstanceVariableNamed_toClass_", [each, aClass]);return (function(){throw({name: 'stReturn', selector: '_compileMethodDefinitionFor_', fn: function(){return smalltalk.send(self, "_compileMethodDefinitionFor_", [aClass])}})})();})]);})]);
  953. smalltalk.send(aClass, "_addCompiledMethod_", [method]);
  954. smalltalk.send(self, "_updateMethodsList", []);
  955. smalltalk.send(self, "_selectMethod_", [method]);
  956. return self;
  957. } catch(e) {if(e.name === 'stReturn' && e.selector === '_compileMethodDefinitionFor_'){return e.fn()} throw(e)}},
  958. source: unescape('compileMethodDefinitionFor%3A%20aClass%0A%20%20%20%20%7C%20compiler%20method%20source%20node%20%7C%0A%20%20%20%20source%20%3A%3D%20sourceTextarea%20asJQuery%20val.%0A%20%20%20%20selectedProtocol%20ifNil%3A%20%5BselectedProtocol%20%3A%3D%20selectedMethod%20category%5D.%0A%20%20%20%20compiler%20%3A%3D%20Compiler%20new.%0A%20%20%20%20node%20%3A%3D%20compiler%20parse%3A%20source.%0A%20%20%20%20node%20isParseFailure%20ifTrue%3A%20%5B%0A%09%5Eself%20alert%3A%20%27PARSE%20ERROR%3A%20%27%2C%20node%20reason%2C%20%27%2C%20position%3A%20%27%2C%20node%20position%20asString%5D.%0A%20%20%20%20compiler%20currentClass%3A%20selectedClass.%0A%20%20%20%20method%20%3A%3D%20compiler%20eval%3A%20%28compiler%20compileNode%3A%20node%29.%0A%20%20%20%20method%20category%3A%20selectedProtocol.%0A%20%20%20%20compiler%20unknownVariables%20do%3A%20%5B%3Aeach%20%7C%0A%09%28self%20confirm%3A%20%27Declare%20%27%27%27%2C%20each%2C%20%27%27%27%20as%20instance%20variable%3F%27%29%20ifTrue%3A%20%5B%0A%09%09self%20addInstanceVariableNamed%3A%20each%20toClass%3A%20aClass.%0A%09%09%5Eself%20compileMethodDefinitionFor%3A%20aClass%5D%5D.%0A%20%20%20%20aClass%20addCompiledMethod%3A%20method.%0A%20%20%20%20self%20updateMethodsList.%0A%20%20%20%20self%20selectMethod%3A%20method%0A')}),
  959. smalltalk.Browser);
  960. smalltalk.addMethod(
  961. '_compileDefinition',
  962. smalltalk.method({
  963. selector: 'compileDefinition',
  964. category: 'actions',
  965. fn: function (){
  966. var self=this;
  967. var newClass=nil;
  968. newClass=smalltalk.send(smalltalk.send(smalltalk.Compiler, "_new", []), "_loadExpression_", [smalltalk.send(smalltalk.send(self['@sourceTextarea'], "_asJQuery", []), "_val", [])]);
  969. (function($rec){smalltalk.send($rec, "_updateCategoriesList", []);return smalltalk.send($rec, "_updateClassesList", []);})(self);
  970. return self;},
  971. source: unescape('compileDefinition%0A%20%20%20%20%7C%20newClass%20%7C%0A%20%20%20%20newClass%20%3A%3D%20Compiler%20new%20loadExpression%3A%20sourceTextarea%20asJQuery%20val.%0A%20%20%20%20self%20%0A%09updateCategoriesList%3B%0A%09updateClassesList%0A')}),
  972. smalltalk.Browser);
  973. smalltalk.addMethod(
  974. '_commitCategory',
  975. smalltalk.method({
  976. selector: 'commitCategory',
  977. category: 'actions',
  978. fn: function (){
  979. var self=this;
  980. smalltalk.send(self['@selectedCategory'], "_ifNotNil_", [(function(){return (function($rec){smalltalk.send($rec, "_at_put_", ["type", "PUT"]);smalltalk.send($rec, "_at_put_", ["data", smalltalk.send(smalltalk.send(smalltalk.Exporter, "_new", []), "_exportCategory_", [self['@selectedCategory']])]);smalltalk.send($rec, "_at_put_", ["error", (function(){return smalltalk.send(self, "_alert_", [unescape("Commit%20failed%21")]);})]);return smalltalk.send($rec, "_send", []);})(smalltalk.send(smalltalk.Ajax, "_url_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "_commitPath", []), "__comma", [unescape("/")]), "__comma", [self['@selectedCategory']]), "__comma", [".js"])]));})]);
  981. return self;},
  982. source: unescape('commitCategory%0A%20%20%20%20selectedCategory%20ifNotNil%3A%20%5B%0A%09%28Ajax%20url%3A%20self%20class%20commitPath%2C%20%27/%27%2C%20selectedCategory%2C%20%27.js%27%29%0A%09%20%20%20%20at%3A%20%27type%27%20put%3A%20%27PUT%27%3B%0A%09%20%20%20%20at%3A%20%27data%27%20put%3A%20%28Exporter%20new%20exportCategory%3A%20selectedCategory%29%3B%0A%09%20%20%20%20at%3A%20%27error%27%20put%3A%20%5Bself%20alert%3A%20%27Commit%20failed%21%27%5D%3B%0A%09%20%20%20%20send%5D%0A')}),
  983. smalltalk.Browser);
  984. smalltalk.addMethod(
  985. '_cancelChanges',
  986. smalltalk.method({
  987. selector: 'cancelChanges',
  988. category: 'actions',
  989. fn: function (){
  990. var self=this;
  991. return smalltalk.send(self['@unsavedChanges'], "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_confirm_", [unescape("Cancel%20changes%3F")]);}), (function(){return true;})]);
  992. return self;},
  993. source: unescape('cancelChanges%0A%20%20%20%20%5EunsavedChanges%20%0A%09ifTrue%3A%20%5Bself%20confirm%3A%20%27Cancel%20changes%3F%27%5D%0A%09ifFalse%3A%20%5Btrue%5D%0A')}),
  994. smalltalk.Browser);
  995. smalltalk.addMethod(
  996. '_removeClass',
  997. smalltalk.method({
  998. selector: 'removeClass',
  999. category: 'actions',
  1000. fn: function (){
  1001. var self=this;
  1002. smalltalk.send(smalltalk.send(self, "_confirm_", [smalltalk.send(smalltalk.send("Do you really want to remove ", "__comma", [smalltalk.send(self['@selectedClass'], "_name", [])]), "__comma", [unescape("%3F")])]), "_ifTrue_", [(function(){smalltalk.send(smalltalk.send(smalltalk.Smalltalk, "_current", []), "_basicDelete_", [smalltalk.send(self['@selectedClass'], "_name", [])]);return smalltalk.send(self, "_selectClass_", [nil]);})]);
  1003. return self;},
  1004. source: unescape('removeClass%0A%20%20%20%20%28self%20confirm%3A%20%27Do%20you%20really%20want%20to%20remove%20%27%2C%20selectedClass%20name%2C%20%27%3F%27%29%0A%09ifTrue%3A%20%5B%0A%09%20%20%20%20Smalltalk%20current%20basicDelete%3A%20selectedClass%20name.%0A%09%20%20%20%20self%20selectClass%3A%20nil%5D%0A')}),
  1005. smalltalk.Browser);
  1006. smalltalk.addMethod(
  1007. '_removeMethod',
  1008. smalltalk.method({
  1009. selector: 'removeMethod',
  1010. category: 'actions',
  1011. fn: function (){
  1012. var self=this;
  1013. smalltalk.send(smalltalk.send(self, "_cancelChanges", []), "_ifTrue_", [(function(){return smalltalk.send(smalltalk.send(self, "_confirm_", [smalltalk.send(smalltalk.send(unescape("Do%20you%20really%20want%20to%20remove%20%23"), "__comma", [smalltalk.send(self['@selectedMethod'], "_selector", [])]), "__comma", [unescape("%3F")])]), "_ifTrue_", [(function(){smalltalk.send(smalltalk.send(self['@selectedTab'], "__eq", ["instance"]), "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@selectedClass'], "_removeCompiledMethod_", [self['@selectedMethod']]);}), (function(){return smalltalk.send(smalltalk.send(self['@selectedClass'], "_class", []), "_removeCompiledMethod_", [self['@selectedMethod']]);})]);return smalltalk.send(self, "_selectMethod_", [nil]);})]);})]);
  1014. return self;},
  1015. source: unescape('removeMethod%0A%20%20%20%20self%20cancelChanges%20ifTrue%3A%20%5B%0A%09%28self%20confirm%3A%20%27Do%20you%20really%20want%20to%20remove%20%23%27%2C%20selectedMethod%20selector%2C%20%27%3F%27%29%0A%09%20%20%20%20ifTrue%3A%20%5B%0A%09%09selectedTab%20%3D%20%23instance%20%0A%09%09%09ifTrue%3A%20%5BselectedClass%20removeCompiledMethod%3A%20selectedMethod%5D%0A%09%09%09ifFalse%3A%20%5BselectedClass%20class%20removeCompiledMethod%3A%20selectedMethod%5D.%0A%09%09self%20selectMethod%3A%20nil%5D%5D%0A')}),
  1016. smalltalk.Browser);
  1017. smalltalk.addMethod(
  1018. '_setMethodProtocol_',
  1019. smalltalk.method({
  1020. selector: 'setMethodProtocol:',
  1021. category: 'actions',
  1022. fn: function (aString){
  1023. var self=this;
  1024. smalltalk.send(smalltalk.send(self, "_cancelChanges", []), "_ifTrue_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(self, "_protocols", []), "_includes_", [aString]), "_ifFalse_ifTrue_", [(function(){return smalltalk.send(self, "_addNewProtocol", []);}), (function(){smalltalk.send(self['@selectedMethod'], "_category_", [aString]);self['@selectedProtocol']=aString;self['@selectedMethod']=self['@selectedMethod'];return (function($rec){smalltalk.send($rec, "_updateProtocolsList", []);smalltalk.send($rec, "_updateMethodsList", []);return smalltalk.send($rec, "_updateSourceAndButtons", []);})(self);})]);})]);
  1025. return self;},
  1026. source: unescape('setMethodProtocol%3A%20aString%0A%20%20%20%20self%20cancelChanges%20ifTrue%3A%20%5B%0A%09%28self%20protocols%20includes%3A%20aString%29%0A%09%20%20%20%20ifFalse%3A%20%5Bself%20addNewProtocol%5D%0A%09%20%20%20%20ifTrue%3A%20%5B%0A%09%09selectedMethod%20category%3A%20aString.%0A%09%09selectedProtocol%20%3A%3D%20aString.%0A%09%09selectedMethod%20%3A%3D%20selectedMethod.%0A%09%09self%20%0A%09%09%20%20%20%20updateProtocolsList%3B%0A%09%09%20%20%20%20updateMethodsList%3B%0A%09%09%20%20%20%20updateSourceAndButtons%5D%5D%0A')}),
  1027. smalltalk.Browser);
  1028. smalltalk.addMethod(
  1029. '_addNewProtocol',
  1030. smalltalk.method({
  1031. selector: 'addNewProtocol',
  1032. category: 'actions',
  1033. fn: function (){
  1034. var self=this;
  1035. var newProtocol=nil;
  1036. newProtocol=smalltalk.send(self, "_prompt_", ["New method protocol"]);
  1037. smalltalk.send(smalltalk.send(newProtocol, "_notEmpty", []), "_ifTrue_", [(function(){smalltalk.send(self['@selectedMethod'], "_category_", [newProtocol]);return smalltalk.send(self, "_setMethodProtocol_", [newProtocol]);})]);
  1038. return self;},
  1039. source: unescape('addNewProtocol%0A%20%20%20%20%7C%20newProtocol%20%7C%0A%20%20%20%20newProtocol%20%3A%3D%20self%20prompt%3A%20%27New%20method%20protocol%27.%0A%20%20%20%20newProtocol%20notEmpty%20ifTrue%3A%20%5B%0A%09selectedMethod%20category%3A%20newProtocol.%0A%09self%20setMethodProtocol%3A%20newProtocol%5D%0A')}),
  1040. smalltalk.Browser);
  1041. smalltalk.addMethod(
  1042. '_selectCategory_',
  1043. smalltalk.method({
  1044. selector: 'selectCategory:',
  1045. category: 'actions',
  1046. fn: function (aCategory){
  1047. var self=this;
  1048. smalltalk.send(smalltalk.send(self, "_cancelChanges", []), "_ifTrue_", [(function(){self['@selectedCategory']=aCategory;self['@selectedClass']=self['@selectedProtocol']=self['@selectedMethod']=nil;return (function($rec){smalltalk.send($rec, "_updateCategoriesList", []);smalltalk.send($rec, "_updateClassesList", []);smalltalk.send($rec, "_updateProtocolsList", []);smalltalk.send($rec, "_updateMethodsList", []);return smalltalk.send($rec, "_updateSourceAndButtons", []);})(self);})]);
  1049. return self;},
  1050. source: unescape('selectCategory%3A%20aCategory%0A%20%20%20%20self%20cancelChanges%20ifTrue%3A%20%5B%0A%09selectedCategory%20%3A%3D%20aCategory.%0A%09selectedClass%20%3A%3D%20selectedProtocol%20%3A%3D%20selectedMethod%20%3A%3D%20%20nil.%0A%09self%20%0A%09%20%20%20%20updateCategoriesList%3B%0A%09%20%20%20%20updateClassesList%3B%0A%09%20%20%20%20updateProtocolsList%3B%0A%09%20%20%20%20updateMethodsList%3B%0A%09%20%20%20%20updateSourceAndButtons%5D%0A')}),
  1051. smalltalk.Browser);
  1052. smalltalk.addMethod(
  1053. '_selectClass_',
  1054. smalltalk.method({
  1055. selector: 'selectClass:',
  1056. category: 'actions',
  1057. fn: function (aClass){
  1058. var self=this;
  1059. smalltalk.send(smalltalk.send(self, "_cancelChanges", []), "_ifTrue_", [(function(){self['@selectedClass']=aClass;self['@selectedProtocol']=self['@selectedMethod']=nil;return (function($rec){smalltalk.send($rec, "_updateClassesList", []);smalltalk.send($rec, "_updateProtocolsList", []);smalltalk.send($rec, "_updateMethodsList", []);return smalltalk.send($rec, "_updateSourceAndButtons", []);})(self);})]);
  1060. return self;},
  1061. source: unescape('selectClass%3A%20aClass%0A%20%20%20%20self%20cancelChanges%20ifTrue%3A%20%5B%0A%09selectedClass%20%3A%3D%20aClass.%0A%09selectedProtocol%20%3A%3D%20selectedMethod%20%3A%3D%20nil.%0A%09self%20%0A%09%20%20%20%20updateClassesList%3B%0A%09%20%20%20%20updateProtocolsList%3B%0A%09%20%20%20%20updateMethodsList%3B%0A%09%20%20%20%20updateSourceAndButtons%5D%0A')}),
  1062. smalltalk.Browser);
  1063. smalltalk.addMethod(
  1064. '_selectProtocol_',
  1065. smalltalk.method({
  1066. selector: 'selectProtocol:',
  1067. category: 'actions',
  1068. fn: function (aString){
  1069. var self=this;
  1070. smalltalk.send(smalltalk.send(self, "_cancelChanges", []), "_ifTrue_", [(function(){self['@selectedProtocol']=aString;self['@selectedMethod']=nil;return (function($rec){smalltalk.send($rec, "_updateProtocolsList", []);smalltalk.send($rec, "_updateMethodsList", []);return smalltalk.send($rec, "_updateSourceAndButtons", []);})(self);})]);
  1071. return self;},
  1072. source: unescape('selectProtocol%3A%20aString%0A%20%20%20%20self%20cancelChanges%20ifTrue%3A%20%5B%0A%09selectedProtocol%20%3A%3D%20aString.%0A%09selectedMethod%20%3A%3D%20nil.%0A%09self%20%0A%09%20%20%20%20updateProtocolsList%3B%0A%09%20%20%20%20updateMethodsList%3B%0A%09%20%20%20%20updateSourceAndButtons%5D%0A')}),
  1073. smalltalk.Browser);
  1074. smalltalk.addMethod(
  1075. '_selectMethod_',
  1076. smalltalk.method({
  1077. selector: 'selectMethod:',
  1078. category: 'actions',
  1079. fn: function (aMethod){
  1080. var self=this;
  1081. smalltalk.send(smalltalk.send(self, "_cancelChanges", []), "_ifTrue_", [(function(){self['@selectedMethod']=aMethod;return (function($rec){smalltalk.send($rec, "_updateProtocolsList", []);smalltalk.send($rec, "_updateMethodsList", []);return smalltalk.send($rec, "_updateSourceAndButtons", []);})(self);})]);
  1082. return self;},
  1083. source: unescape('selectMethod%3A%20aMethod%0A%20%20%20%20self%20cancelChanges%20ifTrue%3A%20%5B%0A%09selectedMethod%20%3A%3D%20aMethod.%0A%09self%20%0A%09%20%20%20%20updateProtocolsList%3B%0A%09%20%20%20%20updateMethodsList%3B%0A%09%20%20%20%20updateSourceAndButtons%5D%0A')}),
  1084. smalltalk.Browser);
  1085. smalltalk.addMethod(
  1086. '_selectTab_',
  1087. smalltalk.method({
  1088. selector: 'selectTab:',
  1089. category: 'actions',
  1090. fn: function (aString){
  1091. var self=this;
  1092. smalltalk.send(smalltalk.send(self, "_cancelChanges", []), "_ifTrue_", [(function(){self['@selectedTab']=aString;smalltalk.send(self, "_selectProtocol_", [nil]);return smalltalk.send(self, "_updateTabsList", []);})]);
  1093. return self;},
  1094. source: unescape('selectTab%3A%20aString%0A%20%20%20%20self%20cancelChanges%20ifTrue%3A%20%5B%0A%09selectedTab%20%3A%3D%20aString.%0A%09self%20selectProtocol%3A%20nil.%0A%09self%20updateTabsList%5D%0A')}),
  1095. smalltalk.Browser);
  1096. smalltalk.addMethod(
  1097. '_renderBoxOn_',
  1098. smalltalk.method({
  1099. selector: 'renderBoxOn:',
  1100. category: 'rendering',
  1101. fn: function (html){
  1102. var self=this;
  1103. (function($rec){smalltalk.send($rec, "_renderTopPanelOn_", [html]);smalltalk.send($rec, "_renderTabsOn_", [html]);return smalltalk.send($rec, "_renderBottomPanelOn_", [html]);})(self);
  1104. return self;},
  1105. source: unescape('renderBoxOn%3A%20html%0A%20%20%20%20self%20%0A%09renderTopPanelOn%3A%20html%3B%0A%09renderTabsOn%3A%20html%3B%0A%09renderBottomPanelOn%3A%20html%0A')}),
  1106. smalltalk.Browser);
  1107. smalltalk.addMethod(
  1108. '_renderTopPanelOn_',
  1109. smalltalk.method({
  1110. selector: 'renderTopPanelOn:',
  1111. category: 'rendering',
  1112. fn: function (html){
  1113. var self=this;
  1114. (function($rec){smalltalk.send($rec, "_class_", ["top"]);return smalltalk.send($rec, "_with_", [(function(){self['@categoriesList']=smalltalk.send(smalltalk.send(html, "_ul", []), "_class_", ["jt_column categories"]);self['@commitButton']=(function($rec){smalltalk.send($rec, "_class_", ["jt_commit"]);smalltalk.send($rec, "_title_", ["Commit classes in this category to disk"]);smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_commitCategory", []);})]);return smalltalk.send($rec, "_with_", ["Commit category"]);})(smalltalk.send(html, "_button", []));self['@classesList']=smalltalk.send(smalltalk.send(html, "_ul", []), "_class_", ["jt_column classes"]);self['@protocolsList']=smalltalk.send(smalltalk.send(html, "_ul", []), "_class_", ["jt_column protocols"]);self['@methodsList']=smalltalk.send(smalltalk.send(html, "_ul", []), "_class_", ["jt_column methods"]);(function($rec){smalltalk.send($rec, "_updateCategoriesList", []);smalltalk.send($rec, "_updateClassesList", []);smalltalk.send($rec, "_updateProtocolsList", []);return smalltalk.send($rec, "_updateMethodsList", []);})(self);return smalltalk.send(smalltalk.send(html, "_div", []), "_class_", ["jt_clear"]);})]);})(smalltalk.send(html, "_div", []));
  1115. return self;},
  1116. source: unescape('renderTopPanelOn%3A%20html%0A%20%20%20%20html%20div%20%0A%09class%3A%20%27top%27%3B%20%0A%09with%3A%20%5B%0A%09%20%20%20%20categoriesList%20%3A%3D%20html%20ul%20class%3A%20%27jt_column%20categories%27.%0A%09%20%20%20%20commitButton%20%3A%3D%20html%20button%20%0A%09%09class%3A%20%27jt_commit%27%3B%0A%09%09title%3A%20%27Commit%20classes%20in%20this%20category%20to%20disk%27%3B%0A%09%09onClick%3A%20%5Bself%20commitCategory%5D%3B%0A%09%09with%3A%20%27Commit%20category%27.%0A%09%20%20%20%20classesList%20%3A%3D%20html%20ul%20class%3A%20%27jt_column%20classes%27.%0A%09%20%20%20%20protocolsList%20%3A%3D%20html%20ul%20class%3A%20%27jt_column%20protocols%27.%0A%09%20%20%20%20methodsList%20%3A%3D%20html%20ul%20class%3A%20%27jt_column%20methods%27.%0A%09%20%20%20%20self%0A%09%09updateCategoriesList%3B%0A%09%09updateClassesList%3B%0A%09%09updateProtocolsList%3B%0A%09%09updateMethodsList.%0A%09%20%20%20%20html%20div%20class%3A%20%27jt_clear%27%5D%0A')}),
  1117. smalltalk.Browser);
  1118. smalltalk.addMethod(
  1119. '_renderTabsOn_',
  1120. smalltalk.method({
  1121. selector: 'renderTabsOn:',
  1122. category: 'rendering',
  1123. fn: function (html){
  1124. var self=this;
  1125. self['@tabsList']=smalltalk.send(smalltalk.send(html, "_ul", []), "_class_", ["jt_tabs"]);
  1126. smalltalk.send(self, "_updateTabsList", []);
  1127. return self;},
  1128. source: unescape('renderTabsOn%3A%20html%0A%20%20%20%20tabsList%20%3A%3D%20html%20ul%20class%3A%20%27jt_tabs%27.%0A%20%20%20%20self%20updateTabsList.%0A')}),
  1129. smalltalk.Browser);
  1130. smalltalk.addMethod(
  1131. '_renderBottomPanelOn_',
  1132. smalltalk.method({
  1133. selector: 'renderBottomPanelOn:',
  1134. category: 'rendering',
  1135. fn: function (html){
  1136. var self=this;
  1137. (function($rec){smalltalk.send($rec, "_class_", ["jt_sourceCode"]);return smalltalk.send($rec, "_with_", [(function(){self['@sourceTextarea']=(function($rec){smalltalk.send($rec, "_onKeyPress_", [(function(){return smalltalk.send(self, "_enableSaveButton", []);})]);smalltalk.send($rec, "_class_", ["source"]);return smalltalk.send($rec, "_at_put_", ["spellcheck", "false"]);})(smalltalk.send(html, "_textarea", []));return smalltalk.send(smalltalk.send(self['@sourceTextarea'], "_asJQuery", []), "_call_", ["tabby"]);})]);})(smalltalk.send(html, "_div", []));
  1138. return self;},
  1139. source: unescape('renderBottomPanelOn%3A%20html%0A%20%20%20%20html%20div%0A%09class%3A%20%27jt_sourceCode%27%3B%0A%09with%3A%20%5B%0A%09%20%20%20%20sourceTextarea%20%3A%3D%20html%20textarea%20%0A%09%09onKeyPress%3A%20%5Bself%20enableSaveButton%5D%3B%0A%09%09class%3A%20%27source%27%3B%0A%09%09at%3A%20%27spellcheck%27%20put%3A%20%27false%27.%0A%09%20%20%20%20sourceTextarea%20asJQuery%20call%3A%20%27tabby%27%5D%0A')}),
  1140. smalltalk.Browser);
  1141. smalltalk.addMethod(
  1142. '_renderButtonsOn_',
  1143. smalltalk.method({
  1144. selector: 'renderButtonsOn:',
  1145. category: 'rendering',
  1146. fn: function (html){
  1147. var self=this;
  1148. self['@saveButton']=smalltalk.send(html, "_button", []);
  1149. (function($rec){smalltalk.send($rec, "_with_", ["Save"]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_compile", []);})]);})(self['@saveButton']);
  1150. self['@methodButtons']=smalltalk.send(html, "_span", []);
  1151. self['@classButtons']=smalltalk.send(html, "_span", []);
  1152. smalltalk.send(self, "_updateSourceAndButtons", []);
  1153. return self;},
  1154. source: unescape('renderButtonsOn%3A%20html%0A%20%20%20%20saveButton%20%3A%3D%20html%20button.%0A%20%20%20%20saveButton%20%0A%09with%3A%20%27Save%27%3B%0A%09onClick%3A%20%5Bself%20compile%5D.%0A%20%20%20%20methodButtons%20%3A%3D%20html%20span.%0A%20%20%20%20classButtons%20%3A%3D%20html%20span.%0A%20%20%20%20self%20updateSourceAndButtons%0A')}),
  1155. smalltalk.Browser);
  1156. smalltalk.addMethod(
  1157. '_updateCategoriesList',
  1158. smalltalk.method({
  1159. selector: 'updateCategoriesList',
  1160. category: 'updating',
  1161. fn: function (){
  1162. var self=this;
  1163. smalltalk.send(self['@categoriesList'], "_contents_", [(function(html){return smalltalk.send(smalltalk.send(self, "_categories", []), "_do_", [(function(each){var li=nil;
  1164. var label=nil;
  1165. smalltalk.send(smalltalk.send(each, "_isEmpty", []), "_ifTrue_ifFalse_", [(function(){return label="Unclassified";}), (function(){return label=each;})]);li=smalltalk.send(html, "_li", []);smalltalk.send(smalltalk.send(self['@selectedCategory'], "__eq", [each]), "_ifTrue_", [(function(){return smalltalk.send(li, "_class_", ["selected"]);})]);return (function($rec){smalltalk.send($rec, "_with_", [label]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_selectCategory_", [each]);})]);})(li);})]);})]);
  1166. return self;},
  1167. source: unescape('updateCategoriesList%0A%20%20%20%20categoriesList%20contents%3A%20%5B%3Ahtml%20%7C%0A%09self%20categories%20do%3A%20%5B%3Aeach%20%7C%7C%20li%20label%20%7C%0A%09%20%20%20%20each%20isEmpty%20%0A%09%09ifTrue%3A%20%5Blabel%20%3A%3D%20%27Unclassified%27%5D%0A%09%09ifFalse%3A%20%5Blabel%20%3A%3D%20each%5D.%0A%09%20%20%20%20li%20%3A%3D%20html%20li.%0A%09%20%20%20%20selectedCategory%20%3D%20each%20ifTrue%3A%20%5B%0A%09%09li%20class%3A%20%27selected%27%5D.%0A%09%20%20%20%20li%0A%09%09with%3A%20label%3B%0A%09%09onClick%3A%20%5Bself%20selectCategory%3A%20each%5D%5D%5D%0A')}),
  1168. smalltalk.Browser);
  1169. smalltalk.addMethod(
  1170. '_updateClassesList',
  1171. smalltalk.method({
  1172. selector: 'updateClassesList',
  1173. category: 'updating',
  1174. fn: function (){
  1175. var self=this;
  1176. smalltalk.send(smalltalk.send(smalltalk.TabManager, "_current", []), "_update", []);
  1177. smalltalk.send(self['@classesList'], "_contents_", [(function(html){return smalltalk.send(smalltalk.send(self, "_classes", []), "_do_", [(function(each){var li=nil;
  1178. li=smalltalk.send(html, "_li", []);smalltalk.send(smalltalk.send(self['@selectedClass'], "__eq", [each]), "_ifTrue_", [(function(){return smalltalk.send(li, "_class_", ["selected"]);})]);return (function($rec){smalltalk.send($rec, "_with_", [smalltalk.send(each, "_name", [])]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_selectClass_", [each]);})]);})(li);})]);})]);
  1179. return self;},
  1180. source: unescape('updateClassesList%0A%20%20%20%20TabManager%20current%20update.%0A%20%20%20%20classesList%20contents%3A%20%5B%3Ahtml%20%7C%0A%09self%20classes%20do%3A%20%5B%3Aeach%20%7C%7C%20li%20%7C%0A%09%20%20%20%20li%20%3A%3D%20html%20li.%0A%09%20%20%20%20selectedClass%20%3D%20each%20ifTrue%3A%20%5B%0A%09%09li%20class%3A%20%27selected%27%5D.%0A%09%20%20%20%20li%0A%09%09with%3A%20each%20name%3B%0A%09%09onClick%3A%20%5Bself%20selectClass%3A%20each%5D%5D%5D%0A')}),
  1181. smalltalk.Browser);
  1182. smalltalk.addMethod(
  1183. '_updateProtocolsList',
  1184. smalltalk.method({
  1185. selector: 'updateProtocolsList',
  1186. category: 'updating',
  1187. fn: function (){
  1188. var self=this;
  1189. smalltalk.send(self['@protocolsList'], "_contents_", [(function(html){return smalltalk.send(smalltalk.send(self, "_protocols", []), "_do_", [(function(each){var li=nil;
  1190. li=smalltalk.send(html, "_li", []);smalltalk.send(smalltalk.send(self['@selectedProtocol'], "__eq", [each]), "_ifTrue_", [(function(){return smalltalk.send(li, "_class_", ["selected"]);})]);return (function($rec){smalltalk.send($rec, "_with_", [each]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_selectProtocol_", [each]);})]);})(li);})]);})]);
  1191. return self;},
  1192. source: unescape('updateProtocolsList%0A%20%20%20%20protocolsList%20contents%3A%20%5B%3Ahtml%20%7C%0A%09self%20protocols%20do%3A%20%5B%3Aeach%20%7C%7C%20li%20%7C%0A%09%20%20%20%20li%20%3A%3D%20html%20li.%0A%09%20%20%20%20selectedProtocol%20%3D%20each%20ifTrue%3A%20%5B%0A%09%09li%20class%3A%20%27selected%27%5D.%0A%09%20%20%20%20li%20%0A%09%09with%3A%20each%3B%0A%09%09onClick%3A%20%5Bself%20selectProtocol%3A%20each%5D%5D%5D%0A')}),
  1193. smalltalk.Browser);
  1194. smalltalk.addMethod(
  1195. '_updateMethodsList',
  1196. smalltalk.method({
  1197. selector: 'updateMethodsList',
  1198. category: 'updating',
  1199. fn: function (){
  1200. var self=this;
  1201. smalltalk.send(self['@methodsList'], "_contents_", [(function(html){return smalltalk.send(smalltalk.send(self, "_methods", []), "_do_", [(function(each){var li=nil;
  1202. li=smalltalk.send(html, "_li", []);smalltalk.send(smalltalk.send(self['@selectedMethod'], "__eq", [each]), "_ifTrue_", [(function(){return smalltalk.send(li, "_class_", ["selected"]);})]);return (function($rec){smalltalk.send($rec, "_with_", [smalltalk.send(each, "_selector", [])]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_selectMethod_", [each]);})]);})(li);})]);})]);
  1203. return self;},
  1204. source: unescape('updateMethodsList%0A%20%20%20%20methodsList%20contents%3A%20%5B%3Ahtml%20%7C%0A%09self%20methods%20do%3A%20%5B%3Aeach%20%7C%7C%20li%20%7C%0A%09%20%20%20%20li%20%3A%3D%20html%20li.%0A%09%20%20%20%20selectedMethod%20%3D%20each%20ifTrue%3A%20%5B%0A%09%09li%20class%3A%20%27selected%27%5D.%0A%09%20%20%20%20li%0A%09%09with%3A%20each%20selector%3B%0A%09%09onClick%3A%20%5Bself%20selectMethod%3A%20each%5D%5D%5D%0A')}),
  1205. smalltalk.Browser);
  1206. smalltalk.addMethod(
  1207. '_updateTabsList',
  1208. smalltalk.method({
  1209. selector: 'updateTabsList',
  1210. category: 'updating',
  1211. fn: function (){
  1212. var self=this;
  1213. smalltalk.send(self['@tabsList'], "_contents_", [(function(html){var li=nil;
  1214. li=smalltalk.send(html, "_li", []);smalltalk.send(smalltalk.send(self['@selectedTab'], "__eq", ["instance"]), "_ifTrue_", [(function(){return smalltalk.send(li, "_class_", ["selected"]);})]);(function($rec){smalltalk.send($rec, "_with_", ["Instance"]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_selectTab_", ["instance"]);})]);})(li);li=smalltalk.send(html, "_li", []);smalltalk.send(smalltalk.send(self['@selectedTab'], "__eq", ["class"]), "_ifTrue_", [(function(){return smalltalk.send(li, "_class_", ["selected"]);})]);(function($rec){smalltalk.send($rec, "_with_", ["Class"]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_selectTab_", ["class"]);})]);})(li);li=smalltalk.send(html, "_li", []);smalltalk.send(smalltalk.send(self['@selectedTab'], "__eq", ["comment"]), "_ifTrue_", [(function(){return smalltalk.send(li, "_class_", ["selected"]);})]);return (function($rec){smalltalk.send($rec, "_with_", ["Comment"]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_selectTab_", ["comment"]);})]);})(li);})]);
  1215. return self;},
  1216. source: unescape('updateTabsList%0A%20%20%20%20tabsList%20contents%3A%20%5B%3Ahtml%20%7C%7C%20li%20%7C%0A%09li%20%3A%3D%20html%20li.%0A%09selectedTab%20%3D%20%23instance%20ifTrue%3A%20%5Bli%20class%3A%20%27selected%27%5D.%0A%09li%0A%09%20%20%20%20with%3A%20%27Instance%27%3B%0A%09%20%20%20%20onClick%3A%20%5Bself%20selectTab%3A%20%23instance%5D.%0A%09li%20%3A%3D%20html%20li.%0A%09selectedTab%20%3D%20%23class%20ifTrue%3A%20%5Bli%20class%3A%20%27selected%27%5D.%0A%09li%0A%09%20%20%20%20with%3A%20%27Class%27%3B%0A%09%20%20%20%20onClick%3A%20%5Bself%20selectTab%3A%20%23class%5D.%0A%09li%20%3A%3D%20html%20li.%0A%09selectedTab%20%3D%20%23comment%20ifTrue%3A%20%5Bli%20class%3A%20%27selected%27%5D.%0A%09li%0A%09%20%20%20%20with%3A%20%27Comment%27%3B%0A%09%20%20%20%20onClick%3A%20%5Bself%20selectTab%3A%20%23comment%5D%5D%0A')}),
  1217. smalltalk.Browser);
  1218. smalltalk.addMethod(
  1219. '_updateSourceAndButtons',
  1220. smalltalk.method({
  1221. selector: 'updateSourceAndButtons',
  1222. category: 'updating',
  1223. fn: function (){
  1224. var self=this;
  1225. smalltalk.send(self, "_disableSaveButton", []);
  1226. smalltalk.send(self['@classButtons'], "_contents_", [(function(html){(function($rec){smalltalk.send($rec, "_with_", ["Rename class"]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_renameClass", []);})]);})(smalltalk.send(html, "_button", []));return (function($rec){smalltalk.send($rec, "_with_", ["Remove class"]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_removeClass", []);})]);})(smalltalk.send(html, "_button", []));})]);
  1227. smalltalk.send(self['@methodButtons'], "_contents_", [(function(html){(function($rec){smalltalk.send($rec, "_with_", ["Remove method"]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_removeMethod", []);})]);})(smalltalk.send(html, "_button", []));return (function($rec){smalltalk.send($rec, "_onChange_", [(function(e, select){return smalltalk.send(self, "_setMethodProtocol_", [smalltalk.send(select, "_val", [])]);})]);return smalltalk.send($rec, "_with_", [(function(){(function($rec){smalltalk.send($rec, "_with_", ["Method protocol"]);return smalltalk.send($rec, "_at_put_", ["disabled", "disabled"]);})(smalltalk.send(html, "_option", []));(function($rec){smalltalk.send($rec, "_class_", ["important"]);return smalltalk.send($rec, "_with_", ["New..."]);})(smalltalk.send(html, "_option", []));return smalltalk.send(smalltalk.send(self, "_protocols", []), "_do_", [(function(each){return smalltalk.send(smalltalk.send(html, "_option", []), "_with_", [each]);})]);})]);})(smalltalk.send(html, "_select", []));})]);
  1228. smalltalk.send(smalltalk.send(self['@selectedMethod'], "_isNil", []), "_ifTrue_ifFalse_", [(function(){smalltalk.send(self, "_hideMethodButtons", []);return smalltalk.send(smalltalk.send(smalltalk.send(self['@selectedClass'], "_isNil", []), "_or_", [(function(){return smalltalk.send(self['@selectedProtocol'], "_notNil", []);})]), "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_hideClassButtons", []);}), (function(){return smalltalk.send(self, "_showClassButtons", []);})]);}), (function(){smalltalk.send(self, "_hideClassButtons", []);return smalltalk.send(self, "_showMethodButtons", []);})]);
  1229. smalltalk.send(smalltalk.send(self['@sourceTextarea'], "_asJQuery", []), "_val_", [smalltalk.send(self, "_source", [])]);
  1230. return self;},
  1231. source: unescape('updateSourceAndButtons%0A%09self%20disableSaveButton.%0A%09classButtons%20contents%3A%20%5B%3Ahtml%20%7C%0A%09%09html%20button%0A%09%09%09with%3A%20%27Rename%20class%27%3B%0A%09%09%09onClick%3A%20%5Bself%20renameClass%5D.%0A%09%09html%20button%0A%09%09%09with%3A%20%27Remove%20class%27%3B%0A%09%09%09onClick%3A%20%5Bself%20removeClass%5D%5D.%0A%09methodButtons%20contents%3A%20%5B%3Ahtml%20%7C%0A%09%09html%20button%0A%09%09%09with%3A%20%27Remove%20method%27%3B%0A%09%09%09onClick%3A%20%5Bself%20removeMethod%5D.%0A%09%09html%20select%20%0A%09%20%20%20%20%09%09onChange%3A%20%5B%3Ae%20%3Aselect%20%7C%20self%20setMethodProtocol%3A%20select%20val%5D%3B%0A%09%20%20%20%20%09%09with%3A%20%5B%0A%09%09%09%09html%20option%0A%09%09%20%20%20%20%09%09%09with%3A%20%27Method%20protocol%27%3B%0A%09%09%20%20%20%20%09%09%09at%3A%20%27disabled%27%20put%3A%20%27disabled%27.%0A%09%09%09%09html%20option%0A%09%09%20%20%20%20%09%09%09class%3A%20%27important%27%3B%0A%09%09%20%20%20%20%09%09%09with%3A%20%27New...%27.%0A%09%09%09%09self%20protocols%20do%3A%20%5B%3Aeach%20%7C%0A%09%09%20%20%20%20%09%09%09html%20option%20with%3A%20each%5D%5D%5D.%0A%20%20%20%20%09selectedMethod%20isNil%0A%09%09ifTrue%3A%20%5B%0A%09%20%20%20%20%09%09self%20hideMethodButtons.%0A%09%20%20%20%20%09%09%09%28selectedClass%20isNil%20or%3A%20%5BselectedProtocol%20notNil%5D%29%0A%09%09%09%09%09ifTrue%3A%20%5Bself%20hideClassButtons%5D%0A%09%20%20%20%20%09%09%09%09ifFalse%3A%20%5Bself%20showClassButtons%5D%5D%0A%09%09ifFalse%3A%20%5B%0A%09%20%20%20%20%09%09self%20hideClassButtons.%0A%09%20%20%20%20%09%09self%20showMethodButtons%5D.%0A%20%20%20%20%09sourceTextarea%20asJQuery%20val%3A%20self%20source%0A')}),
  1232. smalltalk.Browser);
  1233. smalltalk.addMethod(
  1234. '_canBeClosed',
  1235. smalltalk.method({
  1236. selector: 'canBeClosed',
  1237. category: 'testing',
  1238. fn: function (){
  1239. var self=this;
  1240. return true;
  1241. return self;},
  1242. source: unescape('canBeClosed%0A%20%20%20%20%5Etrue%0A')}),
  1243. smalltalk.Browser);
  1244. smalltalk.addMethod(
  1245. '_renameClass',
  1246. smalltalk.method({
  1247. selector: 'renameClass',
  1248. category: 'actions',
  1249. fn: function (){
  1250. var self=this;
  1251. var newName=nil;
  1252. newName=smalltalk.send(self, "_prompt_", [smalltalk.send("Rename class ", "__comma", [smalltalk.send(self['@selectedClass'], "_name", [])])]);
  1253. smalltalk.send(smalltalk.send(newName, "_notEmpty", []), "_ifTrue_", [(function(){smalltalk.send(self['@selectedClass'], "_rename_", [newName]);return (function($rec){smalltalk.send($rec, "_updateClassesList", []);return smalltalk.send($rec, "_updateSourceAndButtons", []);})(self);})]);
  1254. return self;},
  1255. source: unescape('renameClass%0A%20%20%20%20%7C%20newName%20%7C%0A%20%20%20%20newName%20%3A%3D%20self%20prompt%3A%20%27Rename%20class%20%27%2C%20selectedClass%20name.%0A%20%20%20%20newName%20notEmpty%20ifTrue%3A%20%5B%0A%09selectedClass%20rename%3A%20newName.%0A%09self%20%0A%09%09updateClassesList%3B%0A%09%09updateSourceAndButtons%5D%0A')}),
  1256. smalltalk.Browser);
  1257. smalltalk.addMethod(
  1258. '_addInstanceVariableNamed_toClass_',
  1259. smalltalk.method({
  1260. selector: 'addInstanceVariableNamed:toClass:',
  1261. category: 'actions',
  1262. fn: function (aString, aClass){
  1263. var self=this;
  1264. smalltalk.send(smalltalk.send(smalltalk.ClassBuilder, "_new", []), "_addSubclassOf_named_instanceVariableNames_", [smalltalk.send(aClass, "_superclass", []), smalltalk.send(aClass, "_name", []), (function($rec){smalltalk.send($rec, "_add_", [aString]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(smalltalk.send(aClass, "_instanceVariableNames", []), "_copy", []))]);
  1265. return self;},
  1266. source: unescape('addInstanceVariableNamed%3A%20aString%20toClass%3A%20aClass%0A%09ClassBuilder%20new%0A%09%09addSubclassOf%3A%20aClass%20superclass%20named%3A%20aClass%20name%20instanceVariableNames%3A%20%28aClass%20instanceVariableNames%20copy%20add%3A%20aString%3B%20yourself%29')}),
  1267. smalltalk.Browser);
  1268. smalltalk.addMethod(
  1269. '_openOn_',
  1270. smalltalk.method({
  1271. selector: 'openOn:',
  1272. category: 'convenience',
  1273. fn: function (aClass){
  1274. var self=this;
  1275. (function($rec){smalltalk.send($rec, "_open", []);smalltalk.send($rec, "_selectCategory_", [smalltalk.send(aClass, "_category", [])]);return smalltalk.send($rec, "_selectClass_", [aClass]);})(smalltalk.send(self, "_new", []));
  1276. return self;},
  1277. source: unescape('openOn%3A%20aClass%0A%20%20%20%20self%20new%0A%09open%3B%0A%09selectCategory%3A%20aClass%20category%3B%0A%09selectClass%3A%20aClass%0A')}),
  1278. smalltalk.Browser.klass);
  1279. smalltalk.addMethod(
  1280. '_open',
  1281. smalltalk.method({
  1282. selector: 'open',
  1283. category: 'convenience',
  1284. fn: function (){
  1285. var self=this;
  1286. smalltalk.send(smalltalk.send(self, "_new", []), "_open", []);
  1287. return self;},
  1288. source: unescape('open%0A%20%20%20%20self%20new%20open%0A')}),
  1289. smalltalk.Browser.klass);
  1290. smalltalk.addMethod(
  1291. '_commitPath',
  1292. smalltalk.method({
  1293. selector: 'commitPath',
  1294. category: 'accessing',
  1295. fn: function (){
  1296. var self=this;
  1297. return "js";
  1298. return self;},
  1299. source: unescape('commitPath%0A%09%5E%27js%27')}),
  1300. smalltalk.Browser.klass);
  1301. smalltalk.addClass('Inspector', smalltalk.TabWidget, ['label', 'variables', 'object', 'selectedVariable', 'variablesList', 'valueTextarea', 'workspaceTextarea', 'diveButton'], 'IDE');
  1302. smalltalk.addMethod(
  1303. '_label',
  1304. smalltalk.method({
  1305. selector: 'label',
  1306. category: 'accessing',
  1307. fn: function (){
  1308. var self=this;
  1309. return smalltalk.send(self['@label'], "_ifNil_", [(function(){return unescape("Inspector%20%28nil%29");})]);
  1310. return self;},
  1311. source: unescape('label%0A%09%5Elabel%20ifNil%3A%20%5B%27Inspector%20%28nil%29%27%5D')}),
  1312. smalltalk.Inspector);
  1313. smalltalk.addMethod(
  1314. '_canBeClosed',
  1315. smalltalk.method({
  1316. selector: 'canBeClosed',
  1317. category: 'testing',
  1318. fn: function (){
  1319. var self=this;
  1320. return true;
  1321. return self;},
  1322. source: unescape('canBeClosed%0A%09%5Etrue')}),
  1323. smalltalk.Inspector);
  1324. smalltalk.addMethod(
  1325. '_inspect_',
  1326. smalltalk.method({
  1327. selector: 'inspect:',
  1328. category: 'actions',
  1329. fn: function (anObject){
  1330. var self=this;
  1331. self['@object']=anObject;
  1332. self['@variables']=[];
  1333. smalltalk.send(self['@object'], "_inspectOn_", [self]);
  1334. return self;},
  1335. source: unescape('inspect%3A%20anObject%0A%09object%20%3A%3D%20anObject.%0A%09variables%20%3A%3D%20%23%28%29.%0A%09object%20inspectOn%3A%20self')}),
  1336. smalltalk.Inspector);
  1337. smalltalk.addMethod(
  1338. '_variables',
  1339. smalltalk.method({
  1340. selector: 'variables',
  1341. category: 'accessing',
  1342. fn: function (){
  1343. var self=this;
  1344. return self['@variables'];
  1345. return self;},
  1346. source: unescape('variables%0A%09%5Evariables')}),
  1347. smalltalk.Inspector);
  1348. smalltalk.addMethod(
  1349. '_setVariables_',
  1350. smalltalk.method({
  1351. selector: 'setVariables:',
  1352. category: 'accessing',
  1353. fn: function (aCollection){
  1354. var self=this;
  1355. self['@variables']=aCollection;
  1356. return self;},
  1357. source: unescape('setVariables%3A%20aCollection%0A%09variables%20%3A%3D%20aCollection')}),
  1358. smalltalk.Inspector);
  1359. smalltalk.addMethod(
  1360. '_setLabel_',
  1361. smalltalk.method({
  1362. selector: 'setLabel:',
  1363. category: 'accessing',
  1364. fn: function (aString){
  1365. var self=this;
  1366. self['@label']=aString;
  1367. return self;},
  1368. source: unescape('setLabel%3A%20aString%0A%09label%20%3A%3D%20aString')}),
  1369. smalltalk.Inspector);
  1370. smalltalk.addMethod(
  1371. '_renderBoxOn_',
  1372. smalltalk.method({
  1373. selector: 'renderBoxOn:',
  1374. category: 'rendering',
  1375. fn: function (html){
  1376. var self=this;
  1377. (function($rec){smalltalk.send($rec, "_renderTopPanelOn_", [html]);return smalltalk.send($rec, "_renderBottomPanelOn_", [html]);})(self);
  1378. return self;},
  1379. source: unescape('renderBoxOn%3A%20html%0A%09self%20%0A%09%09renderTopPanelOn%3A%20html%3B%0A%09%09renderBottomPanelOn%3A%20html')}),
  1380. smalltalk.Inspector);
  1381. smalltalk.addMethod(
  1382. '_renderTopPanelOn_',
  1383. smalltalk.method({
  1384. selector: 'renderTopPanelOn:',
  1385. category: 'rendering',
  1386. fn: function (html){
  1387. var self=this;
  1388. (function($rec){smalltalk.send($rec, "_class_", ["top"]);return smalltalk.send($rec, "_with_", [(function(){self['@variablesList']=smalltalk.send(smalltalk.send(html, "_ul", []), "_class_", ["jt_column variables"]);self['@valueTextarea']=(function($rec){smalltalk.send($rec, "_class_", ["jt_column value"]);return smalltalk.send($rec, "_at_put_", ["readonly", "readonly"]);})(smalltalk.send(html, "_textarea", []));(function($rec){smalltalk.send($rec, "_updateVariablesList", []);return smalltalk.send($rec, "_updateValueTextarea", []);})(self);return smalltalk.send(smalltalk.send(html, "_div", []), "_class_", ["jt_clear"]);})]);})(smalltalk.send(html, "_div", []));
  1389. return self;},
  1390. source: unescape('renderTopPanelOn%3A%20html%0A%20%20%20%20html%20div%20%0A%09class%3A%20%27top%27%3B%20%0A%09with%3A%20%5B%0A%09%20%20%20%20variablesList%20%3A%3D%20html%20ul%20class%3A%20%27jt_column%20variables%27.%0A%09%20%20%20%20valueTextarea%20%3A%3D%20html%20textarea%20class%3A%20%27jt_column%20value%27%3B%20at%3A%20%27readonly%27%20put%3A%20%27readonly%27.%0A%09%20%20%20%20self%0A%09%09updateVariablesList%3B%0A%09%09updateValueTextarea.%0A%09%20%20%20%20html%20div%20class%3A%20%27jt_clear%27%5D%0A')}),
  1391. smalltalk.Inspector);
  1392. smalltalk.addMethod(
  1393. '_renderBottomPanelOn_',
  1394. smalltalk.method({
  1395. selector: 'renderBottomPanelOn:',
  1396. category: 'rendering',
  1397. fn: function (html){
  1398. var self=this;
  1399. (function($rec){smalltalk.send($rec, "_class_", ["jt_sourceCode"]);return smalltalk.send($rec, "_with_", [(function(){self['@workspaceTextarea']=(function($rec){smalltalk.send($rec, "_class_", ["source"]);return smalltalk.send($rec, "_at_put_", ["spellcheck", "false"]);})(smalltalk.send(html, "_textarea", []));return smalltalk.send(smalltalk.send(self['@workspaceTextarea'], "_asJQuery", []), "_call_", ["tabby"]);})]);})(smalltalk.send(html, "_div", []));
  1400. return self;},
  1401. source: unescape('renderBottomPanelOn%3A%20html%0A%20%20%20%20html%20div%0A%09class%3A%20%27jt_sourceCode%27%3B%0A%09with%3A%20%5B%0A%09%20%20%20%20workspaceTextarea%20%3A%3D%20html%20textarea%20%0A%09%09class%3A%20%27source%27%3B%0A%09%09at%3A%20%27spellcheck%27%20put%3A%20%27false%27.%0A%09%20%20%20%20workspaceTextarea%20asJQuery%20call%3A%20%27tabby%27%5D%0A')}),
  1402. smalltalk.Inspector);
  1403. smalltalk.addMethod(
  1404. '_updateVariablesList',
  1405. smalltalk.method({
  1406. selector: 'updateVariablesList',
  1407. category: 'updating',
  1408. fn: function (){
  1409. var self=this;
  1410. smalltalk.send(self['@variablesList'], "_contents_", [(function(html){return smalltalk.send(smalltalk.send(smalltalk.send(self, "_variables", []), "_keys", []), "_do_", [(function(each){var li=nil;
  1411. li=smalltalk.send(html, "_li", []);(function($rec){smalltalk.send($rec, "_with_", [each]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_selectVariable_", [each]);})]);})(li);return smalltalk.send(smalltalk.send(smalltalk.send(self, "_selectedVariable", []), "__eq", [each]), "_ifTrue_", [(function(){return smalltalk.send(li, "_class_", ["selected"]);})]);})]);})]);
  1412. return self;},
  1413. source: unescape('updateVariablesList%0A%09variablesList%20contents%3A%20%5B%3Ahtml%20%7C%0A%09%09self%20variables%20keys%20do%3A%20%5B%3Aeach%20%7C%7C%20li%20%7C%0A%09%09%09li%20%3A%3D%20html%20li.%0A%09%09%09li%0A%09%09%09%09with%3A%20each%3B%0A%09%09%09%09onClick%3A%20%5Bself%20selectVariable%3A%20each%5D.%0A%09%09%09self%20selectedVariable%20%3D%20each%20ifTrue%3A%20%5B%0A%09%09%09%09li%20class%3A%20%27selected%27%5D%5D%5D')}),
  1414. smalltalk.Inspector);
  1415. smalltalk.addMethod(
  1416. '_selectedVariable',
  1417. smalltalk.method({
  1418. selector: 'selectedVariable',
  1419. category: 'accessing',
  1420. fn: function (){
  1421. var self=this;
  1422. return self['@selectedVariable'];
  1423. return self;},
  1424. source: unescape('selectedVariable%0A%09%5EselectedVariable')}),
  1425. smalltalk.Inspector);
  1426. smalltalk.addMethod(
  1427. '_selectedVariable_',
  1428. smalltalk.method({
  1429. selector: 'selectedVariable:',
  1430. category: 'accessing',
  1431. fn: function (aString){
  1432. var self=this;
  1433. self['@selectedVariable']=aString;
  1434. return self;},
  1435. source: unescape('selectedVariable%3A%20aString%0A%09selectedVariable%20%3A%3D%20aString')}),
  1436. smalltalk.Inspector);
  1437. smalltalk.addMethod(
  1438. '_selectVariable_',
  1439. smalltalk.method({
  1440. selector: 'selectVariable:',
  1441. category: 'updating',
  1442. fn: function (aString){
  1443. var self=this;
  1444. smalltalk.send(self, "_selectedVariable_", [aString]);
  1445. (function($rec){smalltalk.send($rec, "_updateVariablesList", []);smalltalk.send($rec, "_updateValueTextarea", []);return smalltalk.send($rec, "_updateButtons", []);})(self);
  1446. return self;},
  1447. source: unescape('selectVariable%3A%20aString%0A%09self%20selectedVariable%3A%20aString.%0A%09self%20%0A%09%09updateVariablesList%3B%0A%09%09updateValueTextarea%3B%0A%09%09updateButtons')}),
  1448. smalltalk.Inspector);
  1449. smalltalk.addMethod(
  1450. '_updateValueTextarea',
  1451. smalltalk.method({
  1452. selector: 'updateValueTextarea',
  1453. category: 'updating',
  1454. fn: function (){
  1455. var self=this;
  1456. smalltalk.send(smalltalk.send(self['@valueTextarea'], "_asJQuery", []), "_val_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_selectedVariable", []), "_isNil", []), "_ifTrue_ifFalse_", [(function(){return "";}), (function(){return smalltalk.send(smalltalk.send(smalltalk.send(self, "_variables", []), "_at_", [smalltalk.send(self, "_selectedVariable", [])]), "_printString", []);})])]);
  1457. return self;},
  1458. source: unescape('updateValueTextarea%0A%09valueTextarea%20asJQuery%20val%3A%20%28self%20selectedVariable%20isNil%0A%09%09ifTrue%3A%20%5B%27%27%5D%0A%09%09ifFalse%3A%20%5B%28self%20variables%20at%3A%20self%20selectedVariable%29%20printString%5D%29')}),
  1459. smalltalk.Inspector);
  1460. smalltalk.addMethod(
  1461. '_renderButtonsOn_',
  1462. smalltalk.method({
  1463. selector: 'renderButtonsOn:',
  1464. category: 'rendering',
  1465. fn: function (html){
  1466. var self=this;
  1467. (function($rec){smalltalk.send($rec, "_with_", ["Refresh"]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_refresh", []);})]);})(smalltalk.send(html, "_button", []));
  1468. self['@diveButton']=(function($rec){smalltalk.send($rec, "_with_", ["Dive"]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_dive", []);})]);})(smalltalk.send(html, "_button", []));
  1469. smalltalk.send(self, "_updateButtons", []);
  1470. return self;},
  1471. source: unescape('renderButtonsOn%3A%20html%0A%09html%20button%0A%09%09with%3A%20%27Refresh%27%3B%0A%09%09onClick%3A%20%5Bself%20refresh%5D.%0A%09diveButton%20%3A%3D%20html%20button%20%0A%09%09with%3A%20%27Dive%27%3B%20%0A%09%09onClick%3A%20%5Bself%20dive%5D.%0A%09self%20updateButtons%0A%09')}),
  1472. smalltalk.Inspector);
  1473. smalltalk.addMethod(
  1474. '_dive',
  1475. smalltalk.method({
  1476. selector: 'dive',
  1477. category: 'actions',
  1478. fn: function (){
  1479. var self=this;
  1480. smalltalk.send(smalltalk.send(smalltalk.send(self, "_variables", []), "_at_", [smalltalk.send(self, "_selectedVariable", [])]), "_inspect", []);
  1481. return self;},
  1482. source: unescape('dive%0A%09%28self%20variables%20at%3A%20self%20selectedVariable%29%20inspect')}),
  1483. smalltalk.Inspector);
  1484. smalltalk.addMethod(
  1485. '_updateButtons',
  1486. smalltalk.method({
  1487. selector: 'updateButtons',
  1488. category: 'updating',
  1489. fn: function (){
  1490. var self=this;
  1491. smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_selectedVariable", []), "_notNil", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(self, "_variables", []), "_at_", [smalltalk.send(self, "_selectedVariable", [])]), "_notNil", []);})]), "_ifFalse_ifTrue_", [(function(){return smalltalk.send(self['@diveButton'], "_at_put_", ["disabled", true]);}), (function(){return smalltalk.send(self['@diveButton'], "_removeAt_", ["disabled"]);})]);
  1492. return self;},
  1493. source: unescape('updateButtons%0A%09%28self%20selectedVariable%20notNil%20and%3A%20%5B%28self%20variables%20at%3A%20self%20selectedVariable%29%20notNil%5D%29%0A%09%09ifFalse%3A%20%5BdiveButton%20at%3A%20%27disabled%27%20put%3A%20true%5D%20%0A%09%09ifTrue%3A%20%5BdiveButton%20removeAt%3A%20%27disabled%27%5D%0A%09%09')}),
  1494. smalltalk.Inspector);
  1495. smalltalk.addMethod(
  1496. '_refresh',
  1497. smalltalk.method({
  1498. selector: 'refresh',
  1499. category: 'actions',
  1500. fn: function (){
  1501. var self=this;
  1502. (function($rec){smalltalk.send($rec, "_inspect_", [self['@object']]);smalltalk.send($rec, "_updateVariablesList", []);return smalltalk.send($rec, "_updateValueTextarea", []);})(self);
  1503. return self;},
  1504. source: unescape('refresh%0A%09self%20%0A%09%09inspect%3A%20object%3B%20%0A%09%09updateVariablesList%3B%0A%09%09updateValueTextarea')}),
  1505. smalltalk.Inspector);
  1506. smalltalk.addMethod(
  1507. '_on_',
  1508. smalltalk.method({
  1509. selector: 'on:',
  1510. category: 'instance creation',
  1511. fn: function (anObject){
  1512. var self=this;
  1513. return (function($rec){smalltalk.send($rec, "_inspect_", [anObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  1514. return self;},
  1515. source: unescape('on%3A%20anObject%0A%09%5Eself%20new%0A%09%09inspect%3A%20anObject%3B%0A%09%09yourself')}),
  1516. smalltalk.Inspector.klass);