Helios-Core.deploy.js 28 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036
  1. smalltalk.addPackage('Helios-Core', {});
  2. smalltalk.addClass('HLTab', smalltalk.Object, ['widget', 'label'], 'Helios-Core');
  3. smalltalk.addMethod(
  4. "_activate",
  5. smalltalk.method({
  6. selector: "activate",
  7. fn: function () {
  8. var self = this;
  9. smalltalk.send(smalltalk.send(self, "_manager", []), "_activate_", [self]);
  10. return self;
  11. }
  12. }),
  13. smalltalk.HLTab);
  14. smalltalk.addMethod(
  15. "_add",
  16. smalltalk.method({
  17. selector: "add",
  18. fn: function () {
  19. var self = this;
  20. smalltalk.send(smalltalk.send(self, "_manager", []), "_addTab_", [self]);
  21. return self;
  22. }
  23. }),
  24. smalltalk.HLTab);
  25. smalltalk.addMethod(
  26. "_isActive",
  27. smalltalk.method({
  28. selector: "isActive",
  29. fn: function () {
  30. var self = this;
  31. var $1;
  32. $1 = smalltalk.send(smalltalk.send(smalltalk.send(self, "_manager", []), "_activeTab", []), "__eq", [self]);
  33. return $1;
  34. }
  35. }),
  36. smalltalk.HLTab);
  37. smalltalk.addMethod(
  38. "_label",
  39. smalltalk.method({
  40. selector: "label",
  41. fn: function () {
  42. var self = this;
  43. var $1;
  44. if (($receiver = self['@label']) == nil || $receiver == undefined) {
  45. $1 = "";
  46. } else {
  47. $1 = self['@label'];
  48. }
  49. return $1;
  50. }
  51. }),
  52. smalltalk.HLTab);
  53. smalltalk.addMethod(
  54. "_label_",
  55. smalltalk.method({
  56. selector: "label:",
  57. fn: function (aString) {
  58. var self = this;
  59. self['@label'] = aString;
  60. return self;
  61. }
  62. }),
  63. smalltalk.HLTab);
  64. smalltalk.addMethod(
  65. "_manager",
  66. smalltalk.method({
  67. selector: "manager",
  68. fn: function () {
  69. var self = this;
  70. var $1;
  71. $1 = smalltalk.send(smalltalk.HLManager || HLManager, "_current", []);
  72. return $1;
  73. }
  74. }),
  75. smalltalk.HLTab);
  76. smalltalk.addMethod(
  77. "_widget",
  78. smalltalk.method({
  79. selector: "widget",
  80. fn: function () {
  81. var self = this;
  82. return self['@widget'];
  83. }
  84. }),
  85. smalltalk.HLTab);
  86. smalltalk.addMethod(
  87. "_widget_",
  88. smalltalk.method({
  89. selector: "widget:",
  90. fn: function (aWidget) {
  91. var self = this;
  92. self['@widget'] = aWidget;
  93. return self;
  94. }
  95. }),
  96. smalltalk.HLTab);
  97. smalltalk.addMethod(
  98. "_on_labelled_",
  99. smalltalk.method({
  100. selector: "on:labelled:",
  101. fn: function (aWidget, aString) {
  102. var self = this;
  103. var $2, $3, $1;
  104. $2 = smalltalk.send(self, "_new", []);
  105. smalltalk.send($2, "_widget_", [aWidget]);
  106. smalltalk.send($2, "_label_", [aString]);
  107. $3 = smalltalk.send($2, "_yourself", []);
  108. $1 = $3;
  109. return $1;
  110. }
  111. }),
  112. smalltalk.HLTab.klass);
  113. smalltalk.addClass('HLWidget', smalltalk.Widget, ['wrapper'], 'Helios-Core');
  114. smalltalk.addMethod(
  115. "_manager",
  116. smalltalk.method({
  117. selector: "manager",
  118. fn: function () {
  119. var self = this;
  120. var $1;
  121. $1 = smalltalk.send(smalltalk.HLManager || HLManager, "_current", []);
  122. return $1;
  123. }
  124. }),
  125. smalltalk.HLWidget);
  126. smalltalk.addMethod(
  127. "_refresh",
  128. smalltalk.method({
  129. selector: "refresh",
  130. fn: function () {
  131. var self = this;
  132. var $1;
  133. $1 = smalltalk.send(self, "_wrapper", []);
  134. if (($receiver = $1) == nil || $receiver == undefined) {
  135. return self;
  136. } else {
  137. }
  138. smalltalk.send(smalltalk.send(smalltalk.send(self, "_wrapper", []), "_asJQuery", []), "_empty", []);
  139. smalltalk.send(function (html) {return smalltalk.send(self, "_renderContentOn_", [html]);}, "_appendToJQuery_", [smalltalk.send(smalltalk.send(self, "_wrapper", []), "_asJQuery", [])]);
  140. return self;
  141. }
  142. }),
  143. smalltalk.HLWidget);
  144. smalltalk.addMethod(
  145. "_registerBindings",
  146. smalltalk.method({
  147. selector: "registerBindings",
  148. fn: function () {
  149. var self = this;
  150. smalltalk.send(self, "_registerBindingsOn_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_manager", []), "_keyBinder", []), "_bindings", [])]);
  151. return self;
  152. }
  153. }),
  154. smalltalk.HLWidget);
  155. smalltalk.addMethod(
  156. "_registerBindingsOn_",
  157. smalltalk.method({
  158. selector: "registerBindingsOn:",
  159. fn: function (aBindingGroup) {
  160. var self = this;
  161. return self;
  162. }
  163. }),
  164. smalltalk.HLWidget);
  165. smalltalk.addMethod(
  166. "_renderContentOn_",
  167. smalltalk.method({
  168. selector: "renderContentOn:",
  169. fn: function (html) {
  170. var self = this;
  171. return self;
  172. }
  173. }),
  174. smalltalk.HLWidget);
  175. smalltalk.addMethod(
  176. "_renderOn_",
  177. smalltalk.method({
  178. selector: "renderOn:",
  179. fn: function (html) {
  180. var self = this;
  181. smalltalk.send(self, "_registerBindings", []);
  182. self['@wrapper'] = smalltalk.send(smalltalk.send(html, "_div", []), "_with_", [function () {return smalltalk.send(self, "_renderContentOn_", [html]);}]);
  183. return self;
  184. }
  185. }),
  186. smalltalk.HLWidget);
  187. smalltalk.addMethod(
  188. "_wrapper",
  189. smalltalk.method({
  190. selector: "wrapper",
  191. fn: function () {
  192. var self = this;
  193. return self['@wrapper'];
  194. }
  195. }),
  196. smalltalk.HLWidget);
  197. smalltalk.addMethod(
  198. "_canBeOpenAsTab",
  199. smalltalk.method({
  200. selector: "canBeOpenAsTab",
  201. fn: function () {
  202. var self = this;
  203. return false;
  204. }
  205. }),
  206. smalltalk.HLWidget.klass);
  207. smalltalk.addMethod(
  208. "_openAsTab",
  209. smalltalk.method({
  210. selector: "openAsTab",
  211. fn: function () {
  212. var self = this;
  213. smalltalk.send(smalltalk.send(smalltalk.HLManager || HLManager, "_current", []), "_addTab_", [smalltalk.send(smalltalk.HLTab || HLTab, "_on_labelled_", [smalltalk.send(self, "_new", []), smalltalk.send(self, "_tabLabel", [])])]);
  214. return self;
  215. }
  216. }),
  217. smalltalk.HLWidget.klass);
  218. smalltalk.addMethod(
  219. "_tabLabel",
  220. smalltalk.method({
  221. selector: "tabLabel",
  222. fn: function () {
  223. var self = this;
  224. return "Tab";
  225. }
  226. }),
  227. smalltalk.HLWidget.klass);
  228. smalltalk.addMethod(
  229. "_tabPriority",
  230. smalltalk.method({
  231. selector: "tabPriority",
  232. fn: function () {
  233. var self = this;
  234. return 500;
  235. }
  236. }),
  237. smalltalk.HLWidget.klass);
  238. smalltalk.addClass('HLDebugger', smalltalk.HLWidget, [], 'Helios-Core');
  239. smalltalk.addClass('HLFocusableWidget', smalltalk.HLWidget, ['hiddenInput'], 'Helios-Core');
  240. smalltalk.addMethod(
  241. "_blur",
  242. smalltalk.method({
  243. selector: "blur",
  244. fn: function () {
  245. var self = this;
  246. smalltalk.send(smalltalk.send(self['@hiddenInput'], "_asJQuery", []), "_blur", []);
  247. return self;
  248. }
  249. }),
  250. smalltalk.HLFocusableWidget);
  251. smalltalk.addMethod(
  252. "_focus",
  253. smalltalk.method({
  254. selector: "focus",
  255. fn: function () {
  256. var self = this;
  257. smalltalk.send(smalltalk.send(self['@hiddenInput'], "_asJQuery", []), "_focus", []);
  258. return self;
  259. }
  260. }),
  261. smalltalk.HLFocusableWidget);
  262. smalltalk.addMethod(
  263. "_focusClass",
  264. smalltalk.method({
  265. selector: "focusClass",
  266. fn: function () {
  267. var self = this;
  268. return "focused";
  269. }
  270. }),
  271. smalltalk.HLFocusableWidget);
  272. smalltalk.addMethod(
  273. "_hasFocus",
  274. smalltalk.method({
  275. selector: "hasFocus",
  276. fn: function () {
  277. var self = this;
  278. var $1;
  279. $1 = smalltalk.send(smalltalk.send(smalltalk.send(self, "_wrapper", []), "_notNil", []), "_and_", [function () {return smalltalk.send(smalltalk.send(smalltalk.send(self, "_wrapper", []), "_asJQuery", []), "_hasClass_", [smalltalk.send(self, "_focusClass", [])]);}]);
  280. return $1;
  281. }
  282. }),
  283. smalltalk.HLFocusableWidget);
  284. smalltalk.addMethod(
  285. "_renderContentOn_",
  286. smalltalk.method({
  287. selector: "renderContentOn:",
  288. fn: function (html) {
  289. var self = this;
  290. return self;
  291. }
  292. }),
  293. smalltalk.HLFocusableWidget);
  294. smalltalk.addMethod(
  295. "_renderHiddenInputOn_",
  296. smalltalk.method({
  297. selector: "renderHiddenInputOn:",
  298. fn: function (html) {
  299. var self = this;
  300. var $1, $2;
  301. $1 = smalltalk.send(html, "_input", []);
  302. smalltalk.send($1, "_style_", ["position: absolute; left: -100000px;"]);
  303. smalltalk.send($1, "_onBlur_", [function () {return smalltalk.send(smalltalk.send(smalltalk.send(self, "_wrapper", []), "_asJQuery", []), "_removeClass_", [smalltalk.send(self, "_focusClass", [])]);}]);
  304. $2 = smalltalk.send($1, "_onFocus_", [function () {return smalltalk.send(smalltalk.send(smalltalk.send(self, "_wrapper", []), "_asJQuery", []), "_addClass_", [smalltalk.send(self, "_focusClass", [])]);}]);
  305. self['@hiddenInput'] = $2;
  306. return self;
  307. }
  308. }),
  309. smalltalk.HLFocusableWidget);
  310. smalltalk.addMethod(
  311. "_renderOn_",
  312. smalltalk.method({
  313. selector: "renderOn:",
  314. fn: function (html) {
  315. var self = this;
  316. var $1, $2;
  317. smalltalk.send(self, "_registerBindings", []);
  318. smalltalk.send(self, "_renderHiddenInputOn_", [html]);
  319. $1 = smalltalk.send(html, "_div", []);
  320. smalltalk.send($1, "_class_", ["hl_widget"]);
  321. smalltalk.send($1, "_onClick_", [function () {return smalltalk.send(smalltalk.send(self['@hiddenInput'], "_asJQuery", []), "_focus", []);}]);
  322. $2 = smalltalk.send($1, "_with_", [function () {return smalltalk.send(self, "_renderContentOn_", [html]);}]);
  323. self['@wrapper'] = $2;
  324. return self;
  325. }
  326. }),
  327. smalltalk.HLFocusableWidget);
  328. smalltalk.addClass('HLListWidget', smalltalk.HLFocusableWidget, ['items', 'selectedItem'], 'Helios-Core');
  329. smalltalk.addMethod(
  330. "_activateListItem_",
  331. smalltalk.method({
  332. selector: "activateListItem:",
  333. fn: function (aListItem) {
  334. var self = this;
  335. var $1, $2, $3;
  336. var parent;
  337. var position;
  338. $1 = smalltalk.send(aListItem, "_get_", [0]);
  339. if (($receiver = $1) == nil || $receiver == undefined) {
  340. return self;
  341. } else {
  342. }
  343. position = aListItem.parent().children().get().indexOf(aListItem.get(0)) + 1;
  344. parent = smalltalk.send(aListItem, "_parent", []);
  345. smalltalk.send(smalltalk.send(parent, "_children", []), "_removeClass_", ["active"]);
  346. smalltalk.send(aListItem, "_addClass_", ["active"]);
  347. $2 = smalltalk.send(smalltalk.send(smalltalk.send(aListItem, "_position", []), "_top", []), "__lt", [0]);
  348. if (smalltalk.assert($2)) {
  349. 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])]);
  350. }
  351. $3 = smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aListItem, "_position", []), "_top", []), "__plus", [smalltalk.send(aListItem, "_height", [])]), "__gt", [smalltalk.send(parent, "_height", [])]);
  352. if (smalltalk.assert($3)) {
  353. 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])]);
  354. }
  355. smalltalk.send(self, "_selectItem_", [smalltalk.send(smalltalk.send(self, "_items", []), "_at_", [smalltalk.send(smalltalk.send(aListItem, "_attr_", ["list-data"]), "_asNumber", [])])]);
  356. return self;
  357. }
  358. }),
  359. smalltalk.HLListWidget);
  360. smalltalk.addMethod(
  361. "_cssClassForItem_",
  362. smalltalk.method({
  363. selector: "cssClassForItem:",
  364. fn: function (anObject) {
  365. var self = this;
  366. var $2, $1;
  367. $2 = smalltalk.send(smalltalk.send(self, "_selectedItem", []), "__eq", [anObject]);
  368. if (smalltalk.assert($2)) {
  369. $1 = "active";
  370. } else {
  371. $1 = "inactive";
  372. }
  373. return $1;
  374. }
  375. }),
  376. smalltalk.HLListWidget);
  377. smalltalk.addMethod(
  378. "_defaultItems",
  379. smalltalk.method({
  380. selector: "defaultItems",
  381. fn: function () {
  382. var self = this;
  383. return [];
  384. }
  385. }),
  386. smalltalk.HLListWidget);
  387. smalltalk.addMethod(
  388. "_iconForItem_",
  389. smalltalk.method({
  390. selector: "iconForItem:",
  391. fn: function (anObject) {
  392. var self = this;
  393. return "";
  394. }
  395. }),
  396. smalltalk.HLListWidget);
  397. smalltalk.addMethod(
  398. "_items",
  399. smalltalk.method({
  400. selector: "items",
  401. fn: function () {
  402. var self = this;
  403. var $1;
  404. if (($receiver = self['@items']) == nil || $receiver == undefined) {
  405. self['@items'] = smalltalk.send(self, "_defaultItems", []);
  406. $1 = self['@items'];
  407. } else {
  408. $1 = self['@items'];
  409. }
  410. return $1;
  411. }
  412. }),
  413. smalltalk.HLListWidget);
  414. smalltalk.addMethod(
  415. "_items_",
  416. smalltalk.method({
  417. selector: "items:",
  418. fn: function (aCollection) {
  419. var self = this;
  420. self['@items'] = aCollection;
  421. return self;
  422. }
  423. }),
  424. smalltalk.HLListWidget);
  425. smalltalk.addMethod(
  426. "_renderButtonsOn_",
  427. smalltalk.method({
  428. selector: "renderButtonsOn:",
  429. fn: function (html) {
  430. var self = this;
  431. return self;
  432. }
  433. }),
  434. smalltalk.HLListWidget);
  435. smalltalk.addMethod(
  436. "_renderContentOn_",
  437. smalltalk.method({
  438. selector: "renderContentOn:",
  439. fn: function (html) {
  440. var self = this;
  441. var $1, $2, $3, $4;
  442. $1 = smalltalk.send(html, "_ul", []);
  443. smalltalk.send($1, "_class_", ["nav nav-pills nav-stacked"]);
  444. $2 = smalltalk.send($1, "_with_", [function () {return smalltalk.send(self, "_renderListOn_", [html]);}]);
  445. $3 = smalltalk.send(html, "_div", []);
  446. smalltalk.send($3, "_class_", ["pane_actions form-actions"]);
  447. $4 = smalltalk.send($3, "_with_", [function () {return smalltalk.send(self, "_renderButtonsOn_", [html]);}]);
  448. smalltalk.send(self, "_setupKeyBindings", []);
  449. return self;
  450. }
  451. }),
  452. smalltalk.HLListWidget);
  453. smalltalk.addMethod(
  454. "_renderItem_on_",
  455. smalltalk.method({
  456. selector: "renderItem:on:",
  457. fn: function (anObject, html) {
  458. var self = this;
  459. var $2, $3, $1;
  460. var li;
  461. li = smalltalk.send(html, "_li", []);
  462. smalltalk.send(li, "_class_", [smalltalk.send(self, "_cssClassForItem_", [anObject])]);
  463. smalltalk.send(li, "_at_put_", ["list-data", smalltalk.send(smalltalk.send(smalltalk.send(self, "_items", []), "_indexOf_", [anObject]), "_asString", [])]);
  464. $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;}]);
  465. return self;
  466. }
  467. }),
  468. smalltalk.HLListWidget);
  469. smalltalk.addMethod(
  470. "_renderItemLabel_on_",
  471. smalltalk.method({
  472. selector: "renderItemLabel:on:",
  473. fn: function (anObject, html) {
  474. var self = this;
  475. smalltalk.send(html, "_with_", [smalltalk.send(anObject, "_asString", [])]);
  476. return self;
  477. }
  478. }),
  479. smalltalk.HLListWidget);
  480. smalltalk.addMethod(
  481. "_renderListOn_",
  482. smalltalk.method({
  483. selector: "renderListOn:",
  484. fn: function (html) {
  485. var self = this;
  486. smalltalk.send(smalltalk.send(self, "_items", []), "_do_", [function (each) {return smalltalk.send(self, "_renderItem_on_", [each, html]);}]);
  487. return self;
  488. }
  489. }),
  490. smalltalk.HLListWidget);
  491. smalltalk.addMethod(
  492. "_selectItem_",
  493. smalltalk.method({
  494. selector: "selectItem:",
  495. fn: function (anObject) {
  496. var self = this;
  497. smalltalk.send(self, "_selectedItem_", [anObject]);
  498. return self;
  499. }
  500. }),
  501. smalltalk.HLListWidget);
  502. smalltalk.addMethod(
  503. "_selectedItem",
  504. smalltalk.method({
  505. selector: "selectedItem",
  506. fn: function () {
  507. var self = this;
  508. return self['@selectedItem'];
  509. }
  510. }),
  511. smalltalk.HLListWidget);
  512. smalltalk.addMethod(
  513. "_selectedItem_",
  514. smalltalk.method({
  515. selector: "selectedItem:",
  516. fn: function (anObject) {
  517. var self = this;
  518. self['@selectedItem'] = anObject;
  519. return self;
  520. }
  521. }),
  522. smalltalk.HLListWidget);
  523. smalltalk.addMethod(
  524. "_setupKeyBindings",
  525. smalltalk.method({
  526. selector: "setupKeyBindings",
  527. fn: function () {
  528. var self = this;
  529. var $1, $2, $3;
  530. var next;
  531. smalltalk.send(smalltalk.send(self['@hiddenInput'], "_asJQuery", []), "_unbind_", ["keydown"]);
  532. 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]);}}]);
  533. return self;
  534. }
  535. }),
  536. smalltalk.HLListWidget);
  537. smalltalk.addClass('HLNavigationListWidget', smalltalk.HLListWidget, ['previous', 'next'], 'Helios-Core');
  538. smalltalk.addMethod(
  539. "_next",
  540. smalltalk.method({
  541. selector: "next",
  542. fn: function () {
  543. var self = this;
  544. return self['@next'];
  545. }
  546. }),
  547. smalltalk.HLNavigationListWidget);
  548. smalltalk.addMethod(
  549. "_next_",
  550. smalltalk.method({
  551. selector: "next:",
  552. fn: function (aWidget) {
  553. var self = this;
  554. var $1;
  555. self['@next'] = aWidget;
  556. $1 = smalltalk.send(smalltalk.send(aWidget, "_previous", []), "__eq", [self]);
  557. if (!smalltalk.assert($1)) {
  558. smalltalk.send(aWidget, "_previous_", [self]);
  559. }
  560. return self;
  561. }
  562. }),
  563. smalltalk.HLNavigationListWidget);
  564. smalltalk.addMethod(
  565. "_nextFocus",
  566. smalltalk.method({
  567. selector: "nextFocus",
  568. fn: function () {
  569. var self = this;
  570. var $1;
  571. $1 = smalltalk.send(self, "_next", []);
  572. if (($receiver = $1) == nil || $receiver == undefined) {
  573. } else {
  574. smalltalk.send(smalltalk.send(self, "_next", []), "_focus", []);
  575. }
  576. return self;
  577. }
  578. }),
  579. smalltalk.HLNavigationListWidget);
  580. smalltalk.addMethod(
  581. "_previous",
  582. smalltalk.method({
  583. selector: "previous",
  584. fn: function () {
  585. var self = this;
  586. return self['@previous'];
  587. }
  588. }),
  589. smalltalk.HLNavigationListWidget);
  590. smalltalk.addMethod(
  591. "_previous_",
  592. smalltalk.method({
  593. selector: "previous:",
  594. fn: function (aWidget) {
  595. var self = this;
  596. var $1;
  597. self['@previous'] = aWidget;
  598. $1 = smalltalk.send(smalltalk.send(aWidget, "_next", []), "__eq", [self]);
  599. if (!smalltalk.assert($1)) {
  600. smalltalk.send(aWidget, "_next_", [self]);
  601. }
  602. return self;
  603. }
  604. }),
  605. smalltalk.HLNavigationListWidget);
  606. smalltalk.addMethod(
  607. "_previousFocus",
  608. smalltalk.method({
  609. selector: "previousFocus",
  610. fn: function () {
  611. var self = this;
  612. var $1;
  613. $1 = smalltalk.send(self, "_previous", []);
  614. if (($receiver = $1) == nil || $receiver == undefined) {
  615. } else {
  616. smalltalk.send(smalltalk.send(self, "_previous", []), "_focus", []);
  617. }
  618. return self;
  619. }
  620. }),
  621. smalltalk.HLNavigationListWidget);
  622. smalltalk.addMethod(
  623. "_setupKeyBindings",
  624. smalltalk.method({
  625. selector: "setupKeyBindings",
  626. fn: function () {
  627. var self = this;
  628. var $1, $2;
  629. smalltalk.send(self, "_setupKeyBindings", [], smalltalk.HLListWidget);
  630. 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", []);}}]);
  631. return self;
  632. }
  633. }),
  634. smalltalk.HLNavigationListWidget);
  635. smalltalk.addClass('HLManager', smalltalk.HLWidget, ['tabs', 'activeTab', 'keyBinder', 'environment'], 'Helios-Core');
  636. smalltalk.addMethod(
  637. "_activate_",
  638. smalltalk.method({
  639. selector: "activate:",
  640. fn: function (aTab) {
  641. var self = this;
  642. var $1;
  643. smalltalk.send(smalltalk.send(self, "_keyBinder", []), "_flushBindings", []);
  644. self['@activeTab'] = aTab;
  645. smalltalk.send(self, "_refresh", []);
  646. $1 = smalltalk.send(self, "_show_", [aTab]);
  647. return self;
  648. }
  649. }),
  650. smalltalk.HLManager);
  651. smalltalk.addMethod(
  652. "_activeTab",
  653. smalltalk.method({
  654. selector: "activeTab",
  655. fn: function () {
  656. var self = this;
  657. return self['@activeTab'];
  658. }
  659. }),
  660. smalltalk.HLManager);
  661. smalltalk.addMethod(
  662. "_addTab_",
  663. smalltalk.method({
  664. selector: "addTab:",
  665. fn: function (aTab) {
  666. var self = this;
  667. smalltalk.send(smalltalk.send(self, "_tabs", []), "_add_", [aTab]);
  668. smalltalk.send(self, "_activate_", [aTab]);
  669. return self;
  670. }
  671. }),
  672. smalltalk.HLManager);
  673. smalltalk.addMethod(
  674. "_defaultEnvironment",
  675. smalltalk.method({
  676. selector: "defaultEnvironment",
  677. fn: function () {
  678. var self = this;
  679. var $1;
  680. $1 = smalltalk.send(smalltalk.HLLocalEnvironment || HLLocalEnvironment, "_new", []);
  681. return $1;
  682. }
  683. }),
  684. smalltalk.HLManager);
  685. smalltalk.addMethod(
  686. "_environment",
  687. smalltalk.method({
  688. selector: "environment",
  689. fn: function () {
  690. var self = this;
  691. var $1;
  692. if (($receiver = self['@environment']) == nil || $receiver == undefined) {
  693. self['@environment'] = smalltalk.send(self, "_defaultEnvironment", []);
  694. $1 = self['@environment'];
  695. } else {
  696. $1 = self['@environment'];
  697. }
  698. return $1;
  699. }
  700. }),
  701. smalltalk.HLManager);
  702. smalltalk.addMethod(
  703. "_environment_",
  704. smalltalk.method({
  705. selector: "environment:",
  706. fn: function (anEnvironment) {
  707. var self = this;
  708. self['@environment'] = anEnvironment;
  709. return self;
  710. }
  711. }),
  712. smalltalk.HLManager);
  713. smalltalk.addMethod(
  714. "_initialize",
  715. smalltalk.method({
  716. selector: "initialize",
  717. fn: function () {
  718. var self = this;
  719. smalltalk.send(self, "_initialize", [], smalltalk.HLWidget);
  720. smalltalk.send(smalltalk.send(self, "_keyBinder", []), "_setupEvents", []);
  721. return self;
  722. }
  723. }),
  724. smalltalk.HLManager);
  725. smalltalk.addMethod(
  726. "_keyBinder",
  727. smalltalk.method({
  728. selector: "keyBinder",
  729. fn: function () {
  730. var self = this;
  731. var $1;
  732. if (($receiver = self['@keyBinder']) == nil || $receiver == undefined) {
  733. self['@keyBinder'] = smalltalk.send(smalltalk.HLKeyBinder || HLKeyBinder, "_new", []);
  734. $1 = self['@keyBinder'];
  735. } else {
  736. $1 = self['@keyBinder'];
  737. }
  738. return $1;
  739. }
  740. }),
  741. smalltalk.HLManager);
  742. smalltalk.addMethod(
  743. "_refresh",
  744. smalltalk.method({
  745. selector: "refresh",
  746. fn: function () {
  747. var self = this;
  748. smalltalk.send(smalltalk.send(window, "_jQuery_", [".navbar"]), "_remove", []);
  749. smalltalk.send(smalltalk.send(window, "_jQuery_", ["#container"]), "_remove", []);
  750. smalltalk.send(self, "_appendToJQuery_", [smalltalk.send("body", "_asJQuery", [])]);
  751. return self;
  752. }
  753. }),
  754. smalltalk.HLManager);
  755. smalltalk.addMethod(
  756. "_removeTab_",
  757. smalltalk.method({
  758. selector: "removeTab:",
  759. fn: function (aTab) {
  760. var self = this;
  761. var $1;
  762. $1 = smalltalk.send(smalltalk.send(self, "_tabs", []), "_includes_", [aTab]);
  763. if (!smalltalk.assert($1)) {
  764. return self;
  765. }
  766. smalltalk.send(smalltalk.send(self, "_tabs", []), "_remove_", [aTab]);
  767. smalltalk.send(self, "_refresh", []);
  768. return self;
  769. }
  770. }),
  771. smalltalk.HLManager);
  772. smalltalk.addMethod(
  773. "_renderAddOn_",
  774. smalltalk.method({
  775. selector: "renderAddOn:",
  776. fn: function (html) {
  777. var self = this;
  778. var $1, $3, $4, $5, $7, $8, $6, $2;
  779. $1 = smalltalk.send(html, "_li", []);
  780. smalltalk.send($1, "_class_", ["dropdown"]);
  781. $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;}]);
  782. return self;
  783. }
  784. }),
  785. smalltalk.HLManager);
  786. smalltalk.addMethod(
  787. "_renderContentOn_",
  788. smalltalk.method({
  789. selector: "renderContentOn:",
  790. fn: function (html) {
  791. var self = this;
  792. var $1, $3, $4, $2;
  793. $1 = smalltalk.send(html, "_div", []);
  794. smalltalk.send($1, "_class_", ["navbar navbar-fixed-top"]);
  795. $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;}]);
  796. smalltalk.send(smalltalk.send(html, "_div", []), "_id_", ["container"]);
  797. return self;
  798. }
  799. }),
  800. smalltalk.HLManager);
  801. smalltalk.addMethod(
  802. "_renderTabsOn_",
  803. smalltalk.method({
  804. selector: "renderTabsOn:",
  805. fn: function (html) {
  806. var self = this;
  807. var $1, $3, $5, $4, $7, $8, $6, $2;
  808. $1 = smalltalk.send(html, "_ul", []);
  809. smalltalk.send($1, "_class_", ["nav"]);
  810. $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]);}]);
  811. return self;
  812. }
  813. }),
  814. smalltalk.HLManager);
  815. smalltalk.addMethod(
  816. "_show_",
  817. smalltalk.method({
  818. selector: "show:",
  819. fn: function (aTab) {
  820. var self = this;
  821. smalltalk.send(smalltalk.send(window, "_jQuery_", ["#container"]), "_empty", []);
  822. smalltalk.send(smalltalk.send(aTab, "_widget", []), "_appendToJQuery_", [smalltalk.send("#container", "_asJQuery", [])]);
  823. return self;
  824. }
  825. }),
  826. smalltalk.HLManager);
  827. smalltalk.addMethod(
  828. "_tabs",
  829. smalltalk.method({
  830. selector: "tabs",
  831. fn: function () {
  832. var self = this;
  833. var $1;
  834. if (($receiver = self['@tabs']) == nil || $receiver == undefined) {
  835. self['@tabs'] = smalltalk.send(smalltalk.OrderedCollection || OrderedCollection, "_new", []);
  836. $1 = self['@tabs'];
  837. } else {
  838. $1 = self['@tabs'];
  839. }
  840. return $1;
  841. }
  842. }),
  843. smalltalk.HLManager);
  844. smalltalk.HLManager.klass.iVarNames = ['current'];
  845. smalltalk.addMethod(
  846. "_current",
  847. smalltalk.method({
  848. selector: "current",
  849. fn: function () {
  850. var self = this;
  851. var $1;
  852. if (($receiver = self['@current']) == nil || $receiver == undefined) {
  853. self['@current'] = smalltalk.send(smalltalk.send(self, "_basicNew", []), "_initialize", []);
  854. $1 = self['@current'];
  855. } else {
  856. $1 = self['@current'];
  857. }
  858. return $1;
  859. }
  860. }),
  861. smalltalk.HLManager.klass);
  862. smalltalk.addMethod(
  863. "_initialize",
  864. smalltalk.method({
  865. selector: "initialize",
  866. fn: function () {
  867. var self = this;
  868. smalltalk.send(smalltalk.send(self, "_current", []), "_appendToJQuery_", [smalltalk.send("body", "_asJQuery", [])]);
  869. return self;
  870. }
  871. }),
  872. smalltalk.HLManager.klass);
  873. smalltalk.addMethod(
  874. "_new",
  875. smalltalk.method({
  876. selector: "new",
  877. fn: function () {
  878. var self = this;
  879. smalltalk.send(self, "_shouldNotImplement", []);
  880. return self;
  881. }
  882. }),
  883. smalltalk.HLManager.klass);
  884. smalltalk.addClass('HLSUnit', smalltalk.HLWidget, [], 'Helios-Core');
  885. smalltalk.addMethod(
  886. "_canBeOpenAsTab",
  887. smalltalk.method({
  888. selector: "canBeOpenAsTab",
  889. fn: function () {
  890. var self = this;
  891. return true;
  892. }
  893. }),
  894. smalltalk.HLSUnit.klass);
  895. smalltalk.addMethod(
  896. "_tabLabel",
  897. smalltalk.method({
  898. selector: "tabLabel",
  899. fn: function () {
  900. var self = this;
  901. return "SUnit";
  902. }
  903. }),
  904. smalltalk.HLSUnit.klass);
  905. smalltalk.addMethod(
  906. "_tabPriority",
  907. smalltalk.method({
  908. selector: "tabPriority",
  909. fn: function () {
  910. var self = this;
  911. return 1000;
  912. }
  913. }),
  914. smalltalk.HLSUnit.klass);
  915. smalltalk.addClass('HLTranscript', smalltalk.HLWidget, [], 'Helios-Core');
  916. smalltalk.addMethod(
  917. "_canBeOpenAsTab",
  918. smalltalk.method({
  919. selector: "canBeOpenAsTab",
  920. fn: function () {
  921. var self = this;
  922. return true;
  923. }
  924. }),
  925. smalltalk.HLTranscript.klass);
  926. smalltalk.addMethod(
  927. "_tabLabel",
  928. smalltalk.method({
  929. selector: "tabLabel",
  930. fn: function () {
  931. var self = this;
  932. return "Transcript";
  933. }
  934. }),
  935. smalltalk.HLTranscript.klass);
  936. smalltalk.addMethod(
  937. "_tabPriority",
  938. smalltalk.method({
  939. selector: "tabPriority",
  940. fn: function () {
  941. var self = this;
  942. return 600;
  943. }
  944. }),
  945. smalltalk.HLTranscript.klass);