Helios-Core.deploy.js 36 KB

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