1
0

Helios-Core.deploy.js 54 KB

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