Helios-Core.deploy.js 34 KB

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