Helios-Core.deploy.js 38 KB

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