Helios-Core.deploy.js 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503
  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,$3;
  896. var next;
  897. smalltalk.send(smalltalk.send(self["@hiddenInput"],"_asJQuery",[]),"_unbind_",["keydown"]);
  898. smalltalk.send(smalltalk.send(self["@hiddenInput"],"_asJQuery",[]),"_keydown_",[(function(e){
  899. var selected;
  900. selected=smalltalk.send(window,"_jQuery_",[".focused .nav-pills .active"]);
  901. selected;
  902. $1=smalltalk.send(smalltalk.send(e,"_which",[]),"__eq",[(38)]);
  903. if(smalltalk.assert($1)){
  904. smalltalk.send(self,"_activateListItem_",[smalltalk.send(selected,"_prev",[])]);
  905. };
  906. $2=smalltalk.send(smalltalk.send(e,"_which",[]),"__eq",[(40)]);
  907. if(smalltalk.assert($2)){
  908. next=smalltalk.send(selected,"_next",[]);
  909. next;
  910. $3=smalltalk.send(next,"_get_",[(0)]);
  911. if(($receiver = $3) == nil || $receiver == undefined){
  912. next=smalltalk.send(window,"_jQuery_",[".focused .nav-pills li:first-child"]);
  913. next;
  914. } else {
  915. $3;
  916. };
  917. return smalltalk.send(self,"_activateListItem_",[next]);
  918. };
  919. })]);
  920. return self}
  921. }),
  922. smalltalk.HLListWidget);
  923. smalltalk.addClass('HLNavigationListWidget', smalltalk.HLListWidget, ['previous', 'next'], 'Helios-Core');
  924. smalltalk.addMethod(
  925. "_next",
  926. smalltalk.method({
  927. selector: "next",
  928. fn: function (){
  929. var self=this;
  930. return self["@next"];
  931. }
  932. }),
  933. smalltalk.HLNavigationListWidget);
  934. smalltalk.addMethod(
  935. "_next_",
  936. smalltalk.method({
  937. selector: "next:",
  938. fn: function (aWidget){
  939. var self=this;
  940. var $1;
  941. self["@next"]=aWidget;
  942. $1=smalltalk.send(smalltalk.send(aWidget,"_previous",[]),"__eq",[self]);
  943. if(! smalltalk.assert($1)){
  944. smalltalk.send(aWidget,"_previous_",[self]);
  945. };
  946. return self}
  947. }),
  948. smalltalk.HLNavigationListWidget);
  949. smalltalk.addMethod(
  950. "_nextFocus",
  951. smalltalk.method({
  952. selector: "nextFocus",
  953. fn: function (){
  954. var self=this;
  955. var $1;
  956. $1=smalltalk.send(self,"_next",[]);
  957. if(($receiver = $1) == nil || $receiver == undefined){
  958. $1;
  959. } else {
  960. smalltalk.send(smalltalk.send(self,"_next",[]),"_focus",[]);
  961. };
  962. return self}
  963. }),
  964. smalltalk.HLNavigationListWidget);
  965. smalltalk.addMethod(
  966. "_previous",
  967. smalltalk.method({
  968. selector: "previous",
  969. fn: function (){
  970. var self=this;
  971. return self["@previous"];
  972. }
  973. }),
  974. smalltalk.HLNavigationListWidget);
  975. smalltalk.addMethod(
  976. "_previous_",
  977. smalltalk.method({
  978. selector: "previous:",
  979. fn: function (aWidget){
  980. var self=this;
  981. var $1;
  982. self["@previous"]=aWidget;
  983. $1=smalltalk.send(smalltalk.send(aWidget,"_next",[]),"__eq",[self]);
  984. if(! smalltalk.assert($1)){
  985. smalltalk.send(aWidget,"_next_",[self]);
  986. };
  987. return self}
  988. }),
  989. smalltalk.HLNavigationListWidget);
  990. smalltalk.addMethod(
  991. "_previousFocus",
  992. smalltalk.method({
  993. selector: "previousFocus",
  994. fn: function (){
  995. var self=this;
  996. var $1;
  997. $1=smalltalk.send(self,"_previous",[]);
  998. if(($receiver = $1) == nil || $receiver == undefined){
  999. $1;
  1000. } else {
  1001. smalltalk.send(smalltalk.send(self,"_previous",[]),"_focus",[]);
  1002. };
  1003. return self}
  1004. }),
  1005. smalltalk.HLNavigationListWidget);
  1006. smalltalk.addMethod(
  1007. "_setupKeyBindings",
  1008. smalltalk.method({
  1009. selector: "setupKeyBindings",
  1010. fn: function (){
  1011. var self=this;
  1012. var $1,$2;
  1013. smalltalk.send(self,"_setupKeyBindings",[],smalltalk.HLListWidget);
  1014. smalltalk.send(smalltalk.send(self["@hiddenInput"],"_asJQuery",[]),"_keydown_",[(function(e){
  1015. $1=smalltalk.send(smalltalk.send(e,"_which",[]),"__eq",[(39)]);
  1016. if(smalltalk.assert($1)){
  1017. smalltalk.send(self,"_nextFocus",[]);
  1018. };
  1019. $2=smalltalk.send(smalltalk.send(e,"_which",[]),"__eq",[(37)]);
  1020. if(smalltalk.assert($2)){
  1021. return smalltalk.send(self,"_previousFocus",[]);
  1022. };
  1023. })]);
  1024. return self}
  1025. }),
  1026. smalltalk.HLNavigationListWidget);
  1027. smalltalk.addClass('HLInspector', smalltalk.HLWidget, [], 'Helios-Core');
  1028. smalltalk.addClass('HLManager', smalltalk.HLWidget, ['tabs', 'activeTab', 'keyBinder'], 'Helios-Core');
  1029. smalltalk.addMethod(
  1030. "_activate_",
  1031. smalltalk.method({
  1032. selector: "activate:",
  1033. fn: function (aTab){
  1034. var self=this;
  1035. var $1;
  1036. smalltalk.send(smalltalk.send(self,"_keyBinder",[]),"_flushBindings",[]);
  1037. self["@activeTab"]=aTab;
  1038. smalltalk.send(self,"_refresh",[]);
  1039. $1=smalltalk.send(self,"_show_",[aTab]);
  1040. return self}
  1041. }),
  1042. smalltalk.HLManager);
  1043. smalltalk.addMethod(
  1044. "_activeTab",
  1045. smalltalk.method({
  1046. selector: "activeTab",
  1047. fn: function (){
  1048. var self=this;
  1049. return self["@activeTab"];
  1050. }
  1051. }),
  1052. smalltalk.HLManager);
  1053. smalltalk.addMethod(
  1054. "_addTab_",
  1055. smalltalk.method({
  1056. selector: "addTab:",
  1057. fn: function (aTab){
  1058. var self=this;
  1059. smalltalk.send(smalltalk.send(self,"_tabs",[]),"_add_",[aTab]);
  1060. smalltalk.send(self,"_activate_",[aTab]);
  1061. return self}
  1062. }),
  1063. smalltalk.HLManager);
  1064. smalltalk.addMethod(
  1065. "_initialize",
  1066. smalltalk.method({
  1067. selector: "initialize",
  1068. fn: function (){
  1069. var self=this;
  1070. smalltalk.send(self,"_initialize",[],smalltalk.HLWidget);
  1071. smalltalk.send(smalltalk.send(self,"_keyBinder",[]),"_setupEvents",[]);
  1072. return self}
  1073. }),
  1074. smalltalk.HLManager);
  1075. smalltalk.addMethod(
  1076. "_keyBinder",
  1077. smalltalk.method({
  1078. selector: "keyBinder",
  1079. fn: function (){
  1080. var self=this;
  1081. var $1;
  1082. if(($receiver = self["@keyBinder"]) == nil || $receiver == undefined){
  1083. self["@keyBinder"]=smalltalk.send((smalltalk.HLKeyBinder || HLKeyBinder),"_new",[]);
  1084. $1=self["@keyBinder"];
  1085. } else {
  1086. $1=self["@keyBinder"];
  1087. };
  1088. return $1;
  1089. }
  1090. }),
  1091. smalltalk.HLManager);
  1092. smalltalk.addMethod(
  1093. "_refresh",
  1094. smalltalk.method({
  1095. selector: "refresh",
  1096. fn: function (){
  1097. var self=this;
  1098. smalltalk.send(smalltalk.send(window,"_jQuery_",[".navbar"]),"_remove",[]);
  1099. smalltalk.send(smalltalk.send(window,"_jQuery_",["#container"]),"_remove",[]);
  1100. smalltalk.send(self,"_appendToJQuery_",[smalltalk.send("body","_asJQuery",[])]);
  1101. return self}
  1102. }),
  1103. smalltalk.HLManager);
  1104. smalltalk.addMethod(
  1105. "_removeTab_",
  1106. smalltalk.method({
  1107. selector: "removeTab:",
  1108. fn: function (aTab){
  1109. var self=this;
  1110. var $1;
  1111. $1=smalltalk.send(smalltalk.send(self,"_tabs",[]),"_includes_",[aTab]);
  1112. if(! smalltalk.assert($1)){
  1113. return self;
  1114. };
  1115. smalltalk.send(smalltalk.send(self,"_tabs",[]),"_remove_",[aTab]);
  1116. smalltalk.send(self,"_refresh",[]);
  1117. return self}
  1118. }),
  1119. smalltalk.HLManager);
  1120. smalltalk.addMethod(
  1121. "_renderAddOn_",
  1122. smalltalk.method({
  1123. selector: "renderAddOn:",
  1124. fn: function (html){
  1125. var self=this;
  1126. var $1,$3,$4,$5,$7,$8,$6,$2;
  1127. $1=smalltalk.send(html,"_li",[]);
  1128. smalltalk.send($1,"_class_",["dropdown"]);
  1129. $2=smalltalk.send($1,"_with_",[(function(){
  1130. $3=smalltalk.send(html,"_a",[]);
  1131. smalltalk.send($3,"_class_",["dropdown-toggle"]);
  1132. smalltalk.send($3,"_at_put_",["data-toggle","dropdown"]);
  1133. $4=smalltalk.send($3,"_with_",[(function(){
  1134. smalltalk.send(html,"_with_",["Open..."]);
  1135. return smalltalk.send(smalltalk.send(html,"_tag_",["b"]),"_class_",["caret"]);
  1136. })]);
  1137. $4;
  1138. $5=smalltalk.send(html,"_ul",[]);
  1139. smalltalk.send($5,"_class_",["dropdown-menu"]);
  1140. $6=smalltalk.send($5,"_with_",[(function(){
  1141. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.HLWidget || HLWidget),"_withAllSubclasses",[]),"_select_",[(function(each){
  1142. return smalltalk.send(each,"_canBeOpenAsTab",[]);
  1143. })]),"_sorted_",[(function(a,b){
  1144. return smalltalk.send(smalltalk.send(a,"_tabPriority",[]),"__lt",[smalltalk.send(b,"_tabPriority",[])]);
  1145. })]),"_do_",[(function(each){
  1146. return smalltalk.send(smalltalk.send(html,"_li",[]),"_with_",[(function(){
  1147. $7=smalltalk.send(html,"_a",[]);
  1148. smalltalk.send($7,"_with_",[smalltalk.send(each,"_tabLabel",[])]);
  1149. $8=smalltalk.send($7,"_onClick_",[(function(){
  1150. return smalltalk.send(each,"_openAsTab",[]);
  1151. })]);
  1152. return $8;
  1153. })]);
  1154. })]);
  1155. })]);
  1156. return $6;
  1157. })]);
  1158. return self}
  1159. }),
  1160. smalltalk.HLManager);
  1161. smalltalk.addMethod(
  1162. "_renderContentOn_",
  1163. smalltalk.method({
  1164. selector: "renderContentOn:",
  1165. fn: function (html){
  1166. var self=this;
  1167. var $1,$3,$4,$2;
  1168. $1=smalltalk.send(html,"_div",[]);
  1169. smalltalk.send($1,"_class_",["navbar navbar-fixed-top"]);
  1170. $2=smalltalk.send($1,"_with_",[(function(){
  1171. $3=smalltalk.send(html,"_div",[]);
  1172. smalltalk.send($3,"_class_",["navbar-inner"]);
  1173. $4=smalltalk.send($3,"_with_",[(function(){
  1174. return smalltalk.send(self,"_renderTabsOn_",[html]);
  1175. })]);
  1176. return $4;
  1177. })]);
  1178. smalltalk.send(smalltalk.send(html,"_div",[]),"_id_",["container"]);
  1179. return self}
  1180. }),
  1181. smalltalk.HLManager);
  1182. smalltalk.addMethod(
  1183. "_renderTabsOn_",
  1184. smalltalk.method({
  1185. selector: "renderTabsOn:",
  1186. fn: function (html){
  1187. var self=this;
  1188. var $1,$3,$5,$4,$7,$8,$6,$2;
  1189. $1=smalltalk.send(html,"_ul",[]);
  1190. smalltalk.send($1,"_class_",["nav"]);
  1191. $2=smalltalk.send($1,"_with_",[(function(){
  1192. smalltalk.send(smalltalk.send(self,"_tabs",[]),"_do_",[(function(each){
  1193. $3=smalltalk.send(html,"_li",[]);
  1194. $5=smalltalk.send(each,"_isActive",[]);
  1195. if(smalltalk.assert($5)){
  1196. $4="active";
  1197. } else {
  1198. $4="inactive";
  1199. };
  1200. smalltalk.send($3,"_class_",[$4]);
  1201. $6=smalltalk.send($3,"_with_",[(function(){
  1202. $7=smalltalk.send(html,"_a",[]);
  1203. smalltalk.send($7,"_with_",[(function(){
  1204. smalltalk.send(smalltalk.send(smalltalk.send(html,"_tag_",["i"]),"_class_",["icon-remove-circle"]),"_onClick_",[(function(){
  1205. return smalltalk.send(self,"_removeTab_",[each]);
  1206. })]);
  1207. return smalltalk.send(html,"_with_",[smalltalk.send(each,"_label",[])]);
  1208. })]);
  1209. $8=smalltalk.send($7,"_onClick_",[(function(){
  1210. return smalltalk.send(each,"_activate",[]);
  1211. })]);
  1212. return $8;
  1213. })]);
  1214. return $6;
  1215. })]);
  1216. return smalltalk.send(self,"_renderAddOn_",[html]);
  1217. })]);
  1218. return self}
  1219. }),
  1220. smalltalk.HLManager);
  1221. smalltalk.addMethod(
  1222. "_show_",
  1223. smalltalk.method({
  1224. selector: "show:",
  1225. fn: function (aTab){
  1226. var self=this;
  1227. smalltalk.send(smalltalk.send(window,"_jQuery_",["#container"]),"_empty",[]);
  1228. smalltalk.send(smalltalk.send(aTab,"_widget",[]),"_appendToJQuery_",[smalltalk.send("#container","_asJQuery",[])]);
  1229. return self}
  1230. }),
  1231. smalltalk.HLManager);
  1232. smalltalk.addMethod(
  1233. "_tabs",
  1234. smalltalk.method({
  1235. selector: "tabs",
  1236. fn: function (){
  1237. var self=this;
  1238. var $1;
  1239. if(($receiver = self["@tabs"]) == nil || $receiver == undefined){
  1240. self["@tabs"]=smalltalk.send((smalltalk.OrderedCollection || OrderedCollection),"_new",[]);
  1241. $1=self["@tabs"];
  1242. } else {
  1243. $1=self["@tabs"];
  1244. };
  1245. return $1;
  1246. }
  1247. }),
  1248. smalltalk.HLManager);
  1249. smalltalk.HLManager.klass.iVarNames = ['current'];
  1250. smalltalk.addMethod(
  1251. "_current",
  1252. smalltalk.method({
  1253. selector: "current",
  1254. fn: function (){
  1255. var self=this;
  1256. var $1;
  1257. if(($receiver = self["@current"]) == nil || $receiver == undefined){
  1258. self["@current"]=smalltalk.send(smalltalk.send(self,"_basicNew",[]),"_initialize",[]);
  1259. $1=self["@current"];
  1260. } else {
  1261. $1=self["@current"];
  1262. };
  1263. return $1;
  1264. }
  1265. }),
  1266. smalltalk.HLManager.klass);
  1267. smalltalk.addMethod(
  1268. "_initialize",
  1269. smalltalk.method({
  1270. selector: "initialize",
  1271. fn: function (){
  1272. var self=this;
  1273. smalltalk.send(smalltalk.send(self,"_current",[]),"_appendToJQuery_",[smalltalk.send("body","_asJQuery",[])]);
  1274. return self}
  1275. }),
  1276. smalltalk.HLManager.klass);
  1277. smalltalk.addMethod(
  1278. "_new",
  1279. smalltalk.method({
  1280. selector: "new",
  1281. fn: function (){
  1282. var self=this;
  1283. smalltalk.send(self,"_shouldNotImplement",[]);
  1284. return self}
  1285. }),
  1286. smalltalk.HLManager.klass);
  1287. smalltalk.addClass('HLSUnit', smalltalk.HLWidget, [], 'Helios-Core');
  1288. smalltalk.addMethod(
  1289. "_canBeOpenAsTab",
  1290. smalltalk.method({
  1291. selector: "canBeOpenAsTab",
  1292. fn: function (){
  1293. var self=this;
  1294. return true;
  1295. }
  1296. }),
  1297. smalltalk.HLSUnit.klass);
  1298. smalltalk.addMethod(
  1299. "_tabLabel",
  1300. smalltalk.method({
  1301. selector: "tabLabel",
  1302. fn: function (){
  1303. var self=this;
  1304. return "SUnit";
  1305. }
  1306. }),
  1307. smalltalk.HLSUnit.klass);
  1308. smalltalk.addMethod(
  1309. "_tabPriority",
  1310. smalltalk.method({
  1311. selector: "tabPriority",
  1312. fn: function (){
  1313. var self=this;
  1314. return (1000);
  1315. }
  1316. }),
  1317. smalltalk.HLSUnit.klass);
  1318. smalltalk.addClass('HLTranscript', smalltalk.HLWidget, [], 'Helios-Core');
  1319. smalltalk.addMethod(
  1320. "_canBeOpenAsTab",
  1321. smalltalk.method({
  1322. selector: "canBeOpenAsTab",
  1323. fn: function (){
  1324. var self=this;
  1325. return true;
  1326. }
  1327. }),
  1328. smalltalk.HLTranscript.klass);
  1329. smalltalk.addMethod(
  1330. "_tabLabel",
  1331. smalltalk.method({
  1332. selector: "tabLabel",
  1333. fn: function (){
  1334. var self=this;
  1335. return "Transcript";
  1336. }
  1337. }),
  1338. smalltalk.HLTranscript.klass);
  1339. smalltalk.addMethod(
  1340. "_tabPriority",
  1341. smalltalk.method({
  1342. selector: "tabPriority",
  1343. fn: function (){
  1344. var self=this;
  1345. return (600);
  1346. }
  1347. }),
  1348. smalltalk.HLTranscript.klass);
  1349. smalltalk.addClass('HLWorkspace', smalltalk.HLWidget, [], 'Helios-Core');
  1350. smalltalk.addMethod(
  1351. "_canBeOpenAsTab",
  1352. smalltalk.method({
  1353. selector: "canBeOpenAsTab",
  1354. fn: function (){
  1355. var self=this;
  1356. return true;
  1357. }
  1358. }),
  1359. smalltalk.HLWorkspace.klass);
  1360. smalltalk.addMethod(
  1361. "_tabLabel",
  1362. smalltalk.method({
  1363. selector: "tabLabel",
  1364. fn: function (){
  1365. var self=this;
  1366. return "Workspace";
  1367. }
  1368. }),
  1369. smalltalk.HLWorkspace.klass);
  1370. smalltalk.addMethod(
  1371. "_tabPriority",
  1372. smalltalk.method({
  1373. selector: "tabPriority",
  1374. fn: function (){
  1375. var self=this;
  1376. return (10);
  1377. }
  1378. }),
  1379. smalltalk.HLWorkspace.klass);