Helios-Core.deploy.js 35 KB

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