1
0

Helios-Core.deploy.js 41 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570
  1. smalltalk.addPackage('Helios-Core', {});
  2. smalltalk.addClass('HLEnvironment', smalltalk.Object, [], 'Helios-Core');
  3. smalltalk.addMethod(
  4. "_eval_on_",
  5. smalltalk.method({
  6. selector: "eval:on:",
  7. fn: function (someCode, aReceiver) {
  8. var self = this;
  9. var $1;
  10. $1 = smalltalk.send(self, "_subclassResponsibility", []);
  11. return $1;
  12. }
  13. }),
  14. smalltalk.HLEnvironment);
  15. smalltalk.addMethod(
  16. "_packages",
  17. smalltalk.method({
  18. selector: "packages",
  19. fn: function () {
  20. var self = this;
  21. var $1;
  22. $1 = smalltalk.send(self, "_subclassResponsibility", []);
  23. return $1;
  24. }
  25. }),
  26. smalltalk.HLEnvironment);
  27. smalltalk.addClass('HLLocalEnvironment', smalltalk.HLEnvironment, [], 'Helios-Core');
  28. smalltalk.addMethod(
  29. "_eval_on_",
  30. smalltalk.method({
  31. selector: "eval:on:",
  32. fn: function (someCode, aReceiver) {
  33. var self = this;
  34. var $1, $2;
  35. var $early = {};
  36. try {
  37. var compiler;
  38. compiler = smalltalk.send(smalltalk.Compiler || Compiler, "_new", []);
  39. smalltalk.send(function () {return smalltalk.send(compiler, "_parseExpression_", [someCode]);}, "_on_do_", [smalltalk.Error || Error, function (ex) {$1 = smalltalk.send(window, "_alert_", [smalltalk.send(ex, "_messageText", [])]);throw $early = [$1];}]);
  40. $2 = smalltalk.send(smalltalk.send(smalltalk.send(compiler, "_eval_", [smalltalk.send(compiler, "_compile_forClass_", [smalltalk.send(smalltalk.send("doIt ^[", "__comma", [someCode]), "__comma", ["] value"]), smalltalk.DoIt || DoIt])]), "_fn", []), "_applyTo_arguments_", [aReceiver, []]);
  41. return $2;
  42. } catch (e) {
  43. if (e === $early) {
  44. return e[0];
  45. }
  46. throw e;
  47. }
  48. }
  49. }),
  50. smalltalk.HLLocalEnvironment);
  51. smalltalk.addMethod(
  52. "_packages",
  53. smalltalk.method({
  54. selector: "packages",
  55. fn: function () {
  56. var self = this;
  57. var $1;
  58. $1 = smalltalk.send(smalltalk.send(smalltalk.Smalltalk || Smalltalk, "_current", []), "_packages", []);
  59. return $1;
  60. }
  61. }),
  62. smalltalk.HLLocalEnvironment);
  63. smalltalk.addClass('HLRemoteEnvironment', smalltalk.HLEnvironment, [], 'Helios-Core');
  64. smalltalk.addMethod(
  65. "_eval_on_",
  66. smalltalk.method({
  67. selector: "eval:on:",
  68. fn: function (someCode, aReceiver) {
  69. var self = this;
  70. smalltalk.send(self, "_notYetImplemented", []);
  71. return self;
  72. }
  73. }),
  74. smalltalk.HLRemoteEnvironment);
  75. smalltalk.addMethod(
  76. "_packages",
  77. smalltalk.method({
  78. selector: "packages",
  79. fn: function () {
  80. var self = this;
  81. return self;
  82. }
  83. }),
  84. smalltalk.HLRemoteEnvironment);
  85. smalltalk.addClass('HLRemoteObject', smalltalk.Object, [], 'Helios-Core');
  86. smalltalk.addMethod(
  87. "_doesNotUnderstand_",
  88. smalltalk.method({
  89. selector: "doesNotUnderstand:",
  90. fn: function (aMessage) {
  91. var self = this;
  92. return self;
  93. }
  94. }),
  95. smalltalk.HLRemoteObject);
  96. smalltalk.addMethod(
  97. "_inspectOn_",
  98. smalltalk.method({
  99. selector: "inspectOn:",
  100. fn: function (anInspector) {
  101. var self = this;
  102. return self;
  103. }
  104. }),
  105. smalltalk.HLRemoteObject);
  106. smalltalk.addMethod(
  107. "_printString",
  108. smalltalk.method({
  109. selector: "printString",
  110. fn: function () {
  111. var self = this;
  112. return "this is a remote object";
  113. }
  114. }),
  115. smalltalk.HLRemoteObject);
  116. smalltalk.addClass('HLSourceArea', smalltalk.Widget, ['editor', 'textarea', 'div', 'receiver', 'onDoIt'], 'Helios-Core');
  117. smalltalk.addMethod(
  118. "_clear",
  119. smalltalk.method({
  120. selector: "clear",
  121. fn: function () {
  122. var self = this;
  123. smalltalk.send(self, "_contents_", [""]);
  124. return self;
  125. }
  126. }),
  127. smalltalk.HLSourceArea);
  128. smalltalk.addMethod(
  129. "_contents",
  130. smalltalk.method({
  131. selector: "contents",
  132. fn: function () {
  133. var self = this;
  134. var $1;
  135. $1 = smalltalk.send(self['@editor'], "_getValue", []);
  136. return $1;
  137. }
  138. }),
  139. smalltalk.HLSourceArea);
  140. smalltalk.addMethod(
  141. "_contents_",
  142. smalltalk.method({
  143. selector: "contents:",
  144. fn: function (aString) {
  145. var self = this;
  146. smalltalk.send(self['@editor'], "_setValue_", [aString]);
  147. return self;
  148. }
  149. }),
  150. smalltalk.HLSourceArea);
  151. smalltalk.addMethod(
  152. "_currentLine",
  153. smalltalk.method({
  154. selector: "currentLine",
  155. fn: function () {
  156. var self = this;
  157. var $1;
  158. $1 = smalltalk.send(self['@editor'], "_getLine_", [smalltalk.send(smalltalk.send(self['@editor'], "_getCursor", []), "_line", [])]);
  159. return $1;
  160. }
  161. }),
  162. smalltalk.HLSourceArea);
  163. smalltalk.addMethod(
  164. "_currentLineOrSelection",
  165. smalltalk.method({
  166. selector: "currentLineOrSelection",
  167. fn: function () {
  168. var self = this;
  169. var $2, $1;
  170. $2 = smalltalk.send(self['@editor'], "_somethingSelected", []);
  171. if (smalltalk.assert($2)) {
  172. $1 = smalltalk.send(self, "_selection", []);
  173. } else {
  174. $1 = smalltalk.send(self, "_currentLine", []);
  175. }
  176. return $1;
  177. }
  178. }),
  179. smalltalk.HLSourceArea);
  180. smalltalk.addMethod(
  181. "_doIt",
  182. smalltalk.method({
  183. selector: "doIt",
  184. fn: function () {
  185. var self = this;
  186. var $1;
  187. var result;
  188. result = smalltalk.send(self, "_eval_", [smalltalk.send(self, "_currentLineOrSelection", [])]);
  189. $1 = smalltalk.send(self, "_onDoIt", []);
  190. if (($receiver = $1) == nil || $receiver == undefined) {
  191. } else {
  192. smalltalk.send(smalltalk.send(self, "_onDoIt", []), "_value", []);
  193. }
  194. return result;
  195. }
  196. }),
  197. smalltalk.HLSourceArea);
  198. smalltalk.addMethod(
  199. "_editor",
  200. smalltalk.method({
  201. selector: "editor",
  202. fn: function () {
  203. var self = this;
  204. return self['@editor'];
  205. }
  206. }),
  207. smalltalk.HLSourceArea);
  208. smalltalk.addMethod(
  209. "_eval_",
  210. smalltalk.method({
  211. selector: "eval:",
  212. fn: function (aString) {
  213. var self = this;
  214. var $1, $2;
  215. var $early = {};
  216. try {
  217. var compiler;
  218. compiler = smalltalk.send(smalltalk.Compiler || Compiler, "_new", []);
  219. smalltalk.send(function () {return smalltalk.send(compiler, "_parseExpression_", [aString]);}, "_on_do_", [smalltalk.Error || Error, function (ex) {$1 = smalltalk.send(window, "_alert_", [smalltalk.send(ex, "_messageText", [])]);throw $early = [$1];}]);
  220. $2 = smalltalk.send(smalltalk.send(smalltalk.send(compiler, "_eval_", [smalltalk.send(compiler, "_compile_forClass_", [smalltalk.send(smalltalk.send("doIt ^[", "__comma", [aString]), "__comma", ["] value"]), smalltalk.DoIt || DoIt])]), "_fn", []), "_applyTo_arguments_", [smalltalk.send(self, "_receiver", []), []]);
  221. return $2;
  222. } catch (e) {
  223. if (e === $early) {
  224. return e[0];
  225. }
  226. throw e;
  227. }
  228. }
  229. }),
  230. smalltalk.HLSourceArea);
  231. smalltalk.addMethod(
  232. "_fileIn",
  233. smalltalk.method({
  234. selector: "fileIn",
  235. fn: function () {
  236. var self = this;
  237. smalltalk.send(smalltalk.send(smalltalk.Importer || Importer, "_new", []), "_import_", [smalltalk.send(smalltalk.send(self, "_currentLineOrSelection", []), "_readStream", [])]);
  238. return self;
  239. }
  240. }),
  241. smalltalk.HLSourceArea);
  242. smalltalk.addMethod(
  243. "_handleKeyDown_",
  244. smalltalk.method({
  245. selector: "handleKeyDown:",
  246. fn: function (anEvent) {
  247. var self = this;
  248. if (anEvent.ctrlKey) {
  249. if (anEvent.keyCode === 80) {
  250. self._printIt();
  251. anEvent.preventDefault();
  252. return false;
  253. }
  254. if (anEvent.keyCode === 68) {
  255. self._doIt();
  256. anEvent.preventDefault();
  257. return false;
  258. }
  259. if (anEvent.keyCode === 73) {
  260. self._inspectIt();
  261. anEvent.preventDefault();
  262. return false;
  263. }
  264. }
  265. return self;
  266. }
  267. }),
  268. smalltalk.HLSourceArea);
  269. smalltalk.addMethod(
  270. "_inspectIt",
  271. smalltalk.method({
  272. selector: "inspectIt",
  273. fn: function () {
  274. var self = this;
  275. smalltalk.send(smalltalk.send(self, "_doIt", []), "_inspect", []);
  276. return self;
  277. }
  278. }),
  279. smalltalk.HLSourceArea);
  280. smalltalk.addMethod(
  281. "_onDoIt",
  282. smalltalk.method({
  283. selector: "onDoIt",
  284. fn: function () {
  285. var self = this;
  286. return self['@onDoIt'];
  287. }
  288. }),
  289. smalltalk.HLSourceArea);
  290. smalltalk.addMethod(
  291. "_onDoIt_",
  292. smalltalk.method({
  293. selector: "onDoIt:",
  294. fn: function (aBlock) {
  295. var self = this;
  296. self['@onDoIt'] = aBlock;
  297. return self;
  298. }
  299. }),
  300. smalltalk.HLSourceArea);
  301. smalltalk.addMethod(
  302. "_onKeyDown_",
  303. smalltalk.method({
  304. selector: "onKeyDown:",
  305. fn: function (aBlock) {
  306. var self = this;
  307. smalltalk.send(self['@div'], "_onKeyDown_", [aBlock]);
  308. return self;
  309. }
  310. }),
  311. smalltalk.HLSourceArea);
  312. smalltalk.addMethod(
  313. "_onKeyUp_",
  314. smalltalk.method({
  315. selector: "onKeyUp:",
  316. fn: function (aBlock) {
  317. var self = this;
  318. smalltalk.send(self['@div'], "_onKeyUp_", [aBlock]);
  319. return self;
  320. }
  321. }),
  322. smalltalk.HLSourceArea);
  323. smalltalk.addMethod(
  324. "_print_",
  325. smalltalk.method({
  326. selector: "print:",
  327. fn: function (aString) {
  328. var self = this;
  329. var start;
  330. var stop;
  331. start = smalltalk.send(smalltalk.HashedCollection || HashedCollection, "_new", []);
  332. stop = smalltalk.send(smalltalk.HashedCollection || HashedCollection, "_new", []);
  333. smalltalk.send(start, "_at_put_", ["line", smalltalk.send(smalltalk.send(self['@editor'], "_getCursor_", [false]), "_line", [])]);
  334. smalltalk.send(start, "_at_put_", ["ch", smalltalk.send(smalltalk.send(self['@editor'], "_getCursor_", [false]), "_ch", [])]);
  335. smalltalk.send(stop, "_at_put_", ["line", smalltalk.send(start, "_at_", ["line"])]);
  336. smalltalk.send(stop, "_at_put_", ["ch", smalltalk.send(smalltalk.send(smalltalk.send(start, "_at_", ["ch"]), "__plus", [smalltalk.send(aString, "_size", [])]), "__plus", [2])]);
  337. smalltalk.send(self['@editor'], "_replaceSelection_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self['@editor'], "_getSelection", []), "__comma", [" "]), "__comma", [aString]), "__comma", [" "])]);
  338. smalltalk.send(self['@editor'], "_setCursor_", [smalltalk.send(self['@editor'], "_getCursor_", [true])]);
  339. smalltalk.send(self['@editor'], "_setSelection_end_", [stop, start]);
  340. return self;
  341. }
  342. }),
  343. smalltalk.HLSourceArea);
  344. smalltalk.addMethod(
  345. "_printIt",
  346. smalltalk.method({
  347. selector: "printIt",
  348. fn: function () {
  349. var self = this;
  350. smalltalk.send(self, "_print_", [smalltalk.send(smalltalk.send(self, "_doIt", []), "_printString", [])]);
  351. return self;
  352. }
  353. }),
  354. smalltalk.HLSourceArea);
  355. smalltalk.addMethod(
  356. "_receiver",
  357. smalltalk.method({
  358. selector: "receiver",
  359. fn: function () {
  360. var self = this;
  361. var $1;
  362. if (($receiver = self['@receiver']) == nil || $receiver == undefined) {
  363. $1 = smalltalk.send(smalltalk.DoIt || DoIt, "_new", []);
  364. } else {
  365. $1 = self['@receiver'];
  366. }
  367. return $1;
  368. }
  369. }),
  370. smalltalk.HLSourceArea);
  371. smalltalk.addMethod(
  372. "_receiver_",
  373. smalltalk.method({
  374. selector: "receiver:",
  375. fn: function (anObject) {
  376. var self = this;
  377. self['@receiver'] = anObject;
  378. return self;
  379. }
  380. }),
  381. smalltalk.HLSourceArea);
  382. smalltalk.addMethod(
  383. "_renderOn_",
  384. smalltalk.method({
  385. selector: "renderOn:",
  386. fn: function (html) {
  387. var self = this;
  388. self['@div'] = smalltalk.send(smalltalk.send(html, "_div", []), "_class_", ["source"]);
  389. smalltalk.send(self['@div'], "_with_", [function () {self['@textarea'] = smalltalk.send(html, "_textarea", []);return self['@textarea'];}]);
  390. smalltalk.send(self, "_setEditorOn_", [smalltalk.send(self['@textarea'], "_element", [])]);
  391. smalltalk.send(self['@div'], "_onKeyDown_", [function (e) {return smalltalk.send(self, "_handleKeyDown_", [e]);}]);
  392. return self;
  393. }
  394. }),
  395. smalltalk.HLSourceArea);
  396. smalltalk.addMethod(
  397. "_selection",
  398. smalltalk.method({
  399. selector: "selection",
  400. fn: function () {
  401. var self = this;
  402. var $1;
  403. $1 = smalltalk.send(self['@editor'], "_getSelection", []);
  404. return $1;
  405. }
  406. }),
  407. smalltalk.HLSourceArea);
  408. smalltalk.addMethod(
  409. "_selectionEnd",
  410. smalltalk.method({
  411. selector: "selectionEnd",
  412. fn: function () {
  413. var self = this;
  414. var $1;
  415. $1 = smalltalk.send(smalltalk.send(self['@textarea'], "_element", []), "_selectionEnd", []);
  416. return $1;
  417. }
  418. }),
  419. smalltalk.HLSourceArea);
  420. smalltalk.addMethod(
  421. "_selectionEnd_",
  422. smalltalk.method({
  423. selector: "selectionEnd:",
  424. fn: function (anInteger) {
  425. var self = this;
  426. smalltalk.send(smalltalk.send(self['@textarea'], "_element", []), "_selectionEnd_", [anInteger]);
  427. return self;
  428. }
  429. }),
  430. smalltalk.HLSourceArea);
  431. smalltalk.addMethod(
  432. "_selectionStart",
  433. smalltalk.method({
  434. selector: "selectionStart",
  435. fn: function () {
  436. var self = this;
  437. var $1;
  438. $1 = smalltalk.send(smalltalk.send(self['@textarea'], "_element", []), "_selectionStart", []);
  439. return $1;
  440. }
  441. }),
  442. smalltalk.HLSourceArea);
  443. smalltalk.addMethod(
  444. "_selectionStart_",
  445. smalltalk.method({
  446. selector: "selectionStart:",
  447. fn: function (anInteger) {
  448. var self = this;
  449. smalltalk.send(smalltalk.send(self['@textarea'], "_element", []), "_selectionStart_", [anInteger]);
  450. return self;
  451. }
  452. }),
  453. smalltalk.HLSourceArea);
  454. smalltalk.addMethod(
  455. "_setEditorOn_",
  456. smalltalk.method({
  457. selector: "setEditorOn:",
  458. fn: function (aTextarea) {
  459. var self = this;
  460. self['@editor'] = CodeMirror.fromTextArea(aTextarea, {theme: "amber", lineNumbers: true, enterMode: "flat", matchBrackets: true, electricChars: false});
  461. return self;
  462. }
  463. }),
  464. smalltalk.HLSourceArea);
  465. smalltalk.addMethod(
  466. "_val",
  467. smalltalk.method({
  468. selector: "val",
  469. fn: function () {
  470. var self = this;
  471. var $1;
  472. $1 = smalltalk.send(self['@editor'], "_getValue", []);
  473. return $1;
  474. }
  475. }),
  476. smalltalk.HLSourceArea);
  477. smalltalk.addMethod(
  478. "_val_",
  479. smalltalk.method({
  480. selector: "val:",
  481. fn: function (aString) {
  482. var self = this;
  483. smalltalk.send(self['@editor'], "_setValue_", [aString]);
  484. return self;
  485. }
  486. }),
  487. smalltalk.HLSourceArea);
  488. smalltalk.addClass('HLTab', smalltalk.Object, ['widget', 'label'], 'Helios-Core');
  489. smalltalk.addMethod(
  490. "_activate",
  491. smalltalk.method({
  492. selector: "activate",
  493. fn: function () {
  494. var self = this;
  495. smalltalk.send(smalltalk.send(self, "_manager", []), "_activate_", [self]);
  496. return self;
  497. }
  498. }),
  499. smalltalk.HLTab);
  500. smalltalk.addMethod(
  501. "_add",
  502. smalltalk.method({
  503. selector: "add",
  504. fn: function () {
  505. var self = this;
  506. smalltalk.send(smalltalk.send(self, "_manager", []), "_addTab_", [self]);
  507. return self;
  508. }
  509. }),
  510. smalltalk.HLTab);
  511. smalltalk.addMethod(
  512. "_isActive",
  513. smalltalk.method({
  514. selector: "isActive",
  515. fn: function () {
  516. var self = this;
  517. var $1;
  518. $1 = smalltalk.send(smalltalk.send(smalltalk.send(self, "_manager", []), "_activeTab", []), "__eq", [self]);
  519. return $1;
  520. }
  521. }),
  522. smalltalk.HLTab);
  523. smalltalk.addMethod(
  524. "_label",
  525. smalltalk.method({
  526. selector: "label",
  527. fn: function () {
  528. var self = this;
  529. var $1;
  530. if (($receiver = self['@label']) == nil || $receiver == undefined) {
  531. $1 = "";
  532. } else {
  533. $1 = self['@label'];
  534. }
  535. return $1;
  536. }
  537. }),
  538. smalltalk.HLTab);
  539. smalltalk.addMethod(
  540. "_label_",
  541. smalltalk.method({
  542. selector: "label:",
  543. fn: function (aString) {
  544. var self = this;
  545. self['@label'] = aString;
  546. return self;
  547. }
  548. }),
  549. smalltalk.HLTab);
  550. smalltalk.addMethod(
  551. "_manager",
  552. smalltalk.method({
  553. selector: "manager",
  554. fn: function () {
  555. var self = this;
  556. var $1;
  557. $1 = smalltalk.send(smalltalk.HLManager || HLManager, "_current", []);
  558. return $1;
  559. }
  560. }),
  561. smalltalk.HLTab);
  562. smalltalk.addMethod(
  563. "_widget",
  564. smalltalk.method({
  565. selector: "widget",
  566. fn: function () {
  567. var self = this;
  568. return self['@widget'];
  569. }
  570. }),
  571. smalltalk.HLTab);
  572. smalltalk.addMethod(
  573. "_widget_",
  574. smalltalk.method({
  575. selector: "widget:",
  576. fn: function (aWidget) {
  577. var self = this;
  578. self['@widget'] = aWidget;
  579. return self;
  580. }
  581. }),
  582. smalltalk.HLTab);
  583. smalltalk.addMethod(
  584. "_on_labelled_",
  585. smalltalk.method({
  586. selector: "on:labelled:",
  587. fn: function (aWidget, aString) {
  588. var self = this;
  589. var $2, $3, $1;
  590. $2 = smalltalk.send(self, "_new", []);
  591. smalltalk.send($2, "_widget_", [aWidget]);
  592. smalltalk.send($2, "_label_", [aString]);
  593. $3 = smalltalk.send($2, "_yourself", []);
  594. $1 = $3;
  595. return $1;
  596. }
  597. }),
  598. smalltalk.HLTab.klass);
  599. smalltalk.addClass('HLWidget', smalltalk.Widget, ['rootDiv'], 'Helios-Core');
  600. smalltalk.addMethod(
  601. "_manager",
  602. smalltalk.method({
  603. selector: "manager",
  604. fn: function () {
  605. var self = this;
  606. var $1;
  607. $1 = smalltalk.send(smalltalk.HLManager || HLManager, "_current", []);
  608. return $1;
  609. }
  610. }),
  611. smalltalk.HLWidget);
  612. smalltalk.addMethod(
  613. "_refresh",
  614. smalltalk.method({
  615. selector: "refresh",
  616. fn: function () {
  617. var self = this;
  618. if (($receiver = self['@rootDiv']) == nil || $receiver == undefined) {
  619. return self;
  620. } else {
  621. self['@rootDiv'];
  622. }
  623. smalltalk.send(smalltalk.send(self['@rootDiv'], "_asJQuery", []), "_empty", []);
  624. smalltalk.send(function (html) {return smalltalk.send(self, "_renderContentOn_", [html]);}, "_appendToJQuery_", [smalltalk.send(self['@rootDiv'], "_asJQuery", [])]);
  625. return self;
  626. }
  627. }),
  628. smalltalk.HLWidget);
  629. smalltalk.addMethod(
  630. "_registerBindings",
  631. smalltalk.method({
  632. selector: "registerBindings",
  633. fn: function () {
  634. var self = this;
  635. smalltalk.send(self, "_registerBindingsOn_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_manager", []), "_keyBinder", []), "_bindings", [])]);
  636. return self;
  637. }
  638. }),
  639. smalltalk.HLWidget);
  640. smalltalk.addMethod(
  641. "_registerBindingsOn_",
  642. smalltalk.method({
  643. selector: "registerBindingsOn:",
  644. fn: function (aBindingGroup) {
  645. var self = this;
  646. return self;
  647. }
  648. }),
  649. smalltalk.HLWidget);
  650. smalltalk.addMethod(
  651. "_renderContentOn_",
  652. smalltalk.method({
  653. selector: "renderContentOn:",
  654. fn: function (html) {
  655. var self = this;
  656. return self;
  657. }
  658. }),
  659. smalltalk.HLWidget);
  660. smalltalk.addMethod(
  661. "_renderOn_",
  662. smalltalk.method({
  663. selector: "renderOn:",
  664. fn: function (html) {
  665. var self = this;
  666. smalltalk.send(self, "_registerBindings", []);
  667. self['@rootDiv'] = smalltalk.send(smalltalk.send(html, "_div", []), "_with_", [function () {return smalltalk.send(self, "_renderContentOn_", [html]);}]);
  668. return self;
  669. }
  670. }),
  671. smalltalk.HLWidget);
  672. smalltalk.addMethod(
  673. "_subscribeTo_",
  674. smalltalk.method({
  675. selector: "subscribeTo:",
  676. fn: function (anAnnouncer) {
  677. var self = this;
  678. return self;
  679. }
  680. }),
  681. smalltalk.HLWidget);
  682. smalltalk.addMethod(
  683. "_canBeOpenAsTab",
  684. smalltalk.method({
  685. selector: "canBeOpenAsTab",
  686. fn: function () {
  687. var self = this;
  688. return false;
  689. }
  690. }),
  691. smalltalk.HLWidget.klass);
  692. smalltalk.addMethod(
  693. "_openAsTab",
  694. smalltalk.method({
  695. selector: "openAsTab",
  696. fn: function () {
  697. var self = this;
  698. smalltalk.send(smalltalk.send(smalltalk.HLManager || HLManager, "_current", []), "_addTab_", [smalltalk.send(smalltalk.HLTab || HLTab, "_on_labelled_", [smalltalk.send(self, "_new", []), smalltalk.send(self, "_tabLabel", [])])]);
  699. return self;
  700. }
  701. }),
  702. smalltalk.HLWidget.klass);
  703. smalltalk.addMethod(
  704. "_tabLabel",
  705. smalltalk.method({
  706. selector: "tabLabel",
  707. fn: function () {
  708. var self = this;
  709. return "Tab";
  710. }
  711. }),
  712. smalltalk.HLWidget.klass);
  713. smalltalk.addMethod(
  714. "_tabPriority",
  715. smalltalk.method({
  716. selector: "tabPriority",
  717. fn: function () {
  718. var self = this;
  719. return 500;
  720. }
  721. }),
  722. smalltalk.HLWidget.klass);
  723. smalltalk.addClass('HLDebugger', smalltalk.HLWidget, [], 'Helios-Core');
  724. smalltalk.addClass('HLFocusableWidget', smalltalk.HLWidget, ['hiddenInput'], 'Helios-Core');
  725. smalltalk.addMethod(
  726. "_blur",
  727. smalltalk.method({
  728. selector: "blur",
  729. fn: function () {
  730. var self = this;
  731. smalltalk.send(smalltalk.send(self['@hiddenInput'], "_asJQuery", []), "_blur", []);
  732. return self;
  733. }
  734. }),
  735. smalltalk.HLFocusableWidget);
  736. smalltalk.addMethod(
  737. "_focus",
  738. smalltalk.method({
  739. selector: "focus",
  740. fn: function () {
  741. var self = this;
  742. smalltalk.send(smalltalk.send(self['@hiddenInput'], "_asJQuery", []), "_focus", []);
  743. return self;
  744. }
  745. }),
  746. smalltalk.HLFocusableWidget);
  747. smalltalk.addMethod(
  748. "_focusClass",
  749. smalltalk.method({
  750. selector: "focusClass",
  751. fn: function () {
  752. var self = this;
  753. return "focused";
  754. }
  755. }),
  756. smalltalk.HLFocusableWidget);
  757. smalltalk.addMethod(
  758. "_hasFocus",
  759. smalltalk.method({
  760. selector: "hasFocus",
  761. fn: function () {
  762. var self = this;
  763. var $1;
  764. $1 = smalltalk.send(smalltalk.send(self['@rootDiv'], "_notNil", []), "_and_", [function () {return smalltalk.send(smalltalk.send(self['@rootDiv'], "_asJQuery", []), "_hasClass_", [smalltalk.send(self, "_focusClass", [])]);}]);
  765. return $1;
  766. }
  767. }),
  768. smalltalk.HLFocusableWidget);
  769. smalltalk.addMethod(
  770. "_renderContentOn_",
  771. smalltalk.method({
  772. selector: "renderContentOn:",
  773. fn: function (html) {
  774. var self = this;
  775. return self;
  776. }
  777. }),
  778. smalltalk.HLFocusableWidget);
  779. smalltalk.addMethod(
  780. "_renderHiddenInputOn_",
  781. smalltalk.method({
  782. selector: "renderHiddenInputOn:",
  783. fn: function (html) {
  784. var self = this;
  785. var $1, $2;
  786. $1 = smalltalk.send(html, "_input", []);
  787. smalltalk.send($1, "_style_", ["position: absolute; left: -100000px;"]);
  788. smalltalk.send($1, "_onBlur_", [function () {return smalltalk.send(smalltalk.send(self['@rootDiv'], "_asJQuery", []), "_removeClass_", [smalltalk.send(self, "_focusClass", [])]);}]);
  789. $2 = smalltalk.send($1, "_onFocus_", [function () {return smalltalk.send(smalltalk.send(self['@rootDiv'], "_asJQuery", []), "_addClass_", [smalltalk.send(self, "_focusClass", [])]);}]);
  790. self['@hiddenInput'] = $2;
  791. return self;
  792. }
  793. }),
  794. smalltalk.HLFocusableWidget);
  795. smalltalk.addMethod(
  796. "_renderOn_",
  797. smalltalk.method({
  798. selector: "renderOn:",
  799. fn: function (html) {
  800. var self = this;
  801. var $1, $2;
  802. smalltalk.send(self, "_registerBindings", []);
  803. smalltalk.send(self, "_renderHiddenInputOn_", [html]);
  804. $1 = smalltalk.send(html, "_div", []);
  805. smalltalk.send($1, "_class_", ["hl_widget"]);
  806. smalltalk.send($1, "_onClick_", [function () {return smalltalk.send(smalltalk.send(self['@hiddenInput'], "_asJQuery", []), "_focus", []);}]);
  807. $2 = smalltalk.send($1, "_with_", [function () {return smalltalk.send(self, "_renderContentOn_", [html]);}]);
  808. self['@rootDiv'] = $2;
  809. return self;
  810. }
  811. }),
  812. smalltalk.HLFocusableWidget);
  813. smalltalk.addClass('HLListWidget', smalltalk.HLFocusableWidget, ['items', 'selectedItem'], 'Helios-Core');
  814. smalltalk.addMethod(
  815. "_activateListItem_",
  816. smalltalk.method({
  817. selector: "activateListItem:",
  818. fn: function (aListItem) {
  819. var self = this;
  820. var $1, $2, $3;
  821. var parent;
  822. var position;
  823. $1 = smalltalk.send(aListItem, "_get_", [0]);
  824. if (($receiver = $1) == nil || $receiver == undefined) {
  825. return self;
  826. } else {
  827. }
  828. position = aListItem.parent().children().get().indexOf(aListItem.get(0)) + 1;
  829. parent = smalltalk.send(aListItem, "_parent", []);
  830. smalltalk.send(smalltalk.send(parent, "_children", []), "_removeClass_", ["active"]);
  831. smalltalk.send(aListItem, "_addClass_", ["active"]);
  832. $2 = smalltalk.send(smalltalk.send(smalltalk.send(aListItem, "_position", []), "_top", []), "__lt", [0]);
  833. if (smalltalk.assert($2)) {
  834. smalltalk.send(smalltalk.send(parent, "_get_", [0]), "_scrollTop_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(parent, "_get_", [0]), "_scrollTop", []), "__plus", [smalltalk.send(smalltalk.send(aListItem, "_position", []), "_top", [])]), "__minus", [10])]);
  835. }
  836. $3 = smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aListItem, "_position", []), "_top", []), "__plus", [smalltalk.send(aListItem, "_height", [])]), "__gt", [smalltalk.send(parent, "_height", [])]);
  837. if (smalltalk.assert($3)) {
  838. smalltalk.send(smalltalk.send(parent, "_get_", [0]), "_scrollTop_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(parent, "_get_", [0]), "_scrollTop", []), "__plus", [smalltalk.send(aListItem, "_height", [])]), "__minus", [smalltalk.send(smalltalk.send(parent, "_height", []), "__minus", [smalltalk.send(smalltalk.send(aListItem, "_position", []), "_top", [])])]), "__plus", [10])]);
  839. }
  840. smalltalk.send(self, "_selectItem_", [smalltalk.send(smalltalk.send(self, "_items", []), "_at_", [smalltalk.send(smalltalk.send(aListItem, "_attr_", ["list-data"]), "_asNumber", [])])]);
  841. return self;
  842. }
  843. }),
  844. smalltalk.HLListWidget);
  845. smalltalk.addMethod(
  846. "_cssClassForItem_",
  847. smalltalk.method({
  848. selector: "cssClassForItem:",
  849. fn: function (anObject) {
  850. var self = this;
  851. var $2, $1;
  852. $2 = smalltalk.send(smalltalk.send(self, "_selectedItem", []), "__eq", [anObject]);
  853. if (smalltalk.assert($2)) {
  854. $1 = "active";
  855. } else {
  856. $1 = "inactive";
  857. }
  858. return $1;
  859. }
  860. }),
  861. smalltalk.HLListWidget);
  862. smalltalk.addMethod(
  863. "_iconForItem_",
  864. smalltalk.method({
  865. selector: "iconForItem:",
  866. fn: function (anObject) {
  867. var self = this;
  868. return "";
  869. }
  870. }),
  871. smalltalk.HLListWidget);
  872. smalltalk.addMethod(
  873. "_initializeItems",
  874. smalltalk.method({
  875. selector: "initializeItems",
  876. fn: function () {
  877. var self = this;
  878. var $1;
  879. self['@items'] = [];
  880. $1 = self['@items'];
  881. return $1;
  882. }
  883. }),
  884. smalltalk.HLListWidget);
  885. smalltalk.addMethod(
  886. "_items",
  887. smalltalk.method({
  888. selector: "items",
  889. fn: function () {
  890. var self = this;
  891. var $1;
  892. if (($receiver = self['@items']) == nil || $receiver == undefined) {
  893. $1 = smalltalk.send(self, "_initializeItems", []);
  894. } else {
  895. $1 = self['@items'];
  896. }
  897. return $1;
  898. }
  899. }),
  900. smalltalk.HLListWidget);
  901. smalltalk.addMethod(
  902. "_items_",
  903. smalltalk.method({
  904. selector: "items:",
  905. fn: function (aCollection) {
  906. var self = this;
  907. self['@items'] = aCollection;
  908. return self;
  909. }
  910. }),
  911. smalltalk.HLListWidget);
  912. smalltalk.addMethod(
  913. "_renderButtonsOn_",
  914. smalltalk.method({
  915. selector: "renderButtonsOn:",
  916. fn: function (html) {
  917. var self = this;
  918. return self;
  919. }
  920. }),
  921. smalltalk.HLListWidget);
  922. smalltalk.addMethod(
  923. "_renderContentOn_",
  924. smalltalk.method({
  925. selector: "renderContentOn:",
  926. fn: function (html) {
  927. var self = this;
  928. var $1, $2, $3, $4;
  929. $1 = smalltalk.send(html, "_ul", []);
  930. smalltalk.send($1, "_class_", ["nav nav-pills nav-stacked"]);
  931. $2 = smalltalk.send($1, "_with_", [function () {return smalltalk.send(self, "_renderListOn_", [html]);}]);
  932. $3 = smalltalk.send(html, "_div", []);
  933. smalltalk.send($3, "_class_", ["pane_actions form-actions"]);
  934. $4 = smalltalk.send($3, "_with_", [function () {return smalltalk.send(self, "_renderButtonsOn_", [html]);}]);
  935. smalltalk.send(self, "_setupKeyBindings", []);
  936. return self;
  937. }
  938. }),
  939. smalltalk.HLListWidget);
  940. smalltalk.addMethod(
  941. "_renderItem_on_",
  942. smalltalk.method({
  943. selector: "renderItem:on:",
  944. fn: function (anObject, html) {
  945. var self = this;
  946. var $2, $3, $1;
  947. var li;
  948. li = smalltalk.send(html, "_li", []);
  949. smalltalk.send(li, "_class_", [smalltalk.send(self, "_cssClassForItem_", [anObject])]);
  950. smalltalk.send(li, "_at_put_", ["list-data", smalltalk.send(smalltalk.send(smalltalk.send(self, "_items", []), "_indexOf_", [anObject]), "_asString", [])]);
  951. $1 = smalltalk.send(li, "_with_", [function () {$2 = smalltalk.send(html, "_a", []);smalltalk.send($2, "_with_", [function () {smalltalk.send(smalltalk.send(html, "_tag_", ["i"]), "_class_", [smalltalk.send(self, "_iconForItem_", [anObject])]);return smalltalk.send(self, "_renderItemLabel_on_", [anObject, html]);}]);$3 = smalltalk.send($2, "_onClick_", [function () {return smalltalk.send(self, "_activateListItem_", [smalltalk.send(li, "_asJQuery", [])]);}]);return $3;}]);
  952. return self;
  953. }
  954. }),
  955. smalltalk.HLListWidget);
  956. smalltalk.addMethod(
  957. "_renderItemLabel_on_",
  958. smalltalk.method({
  959. selector: "renderItemLabel:on:",
  960. fn: function (anObject, html) {
  961. var self = this;
  962. smalltalk.send(html, "_with_", [smalltalk.send(anObject, "_asString", [])]);
  963. return self;
  964. }
  965. }),
  966. smalltalk.HLListWidget);
  967. smalltalk.addMethod(
  968. "_renderListOn_",
  969. smalltalk.method({
  970. selector: "renderListOn:",
  971. fn: function (html) {
  972. var self = this;
  973. smalltalk.send(smalltalk.send(self, "_items", []), "_do_", [function (each) {return smalltalk.send(self, "_renderItem_on_", [each, html]);}]);
  974. return self;
  975. }
  976. }),
  977. smalltalk.HLListWidget);
  978. smalltalk.addMethod(
  979. "_selectItem_",
  980. smalltalk.method({
  981. selector: "selectItem:",
  982. fn: function (anObject) {
  983. var self = this;
  984. smalltalk.send(self, "_selectedItem_", [anObject]);
  985. return self;
  986. }
  987. }),
  988. smalltalk.HLListWidget);
  989. smalltalk.addMethod(
  990. "_selectedItem",
  991. smalltalk.method({
  992. selector: "selectedItem",
  993. fn: function () {
  994. var self = this;
  995. return self['@selectedItem'];
  996. }
  997. }),
  998. smalltalk.HLListWidget);
  999. smalltalk.addMethod(
  1000. "_selectedItem_",
  1001. smalltalk.method({
  1002. selector: "selectedItem:",
  1003. fn: function (anObject) {
  1004. var self = this;
  1005. self['@selectedItem'] = anObject;
  1006. return self;
  1007. }
  1008. }),
  1009. smalltalk.HLListWidget);
  1010. smalltalk.addMethod(
  1011. "_setupKeyBindings",
  1012. smalltalk.method({
  1013. selector: "setupKeyBindings",
  1014. fn: function () {
  1015. var self = this;
  1016. var $1, $2, $3;
  1017. var next;
  1018. smalltalk.send(smalltalk.send(self['@hiddenInput'], "_asJQuery", []), "_unbind_", ["keydown"]);
  1019. smalltalk.send(smalltalk.send(self['@hiddenInput'], "_asJQuery", []), "_keydown_", [function (e) {var selected;selected = smalltalk.send(window, "_jQuery_", [".focused .nav-pills .active"]);$1 = smalltalk.send(smalltalk.send(e, "_which", []), "__eq", [38]);if (smalltalk.assert($1)) {smalltalk.send(self, "_activateListItem_", [smalltalk.send(selected, "_prev", [])]);}$2 = smalltalk.send(smalltalk.send(e, "_which", []), "__eq", [40]);if (smalltalk.assert($2)) {next = smalltalk.send(selected, "_next", []);next;$3 = smalltalk.send(next, "_get_", [0]);if (($receiver = $3) == nil || $receiver == undefined) {next = smalltalk.send(window, "_jQuery_", [".focused .nav-pills li:first-child"]);next;} else {$3;}return smalltalk.send(self, "_activateListItem_", [next]);}}]);
  1020. return self;
  1021. }
  1022. }),
  1023. smalltalk.HLListWidget);
  1024. smalltalk.addClass('HLNavigationListWidget', smalltalk.HLListWidget, ['previous', 'next'], 'Helios-Core');
  1025. smalltalk.addMethod(
  1026. "_next",
  1027. smalltalk.method({
  1028. selector: "next",
  1029. fn: function () {
  1030. var self = this;
  1031. return self['@next'];
  1032. }
  1033. }),
  1034. smalltalk.HLNavigationListWidget);
  1035. smalltalk.addMethod(
  1036. "_next_",
  1037. smalltalk.method({
  1038. selector: "next:",
  1039. fn: function (aWidget) {
  1040. var self = this;
  1041. var $1;
  1042. self['@next'] = aWidget;
  1043. $1 = smalltalk.send(smalltalk.send(aWidget, "_previous", []), "__eq", [self]);
  1044. if (!smalltalk.assert($1)) {
  1045. smalltalk.send(aWidget, "_previous_", [self]);
  1046. }
  1047. return self;
  1048. }
  1049. }),
  1050. smalltalk.HLNavigationListWidget);
  1051. smalltalk.addMethod(
  1052. "_nextFocus",
  1053. smalltalk.method({
  1054. selector: "nextFocus",
  1055. fn: function () {
  1056. var self = this;
  1057. var $1;
  1058. $1 = smalltalk.send(self, "_next", []);
  1059. if (($receiver = $1) == nil || $receiver == undefined) {
  1060. } else {
  1061. smalltalk.send(smalltalk.send(self, "_next", []), "_focus", []);
  1062. }
  1063. return self;
  1064. }
  1065. }),
  1066. smalltalk.HLNavigationListWidget);
  1067. smalltalk.addMethod(
  1068. "_previous",
  1069. smalltalk.method({
  1070. selector: "previous",
  1071. fn: function () {
  1072. var self = this;
  1073. return self['@previous'];
  1074. }
  1075. }),
  1076. smalltalk.HLNavigationListWidget);
  1077. smalltalk.addMethod(
  1078. "_previous_",
  1079. smalltalk.method({
  1080. selector: "previous:",
  1081. fn: function (aWidget) {
  1082. var self = this;
  1083. var $1;
  1084. self['@previous'] = aWidget;
  1085. $1 = smalltalk.send(smalltalk.send(aWidget, "_next", []), "__eq", [self]);
  1086. if (!smalltalk.assert($1)) {
  1087. smalltalk.send(aWidget, "_next_", [self]);
  1088. }
  1089. return self;
  1090. }
  1091. }),
  1092. smalltalk.HLNavigationListWidget);
  1093. smalltalk.addMethod(
  1094. "_previousFocus",
  1095. smalltalk.method({
  1096. selector: "previousFocus",
  1097. fn: function () {
  1098. var self = this;
  1099. var $1;
  1100. $1 = smalltalk.send(self, "_previous", []);
  1101. if (($receiver = $1) == nil || $receiver == undefined) {
  1102. } else {
  1103. smalltalk.send(smalltalk.send(self, "_previous", []), "_focus", []);
  1104. }
  1105. return self;
  1106. }
  1107. }),
  1108. smalltalk.HLNavigationListWidget);
  1109. smalltalk.addMethod(
  1110. "_setupKeyBindings",
  1111. smalltalk.method({
  1112. selector: "setupKeyBindings",
  1113. fn: function () {
  1114. var self = this;
  1115. var $1, $2;
  1116. smalltalk.send(self, "_setupKeyBindings", [], smalltalk.HLListWidget);
  1117. smalltalk.send(smalltalk.send(self['@hiddenInput'], "_asJQuery", []), "_keydown_", [function (e) {$1 = smalltalk.send(smalltalk.send(e, "_which", []), "__eq", [39]);if (smalltalk.assert($1)) {smalltalk.send(self, "_nextFocus", []);}$2 = smalltalk.send(smalltalk.send(e, "_which", []), "__eq", [37]);if (smalltalk.assert($2)) {return smalltalk.send(self, "_previousFocus", []);}}]);
  1118. return self;
  1119. }
  1120. }),
  1121. smalltalk.HLNavigationListWidget);
  1122. smalltalk.addClass('HLManager', smalltalk.HLWidget, ['tabs', 'activeTab', 'keyBinder', 'environment'], 'Helios-Core');
  1123. smalltalk.addMethod(
  1124. "_activate_",
  1125. smalltalk.method({
  1126. selector: "activate:",
  1127. fn: function (aTab) {
  1128. var self = this;
  1129. var $1;
  1130. smalltalk.send(smalltalk.send(self, "_keyBinder", []), "_flushBindings", []);
  1131. self['@activeTab'] = aTab;
  1132. smalltalk.send(self, "_refresh", []);
  1133. $1 = smalltalk.send(self, "_show_", [aTab]);
  1134. return self;
  1135. }
  1136. }),
  1137. smalltalk.HLManager);
  1138. smalltalk.addMethod(
  1139. "_activeTab",
  1140. smalltalk.method({
  1141. selector: "activeTab",
  1142. fn: function () {
  1143. var self = this;
  1144. return self['@activeTab'];
  1145. }
  1146. }),
  1147. smalltalk.HLManager);
  1148. smalltalk.addMethod(
  1149. "_addTab_",
  1150. smalltalk.method({
  1151. selector: "addTab:",
  1152. fn: function (aTab) {
  1153. var self = this;
  1154. smalltalk.send(smalltalk.send(self, "_tabs", []), "_add_", [aTab]);
  1155. smalltalk.send(self, "_activate_", [aTab]);
  1156. return self;
  1157. }
  1158. }),
  1159. smalltalk.HLManager);
  1160. smalltalk.addMethod(
  1161. "_defaultEnvironment",
  1162. smalltalk.method({
  1163. selector: "defaultEnvironment",
  1164. fn: function () {
  1165. var self = this;
  1166. var $1;
  1167. $1 = smalltalk.send(smalltalk.HLLocalEnvironment || HLLocalEnvironment, "_new", []);
  1168. return $1;
  1169. }
  1170. }),
  1171. smalltalk.HLManager);
  1172. smalltalk.addMethod(
  1173. "_environment",
  1174. smalltalk.method({
  1175. selector: "environment",
  1176. fn: function () {
  1177. var self = this;
  1178. var $1;
  1179. if (($receiver = self['@environment']) == nil || $receiver == undefined) {
  1180. self['@environment'] = smalltalk.send(self, "_defaultEnvironment", []);
  1181. $1 = self['@environment'];
  1182. } else {
  1183. $1 = self['@environment'];
  1184. }
  1185. return $1;
  1186. }
  1187. }),
  1188. smalltalk.HLManager);
  1189. smalltalk.addMethod(
  1190. "_environment_",
  1191. smalltalk.method({
  1192. selector: "environment:",
  1193. fn: function (anEnvironment) {
  1194. var self = this;
  1195. self['@environment'] = anEnvironment;
  1196. return self;
  1197. }
  1198. }),
  1199. smalltalk.HLManager);
  1200. smalltalk.addMethod(
  1201. "_initialize",
  1202. smalltalk.method({
  1203. selector: "initialize",
  1204. fn: function () {
  1205. var self = this;
  1206. smalltalk.send(self, "_initialize", [], smalltalk.HLWidget);
  1207. smalltalk.send(smalltalk.send(self, "_keyBinder", []), "_setupEvents", []);
  1208. return self;
  1209. }
  1210. }),
  1211. smalltalk.HLManager);
  1212. smalltalk.addMethod(
  1213. "_keyBinder",
  1214. smalltalk.method({
  1215. selector: "keyBinder",
  1216. fn: function () {
  1217. var self = this;
  1218. var $1;
  1219. if (($receiver = self['@keyBinder']) == nil || $receiver == undefined) {
  1220. self['@keyBinder'] = smalltalk.send(smalltalk.HLKeyBinder || HLKeyBinder, "_new", []);
  1221. $1 = self['@keyBinder'];
  1222. } else {
  1223. $1 = self['@keyBinder'];
  1224. }
  1225. return $1;
  1226. }
  1227. }),
  1228. smalltalk.HLManager);
  1229. smalltalk.addMethod(
  1230. "_refresh",
  1231. smalltalk.method({
  1232. selector: "refresh",
  1233. fn: function () {
  1234. var self = this;
  1235. smalltalk.send(smalltalk.send(window, "_jQuery_", [".navbar"]), "_remove", []);
  1236. smalltalk.send(smalltalk.send(window, "_jQuery_", ["#container"]), "_remove", []);
  1237. smalltalk.send(self, "_appendToJQuery_", [smalltalk.send("body", "_asJQuery", [])]);
  1238. return self;
  1239. }
  1240. }),
  1241. smalltalk.HLManager);
  1242. smalltalk.addMethod(
  1243. "_removeTab_",
  1244. smalltalk.method({
  1245. selector: "removeTab:",
  1246. fn: function (aTab) {
  1247. var self = this;
  1248. var $1;
  1249. $1 = smalltalk.send(smalltalk.send(self, "_tabs", []), "_includes_", [aTab]);
  1250. if (!smalltalk.assert($1)) {
  1251. return self;
  1252. }
  1253. smalltalk.send(smalltalk.send(self, "_tabs", []), "_remove_", [aTab]);
  1254. smalltalk.send(self, "_refresh", []);
  1255. return self;
  1256. }
  1257. }),
  1258. smalltalk.HLManager);
  1259. smalltalk.addMethod(
  1260. "_renderAddOn_",
  1261. smalltalk.method({
  1262. selector: "renderAddOn:",
  1263. fn: function (html) {
  1264. var self = this;
  1265. var $1, $3, $4, $5, $7, $8, $6, $2;
  1266. $1 = smalltalk.send(html, "_li", []);
  1267. smalltalk.send($1, "_class_", ["dropdown"]);
  1268. $2 = smalltalk.send($1, "_with_", [function () {$3 = smalltalk.send(html, "_a", []);smalltalk.send($3, "_class_", ["dropdown-toggle"]);smalltalk.send($3, "_at_put_", ["data-toggle", "dropdown"]);$4 = smalltalk.send($3, "_with_", [function () {smalltalk.send(html, "_with_", ["Open..."]);return smalltalk.send(smalltalk.send(html, "_tag_", ["b"]), "_class_", ["caret"]);}]);$4;$5 = smalltalk.send(html, "_ul", []);smalltalk.send($5, "_class_", ["dropdown-menu"]);$6 = smalltalk.send($5, "_with_", [function () {return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.HLWidget || HLWidget, "_withAllSubclasses", []), "_select_", [function (each) {return smalltalk.send(each, "_canBeOpenAsTab", []);}]), "_sorted_", [function (a, b) {return smalltalk.send(smalltalk.send(a, "_tabPriority", []), "__lt", [smalltalk.send(b, "_tabPriority", [])]);}]), "_do_", [function (each) {return smalltalk.send(smalltalk.send(html, "_li", []), "_with_", [function () {$7 = smalltalk.send(html, "_a", []);smalltalk.send($7, "_with_", [smalltalk.send(each, "_tabLabel", [])]);$8 = smalltalk.send($7, "_onClick_", [function () {return smalltalk.send(each, "_openAsTab", []);}]);return $8;}]);}]);}]);return $6;}]);
  1269. return self;
  1270. }
  1271. }),
  1272. smalltalk.HLManager);
  1273. smalltalk.addMethod(
  1274. "_renderContentOn_",
  1275. smalltalk.method({
  1276. selector: "renderContentOn:",
  1277. fn: function (html) {
  1278. var self = this;
  1279. var $1, $3, $4, $2;
  1280. $1 = smalltalk.send(html, "_div", []);
  1281. smalltalk.send($1, "_class_", ["navbar navbar-fixed-top"]);
  1282. $2 = smalltalk.send($1, "_with_", [function () {$3 = smalltalk.send(html, "_div", []);smalltalk.send($3, "_class_", ["navbar-inner"]);$4 = smalltalk.send($3, "_with_", [function () {return smalltalk.send(self, "_renderTabsOn_", [html]);}]);return $4;}]);
  1283. smalltalk.send(smalltalk.send(html, "_div", []), "_id_", ["container"]);
  1284. return self;
  1285. }
  1286. }),
  1287. smalltalk.HLManager);
  1288. smalltalk.addMethod(
  1289. "_renderTabsOn_",
  1290. smalltalk.method({
  1291. selector: "renderTabsOn:",
  1292. fn: function (html) {
  1293. var self = this;
  1294. var $1, $3, $5, $4, $7, $8, $6, $2;
  1295. $1 = smalltalk.send(html, "_ul", []);
  1296. smalltalk.send($1, "_class_", ["nav"]);
  1297. $2 = smalltalk.send($1, "_with_", [function () {smalltalk.send(smalltalk.send(self, "_tabs", []), "_do_", [function (each) {$3 = smalltalk.send(html, "_li", []);$5 = smalltalk.send(each, "_isActive", []);if (smalltalk.assert($5)) {$4 = "active";} else {$4 = "inactive";}smalltalk.send($3, "_class_", [$4]);$6 = smalltalk.send($3, "_with_", [function () {$7 = smalltalk.send(html, "_a", []);smalltalk.send($7, "_with_", [function () {smalltalk.send(smalltalk.send(smalltalk.send(html, "_tag_", ["i"]), "_class_", ["icon-remove-circle"]), "_onClick_", [function () {return smalltalk.send(self, "_removeTab_", [each]);}]);return smalltalk.send(html, "_with_", [smalltalk.send(each, "_label", [])]);}]);$8 = smalltalk.send($7, "_onClick_", [function () {return smalltalk.send(each, "_activate", []);}]);return $8;}]);return $6;}]);return smalltalk.send(self, "_renderAddOn_", [html]);}]);
  1298. return self;
  1299. }
  1300. }),
  1301. smalltalk.HLManager);
  1302. smalltalk.addMethod(
  1303. "_show_",
  1304. smalltalk.method({
  1305. selector: "show:",
  1306. fn: function (aTab) {
  1307. var self = this;
  1308. smalltalk.send(smalltalk.send(window, "_jQuery_", ["#container"]), "_empty", []);
  1309. smalltalk.send(smalltalk.send(aTab, "_widget", []), "_appendToJQuery_", [smalltalk.send("#container", "_asJQuery", [])]);
  1310. return self;
  1311. }
  1312. }),
  1313. smalltalk.HLManager);
  1314. smalltalk.addMethod(
  1315. "_tabs",
  1316. smalltalk.method({
  1317. selector: "tabs",
  1318. fn: function () {
  1319. var self = this;
  1320. var $1;
  1321. if (($receiver = self['@tabs']) == nil || $receiver == undefined) {
  1322. self['@tabs'] = smalltalk.send(smalltalk.OrderedCollection || OrderedCollection, "_new", []);
  1323. $1 = self['@tabs'];
  1324. } else {
  1325. $1 = self['@tabs'];
  1326. }
  1327. return $1;
  1328. }
  1329. }),
  1330. smalltalk.HLManager);
  1331. smalltalk.HLManager.klass.iVarNames = ['current'];
  1332. smalltalk.addMethod(
  1333. "_current",
  1334. smalltalk.method({
  1335. selector: "current",
  1336. fn: function () {
  1337. var self = this;
  1338. var $1;
  1339. if (($receiver = self['@current']) == nil || $receiver == undefined) {
  1340. self['@current'] = smalltalk.send(smalltalk.send(self, "_basicNew", []), "_initialize", []);
  1341. $1 = self['@current'];
  1342. } else {
  1343. $1 = self['@current'];
  1344. }
  1345. return $1;
  1346. }
  1347. }),
  1348. smalltalk.HLManager.klass);
  1349. smalltalk.addMethod(
  1350. "_initialize",
  1351. smalltalk.method({
  1352. selector: "initialize",
  1353. fn: function () {
  1354. var self = this;
  1355. smalltalk.send(smalltalk.send(self, "_current", []), "_appendToJQuery_", [smalltalk.send("body", "_asJQuery", [])]);
  1356. return self;
  1357. }
  1358. }),
  1359. smalltalk.HLManager.klass);
  1360. smalltalk.addMethod(
  1361. "_new",
  1362. smalltalk.method({
  1363. selector: "new",
  1364. fn: function () {
  1365. var self = this;
  1366. smalltalk.send(self, "_shouldNotImplement", []);
  1367. return self;
  1368. }
  1369. }),
  1370. smalltalk.HLManager.klass);
  1371. smalltalk.addClass('HLSUnit', smalltalk.HLWidget, [], 'Helios-Core');
  1372. smalltalk.addMethod(
  1373. "_canBeOpenAsTab",
  1374. smalltalk.method({
  1375. selector: "canBeOpenAsTab",
  1376. fn: function () {
  1377. var self = this;
  1378. return true;
  1379. }
  1380. }),
  1381. smalltalk.HLSUnit.klass);
  1382. smalltalk.addMethod(
  1383. "_tabLabel",
  1384. smalltalk.method({
  1385. selector: "tabLabel",
  1386. fn: function () {
  1387. var self = this;
  1388. return "SUnit";
  1389. }
  1390. }),
  1391. smalltalk.HLSUnit.klass);
  1392. smalltalk.addMethod(
  1393. "_tabPriority",
  1394. smalltalk.method({
  1395. selector: "tabPriority",
  1396. fn: function () {
  1397. var self = this;
  1398. return 1000;
  1399. }
  1400. }),
  1401. smalltalk.HLSUnit.klass);
  1402. smalltalk.addClass('HLTranscript', smalltalk.HLWidget, [], 'Helios-Core');
  1403. smalltalk.addMethod(
  1404. "_canBeOpenAsTab",
  1405. smalltalk.method({
  1406. selector: "canBeOpenAsTab",
  1407. fn: function () {
  1408. var self = this;
  1409. return true;
  1410. }
  1411. }),
  1412. smalltalk.HLTranscript.klass);
  1413. smalltalk.addMethod(
  1414. "_tabLabel",
  1415. smalltalk.method({
  1416. selector: "tabLabel",
  1417. fn: function () {
  1418. var self = this;
  1419. return "Transcript";
  1420. }
  1421. }),
  1422. smalltalk.HLTranscript.klass);
  1423. smalltalk.addMethod(
  1424. "_tabPriority",
  1425. smalltalk.method({
  1426. selector: "tabPriority",
  1427. fn: function () {
  1428. var self = this;
  1429. return 600;
  1430. }
  1431. }),
  1432. smalltalk.HLTranscript.klass);