1
0

Helios-Core.deploy.js 29 KB

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