2
0

Helios-Core.deploy.js 36 KB

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