1
0

ide.js 61 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281
  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){$rec._append_(self);$rec._append_((function(html){return html._div()._id_("jtalk");}));return $rec._addClass_("jtalkBody");})("body"._asJQuery());
  12. (function($rec){$rec._addTab_(smalltalk.Transcript._current());return $rec._addTab_(smalltalk.Workspace._new());})(self);
  13. self._selectTab_(self._tabs()._last());
  14. (function($rec){$rec._onResize_((function(){return self._updateBodyMargin();}));return $rec._updatePositionOnWindowResize();})(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%5D%3B%0A%09updatePositionOnWindowResize%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 self['@tabs']._ifNil_((function(){return self['@tabs']=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. self._tabs()._add_(aWidget);
  37. unescape("%23jtalk")._asJQuery()._append_(aWidget);
  38. 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. self._tabs()._remove_(aWidget);
  50. 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. self._setBodyMargin_(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. '_removeBodyMargin',
  67. smalltalk.method({
  68. selector: 'removeBodyMargin',
  69. category: 'actions',
  70. fn: function (){
  71. var self=this;
  72. self._setBodyMargin_((0));
  73. return self;},
  74. source: unescape('removeBodyMargin%0A%20%20%20%20self%20setBodyMargin%3A%200%0A')}),
  75. smalltalk.TabManager);
  76. smalltalk.addMethod(
  77. '_setBodyMargin_',
  78. smalltalk.method({
  79. selector: 'setBodyMargin:',
  80. category: 'actions',
  81. fn: function (anInteger){
  82. var self=this;
  83. ".jtalkBody"._asJQuery()._cssAt_put_(unescape("margin-bottom"),anInteger._asString().__comma("px"));
  84. return self;},
  85. 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')}),
  86. smalltalk.TabManager);
  87. smalltalk.addMethod(
  88. '_onResize_',
  89. smalltalk.method({
  90. selector: 'onResize:',
  91. category: 'actions',
  92. fn: function (aBlock){
  93. var self=this;
  94. (function(){jQuery('#jtalk').resizable({handles: 'n', stop: aBlock, minHeight: 230});})();
  95. return self;},
  96. source: unescape('onResize%3A%20aBlock%0A%20%20%20%20%7B%27jQuery%28%27%27%23jtalk%27%27%29.resizable%28%7Bhandles%3A%20%27%27n%27%27%2C%20stop%3A%20aBlock%2C%20minHeight%3A%20230%7D%29%3B%27%7D%0A')}),
  97. smalltalk.TabManager);
  98. smalltalk.addMethod(
  99. '_updatePositionOnWindowResize',
  100. smalltalk.method({
  101. selector: 'updatePositionOnWindowResize',
  102. category: 'actions',
  103. fn: function (){
  104. var self=this;
  105. (function(){jQuery(window).resize(function(e){jQuery('#jtalk').css('top', '').css('bottom', '27px')});})();
  106. return self;},
  107. source: unescape('updatePositionOnWindowResize%0A%20%20%20%20%7B%27jQuery%28window%29.resize%28function%28e%29%7BjQuery%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%7D%29%3B%27%7D%0A')}),
  108. smalltalk.TabManager);
  109. smalltalk.addMethod(
  110. '_open',
  111. smalltalk.method({
  112. selector: 'open',
  113. category: 'actions',
  114. fn: function (){
  115. var self=this;
  116. self['@opened']._ifFalse_((function(){self._root()._asJQuery()._show();"body"._asJQuery()._addClass_("jtalkBody");unescape("%23jtalk")._asJQuery()._show();self._updateBodyMargin();self['@selectedTab']._root()._asJQuery()._show();return self['@opened']=true;}));
  117. return self;},
  118. 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')}),
  119. smalltalk.TabManager);
  120. smalltalk.addMethod(
  121. '_close',
  122. smalltalk.method({
  123. selector: 'close',
  124. category: 'actions',
  125. fn: function (){
  126. var self=this;
  127. self['@opened']._ifTrue_((function(){self._root()._asJQuery()._hide();unescape("%23jtalk")._asJQuery()._hide();self._removeBodyMargin();"body"._asJQuery()._removeClass_("jtalkBody");return self['@opened']=false;}));
  128. return self;},
  129. 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')}),
  130. smalltalk.TabManager);
  131. smalltalk.addMethod(
  132. '_newBrowserTab',
  133. smalltalk.method({
  134. selector: 'newBrowserTab',
  135. category: 'actions',
  136. fn: function (){
  137. var self=this;
  138. smalltalk.Browser._open();
  139. return self;},
  140. source: unescape('newBrowserTab%0A%20%20%20%20Browser%20open%0A')}),
  141. smalltalk.TabManager);
  142. smalltalk.addMethod(
  143. '_selectTab_',
  144. smalltalk.method({
  145. selector: 'selectTab:',
  146. category: 'actions',
  147. fn: function (aWidget){
  148. var self=this;
  149. self._open();
  150. self['@selectedTab']=aWidget;
  151. self._tabs()._do_((function(each){return each._root()._asJQuery()._hide();}));
  152. aWidget._root()._asJQuery()._show();
  153. self._update();
  154. return self;},
  155. 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')}),
  156. smalltalk.TabManager);
  157. smalltalk.addMethod(
  158. '_closeTab_',
  159. smalltalk.method({
  160. selector: 'closeTab:',
  161. category: 'actions',
  162. fn: function (aWidget){
  163. var self=this;
  164. self._removeTab_(aWidget);
  165. self._selectTab_(self._tabs()._last());
  166. aWidget._root()._asJQuery()._remove();
  167. self._update();
  168. return self;},
  169. 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')}),
  170. smalltalk.TabManager);
  171. smalltalk.addMethod(
  172. '_renderOn_',
  173. smalltalk.method({
  174. selector: 'renderOn:',
  175. category: 'rendering',
  176. fn: function (html){
  177. var self=this;
  178. (function($rec){$rec._id_("jtalkTabs");return $rec._with_((function(){(function($rec){$rec._class_("closeAll");$rec._with_("x");return $rec._onClick_((function(){return self._close();}));})(html._li());self._tabs()._do_((function(each){return self._renderTabFor_on_(each,html);}));return (function($rec){$rec._class_("newtab");$rec._with_(unescape("%20+%20"));return $rec._onClick_((function(){return self._newBrowserTab();}));})(html._li());}));})(html._ul());
  179. return self;},
  180. 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')}),
  181. smalltalk.TabManager);
  182. smalltalk.addMethod(
  183. '_renderTabFor_on_',
  184. smalltalk.method({
  185. selector: 'renderTabFor:on:',
  186. category: 'rendering',
  187. fn: function (aWidget, html){
  188. var self=this;
  189. var li=nil;
  190. li=html._li();
  191. self['@selectedTab'].__eq(aWidget)._ifTrue_((function(){return li._class_("selected");}));
  192. li._with_((function(){(function($rec){$rec._with_(aWidget._label());return $rec._onClick_((function(){return self._selectTab_(aWidget);}));})(html._span());return aWidget._canBeClosed()._ifTrue_((function(){return (function($rec){$rec._class_("close");$rec._with_("x");return $rec._onClick_((function(){return self._closeTab_(aWidget);}));})(html._span());}));}));
  193. return self;},
  194. 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')}),
  195. smalltalk.TabManager);
  196. smalltalk.TabManager.klass.iVarNames = ['current'];
  197. smalltalk.addMethod(
  198. '_current',
  199. smalltalk.method({
  200. selector: 'current',
  201. category: 'instance creation',
  202. fn: function (){
  203. var self=this;
  204. return self['@current']._ifNil_((function(){return self['@current']=self.klass.superclass.fn.prototype['_new'].apply(self, []);}));
  205. return self;},
  206. source: unescape('current%0A%20%20%20%20%5Ecurrent%20ifNil%3A%20%5Bcurrent%20%3A%3D%20super%20new%5D%0A')}),
  207. smalltalk.TabManager.klass);
  208. smalltalk.addMethod(
  209. '_new',
  210. smalltalk.method({
  211. selector: 'new',
  212. category: 'instance creation',
  213. fn: function (){
  214. var self=this;
  215. self._shouldNotImplement();
  216. return self;},
  217. source: unescape('new%0A%20%20%20%20self%20shouldNotImplement%0A')}),
  218. smalltalk.TabManager.klass);
  219. smalltalk.addClass('TabWidget', smalltalk.Widget, [], 'IDE');
  220. smalltalk.addMethod(
  221. '_label',
  222. smalltalk.method({
  223. selector: 'label',
  224. category: 'accessing',
  225. fn: function (){
  226. var self=this;
  227. self._subclassResponsibility();
  228. return self;},
  229. source: unescape('label%0A%20%20%20%20self%20subclassResponsibility%0A')}),
  230. smalltalk.TabWidget);
  231. smalltalk.addMethod(
  232. '_open',
  233. smalltalk.method({
  234. selector: 'open',
  235. category: 'actions',
  236. fn: function (){
  237. var self=this;
  238. (function($rec){$rec._addTab_(self);return $rec._selectTab_(self);})(smalltalk.TabManager._current());
  239. return self;},
  240. source: unescape('open%0A%20%20%20%20TabManager%20current%0A%09addTab%3A%20self%3B%0A%09selectTab%3A%20self%0A')}),
  241. smalltalk.TabWidget);
  242. smalltalk.addMethod(
  243. '_canBeClosed',
  244. smalltalk.method({
  245. selector: 'canBeClosed',
  246. category: 'testing',
  247. fn: function (){
  248. var self=this;
  249. return false;
  250. return self;},
  251. source: unescape('canBeClosed%0A%20%20%20%20%5Efalse%0A')}),
  252. smalltalk.TabWidget);
  253. smalltalk.addMethod(
  254. '_renderOn_',
  255. smalltalk.method({
  256. selector: 'renderOn:',
  257. category: 'rendering',
  258. fn: function (html){
  259. var self=this;
  260. (function($rec){$rec._class_("jtalkTool");return $rec._with_((function(){(function($rec){$rec._class_("jt_box");return $rec._with_((function(){return self._renderBoxOn_(html);}));})(html._div());return (function($rec){$rec._class_("jt_buttons");return $rec._with_((function(){return self._renderButtonsOn_(html);}));})(html._div());}));})(html._root());
  261. return self;},
  262. 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')}),
  263. smalltalk.TabWidget);
  264. smalltalk.addMethod(
  265. '_renderBoxOn_',
  266. smalltalk.method({
  267. selector: 'renderBoxOn:',
  268. category: 'rendering',
  269. fn: function (html){
  270. var self=this;
  271. return self;},
  272. source: unescape('renderBoxOn%3A%20html%0A')}),
  273. smalltalk.TabWidget);
  274. smalltalk.addMethod(
  275. '_renderButtonsOn_',
  276. smalltalk.method({
  277. selector: 'renderButtonsOn:',
  278. category: 'rendering',
  279. fn: function (html){
  280. var self=this;
  281. return self;},
  282. source: unescape('renderButtonsOn%3A%20html%0A')}),
  283. smalltalk.TabWidget);
  284. smalltalk.addMethod(
  285. '_open',
  286. smalltalk.method({
  287. selector: 'open',
  288. category: 'instance creation',
  289. fn: function (){
  290. var self=this;
  291. return self._new()._open();
  292. return self;},
  293. source: unescape('open%0A%20%20%20%20%5Eself%20new%20open%0A')}),
  294. smalltalk.TabWidget.klass);
  295. smalltalk.addClass('Workspace', smalltalk.TabWidget, ['textarea'], 'IDE');
  296. smalltalk.addMethod(
  297. '_label',
  298. smalltalk.method({
  299. selector: 'label',
  300. category: 'accessing',
  301. fn: function (){
  302. var self=this;
  303. return unescape("%5BWorkspace%5D");
  304. return self;},
  305. source: unescape('label%0A%20%20%20%20%5E%27%5BWorkspace%5D%27%0A')}),
  306. smalltalk.Workspace);
  307. smalltalk.addMethod(
  308. '_selection',
  309. smalltalk.method({
  310. selector: 'selection',
  311. category: 'accessing',
  312. fn: function (){
  313. var self=this;
  314. return (function(){return document.selection})();
  315. return self;},
  316. source: unescape('selection%0A%20%20%20%20%5E%7B%27return%20document.selection%27%7D%0A')}),
  317. smalltalk.Workspace);
  318. smalltalk.addMethod(
  319. '_selectionStart',
  320. smalltalk.method({
  321. selector: 'selectionStart',
  322. category: 'accessing',
  323. fn: function (){
  324. var self=this;
  325. return (function(){return jQuery('.workspace')[0].selectionStart})();
  326. return self;},
  327. source: unescape('selectionStart%0A%20%20%20%20%5E%7B%27return%20jQuery%28%27%27.workspace%27%27%29%5B0%5D.selectionStart%27%7D%0A')}),
  328. smalltalk.Workspace);
  329. smalltalk.addMethod(
  330. '_selectionEnd',
  331. smalltalk.method({
  332. selector: 'selectionEnd',
  333. category: 'accessing',
  334. fn: function (){
  335. var self=this;
  336. return (function(){return jQuery('.workspace')[0].selectionEnd})();
  337. return self;},
  338. source: unescape('selectionEnd%0A%20%20%20%20%5E%7B%27return%20jQuery%28%27%27.workspace%27%27%29%5B0%5D.selectionEnd%27%7D%0A')}),
  339. smalltalk.Workspace);
  340. smalltalk.addMethod(
  341. '_selectionStart_',
  342. smalltalk.method({
  343. selector: 'selectionStart:',
  344. category: 'accessing',
  345. fn: function (anInteger){
  346. var self=this;
  347. (function(){jQuery('.workspace')[0].selectionStart = anInteger})();
  348. return self;},
  349. source: unescape('selectionStart%3A%20anInteger%0A%20%20%20%20%7B%27jQuery%28%27%27.workspace%27%27%29%5B0%5D.selectionStart%20%3D%20anInteger%27%7D%0A')}),
  350. smalltalk.Workspace);
  351. smalltalk.addMethod(
  352. '_selectionEnd_',
  353. smalltalk.method({
  354. selector: 'selectionEnd:',
  355. category: 'accessing',
  356. fn: function (anInteger){
  357. var self=this;
  358. (function(){jQuery('.workspace')[0].selectionEnd = anInteger})();
  359. return self;},
  360. source: unescape('selectionEnd%3A%20anInteger%0A%20%20%20%20%7B%27jQuery%28%27%27.workspace%27%27%29%5B0%5D.selectionEnd%20%3D%20anInteger%27%7D%0A')}),
  361. smalltalk.Workspace);
  362. smalltalk.addMethod(
  363. '_currentLine',
  364. smalltalk.method({
  365. selector: 'currentLine',
  366. category: 'accessing',
  367. fn: function (){
  368. var self=this;
  369. try{var lines=nil;
  370. var startLine=nil;
  371. var endLine=nil;
  372. lines=self['@textarea']._asJQuery()._val()._tokenize_(smalltalk.String._cr());
  373. startLine=endLine=(0);
  374. lines._do_((function(each){endLine=startLine.__plus(each._size());startLine=endLine.__plus((1));return endLine.__gt_eq(self._selectionStart())._ifTrue_((function(){self._selectionEnd_(endLine);return (function(){throw({name: 'stReturn', selector: '_currentLine', fn: function(){return each}})})();}));}));
  375. return self;
  376. } catch(e) {if(e.name === 'stReturn' && e.selector === '_currentLine'){return e.fn()} throw(e)}},
  377. 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')}),
  378. smalltalk.Workspace);
  379. smalltalk.addMethod(
  380. '_handleKeyDown_',
  381. smalltalk.method({
  382. selector: 'handleKeyDown:',
  383. category: 'actions',
  384. fn: function (anEvent){
  385. var self=this;
  386. return (function(){if(anEvent.ctrlKey) {
  387. if(anEvent.keyCode === 68) { //ctrl+p
  388. self._printIt();
  389. return false;
  390. }
  391. if(anEvent.keyCode === 80) { //ctrl+d
  392. self._doIt();
  393. return false;
  394. }
  395. }})();
  396. return self;},
  397. source: unescape('handleKeyDown%3A%20anEvent%0A%20%20%20%20%5E%7B%27if%28anEvent.ctrlKey%29%20%7B%0A%09%09if%28anEvent.keyCode%20%3D%3D%3D%2068%29%20%7B%20//ctrl+p%0A%09%09%09self._printIt%28%29%3B%0A%09%09%09return%20false%3B%0A%09%09%7D%0A%09%09if%28anEvent.keyCode%20%3D%3D%3D%2080%29%20%7B%20//ctrl+d%0A%09%09%09self._doIt%28%29%3B%0A%09%09%09return%20false%3B%0A%09%09%7D%0A%09%7D%27%7D%0A')}),
  398. smalltalk.Workspace);
  399. smalltalk.addMethod(
  400. '_clearWorkspace',
  401. smalltalk.method({
  402. selector: 'clearWorkspace',
  403. category: 'actions',
  404. fn: function (){
  405. var self=this;
  406. self['@textarea']._asJQuery()._val_("");
  407. return self;},
  408. source: unescape('clearWorkspace%0A%20%20%20%20textarea%20asJQuery%20val%3A%20%27%27%0A')}),
  409. smalltalk.Workspace);
  410. smalltalk.addMethod(
  411. '_doIt',
  412. smalltalk.method({
  413. selector: 'doIt',
  414. category: 'actions',
  415. fn: function (){
  416. var self=this;
  417. self._printIt();
  418. return self;},
  419. source: unescape('doIt%0A%20%20%20%20self%20printIt%0A')}),
  420. smalltalk.Workspace);
  421. smalltalk.addMethod(
  422. '_printIt',
  423. smalltalk.method({
  424. selector: 'printIt',
  425. category: 'actions',
  426. fn: function (){
  427. var self=this;
  428. var selection=nil;
  429. self['@textarea']._asJQuery()._focus();
  430. self._selectionStart().__eq(self._selectionEnd())._ifTrue_ifFalse_((function(){return selection=self._currentLine();}),(function(){return selection=self['@textarea']._asJQuery()._val()._copyFrom_to_(self._selectionStart().__plus((1)),self._selectionEnd().__plus((1)));}));
  431. self._print_(self._eval_(selection)._printString());
  432. return self;},
  433. source: unescape('printIt%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%20self%20print%3A%20%28self%20eval%3A%20selection%29%20printString%0A')}),
  434. smalltalk.Workspace);
  435. smalltalk.addMethod(
  436. '_print_',
  437. smalltalk.method({
  438. selector: 'print:',
  439. category: 'actions',
  440. fn: function (aString){
  441. var self=this;
  442. var start=nil;
  443. start=self._selectionEnd();
  444. self['@textarea']._asJQuery()._val_(self['@textarea']._asJQuery()._val()._copyFrom_to_((1),start).__comma(" ").__comma(aString).__comma(" ").__comma(self['@textarea']._asJQuery()._val()._copyFrom_to_(start.__plus((1)),self['@textarea']._asJQuery()._val()._size())));
  445. self._selectionStart_(start);
  446. self._selectionEnd_(start.__plus(aString._size()).__plus((2)));
  447. return self;},
  448. 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')}),
  449. smalltalk.Workspace);
  450. smalltalk.addMethod(
  451. '_eval_',
  452. smalltalk.method({
  453. selector: 'eval:',
  454. category: 'actions',
  455. fn: function (aString){
  456. var self=this;
  457. return smalltalk.Compiler._new()._loadExpression_(aString);
  458. return self;},
  459. source: unescape('eval%3A%20aString%0A%20%20%20%20%5ECompiler%20new%20loadExpression%3A%20aString%0A')}),
  460. smalltalk.Workspace);
  461. smalltalk.addMethod(
  462. '_renderBoxOn_',
  463. smalltalk.method({
  464. selector: 'renderBoxOn:',
  465. category: 'rendering',
  466. fn: function (html){
  467. var self=this;
  468. self['@textarea']=html._textarea();
  469. self['@textarea']._asJQuery()._call_("tabby");
  470. self['@textarea']._onKeyDown_((function(e){return self._handleKeyDown_(e);}));
  471. (function($rec){$rec._class_("jt_workspace");return $rec._at_put_("spellcheck","false");})(self['@textarea']);
  472. return self;},
  473. 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')}),
  474. smalltalk.Workspace);
  475. smalltalk.addMethod(
  476. '_renderButtonsOn_',
  477. smalltalk.method({
  478. selector: 'renderButtonsOn:',
  479. category: 'rendering',
  480. fn: function (html){
  481. var self=this;
  482. (function($rec){$rec._with_("DoIt");$rec._title_(unescape("ctrl+d"));return $rec._onClick_((function(){return self._doIt();}));})(html._button());
  483. (function($rec){$rec._with_("PrintIt");$rec._title_(unescape("ctrl+p"));return $rec._onClick_((function(){return self._printIt();}));})(html._button());
  484. (function($rec){$rec._with_("Clear workspace");return $rec._onClick_((function(){return self._clearWorkspace();}));})(html._button());
  485. return self;},
  486. 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%27Clear%20workspace%27%3B%0A%09onClick%3A%20%5Bself%20clearWorkspace%5D%0A')}),
  487. smalltalk.Workspace);
  488. smalltalk.addClass('Transcript', smalltalk.TabWidget, ['textarea'], 'IDE');
  489. smalltalk.addMethod(
  490. '_label',
  491. smalltalk.method({
  492. selector: 'label',
  493. category: 'accessing',
  494. fn: function (){
  495. var self=this;
  496. return unescape("%5BTranscript%5D");
  497. return self;},
  498. source: unescape('label%0A%20%20%20%20%5E%27%5BTranscript%5D%27%0A')}),
  499. smalltalk.Transcript);
  500. smalltalk.addMethod(
  501. '_show_',
  502. smalltalk.method({
  503. selector: 'show:',
  504. category: 'actions',
  505. fn: function (anObject){
  506. var self=this;
  507. self['@textarea']._asJQuery()._val_(self['@textarea']._asJQuery()._val().__comma(anObject._asString()));
  508. return self;},
  509. source: unescape('show%3A%20anObject%0A%20%20%20%20textarea%20asJQuery%20val%3A%20textarea%20asJQuery%20val%2C%20anObject%20asString.%0A%0A')}),
  510. smalltalk.Transcript);
  511. smalltalk.addMethod(
  512. '_cr',
  513. smalltalk.method({
  514. selector: 'cr',
  515. category: 'actions',
  516. fn: function (){
  517. var self=this;
  518. self['@textarea']._asJQuery()._val_(self['@textarea']._asJQuery()._val().__comma(smalltalk.String._cr()));
  519. return self;},
  520. source: unescape('cr%0A%20%20%20%20textarea%20asJQuery%20val%3A%20textarea%20asJQuery%20val%2C%20String%20cr.%0A')}),
  521. smalltalk.Transcript);
  522. smalltalk.addMethod(
  523. '_clear',
  524. smalltalk.method({
  525. selector: 'clear',
  526. category: 'actions',
  527. fn: function (){
  528. var self=this;
  529. self['@textarea']._asJQuery()._val_("");
  530. return self;},
  531. source: unescape('clear%0A%20%20%20%20textarea%20asJQuery%20val%3A%20%27%27%0A')}),
  532. smalltalk.Transcript);
  533. smalltalk.addMethod(
  534. '_renderBoxOn_',
  535. smalltalk.method({
  536. selector: 'renderBoxOn:',
  537. category: 'rendering',
  538. fn: function (html){
  539. var self=this;
  540. self['@textarea']=html._textarea();
  541. self['@textarea']._asJQuery()._call_("tabby");
  542. (function($rec){$rec._class_("jt_transcript");return $rec._at_put_("spellcheck","false");})(self['@textarea']);
  543. return self;},
  544. 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')}),
  545. smalltalk.Transcript);
  546. smalltalk.addMethod(
  547. '_renderButtonsOn_',
  548. smalltalk.method({
  549. selector: 'renderButtonsOn:',
  550. category: 'rendering',
  551. fn: function (html){
  552. var self=this;
  553. (function($rec){$rec._with_("Clear transcript");return $rec._onClick_((function(){return self._clear();}));})(html._button());
  554. return self;},
  555. 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')}),
  556. smalltalk.Transcript);
  557. smalltalk.Transcript.klass.iVarNames = ['current'];
  558. smalltalk.addMethod(
  559. '_open',
  560. smalltalk.method({
  561. selector: 'open',
  562. category: 'instance creation',
  563. fn: function (){
  564. var self=this;
  565. self._current()._open();
  566. return self;},
  567. source: unescape('open%0A%20%20%20%20self%20current%20open%0A')}),
  568. smalltalk.Transcript.klass);
  569. smalltalk.addMethod(
  570. '_new',
  571. smalltalk.method({
  572. selector: 'new',
  573. category: 'instance creation',
  574. fn: function (){
  575. var self=this;
  576. self._shouldNotImplement();
  577. return self;},
  578. source: unescape('new%0A%20%20%20%20self%20shouldNotImplement%0A')}),
  579. smalltalk.Transcript.klass);
  580. smalltalk.addMethod(
  581. '_current',
  582. smalltalk.method({
  583. selector: 'current',
  584. category: 'instance creation',
  585. fn: function (){
  586. var self=this;
  587. return self['@current']._ifNil_((function(){return self['@current']=self.klass.superclass.fn.prototype['_new'].apply(self, []);}));
  588. return self;},
  589. source: unescape('current%0A%20%20%20%20%5Ecurrent%20ifNil%3A%20%5Bcurrent%20%3A%3D%20super%20new%5D%0A')}),
  590. smalltalk.Transcript.klass);
  591. smalltalk.addMethod(
  592. '_show_',
  593. smalltalk.method({
  594. selector: 'show:',
  595. category: 'printing',
  596. fn: function (anObject){
  597. var self=this;
  598. self._current()._show_(anObject);
  599. return self;},
  600. source: unescape('show%3A%20anObject%0A%20%20%20%20self%20current%20show%3A%20anObject%0A')}),
  601. smalltalk.Transcript.klass);
  602. smalltalk.addMethod(
  603. '_cr',
  604. smalltalk.method({
  605. selector: 'cr',
  606. category: 'printing',
  607. fn: function (){
  608. var self=this;
  609. self._current()._show_(smalltalk.String._cr());
  610. return self;},
  611. source: unescape('cr%0A%20%20%20%20self%20current%20show%3A%20String%20cr%0A')}),
  612. smalltalk.Transcript.klass);
  613. smalltalk.addMethod(
  614. '_clear',
  615. smalltalk.method({
  616. selector: 'clear',
  617. category: 'printing',
  618. fn: function (){
  619. var self=this;
  620. self._current()._clear();
  621. return self;},
  622. source: unescape('clear%0A%20%20%20%20self%20current%20clear%0A')}),
  623. smalltalk.Transcript.klass);
  624. smalltalk.addClass('Browser', smalltalk.TabWidget, ['selectedCategory', 'selectedClass', 'selectedProtocol', 'selectedMethod', 'categoriesList', 'classesList', 'protocolsList', 'methodsList', 'sourceTextarea', 'tabsList', 'selectedTab', 'saveButton', 'classButtons', 'methodButtons'], 'IDE');
  625. smalltalk.addMethod(
  626. '_initialize',
  627. smalltalk.method({
  628. selector: 'initialize',
  629. category: 'initialization',
  630. fn: function (){
  631. var self=this;
  632. self.klass.superclass.fn.prototype['_initialize'].apply(self, []);
  633. self['@selectedTab']="instance";
  634. return self;},
  635. source: unescape('initialize%0A%20%20%20%20super%20initialize.%0A%20%20%20%20selectedTab%20%3A%3D%20%23instance%0A')}),
  636. smalltalk.Browser);
  637. smalltalk.addMethod(
  638. '_label',
  639. smalltalk.method({
  640. selector: 'label',
  641. category: 'accessing',
  642. fn: function (){
  643. var self=this;
  644. return self['@selectedClass']._ifNil_ifNotNil_((function(){return unescape("Browser%20%28nil%29");}),(function(){return self['@selectedClass']._name();}));
  645. return self;},
  646. 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')}),
  647. smalltalk.Browser);
  648. smalltalk.addMethod(
  649. '_categories',
  650. smalltalk.method({
  651. selector: 'categories',
  652. category: 'accessing',
  653. fn: function (){
  654. var self=this;
  655. var categories=nil;
  656. categories=smalltalk.Array._new();
  657. smalltalk.Smalltalk._current()._classes()._do_((function(each){return categories._includes_(each._category())._ifFalse_((function(){return categories._add_(each._category());}));}));
  658. return categories._sort();
  659. return self;},
  660. 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')}),
  661. smalltalk.Browser);
  662. smalltalk.addMethod(
  663. '_classes',
  664. smalltalk.method({
  665. selector: 'classes',
  666. category: 'accessing',
  667. fn: function (){
  668. var self=this;
  669. return smalltalk.Smalltalk._current()._classes()._select_((function(each){return each._category().__eq(self['@selectedCategory']);}))._sort_((function(a, b){return a._name().__gt(b._name());}));
  670. return self;},
  671. 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')}),
  672. smalltalk.Browser);
  673. smalltalk.addMethod(
  674. '_protocols',
  675. smalltalk.method({
  676. selector: 'protocols',
  677. category: 'accessing',
  678. fn: function (){
  679. var self=this;
  680. try{var class=nil;
  681. var protocols=nil;
  682. protocols=smalltalk.Array._new();
  683. self['@selectedClass']._ifNotNil_((function(){self['@selectedTab'].__eq("comment")._ifTrue_((function(){return (function(){throw({name: 'stReturn', selector: '_protocols', fn: function(){return []}})})();}));class=self['@selectedTab'].__eq("instance")._ifTrue_ifFalse_((function(){return self['@selectedClass'];}),(function(){return self['@selectedClass']._class();}));class._methodDictionary()._isEmpty()._ifTrue_((function(){return protocols._add_("not yet classified");}));return class._methodDictionary()._do_((function(each){return protocols._includes_(each._category())._ifFalse_((function(){return protocols._add_(each._category());}));}));}));
  684. (function(){throw({name: 'stReturn', selector: '_protocols', fn: function(){return protocols._sort()}})})();
  685. return self;
  686. } catch(e) {if(e.name === 'stReturn' && e.selector === '_protocols'){return e.fn()} throw(e)}},
  687. source: unescape('protocols%0A%20%20%20%20%7C%20class%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%09class%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%09class%20methodDictionary%20isEmpty%20ifTrue%3A%20%5B%0A%09%20%20%20%20protocols%20add%3A%20%27not%20yet%20classified%27%5D.%0A%09class%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')}),
  688. smalltalk.Browser);
  689. smalltalk.addMethod(
  690. '_methods',
  691. smalltalk.method({
  692. selector: 'methods',
  693. category: 'accessing',
  694. fn: function (){
  695. var self=this;
  696. try{var class=nil;
  697. self['@selectedTab'].__eq("comment")._ifTrue_((function(){return (function(){throw({name: 'stReturn', selector: '_methods', fn: function(){return []}})})();}));
  698. self['@selectedClass']._ifNotNil_((function(){return class=self['@selectedTab'].__eq("instance")._ifTrue_ifFalse_((function(){return self['@selectedClass'];}),(function(){return self['@selectedClass']._class();}));}));
  699. (function(){throw({name: 'stReturn', selector: '_methods', fn: function(){return self['@selectedProtocol']._ifNil_ifNotNil_((function(){return class._ifNil_ifNotNil_((function(){return [];}),(function(){return class._methodDictionary()._values();}));}),(function(){return class._methodDictionary()._values()._select_((function(each){return each._category().__eq(self['@selectedProtocol']);}));}))._sort_((function(a, b){return a._selector().__gt(b._selector());}))}})})();
  700. return self;
  701. } catch(e) {if(e.name === 'stReturn' && e.selector === '_methods'){return e.fn()} throw(e)}},
  702. source: unescape('methods%0A%20%20%20%20%7C%20class%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%09class%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%20class%20%0A%09%09ifNil%3A%20%5B%23%28%29%5D%20%0A%09%09ifNotNil%3A%20%5Bclass%20methodDictionary%20values%5D%5D%0A%09ifNotNil%3A%20%5B%0A%09%20%20%20%20class%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')}),
  703. smalltalk.Browser);
  704. smalltalk.addMethod(
  705. '_source',
  706. smalltalk.method({
  707. selector: 'source',
  708. category: 'accessing',
  709. fn: function (){
  710. var self=this;
  711. try{self['@selectedTab'].__eq("comment")._ifFalse_((function(){return (function(){throw({name: 'stReturn', selector: '_source', fn: function(){return self['@selectedProtocol']._notNil()._or_((function(){return self['@selectedMethod']._notNil();}))._ifFalse_ifTrue_((function(){return self._declarationSource();}),(function(){return self._methodSource();}))}})})();}));
  712. (function(){throw({name: 'stReturn', selector: '_source', fn: function(){return self['@selectedClass']._ifNil_ifNotNil_((function(){return "";}),(function(){return self._classCommentSource();}))}})})();
  713. return self;
  714. } catch(e) {if(e.name === 'stReturn' && e.selector === '_source'){return e.fn()} throw(e)}},
  715. 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')}),
  716. smalltalk.Browser);
  717. smalltalk.addMethod(
  718. '_methodSource',
  719. smalltalk.method({
  720. selector: 'methodSource',
  721. category: 'accessing',
  722. fn: function (){
  723. var self=this;
  724. return self['@selectedMethod']._ifNil_ifNotNil_((function(){return self._dummyMethodSource();}),(function(){return self['@selectedMethod']._source();}));
  725. return self;},
  726. source: unescape('methodSource%0A%20%20%20%20%5EselectedMethod%0A%09ifNil%3A%20%5Bself%20dummyMethodSource%5D%0A%09ifNotNil%3A%20%5BselectedMethod%20source%5D%0A')}),
  727. smalltalk.Browser);
  728. smalltalk.addMethod(
  729. '_dummyMethodSource',
  730. smalltalk.method({
  731. selector: 'dummyMethodSource',
  732. category: 'accessing',
  733. fn: function (){
  734. var self=this;
  735. return unescape("messageSelectorAndArgumentNames%0A%09%22comment%20stating%20purpose%20of%20message%22%0A%0A%09%7C%20temporary%20variable%20names%20%7C%0A%09statements");
  736. return self;},
  737. 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')}),
  738. smalltalk.Browser);
  739. smalltalk.addMethod(
  740. '_declarationSource',
  741. smalltalk.method({
  742. selector: 'declarationSource',
  743. category: 'accessing',
  744. fn: function (){
  745. var self=this;
  746. return self['@selectedTab'].__eq("instance")._ifTrue_ifFalse_((function(){return self._classDeclarationSource();}),(function(){return self._metaclassDeclarationSource();}));
  747. return self;},
  748. 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')}),
  749. smalltalk.Browser);
  750. smalltalk.addMethod(
  751. '_classDeclarationSource',
  752. smalltalk.method({
  753. selector: 'classDeclarationSource',
  754. category: 'accessing',
  755. fn: function (){
  756. var self=this;
  757. var stream=nil;
  758. stream=""._writeStream();
  759. self['@selectedClass']._ifNotNil_((function(){(function($rec){$rec._nextPutAll_(self['@selectedClass']._superclass()._asString());$rec._nextPutAll_(unescape("%20subclass%3A%20%23"));$rec._nextPutAll_(self['@selectedClass']._name());$rec._nextPutAll_(smalltalk.String._cr().__comma(smalltalk.String._tab()));return $rec._nextPutAll_(unescape("instanceVariableNames%3A%20%27"));})(stream);self['@selectedClass']._instanceVariableNames()._do_separatedBy_((function(each){return stream._nextPutAll_(each);}),(function(){return stream._nextPutAll_(" ");}));return (function($rec){$rec._nextPutAll_(unescape("%27").__comma(smalltalk.String._cr()).__comma(smalltalk.String._tab()));$rec._nextPutAll_(unescape("category%3A%20%27"));$rec._nextPutAll_(self['@selectedClass']._category());return $rec._nextPutAll_(unescape("%27"));})(stream);}));
  760. return stream._contents();
  761. return self;},
  762. 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')}),
  763. smalltalk.Browser);
  764. smalltalk.addMethod(
  765. '_metaclassDeclarationSource',
  766. smalltalk.method({
  767. selector: 'metaclassDeclarationSource',
  768. category: 'accessing',
  769. fn: function (){
  770. var self=this;
  771. var stream=nil;
  772. stream=""._writeStream();
  773. self['@selectedClass']._ifNotNil_((function(){(function($rec){$rec._nextPutAll_(self['@selectedClass']._asString());$rec._nextPutAll_(" class ");return $rec._nextPutAll_(unescape("instanceVariableNames%3A%20%27"));})(stream);self['@selectedClass']._class()._instanceVariableNames()._do_separatedBy_((function(each){return stream._nextPutAll_(each);}),(function(){return stream._nextPutAll_(" ");}));return stream._nextPutAll_(unescape("%27"));}));
  774. return stream._contents();
  775. return self;},
  776. 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')}),
  777. smalltalk.Browser);
  778. smalltalk.addMethod(
  779. '_classCommentSource',
  780. smalltalk.method({
  781. selector: 'classCommentSource',
  782. category: 'accessing',
  783. fn: function (){
  784. var self=this;
  785. return self['@selectedClass']._comment();
  786. return self;},
  787. source: unescape('classCommentSource%0A%20%20%20%20%5EselectedClass%20comment%0A')}),
  788. smalltalk.Browser);
  789. smalltalk.addMethod(
  790. '_enableSaveButton',
  791. smalltalk.method({
  792. selector: 'enableSaveButton',
  793. category: 'actions',
  794. fn: function (){
  795. var self=this;
  796. self['@saveButton']._removeAt_("disabled");
  797. return self;},
  798. source: unescape('enableSaveButton%0A%20%20%20%20saveButton%20removeAt%3A%20%27disabled%27%0A')}),
  799. smalltalk.Browser);
  800. smalltalk.addMethod(
  801. '_disableSaveButton',
  802. smalltalk.method({
  803. selector: 'disableSaveButton',
  804. category: 'actions',
  805. fn: function (){
  806. var self=this;
  807. self['@saveButton']._ifNotNil_((function(){return self['@saveButton']._at_put_("disabled",true);}));
  808. return self;},
  809. source: unescape('disableSaveButton%0A%20%20%20%20saveButton%20ifNotNil%3A%20%5B%0A%09saveButton%20at%3A%20%27disabled%27%20put%3A%20true%5D%0A')}),
  810. smalltalk.Browser);
  811. smalltalk.addMethod(
  812. '_hideClassButtons',
  813. smalltalk.method({
  814. selector: 'hideClassButtons',
  815. category: 'actions',
  816. fn: function (){
  817. var self=this;
  818. self['@classButtons']._asJQuery()._hide();
  819. return self;},
  820. source: unescape('hideClassButtons%0A%20%20%20%20classButtons%20asJQuery%20hide%0A')}),
  821. smalltalk.Browser);
  822. smalltalk.addMethod(
  823. '_showClassButtons',
  824. smalltalk.method({
  825. selector: 'showClassButtons',
  826. category: 'actions',
  827. fn: function (){
  828. var self=this;
  829. self['@classButtons']._asJQuery()._show();
  830. return self;},
  831. source: unescape('showClassButtons%0A%20%20%20%20classButtons%20asJQuery%20show%0A')}),
  832. smalltalk.Browser);
  833. smalltalk.addMethod(
  834. '_hideMethodButtons',
  835. smalltalk.method({
  836. selector: 'hideMethodButtons',
  837. category: 'actions',
  838. fn: function (){
  839. var self=this;
  840. self['@methodButtons']._asJQuery()._hide();
  841. return self;},
  842. source: unescape('hideMethodButtons%0A%20%20%20%20methodButtons%20asJQuery%20hide%0A')}),
  843. smalltalk.Browser);
  844. smalltalk.addMethod(
  845. '_showMethodButtons',
  846. smalltalk.method({
  847. selector: 'showMethodButtons',
  848. category: 'actions',
  849. fn: function (){
  850. var self=this;
  851. self['@methodButtons']._asJQuery()._show();
  852. return self;},
  853. source: unescape('showMethodButtons%0A%20%20%20%20methodButtons%20asJQuery%20show%0A')}),
  854. smalltalk.Browser);
  855. smalltalk.addMethod(
  856. '_compile',
  857. smalltalk.method({
  858. selector: 'compile',
  859. category: 'actions',
  860. fn: function (){
  861. var self=this;
  862. self['@selectedTab'].__eq("comment")._ifTrue_((function(){return self['@selectedClass']._ifNotNil_((function(){return self._compileClassComment();}));}));
  863. self['@selectedProtocol']._notNil()._or_((function(){return self['@selectedMethod']._notNil();}))._ifFalse_ifTrue_((function(){return self._compileDefinition();}),(function(){return self._compileMethodDefinition();}));
  864. self._disableSaveButton();
  865. return self;},
  866. source: unescape('compile%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%20%20%20%20self%20disableSaveButton%0A')}),
  867. smalltalk.Browser);
  868. smalltalk.addMethod(
  869. '_compileClassComment',
  870. smalltalk.method({
  871. selector: 'compileClassComment',
  872. category: 'actions',
  873. fn: function (){
  874. var self=this;
  875. self['@selectedClass']._comment_(self['@sourceTextarea']._asJQuery()._val());
  876. return self;},
  877. source: unescape('compileClassComment%0A%20%20%20%20selectedClass%20comment%3A%20sourceTextarea%20asJQuery%20val%0A')}),
  878. smalltalk.Browser);
  879. smalltalk.addMethod(
  880. '_compileMethodDefinition',
  881. smalltalk.method({
  882. selector: 'compileMethodDefinition',
  883. category: 'actions',
  884. fn: function (){
  885. var self=this;
  886. self['@selectedTab'].__eq("instance")._ifTrue_ifFalse_((function(){return self._compileMethodDefinitionFor_(self['@selectedClass']);}),(function(){return self._compileMethodDefinitionFor_(self['@selectedClass']._class());}));
  887. return self;},
  888. 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')}),
  889. smalltalk.Browser);
  890. smalltalk.addMethod(
  891. '_compileMethodDefinitionFor_',
  892. smalltalk.method({
  893. selector: 'compileMethodDefinitionFor:',
  894. category: 'actions',
  895. fn: function (aClass){
  896. var self=this;
  897. var method=nil;
  898. method=smalltalk.Compiler._new()._load_forClass_(self['@sourceTextarea']._asJQuery()._val(),self['@selectedClass']);
  899. method._category_(self['@selectedProtocol']);
  900. aClass._addCompiledMethod_(method);
  901. self._updateMethodsList();
  902. self._selectMethod_(method);
  903. return self;},
  904. source: unescape('compileMethodDefinitionFor%3A%20aClass%0A%20%20%20%20%7C%20method%20%7C%0A%20%20%20%20method%20%3A%3D%20Compiler%20new%20load%3A%20sourceTextarea%20asJQuery%20val%20forClass%3A%20selectedClass.%0A%20%20%20%20method%20category%3A%20selectedProtocol.%0A%20%20%20%20aClass%20addCompiledMethod%3A%20method.%0A%20%20%20%20self%20updateMethodsList.%0A%20%20%20%20self%20selectMethod%3A%20method%0A')}),
  905. smalltalk.Browser);
  906. smalltalk.addMethod(
  907. '_compileDefinition',
  908. smalltalk.method({
  909. selector: 'compileDefinition',
  910. category: 'actions',
  911. fn: function (){
  912. var self=this;
  913. var newClass=nil;
  914. newClass=smalltalk.Compiler._new()._loadExpression_(self['@sourceTextarea']._asJQuery()._val());
  915. (function($rec){$rec._updateCategoriesList();return $rec._updateClassesList();})(self);
  916. return self;},
  917. 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')}),
  918. smalltalk.Browser);
  919. smalltalk.addMethod(
  920. '_removeClass',
  921. smalltalk.method({
  922. selector: 'removeClass',
  923. category: 'actions',
  924. fn: function (){
  925. var self=this;
  926. self._confirm_("Do you really want to remove ".__comma(self['@selectedClass']._name()).__comma(unescape("%3F")))._ifTrue_((function(){smalltalk.Smalltalk._current()._basicDelete_(self['@selectedClass']._name());return self._selectClass_(nil);}));
  927. return self;},
  928. 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')}),
  929. smalltalk.Browser);
  930. smalltalk.addMethod(
  931. '_removeMethod',
  932. smalltalk.method({
  933. selector: 'removeMethod',
  934. category: 'actions',
  935. fn: function (){
  936. var self=this;
  937. self._confirm_(unescape("Do%20you%20really%20want%20to%20remove%20%23").__comma(self['@selectedMethod']._selector()).__comma(unescape("%3F")))._ifTrue_((function(){self['@selectedClass']._removeCompiledMethod_(self['@selectedMethod']);return self._selectMethod_(nil);}));
  938. return self;},
  939. source: unescape('removeMethod%0A%20%20%20%20%28self%20confirm%3A%20%27Do%20you%20really%20want%20to%20remove%20%23%27%2C%20selectedMethod%20selector%2C%20%27%3F%27%29%0A%09ifTrue%3A%20%5B%0A%09%20%20%20%20selectedClass%20removeCompiledMethod%3A%20selectedMethod.%0A%09%20%20%20%20self%20selectMethod%3A%20nil%5D%0A')}),
  940. smalltalk.Browser);
  941. smalltalk.addMethod(
  942. '_selectCategory_',
  943. smalltalk.method({
  944. selector: 'selectCategory:',
  945. category: 'actions',
  946. fn: function (aCategory){
  947. var self=this;
  948. self['@selectedCategory']=aCategory;
  949. self['@selectedClass']=self['@selectedProtocol']=self['@selectedMethod']=nil;
  950. (function($rec){$rec._updateCategoriesList();$rec._updateClassesList();$rec._updateProtocolsList();$rec._updateMethodsList();return $rec._updateSourceAndButtons();})(self);
  951. return self;},
  952. source: unescape('selectCategory%3A%20aCategory%0A%20%20%20%20selectedCategory%20%3A%3D%20aCategory.%0A%20%20%20%20selectedClass%20%3A%3D%20selectedProtocol%20%3A%3D%20selectedMethod%20%3A%3D%20%20nil.%0A%20%20%20%20self%20%0A%09updateCategoriesList%3B%0A%09updateClassesList%3B%0A%09updateProtocolsList%3B%0A%09updateMethodsList%3B%0A%09updateSourceAndButtons%0A')}),
  953. smalltalk.Browser);
  954. smalltalk.addMethod(
  955. '_selectClass_',
  956. smalltalk.method({
  957. selector: 'selectClass:',
  958. category: 'actions',
  959. fn: function (aClass){
  960. var self=this;
  961. self['@selectedClass']=aClass;
  962. self['@selectedProtocol']=self['@selectedMethod']=nil;
  963. (function($rec){$rec._updateClassesList();$rec._updateProtocolsList();$rec._updateMethodsList();return $rec._updateSourceAndButtons();})(self);
  964. return self;},
  965. source: unescape('selectClass%3A%20aClass%0A%20%20%20%20selectedClass%20%3A%3D%20aClass.%0A%20%20%20%20selectedProtocol%20%3A%3D%20selectedMethod%20%3A%3D%20nil.%0A%20%20%20%20self%20%0A%09updateClassesList%3B%0A%09updateProtocolsList%3B%0A%09updateMethodsList%3B%0A%09updateSourceAndButtons%0A')}),
  966. smalltalk.Browser);
  967. smalltalk.addMethod(
  968. '_selectProtocol_',
  969. smalltalk.method({
  970. selector: 'selectProtocol:',
  971. category: 'actions',
  972. fn: function (aString){
  973. var self=this;
  974. self['@selectedProtocol']=aString;
  975. self['@selectedMethod']=nil;
  976. (function($rec){$rec._updateProtocolsList();$rec._updateMethodsList();return $rec._updateSourceAndButtons();})(self);
  977. return self;},
  978. source: unescape('selectProtocol%3A%20aString%0A%20%20%20%20selectedProtocol%20%3A%3D%20aString.%0A%20%20%20%20selectedMethod%20%3A%3D%20nil.%0A%20%20%20%20self%20%0A%09updateProtocolsList%3B%0A%09updateMethodsList%3B%0A%09updateSourceAndButtons%0A')}),
  979. smalltalk.Browser);
  980. smalltalk.addMethod(
  981. '_selectMethod_',
  982. smalltalk.method({
  983. selector: 'selectMethod:',
  984. category: 'actions',
  985. fn: function (aMethod){
  986. var self=this;
  987. self['@selectedMethod']=aMethod;
  988. (function($rec){$rec._updateProtocolsList();$rec._updateMethodsList();return $rec._updateSourceAndButtons();})(self);
  989. return self;},
  990. source: unescape('selectMethod%3A%20aMethod%0A%20%20%20%20selectedMethod%20%3A%3D%20aMethod.%0A%20%20%20%20self%20%0A%09updateProtocolsList%3B%0A%09updateMethodsList%3B%0A%09updateSourceAndButtons%0A')}),
  991. smalltalk.Browser);
  992. smalltalk.addMethod(
  993. '_selectTab_',
  994. smalltalk.method({
  995. selector: 'selectTab:',
  996. category: 'actions',
  997. fn: function (aString){
  998. var self=this;
  999. self['@selectedTab']=aString;
  1000. self._selectProtocol_(nil);
  1001. self._updateTabsList();
  1002. return self;},
  1003. source: unescape('selectTab%3A%20aString%0A%20%20%20%20selectedTab%20%3A%3D%20aString.%0A%20%20%20%20self%20selectProtocol%3A%20nil.%0A%20%20%20%20self%20updateTabsList.%0A')}),
  1004. smalltalk.Browser);
  1005. smalltalk.addMethod(
  1006. '_renderBoxOn_',
  1007. smalltalk.method({
  1008. selector: 'renderBoxOn:',
  1009. category: 'rendering',
  1010. fn: function (html){
  1011. var self=this;
  1012. (function($rec){$rec._renderTopPanelOn_(html);$rec._renderTabsOn_(html);return $rec._renderBottomPanelOn_(html);})(self);
  1013. return self;},
  1014. 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')}),
  1015. smalltalk.Browser);
  1016. smalltalk.addMethod(
  1017. '_renderTopPanelOn_',
  1018. smalltalk.method({
  1019. selector: 'renderTopPanelOn:',
  1020. category: 'rendering',
  1021. fn: function (html){
  1022. var self=this;
  1023. (function($rec){$rec._class_("top");return $rec._with_((function(){self['@categoriesList']=html._ul()._class_("jt_column categories");self['@classesList']=html._ul()._class_("jt_column classes");self['@protocolsList']=html._ul()._class_("jt_column protocols");self['@methodsList']=html._ul()._class_("jt_column methods");(function($rec){$rec._updateCategoriesList();$rec._updateClassesList();$rec._updateProtocolsList();return $rec._updateMethodsList();})(self);return html._div()._class_("jt_clear");}));})(html._div());
  1024. return self;},
  1025. 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%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')}),
  1026. smalltalk.Browser);
  1027. smalltalk.addMethod(
  1028. '_renderTabsOn_',
  1029. smalltalk.method({
  1030. selector: 'renderTabsOn:',
  1031. category: 'rendering',
  1032. fn: function (html){
  1033. var self=this;
  1034. self['@tabsList']=html._ul()._class_("jt_tabs");
  1035. self._updateTabsList();
  1036. return self;},
  1037. 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')}),
  1038. smalltalk.Browser);
  1039. smalltalk.addMethod(
  1040. '_renderBottomPanelOn_',
  1041. smalltalk.method({
  1042. selector: 'renderBottomPanelOn:',
  1043. category: 'rendering',
  1044. fn: function (html){
  1045. var self=this;
  1046. (function($rec){$rec._class_("jt_sourceCode");return $rec._with_((function(){self['@sourceTextarea']=(function($rec){$rec._onKeyPress_((function(){return self._enableSaveButton();}));$rec._class_("source");return $rec._at_put_("spellcheck","false");})(html._textarea());return self['@sourceTextarea']._asJQuery()._call_("tabby");}));})(html._div());
  1047. return self;},
  1048. 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')}),
  1049. smalltalk.Browser);
  1050. smalltalk.addMethod(
  1051. '_renderButtonsOn_',
  1052. smalltalk.method({
  1053. selector: 'renderButtonsOn:',
  1054. category: 'rendering',
  1055. fn: function (html){
  1056. var self=this;
  1057. self['@saveButton']=html._button();
  1058. (function($rec){$rec._with_("Save");return $rec._onClick_((function(){return self._compile();}));})(self['@saveButton']);
  1059. self['@methodButtons']=html._span()._with_((function(){return (function($rec){$rec._with_("Remove method");return $rec._onClick_((function(){return self._removeMethod();}));})(html._button());}));
  1060. self['@classButtons']=html._span()._with_((function(){return (function($rec){$rec._with_("Remove class");return $rec._onClick_((function(){return self._removeClass();}));})(html._button());}));
  1061. self._updateSourceAndButtons();
  1062. return self;},
  1063. 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%20with%3A%20%5B%0A%09html%20button%0A%09%20%20%20%20with%3A%20%27Remove%20method%27%3B%0A%09%20%20%20%20onClick%3A%20%5Bself%20removeMethod%5D%5D.%0A%20%20%20%20classButtons%20%3A%3D%20html%20span%20with%3A%20%5B%0A%09html%20button%0A%09%20%20%20%20with%3A%20%27Remove%20class%27%3B%0A%09%20%20%20%20onClick%3A%20%5Bself%20removeClass%5D%5D.%0A%20%20%20%20self%20updateSourceAndButtons%0A')}),
  1064. smalltalk.Browser);
  1065. smalltalk.addMethod(
  1066. '_updateCategoriesList',
  1067. smalltalk.method({
  1068. selector: 'updateCategoriesList',
  1069. category: 'updating',
  1070. fn: function (){
  1071. var self=this;
  1072. self['@categoriesList']._contents_((function(html){return self._categories()._do_((function(each){var li=nil;
  1073. li=html._li();self['@selectedCategory'].__eq(each)._ifTrue_((function(){return li._class_("selected");}));return (function($rec){$rec._with_(each);return $rec._onClick_((function(){return self._selectCategory_(each);}));})(li);}));}));
  1074. return self;},
  1075. 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%20%7C%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%20each%3B%0A%09%09onClick%3A%20%5Bself%20selectCategory%3A%20each%5D%5D%5D%0A')}),
  1076. smalltalk.Browser);
  1077. smalltalk.addMethod(
  1078. '_updateClassesList',
  1079. smalltalk.method({
  1080. selector: 'updateClassesList',
  1081. category: 'updating',
  1082. fn: function (){
  1083. var self=this;
  1084. smalltalk.TabManager._current()._update();
  1085. self['@classesList']._contents_((function(html){return self._classes()._do_((function(each){var li=nil;
  1086. li=html._li();self['@selectedClass'].__eq(each)._ifTrue_((function(){return li._class_("selected");}));return (function($rec){$rec._with_(each._name());return $rec._onClick_((function(){return self._selectClass_(each);}));})(li);}));}));
  1087. return self;},
  1088. 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')}),
  1089. smalltalk.Browser);
  1090. smalltalk.addMethod(
  1091. '_updateProtocolsList',
  1092. smalltalk.method({
  1093. selector: 'updateProtocolsList',
  1094. category: 'updating',
  1095. fn: function (){
  1096. var self=this;
  1097. self['@protocolsList']._contents_((function(html){return self._protocols()._do_((function(each){var li=nil;
  1098. li=html._li();self['@selectedProtocol'].__eq(each)._ifTrue_((function(){return li._class_("selected");}));return (function($rec){$rec._with_(each);return $rec._onClick_((function(){return self._selectProtocol_(each);}));})(li);}));}));
  1099. return self;},
  1100. 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')}),
  1101. smalltalk.Browser);
  1102. smalltalk.addMethod(
  1103. '_updateMethodsList',
  1104. smalltalk.method({
  1105. selector: 'updateMethodsList',
  1106. category: 'updating',
  1107. fn: function (){
  1108. var self=this;
  1109. self['@methodsList']._contents_((function(html){return self._methods()._do_((function(each){var li=nil;
  1110. li=html._li();self['@selectedMethod'].__eq(each)._ifTrue_((function(){return li._class_("selected");}));return (function($rec){$rec._with_(each._selector());return $rec._onClick_((function(){return self._selectMethod_(each);}));})(li);}));}));
  1111. return self;},
  1112. 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')}),
  1113. smalltalk.Browser);
  1114. smalltalk.addMethod(
  1115. '_updateTabsList',
  1116. smalltalk.method({
  1117. selector: 'updateTabsList',
  1118. category: 'updating',
  1119. fn: function (){
  1120. var self=this;
  1121. self['@tabsList']._contents_((function(html){var li=nil;
  1122. li=html._li();self['@selectedTab'].__eq("instance")._ifTrue_((function(){return li._class_("selected");}));(function($rec){$rec._with_("Instance");return $rec._onClick_((function(){return self._selectTab_("instance");}));})(li);li=html._li();self['@selectedTab'].__eq("class")._ifTrue_((function(){return li._class_("selected");}));(function($rec){$rec._with_("Class");return $rec._onClick_((function(){return self._selectTab_("class");}));})(li);li=html._li();self['@selectedTab'].__eq("comment")._ifTrue_((function(){return li._class_("selected");}));return (function($rec){$rec._with_("Comment");return $rec._onClick_((function(){return self._selectTab_("comment");}));})(li);}));
  1123. return self;},
  1124. 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')}),
  1125. smalltalk.Browser);
  1126. smalltalk.addMethod(
  1127. '_updateSourceAndButtons',
  1128. smalltalk.method({
  1129. selector: 'updateSourceAndButtons',
  1130. category: 'updating',
  1131. fn: function (){
  1132. var self=this;
  1133. self._disableSaveButton();
  1134. self['@selectedMethod']._ifNil_ifNotNil_((function(){self._hideMethodButtons();return self['@selectedClass']._ifNil_ifNotNil_((function(){return self._hideClassButtons();}),(function(){return self._showClassButtons();}));}),(function(){self._hideClassButtons();return self._showMethodButtons();}));
  1135. self['@sourceTextarea']._asJQuery()._val_(self._source());
  1136. return self;},
  1137. source: unescape('updateSourceAndButtons%0A%20%20%20%20self%20disableSaveButton.%0A%20%20%20%20selectedMethod%20%0A%09ifNil%3A%20%5B%0A%09%20%20%20%20self%20hideMethodButtons.%0A%09%20%20%20%20selectedClass%20%0A%09%09ifNil%3A%20%5Bself%20hideClassButtons%5D%0A%09%20%20%20%20ifNotNil%3A%20%5Bself%20showClassButtons%5D%5D%0A%09ifNotNil%3A%20%5B%0A%09%20%20%20%20self%20hideClassButtons.%0A%09%20%20%20%20self%20showMethodButtons%5D.%0A%20%20%20%20sourceTextarea%20asJQuery%20val%3A%20self%20source%0A')}),
  1138. smalltalk.Browser);
  1139. smalltalk.addMethod(
  1140. '_canBeClosed',
  1141. smalltalk.method({
  1142. selector: 'canBeClosed',
  1143. category: 'testing',
  1144. fn: function (){
  1145. var self=this;
  1146. return true;
  1147. return self;},
  1148. source: unescape('canBeClosed%0A%20%20%20%20%5Etrue%0A')}),
  1149. smalltalk.Browser);
  1150. smalltalk.addMethod(
  1151. '_openOn_',
  1152. smalltalk.method({
  1153. selector: 'openOn:',
  1154. category: 'convenience',
  1155. fn: function (aClass){
  1156. var self=this;
  1157. (function($rec){$rec._open();$rec._selectCategory_(aClass._category());return $rec._selectClass_(aClass);})(self._new());
  1158. return self;},
  1159. 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')}),
  1160. smalltalk.Browser.klass);
  1161. smalltalk.addMethod(
  1162. '_open',
  1163. smalltalk.method({
  1164. selector: 'open',
  1165. category: 'convenience',
  1166. fn: function (){
  1167. var self=this;
  1168. self._new()._open();
  1169. return self;},
  1170. source: unescape('open%0A%20%20%20%20self%20new%20open%0A')}),
  1171. smalltalk.Browser.klass);