Helios-Core.deploy.js 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188
  1. smalltalk.addPackage('Helios-Core');
  2. smalltalk.addClass('HLTab', smalltalk.Object, ['widget', 'label'], '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. "_isActive",
  25. smalltalk.method({
  26. selector: "isActive",
  27. fn: function (){
  28. var self=this;
  29. return smalltalk.withContext(function($ctx1) { var $1;
  30. $1=_st(_st(_st(self)._manager())._activeTab()).__eq(self);
  31. return $1;
  32. }, function($ctx1) {$ctx1.fill(self,"isActive",{}, smalltalk.HLTab)})},
  33. messageSends: ["=", "activeTab", "manager"]}),
  34. smalltalk.HLTab);
  35. smalltalk.addMethod(
  36. "_label",
  37. smalltalk.method({
  38. selector: "label",
  39. fn: function (){
  40. var self=this;
  41. return smalltalk.withContext(function($ctx1) { var $2,$1;
  42. $2=self["@label"];
  43. if(($receiver = $2) == nil || $receiver == undefined){
  44. $1="";
  45. } else {
  46. $1=$2;
  47. };
  48. return $1;
  49. }, function($ctx1) {$ctx1.fill(self,"label",{}, smalltalk.HLTab)})},
  50. messageSends: ["ifNil:"]}),
  51. smalltalk.HLTab);
  52. smalltalk.addMethod(
  53. "_label_",
  54. smalltalk.method({
  55. selector: "label:",
  56. fn: function (aString){
  57. var self=this;
  58. return smalltalk.withContext(function($ctx1) { self["@label"]=aString;
  59. return self}, function($ctx1) {$ctx1.fill(self,"label:",{aString:aString}, smalltalk.HLTab)})},
  60. messageSends: []}),
  61. smalltalk.HLTab);
  62. smalltalk.addMethod(
  63. "_manager",
  64. smalltalk.method({
  65. selector: "manager",
  66. fn: function (){
  67. var self=this;
  68. return smalltalk.withContext(function($ctx1) { var $1;
  69. $1=_st((smalltalk.HLManager || HLManager))._current();
  70. return $1;
  71. }, function($ctx1) {$ctx1.fill(self,"manager",{}, smalltalk.HLTab)})},
  72. messageSends: ["current"]}),
  73. smalltalk.HLTab);
  74. smalltalk.addMethod(
  75. "_widget",
  76. smalltalk.method({
  77. selector: "widget",
  78. fn: function (){
  79. var self=this;
  80. return smalltalk.withContext(function($ctx1) { var $1;
  81. $1=self["@widget"];
  82. return $1;
  83. }, function($ctx1) {$ctx1.fill(self,"widget",{}, smalltalk.HLTab)})},
  84. messageSends: []}),
  85. smalltalk.HLTab);
  86. smalltalk.addMethod(
  87. "_widget_",
  88. smalltalk.method({
  89. selector: "widget:",
  90. fn: function (aWidget){
  91. var self=this;
  92. return smalltalk.withContext(function($ctx1) { self["@widget"]=aWidget;
  93. return self}, function($ctx1) {$ctx1.fill(self,"widget:",{aWidget:aWidget}, smalltalk.HLTab)})},
  94. messageSends: []}),
  95. smalltalk.HLTab);
  96. smalltalk.addMethod(
  97. "_on_labelled_",
  98. smalltalk.method({
  99. selector: "on:labelled:",
  100. fn: function (aWidget,aString){
  101. var self=this;
  102. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  103. $2=_st(self)._new();
  104. _st($2)._widget_(aWidget);
  105. _st($2)._label_(aString);
  106. $3=_st($2)._yourself();
  107. $1=$3;
  108. return $1;
  109. }, function($ctx1) {$ctx1.fill(self,"on:labelled:",{aWidget:aWidget,aString:aString}, smalltalk.HLTab.klass)})},
  110. messageSends: ["widget:", "new", "label:", "yourself"]}),
  111. smalltalk.HLTab.klass);
  112. smalltalk.addClass('HLWidget', smalltalk.Widget, ['wrapper'], 'Helios-Core');
  113. smalltalk.addMethod(
  114. "_manager",
  115. smalltalk.method({
  116. selector: "manager",
  117. fn: function (){
  118. var self=this;
  119. return smalltalk.withContext(function($ctx1) { var $1;
  120. $1=_st((smalltalk.HLManager || HLManager))._current();
  121. return $1;
  122. }, function($ctx1) {$ctx1.fill(self,"manager",{}, smalltalk.HLWidget)})},
  123. messageSends: ["current"]}),
  124. smalltalk.HLWidget);
  125. smalltalk.addMethod(
  126. "_refresh",
  127. smalltalk.method({
  128. selector: "refresh",
  129. fn: function (){
  130. var self=this;
  131. return smalltalk.withContext(function($ctx1) { var $1,$2;
  132. $1=_st(self)._wrapper();
  133. if(($receiver = $1) == nil || $receiver == undefined){
  134. $2=self;
  135. return $2;
  136. } else {
  137. $1;
  138. };
  139. _st(_st(_st(self)._wrapper())._asJQuery())._empty();
  140. _st((function(html){
  141. return smalltalk.withContext(function($ctx2) { return _st(self)._renderContentOn_(html);
  142. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}))._appendToJQuery_(_st(_st(self)._wrapper())._asJQuery());
  143. return self}, function($ctx1) {$ctx1.fill(self,"refresh",{}, smalltalk.HLWidget)})},
  144. messageSends: ["ifNil:", "wrapper", "empty", "asJQuery", "appendToJQuery:", "renderContentOn:"]}),
  145. smalltalk.HLWidget);
  146. smalltalk.addMethod(
  147. "_registerBindings",
  148. smalltalk.method({
  149. selector: "registerBindings",
  150. fn: function (){
  151. var self=this;
  152. return smalltalk.withContext(function($ctx1) { _st(self)._registerBindingsOn_(_st(_st(_st(self)._manager())._keyBinder())._bindings());
  153. return self}, function($ctx1) {$ctx1.fill(self,"registerBindings",{}, smalltalk.HLWidget)})},
  154. messageSends: ["registerBindingsOn:", "bindings", "keyBinder", "manager"]}),
  155. smalltalk.HLWidget);
  156. smalltalk.addMethod(
  157. "_registerBindingsOn_",
  158. smalltalk.method({
  159. selector: "registerBindingsOn:",
  160. fn: function (aBindingGroup){
  161. var self=this;
  162. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"registerBindingsOn:",{aBindingGroup:aBindingGroup}, smalltalk.HLWidget)})},
  163. messageSends: []}),
  164. smalltalk.HLWidget);
  165. smalltalk.addMethod(
  166. "_renderContentOn_",
  167. smalltalk.method({
  168. selector: "renderContentOn:",
  169. fn: function (html){
  170. var self=this;
  171. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html}, smalltalk.HLWidget)})},
  172. messageSends: []}),
  173. smalltalk.HLWidget);
  174. smalltalk.addMethod(
  175. "_renderOn_",
  176. smalltalk.method({
  177. selector: "renderOn:",
  178. fn: function (html){
  179. var self=this;
  180. return smalltalk.withContext(function($ctx1) { _st(self)._registerBindings();
  181. self["@wrapper"]=_st(html)._div();
  182. _st((function(renderer){
  183. return smalltalk.withContext(function($ctx2) { return _st(self)._renderContentOn_(renderer);
  184. }, function($ctx2) {$ctx2.fillBlock({renderer:renderer},$ctx1)})}))._appendToJQuery_(_st(self["@wrapper"])._asJQuery());
  185. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html}, smalltalk.HLWidget)})},
  186. messageSends: ["registerBindings", "div", "appendToJQuery:", "asJQuery", "renderContentOn:"]}),
  187. smalltalk.HLWidget);
  188. smalltalk.addMethod(
  189. "_wrapper",
  190. smalltalk.method({
  191. selector: "wrapper",
  192. fn: function (){
  193. var self=this;
  194. return smalltalk.withContext(function($ctx1) { var $1;
  195. $1=self["@wrapper"];
  196. return $1;
  197. }, function($ctx1) {$ctx1.fill(self,"wrapper",{}, smalltalk.HLWidget)})},
  198. messageSends: []}),
  199. smalltalk.HLWidget);
  200. smalltalk.addMethod(
  201. "_canBeOpenAsTab",
  202. smalltalk.method({
  203. selector: "canBeOpenAsTab",
  204. fn: function (){
  205. var self=this;
  206. return smalltalk.withContext(function($ctx1) { return false;
  207. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{}, smalltalk.HLWidget.klass)})},
  208. messageSends: []}),
  209. smalltalk.HLWidget.klass);
  210. smalltalk.addMethod(
  211. "_openAsTab",
  212. smalltalk.method({
  213. selector: "openAsTab",
  214. fn: function (){
  215. var self=this;
  216. return smalltalk.withContext(function($ctx1) { _st(_st((smalltalk.HLManager || HLManager))._current())._addTab_(_st((smalltalk.HLTab || HLTab))._on_labelled_(_st(self)._new(),_st(self)._tabLabel()));
  217. return self}, function($ctx1) {$ctx1.fill(self,"openAsTab",{}, smalltalk.HLWidget.klass)})},
  218. messageSends: ["addTab:", "on:labelled:", "new", "tabLabel", "current"]}),
  219. smalltalk.HLWidget.klass);
  220. smalltalk.addMethod(
  221. "_tabLabel",
  222. smalltalk.method({
  223. selector: "tabLabel",
  224. fn: function (){
  225. var self=this;
  226. return smalltalk.withContext(function($ctx1) { return "Tab";
  227. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{}, smalltalk.HLWidget.klass)})},
  228. messageSends: []}),
  229. smalltalk.HLWidget.klass);
  230. smalltalk.addMethod(
  231. "_tabPriority",
  232. smalltalk.method({
  233. selector: "tabPriority",
  234. fn: function (){
  235. var self=this;
  236. return smalltalk.withContext(function($ctx1) { return (500);
  237. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{}, smalltalk.HLWidget.klass)})},
  238. messageSends: []}),
  239. smalltalk.HLWidget.klass);
  240. smalltalk.addClass('HLDebugger', smalltalk.HLWidget, [], 'Helios-Core');
  241. smalltalk.addClass('HLFocusableWidget', smalltalk.HLWidget, ['hiddenInput'], 'Helios-Core');
  242. smalltalk.addMethod(
  243. "_blur",
  244. smalltalk.method({
  245. selector: "blur",
  246. fn: function (){
  247. var self=this;
  248. return smalltalk.withContext(function($ctx1) { _st(_st(self["@hiddenInput"])._asJQuery())._blur();
  249. return self}, function($ctx1) {$ctx1.fill(self,"blur",{}, smalltalk.HLFocusableWidget)})},
  250. messageSends: ["blur", "asJQuery"]}),
  251. smalltalk.HLFocusableWidget);
  252. smalltalk.addMethod(
  253. "_focus",
  254. smalltalk.method({
  255. selector: "focus",
  256. fn: function (){
  257. var self=this;
  258. return smalltalk.withContext(function($ctx1) { _st(_st(self["@hiddenInput"])._asJQuery())._focus();
  259. return self}, function($ctx1) {$ctx1.fill(self,"focus",{}, smalltalk.HLFocusableWidget)})},
  260. messageSends: ["focus", "asJQuery"]}),
  261. smalltalk.HLFocusableWidget);
  262. smalltalk.addMethod(
  263. "_focusClass",
  264. smalltalk.method({
  265. selector: "focusClass",
  266. fn: function (){
  267. var self=this;
  268. return smalltalk.withContext(function($ctx1) { return "focused";
  269. }, function($ctx1) {$ctx1.fill(self,"focusClass",{}, smalltalk.HLFocusableWidget)})},
  270. messageSends: []}),
  271. smalltalk.HLFocusableWidget);
  272. smalltalk.addMethod(
  273. "_hasFocus",
  274. smalltalk.method({
  275. selector: "hasFocus",
  276. fn: function (){
  277. var self=this;
  278. return smalltalk.withContext(function($ctx1) { var $1;
  279. $1=_st(_st(_st(self)._wrapper())._notNil())._and_((function(){
  280. return smalltalk.withContext(function($ctx2) { return _st(_st(_st(self)._wrapper())._asJQuery())._hasClass_(_st(self)._focusClass());
  281. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  282. return $1;
  283. }, function($ctx1) {$ctx1.fill(self,"hasFocus",{}, smalltalk.HLFocusableWidget)})},
  284. messageSends: ["and:", "hasClass:", "focusClass", "asJQuery", "wrapper", "notNil"]}),
  285. smalltalk.HLFocusableWidget);
  286. smalltalk.addMethod(
  287. "_renderContentOn_",
  288. smalltalk.method({
  289. selector: "renderContentOn:",
  290. fn: function (html){
  291. var self=this;
  292. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html}, smalltalk.HLFocusableWidget)})},
  293. messageSends: []}),
  294. smalltalk.HLFocusableWidget);
  295. smalltalk.addMethod(
  296. "_renderHiddenInputOn_",
  297. smalltalk.method({
  298. selector: "renderHiddenInputOn:",
  299. fn: function (html){
  300. var self=this;
  301. return smalltalk.withContext(function($ctx1) { var $1,$2;
  302. $1=_st(html)._input();
  303. _st($1)._style_("position: absolute; left: -100000px;");
  304. _st($1)._onBlur_((function(){
  305. return smalltalk.withContext(function($ctx2) { return _st(_st(_st(self)._wrapper())._asJQuery())._removeClass_(_st(self)._focusClass());
  306. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  307. $2=_st($1)._onFocus_((function(){
  308. return smalltalk.withContext(function($ctx2) { return _st(_st(_st(self)._wrapper())._asJQuery())._addClass_(_st(self)._focusClass());
  309. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  310. self["@hiddenInput"]=$2;
  311. return self}, function($ctx1) {$ctx1.fill(self,"renderHiddenInputOn:",{html:html}, smalltalk.HLFocusableWidget)})},
  312. messageSends: ["style:", "input", "onBlur:", "removeClass:", "focusClass", "asJQuery", "wrapper", "onFocus:", "addClass:"]}),
  313. smalltalk.HLFocusableWidget);
  314. smalltalk.addMethod(
  315. "_renderOn_",
  316. smalltalk.method({
  317. selector: "renderOn:",
  318. fn: function (html){
  319. var self=this;
  320. return smalltalk.withContext(function($ctx1) { var $1,$2;
  321. _st(self)._registerBindings();
  322. _st(self)._renderHiddenInputOn_(html);
  323. $1=_st(html)._div();
  324. _st($1)._class_("hl_widget");
  325. _st($1)._onClick_((function(){
  326. return smalltalk.withContext(function($ctx2) { return _st(_st(self["@hiddenInput"])._asJQuery())._focus();
  327. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  328. $2=_st($1)._with_((function(){
  329. return smalltalk.withContext(function($ctx2) { return _st(self)._renderContentOn_(html);
  330. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  331. self["@wrapper"]=$2;
  332. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html}, smalltalk.HLFocusableWidget)})},
  333. messageSends: ["registerBindings", "renderHiddenInputOn:", "class:", "div", "onClick:", "focus", "asJQuery", "with:", "renderContentOn:"]}),
  334. smalltalk.HLFocusableWidget);
  335. smalltalk.addClass('HLListWidget', smalltalk.HLFocusableWidget, ['items', 'selectedItem'], 'Helios-Core');
  336. smalltalk.addMethod(
  337. "_activateFirstListItem",
  338. smalltalk.method({
  339. selector: "activateFirstListItem",
  340. fn: function (){
  341. var self=this;
  342. return smalltalk.withContext(function($ctx1) { _st(self)._activateListItem_(_st(window)._jQuery_(_st(_st(_st(self["@wrapper"])._asJQuery())._find_("li"))._get_((0))));
  343. return self}, function($ctx1) {$ctx1.fill(self,"activateFirstListItem",{}, smalltalk.HLListWidget)})},
  344. messageSends: ["activateListItem:", "jQuery:", "get:", "find:", "asJQuery"]}),
  345. smalltalk.HLListWidget);
  346. smalltalk.addMethod(
  347. "_activateListItem_",
  348. smalltalk.method({
  349. selector: "activateListItem:",
  350. fn: function (aListItem){
  351. var self=this;
  352. var parent,position;
  353. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  354. $1=_st(aListItem)._get_((0));
  355. if(($receiver = $1) == nil || $receiver == undefined){
  356. $2=self;
  357. return $2;
  358. } else {
  359. $1;
  360. };
  361. position=_st(self)._positionOf_(aListItem);
  362. parent=_st(aListItem)._parent();
  363. _st(_st(parent)._children())._removeClass_("active");
  364. _st(aListItem)._addClass_("active");
  365. $3=_st(_st(_st(aListItem)._position())._top()).__lt((0));
  366. if(smalltalk.assert($3)){
  367. _st(_st(parent)._get_((0)))._scrollTop_(_st(_st(_st(_st(parent)._get_((0)))._scrollTop()).__plus(_st(_st(aListItem)._position())._top())).__minus((10)));
  368. };
  369. $4=_st(_st(_st(_st(aListItem)._position())._top()).__plus(_st(aListItem)._height())).__gt(_st(parent)._height());
  370. if(smalltalk.assert($4)){
  371. _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)));
  372. };
  373. _st(self)._selectItem_(_st(_st(self)._items())._at_(_st(_st(aListItem)._attr_("list-data"))._asNumber()));
  374. return self}, function($ctx1) {$ctx1.fill(self,"activateListItem:",{aListItem:aListItem,parent:parent,position:position}, smalltalk.HLListWidget)})},
  375. messageSends: ["ifNil:", "get:", "positionOf:", "parent", "removeClass:", "children", "addClass:", "ifTrue:", "scrollTop:", "-", "+", "top", "position", "scrollTop", "<", "height", ">", "selectItem:", "at:", "asNumber", "attr:", "items"]}),
  376. smalltalk.HLListWidget);
  377. smalltalk.addMethod(
  378. "_cssClassForItem_",
  379. smalltalk.method({
  380. selector: "cssClassForItem:",
  381. fn: function (anObject){
  382. var self=this;
  383. return smalltalk.withContext(function($ctx1) { var $2,$1;
  384. $2=_st(_st(self)._selectedItem()).__eq(anObject);
  385. if(smalltalk.assert($2)){
  386. $1="active";
  387. } else {
  388. $1="inactive";
  389. };
  390. return $1;
  391. }, function($ctx1) {$ctx1.fill(self,"cssClassForItem:",{anObject:anObject}, smalltalk.HLListWidget)})},
  392. messageSends: ["ifTrue:ifFalse:", "=", "selectedItem"]}),
  393. smalltalk.HLListWidget);
  394. smalltalk.addMethod(
  395. "_defaultItems",
  396. smalltalk.method({
  397. selector: "defaultItems",
  398. fn: function (){
  399. var self=this;
  400. return smalltalk.withContext(function($ctx1) { return [];
  401. }, function($ctx1) {$ctx1.fill(self,"defaultItems",{}, smalltalk.HLListWidget)})},
  402. messageSends: []}),
  403. smalltalk.HLListWidget);
  404. smalltalk.addMethod(
  405. "_focus",
  406. smalltalk.method({
  407. selector: "focus",
  408. fn: function (){
  409. var self=this;
  410. return smalltalk.withContext(function($ctx1) { var $1,$2;
  411. smalltalk.HLFocusableWidget.fn.prototype._focus.apply(_st(self), []);
  412. $1=_st(_st(self)._items())._isEmpty();
  413. if(! smalltalk.assert($1)){
  414. $2=_st(self)._selectedItem();
  415. if(($receiver = $2) == nil || $receiver == undefined){
  416. _st(self)._activateFirstListItem();
  417. } else {
  418. $2;
  419. };
  420. };
  421. return self}, function($ctx1) {$ctx1.fill(self,"focus",{}, smalltalk.HLListWidget)})},
  422. messageSends: ["focus", "ifFalse:", "ifNil:", "activateFirstListItem", "selectedItem", "isEmpty", "items"]}),
  423. smalltalk.HLListWidget);
  424. smalltalk.addMethod(
  425. "_iconForItem_",
  426. smalltalk.method({
  427. selector: "iconForItem:",
  428. fn: function (anObject){
  429. var self=this;
  430. return smalltalk.withContext(function($ctx1) { return "";
  431. }, function($ctx1) {$ctx1.fill(self,"iconForItem:",{anObject:anObject}, smalltalk.HLListWidget)})},
  432. messageSends: []}),
  433. smalltalk.HLListWidget);
  434. smalltalk.addMethod(
  435. "_items",
  436. smalltalk.method({
  437. selector: "items",
  438. fn: function (){
  439. var self=this;
  440. return smalltalk.withContext(function($ctx1) { var $2,$1;
  441. $2=self["@items"];
  442. if(($receiver = $2) == nil || $receiver == undefined){
  443. self["@items"]=_st(self)._defaultItems();
  444. $1=self["@items"];
  445. } else {
  446. $1=$2;
  447. };
  448. return $1;
  449. }, function($ctx1) {$ctx1.fill(self,"items",{}, smalltalk.HLListWidget)})},
  450. messageSends: ["ifNil:", "defaultItems"]}),
  451. smalltalk.HLListWidget);
  452. smalltalk.addMethod(
  453. "_items_",
  454. smalltalk.method({
  455. selector: "items:",
  456. fn: function (aCollection){
  457. var self=this;
  458. return smalltalk.withContext(function($ctx1) { self["@items"]=aCollection;
  459. return self}, function($ctx1) {$ctx1.fill(self,"items:",{aCollection:aCollection}, smalltalk.HLListWidget)})},
  460. messageSends: []}),
  461. smalltalk.HLListWidget);
  462. smalltalk.addMethod(
  463. "_positionOf_",
  464. smalltalk.method({
  465. selector: "positionOf:",
  466. fn: function (aListItem){
  467. var self=this;
  468. return smalltalk.withContext(function($ctx1) {
  469. return aListItem.parent().children().get().indexOf(aListItem.get(0)) + 1
  470. ;
  471. return self}, function($ctx1) {$ctx1.fill(self,"positionOf:",{aListItem:aListItem}, smalltalk.HLListWidget)})},
  472. messageSends: []}),
  473. smalltalk.HLListWidget);
  474. smalltalk.addMethod(
  475. "_renderButtonsOn_",
  476. smalltalk.method({
  477. selector: "renderButtonsOn:",
  478. fn: function (html){
  479. var self=this;
  480. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html}, smalltalk.HLListWidget)})},
  481. messageSends: []}),
  482. smalltalk.HLListWidget);
  483. smalltalk.addMethod(
  484. "_renderContentOn_",
  485. smalltalk.method({
  486. selector: "renderContentOn:",
  487. fn: function (html){
  488. var self=this;
  489. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  490. $1=_st(html)._ul();
  491. _st($1)._class_("nav nav-pills nav-stacked");
  492. $2=_st($1)._with_((function(){
  493. return smalltalk.withContext(function($ctx2) { return _st(self)._renderListOn_(html);
  494. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  495. $3=_st(html)._div();
  496. _st($3)._class_("pane_actions form-actions");
  497. $4=_st($3)._with_((function(){
  498. return smalltalk.withContext(function($ctx2) { return _st(self)._renderButtonsOn_(html);
  499. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  500. _st(self)._setupKeyBindings();
  501. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html}, smalltalk.HLListWidget)})},
  502. messageSends: ["class:", "ul", "with:", "renderListOn:", "div", "renderButtonsOn:", "setupKeyBindings"]}),
  503. smalltalk.HLListWidget);
  504. smalltalk.addMethod(
  505. "_renderItem_on_",
  506. smalltalk.method({
  507. selector: "renderItem:on:",
  508. fn: function (anObject,html){
  509. var self=this;
  510. var li;
  511. return smalltalk.withContext(function($ctx1) { var $1,$3,$4,$2;
  512. li=_st(html)._li();
  513. $1=li;
  514. _st($1)._class_(_st(self)._cssClassForItem_(anObject));
  515. _st($1)._at_put_("list-data",_st(_st(_st(self)._items())._indexOf_(anObject))._asString());
  516. $2=_st($1)._with_((function(){
  517. return smalltalk.withContext(function($ctx2) { $3=_st(html)._a();
  518. _st($3)._with_((function(){
  519. return smalltalk.withContext(function($ctx3) { _st(_st(html)._tag_("i"))._class_(_st(self)._iconForItem_(anObject));
  520. return _st(self)._renderItemLabel_on_(anObject,html);
  521. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  522. $4=_st($3)._onClick_((function(){
  523. return smalltalk.withContext(function($ctx3) { return _st(self)._activateListItem_(_st(li)._asJQuery());
  524. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  525. return $4;
  526. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  527. return self}, function($ctx1) {$ctx1.fill(self,"renderItem:on:",{anObject:anObject,html:html,li:li}, smalltalk.HLListWidget)})},
  528. messageSends: ["li", "class:", "cssClassForItem:", "at:put:", "asString", "indexOf:", "items", "with:", "iconForItem:", "tag:", "renderItemLabel:on:", "a", "onClick:", "activateListItem:", "asJQuery"]}),
  529. smalltalk.HLListWidget);
  530. smalltalk.addMethod(
  531. "_renderItemLabel_on_",
  532. smalltalk.method({
  533. selector: "renderItemLabel:on:",
  534. fn: function (anObject,html){
  535. var self=this;
  536. return smalltalk.withContext(function($ctx1) { _st(html)._with_(_st(anObject)._asString());
  537. return self}, function($ctx1) {$ctx1.fill(self,"renderItemLabel:on:",{anObject:anObject,html:html}, smalltalk.HLListWidget)})},
  538. messageSends: ["with:", "asString"]}),
  539. smalltalk.HLListWidget);
  540. smalltalk.addMethod(
  541. "_renderListOn_",
  542. smalltalk.method({
  543. selector: "renderListOn:",
  544. fn: function (html){
  545. var self=this;
  546. return smalltalk.withContext(function($ctx1) { _st(_st(self)._items())._do_((function(each){
  547. return smalltalk.withContext(function($ctx2) { return _st(self)._renderItem_on_(each,html);
  548. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  549. return self}, function($ctx1) {$ctx1.fill(self,"renderListOn:",{html:html}, smalltalk.HLListWidget)})},
  550. messageSends: ["do:", "renderItem:on:", "items"]}),
  551. smalltalk.HLListWidget);
  552. smalltalk.addMethod(
  553. "_selectItem_",
  554. smalltalk.method({
  555. selector: "selectItem:",
  556. fn: function (anObject){
  557. var self=this;
  558. return smalltalk.withContext(function($ctx1) { _st(self)._selectedItem_(anObject);
  559. return self}, function($ctx1) {$ctx1.fill(self,"selectItem:",{anObject:anObject}, smalltalk.HLListWidget)})},
  560. messageSends: ["selectedItem:"]}),
  561. smalltalk.HLListWidget);
  562. smalltalk.addMethod(
  563. "_selectedItem",
  564. smalltalk.method({
  565. selector: "selectedItem",
  566. fn: function (){
  567. var self=this;
  568. return smalltalk.withContext(function($ctx1) { var $1;
  569. $1=self["@selectedItem"];
  570. return $1;
  571. }, function($ctx1) {$ctx1.fill(self,"selectedItem",{}, smalltalk.HLListWidget)})},
  572. messageSends: []}),
  573. smalltalk.HLListWidget);
  574. smalltalk.addMethod(
  575. "_selectedItem_",
  576. smalltalk.method({
  577. selector: "selectedItem:",
  578. fn: function (anObject){
  579. var self=this;
  580. return smalltalk.withContext(function($ctx1) { self["@selectedItem"]=anObject;
  581. return self}, function($ctx1) {$ctx1.fill(self,"selectedItem:",{anObject:anObject}, smalltalk.HLListWidget)})},
  582. messageSends: []}),
  583. smalltalk.HLListWidget);
  584. smalltalk.addMethod(
  585. "_setupKeyBindings",
  586. smalltalk.method({
  587. selector: "setupKeyBindings",
  588. fn: function (){
  589. var self=this;
  590. var next;
  591. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  592. _st(_st(self["@hiddenInput"])._asJQuery())._unbind_("keydown");
  593. _st(_st(self["@hiddenInput"])._asJQuery())._keydown_((function(e){
  594. var selected;
  595. return smalltalk.withContext(function($ctx2) { selected=_st(window)._jQuery_(".focused .nav-pills .active");
  596. selected;
  597. $1=_st(_st(e)._which()).__eq((38));
  598. if(smalltalk.assert($1)){
  599. _st(self)._activateListItem_(_st(selected)._prev());
  600. };
  601. $2=_st(_st(e)._which()).__eq((40));
  602. if(smalltalk.assert($2)){
  603. next=_st(selected)._next();
  604. next;
  605. $3=_st(next)._get_((0));
  606. if(($receiver = $3) == nil || $receiver == undefined){
  607. next=_st(window)._jQuery_(".focused .nav-pills li:first-child");
  608. next;
  609. } else {
  610. $3;
  611. };
  612. return _st(self)._activateListItem_(next);
  613. };
  614. }, function($ctx2) {$ctx2.fillBlock({e:e,selected:selected},$ctx1)})}));
  615. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyBindings",{next:next}, smalltalk.HLListWidget)})},
  616. messageSends: ["unbind:", "asJQuery", "keydown:", "jQuery:", "ifTrue:", "activateListItem:", "prev", "=", "which", "next", "ifNil:", "get:"]}),
  617. smalltalk.HLListWidget);
  618. smalltalk.addClass('HLNavigationListWidget', smalltalk.HLListWidget, ['previous', 'next'], 'Helios-Core');
  619. smalltalk.addMethod(
  620. "_next",
  621. smalltalk.method({
  622. selector: "next",
  623. fn: function (){
  624. var self=this;
  625. return smalltalk.withContext(function($ctx1) { var $1;
  626. $1=self["@next"];
  627. return $1;
  628. }, function($ctx1) {$ctx1.fill(self,"next",{}, smalltalk.HLNavigationListWidget)})},
  629. messageSends: []}),
  630. smalltalk.HLNavigationListWidget);
  631. smalltalk.addMethod(
  632. "_next_",
  633. smalltalk.method({
  634. selector: "next:",
  635. fn: function (aWidget){
  636. var self=this;
  637. return smalltalk.withContext(function($ctx1) { var $1;
  638. self["@next"]=aWidget;
  639. $1=_st(_st(aWidget)._previous()).__eq(self);
  640. if(! smalltalk.assert($1)){
  641. _st(aWidget)._previous_(self);
  642. };
  643. return self}, function($ctx1) {$ctx1.fill(self,"next:",{aWidget:aWidget}, smalltalk.HLNavigationListWidget)})},
  644. messageSends: ["ifFalse:", "previous:", "=", "previous"]}),
  645. smalltalk.HLNavigationListWidget);
  646. smalltalk.addMethod(
  647. "_nextFocus",
  648. smalltalk.method({
  649. selector: "nextFocus",
  650. fn: function (){
  651. var self=this;
  652. return smalltalk.withContext(function($ctx1) { var $1;
  653. $1=_st(self)._next();
  654. if(($receiver = $1) == nil || $receiver == undefined){
  655. $1;
  656. } else {
  657. _st(_st(self)._next())._focus();
  658. };
  659. return self}, function($ctx1) {$ctx1.fill(self,"nextFocus",{}, smalltalk.HLNavigationListWidget)})},
  660. messageSends: ["ifNotNil:", "focus", "next"]}),
  661. smalltalk.HLNavigationListWidget);
  662. smalltalk.addMethod(
  663. "_previous",
  664. smalltalk.method({
  665. selector: "previous",
  666. fn: function (){
  667. var self=this;
  668. return smalltalk.withContext(function($ctx1) { var $1;
  669. $1=self["@previous"];
  670. return $1;
  671. }, function($ctx1) {$ctx1.fill(self,"previous",{}, smalltalk.HLNavigationListWidget)})},
  672. messageSends: []}),
  673. smalltalk.HLNavigationListWidget);
  674. smalltalk.addMethod(
  675. "_previous_",
  676. smalltalk.method({
  677. selector: "previous:",
  678. fn: function (aWidget){
  679. var self=this;
  680. return smalltalk.withContext(function($ctx1) { var $1;
  681. self["@previous"]=aWidget;
  682. $1=_st(_st(aWidget)._next()).__eq(self);
  683. if(! smalltalk.assert($1)){
  684. _st(aWidget)._next_(self);
  685. };
  686. return self}, function($ctx1) {$ctx1.fill(self,"previous:",{aWidget:aWidget}, smalltalk.HLNavigationListWidget)})},
  687. messageSends: ["ifFalse:", "next:", "=", "next"]}),
  688. smalltalk.HLNavigationListWidget);
  689. smalltalk.addMethod(
  690. "_previousFocus",
  691. smalltalk.method({
  692. selector: "previousFocus",
  693. fn: function (){
  694. var self=this;
  695. return smalltalk.withContext(function($ctx1) { var $1;
  696. $1=_st(self)._previous();
  697. if(($receiver = $1) == nil || $receiver == undefined){
  698. $1;
  699. } else {
  700. _st(_st(self)._previous())._focus();
  701. };
  702. return self}, function($ctx1) {$ctx1.fill(self,"previousFocus",{}, smalltalk.HLNavigationListWidget)})},
  703. messageSends: ["ifNotNil:", "focus", "previous"]}),
  704. smalltalk.HLNavigationListWidget);
  705. smalltalk.addMethod(
  706. "_setupKeyBindings",
  707. smalltalk.method({
  708. selector: "setupKeyBindings",
  709. fn: function (){
  710. var self=this;
  711. return smalltalk.withContext(function($ctx1) { var $1,$2;
  712. smalltalk.HLListWidget.fn.prototype._setupKeyBindings.apply(_st(self), []);
  713. _st(_st(self["@hiddenInput"])._asJQuery())._keydown_((function(e){
  714. return smalltalk.withContext(function($ctx2) { $1=_st(_st(e)._which()).__eq((39));
  715. if(smalltalk.assert($1)){
  716. _st(self)._nextFocus();
  717. };
  718. $2=_st(_st(e)._which()).__eq((37));
  719. if(smalltalk.assert($2)){
  720. return _st(self)._previousFocus();
  721. };
  722. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1)})}));
  723. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyBindings",{}, smalltalk.HLNavigationListWidget)})},
  724. messageSends: ["setupKeyBindings", "keydown:", "ifTrue:", "nextFocus", "=", "which", "previousFocus", "asJQuery"]}),
  725. smalltalk.HLNavigationListWidget);
  726. smalltalk.addClass('HLManager', smalltalk.HLWidget, ['tabs', 'activeTab', 'keyBinder', 'environment'], 'Helios-Core');
  727. smalltalk.addMethod(
  728. "_activate_",
  729. smalltalk.method({
  730. selector: "activate:",
  731. fn: function (aTab){
  732. var self=this;
  733. return smalltalk.withContext(function($ctx1) { var $1,$2;
  734. _st(_st(self)._keyBinder())._flushBindings();
  735. self["@activeTab"]=aTab;
  736. $1=self;
  737. _st($1)._refresh();
  738. $2=_st($1)._show_(aTab);
  739. return self}, function($ctx1) {$ctx1.fill(self,"activate:",{aTab:aTab}, smalltalk.HLManager)})},
  740. messageSends: ["flushBindings", "keyBinder", "refresh", "show:"]}),
  741. smalltalk.HLManager);
  742. smalltalk.addMethod(
  743. "_activeTab",
  744. smalltalk.method({
  745. selector: "activeTab",
  746. fn: function (){
  747. var self=this;
  748. return smalltalk.withContext(function($ctx1) { var $1;
  749. $1=self["@activeTab"];
  750. return $1;
  751. }, function($ctx1) {$ctx1.fill(self,"activeTab",{}, smalltalk.HLManager)})},
  752. messageSends: []}),
  753. smalltalk.HLManager);
  754. smalltalk.addMethod(
  755. "_addTab_",
  756. smalltalk.method({
  757. selector: "addTab:",
  758. fn: function (aTab){
  759. var self=this;
  760. return smalltalk.withContext(function($ctx1) { _st(_st(self)._tabs())._add_(aTab);
  761. _st(self)._activate_(aTab);
  762. return self}, function($ctx1) {$ctx1.fill(self,"addTab:",{aTab:aTab}, smalltalk.HLManager)})},
  763. messageSends: ["add:", "tabs", "activate:"]}),
  764. smalltalk.HLManager);
  765. smalltalk.addMethod(
  766. "_defaultEnvironment",
  767. smalltalk.method({
  768. selector: "defaultEnvironment",
  769. fn: function (){
  770. var self=this;
  771. return smalltalk.withContext(function($ctx1) { var $1;
  772. $1=_st((smalltalk.HLLocalEnvironment || HLLocalEnvironment))._new();
  773. return $1;
  774. }, function($ctx1) {$ctx1.fill(self,"defaultEnvironment",{}, smalltalk.HLManager)})},
  775. messageSends: ["new"]}),
  776. smalltalk.HLManager);
  777. smalltalk.addMethod(
  778. "_environment",
  779. smalltalk.method({
  780. selector: "environment",
  781. fn: function (){
  782. var self=this;
  783. return smalltalk.withContext(function($ctx1) { var $2,$1;
  784. $2=self["@environment"];
  785. if(($receiver = $2) == nil || $receiver == undefined){
  786. self["@environment"]=_st(self)._defaultEnvironment();
  787. $1=self["@environment"];
  788. } else {
  789. $1=$2;
  790. };
  791. return $1;
  792. }, function($ctx1) {$ctx1.fill(self,"environment",{}, smalltalk.HLManager)})},
  793. messageSends: ["ifNil:", "defaultEnvironment"]}),
  794. smalltalk.HLManager);
  795. smalltalk.addMethod(
  796. "_environment_",
  797. smalltalk.method({
  798. selector: "environment:",
  799. fn: function (anEnvironment){
  800. var self=this;
  801. return smalltalk.withContext(function($ctx1) { self["@environment"]=anEnvironment;
  802. return self}, function($ctx1) {$ctx1.fill(self,"environment:",{anEnvironment:anEnvironment}, smalltalk.HLManager)})},
  803. messageSends: []}),
  804. smalltalk.HLManager);
  805. smalltalk.addMethod(
  806. "_initialize",
  807. smalltalk.method({
  808. selector: "initialize",
  809. fn: function (){
  810. var self=this;
  811. return smalltalk.withContext(function($ctx1) { smalltalk.HLWidget.fn.prototype._initialize.apply(_st(self), []);
  812. _st(_st(self)._keyBinder())._setupEvents();
  813. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.HLManager)})},
  814. messageSends: ["initialize", "setupEvents", "keyBinder"]}),
  815. smalltalk.HLManager);
  816. smalltalk.addMethod(
  817. "_keyBinder",
  818. smalltalk.method({
  819. selector: "keyBinder",
  820. fn: function (){
  821. var self=this;
  822. return smalltalk.withContext(function($ctx1) { var $2,$1;
  823. $2=self["@keyBinder"];
  824. if(($receiver = $2) == nil || $receiver == undefined){
  825. self["@keyBinder"]=_st((smalltalk.HLKeyBinder || HLKeyBinder))._new();
  826. $1=self["@keyBinder"];
  827. } else {
  828. $1=$2;
  829. };
  830. return $1;
  831. }, function($ctx1) {$ctx1.fill(self,"keyBinder",{}, smalltalk.HLManager)})},
  832. messageSends: ["ifNil:", "new"]}),
  833. smalltalk.HLManager);
  834. smalltalk.addMethod(
  835. "_refresh",
  836. smalltalk.method({
  837. selector: "refresh",
  838. fn: function (){
  839. var self=this;
  840. return smalltalk.withContext(function($ctx1) { _st(_st(window)._jQuery_(".navbar"))._remove();
  841. _st(_st(window)._jQuery_("#container"))._remove();
  842. _st(self)._appendToJQuery_(_st("body")._asJQuery());
  843. return self}, function($ctx1) {$ctx1.fill(self,"refresh",{}, smalltalk.HLManager)})},
  844. messageSends: ["remove", "jQuery:", "appendToJQuery:", "asJQuery"]}),
  845. smalltalk.HLManager);
  846. smalltalk.addMethod(
  847. "_removeTab_",
  848. smalltalk.method({
  849. selector: "removeTab:",
  850. fn: function (aTab){
  851. var self=this;
  852. return smalltalk.withContext(function($ctx1) { var $1,$2;
  853. $1=_st(_st(self)._tabs())._includes_(aTab);
  854. if(! smalltalk.assert($1)){
  855. $2=self;
  856. return $2;
  857. };
  858. _st(_st(self)._tabs())._remove_(aTab);
  859. _st(self)._refresh();
  860. return self}, function($ctx1) {$ctx1.fill(self,"removeTab:",{aTab:aTab}, smalltalk.HLManager)})},
  861. messageSends: ["ifFalse:", "includes:", "tabs", "remove:", "refresh"]}),
  862. smalltalk.HLManager);
  863. smalltalk.addMethod(
  864. "_renderAddOn_",
  865. smalltalk.method({
  866. selector: "renderAddOn:",
  867. fn: function (html){
  868. var self=this;
  869. return smalltalk.withContext(function($ctx1) { var $1,$3,$4,$5,$7,$8,$6,$2;
  870. $1=_st(html)._li();
  871. _st($1)._class_("dropdown");
  872. $2=_st($1)._with_((function(){
  873. return smalltalk.withContext(function($ctx2) { $3=_st(html)._a();
  874. _st($3)._class_("dropdown-toggle");
  875. _st($3)._at_put_("data-toggle","dropdown");
  876. $4=_st($3)._with_((function(){
  877. return smalltalk.withContext(function($ctx3) { _st(html)._with_("Open...");
  878. return _st(_st(html)._tag_("b"))._class_("caret");
  879. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  880. $4;
  881. $5=_st(html)._ul();
  882. _st($5)._class_("dropdown-menu");
  883. $6=_st($5)._with_((function(){
  884. return smalltalk.withContext(function($ctx3) { return _st(_st(_st(_st((smalltalk.HLWidget || HLWidget))._withAllSubclasses())._select_((function(each){
  885. return smalltalk.withContext(function($ctx4) { return _st(each)._canBeOpenAsTab();
  886. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx1)})})))._sorted_((function(a,b){
  887. return smalltalk.withContext(function($ctx4) { return _st(_st(a)._tabPriority()).__lt(_st(b)._tabPriority());
  888. }, function($ctx4) {$ctx4.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(each){
  889. return smalltalk.withContext(function($ctx4) { return _st(_st(html)._li())._with_((function(){
  890. return smalltalk.withContext(function($ctx5) { $7=_st(html)._a();
  891. _st($7)._with_(_st(each)._tabLabel());
  892. $8=_st($7)._onClick_((function(){
  893. return smalltalk.withContext(function($ctx6) { return _st(each)._openAsTab();
  894. }, function($ctx6) {$ctx6.fillBlock({},$ctx1)})}));
  895. return $8;
  896. }, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
  897. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx1)})}));
  898. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  899. return $6;
  900. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  901. return self}, function($ctx1) {$ctx1.fill(self,"renderAddOn:",{html:html}, smalltalk.HLManager)})},
  902. messageSends: ["class:", "li", "with:", "a", "at:put:", "tag:", "ul", "do:", "tabLabel", "onClick:", "openAsTab", "sorted:", "<", "tabPriority", "select:", "canBeOpenAsTab", "withAllSubclasses"]}),
  903. smalltalk.HLManager);
  904. smalltalk.addMethod(
  905. "_renderContentOn_",
  906. smalltalk.method({
  907. selector: "renderContentOn:",
  908. fn: function (html){
  909. var self=this;
  910. return smalltalk.withContext(function($ctx1) { var $1,$3,$4,$2;
  911. $1=_st(html)._div();
  912. _st($1)._class_("navbar navbar-fixed-top");
  913. $2=_st($1)._with_((function(){
  914. return smalltalk.withContext(function($ctx2) { $3=_st(html)._div();
  915. _st($3)._class_("navbar-inner");
  916. $4=_st($3)._with_((function(){
  917. return smalltalk.withContext(function($ctx3) { return _st(self)._renderTabsOn_(html);
  918. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  919. return $4;
  920. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  921. _st(_st(html)._div())._id_("container");
  922. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html}, smalltalk.HLManager)})},
  923. messageSends: ["class:", "div", "with:", "renderTabsOn:", "id:"]}),
  924. smalltalk.HLManager);
  925. smalltalk.addMethod(
  926. "_renderTabsOn_",
  927. smalltalk.method({
  928. selector: "renderTabsOn:",
  929. fn: function (html){
  930. var self=this;
  931. return smalltalk.withContext(function($ctx1) { var $1,$3,$4,$6,$5,$8,$9,$7,$2;
  932. $1=_st(html)._ul();
  933. _st($1)._class_("nav");
  934. $2=_st($1)._with_((function(){
  935. return smalltalk.withContext(function($ctx2) { _st(_st(self)._tabs())._do_((function(each){
  936. return smalltalk.withContext(function($ctx3) { $3=_st(html)._li();
  937. $4=$3;
  938. $6=_st(each)._isActive();
  939. if(smalltalk.assert($6)){
  940. $5="active";
  941. } else {
  942. $5="inactive";
  943. };
  944. _st($4)._class_($5);
  945. $7=_st($3)._with_((function(){
  946. return smalltalk.withContext(function($ctx4) { $8=_st(html)._a();
  947. _st($8)._with_((function(){
  948. return smalltalk.withContext(function($ctx5) { _st(_st(_st(html)._tag_("i"))._class_("icon-remove-circle"))._onClick_((function(){
  949. return smalltalk.withContext(function($ctx6) { return _st(self)._removeTab_(each);
  950. }, function($ctx6) {$ctx6.fillBlock({},$ctx1)})}));
  951. return _st(html)._with_(_st(each)._label());
  952. }, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
  953. $9=_st($8)._onClick_((function(){
  954. return smalltalk.withContext(function($ctx5) { return _st(each)._activate();
  955. }, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
  956. return $9;
  957. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
  958. return $7;
  959. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  960. return _st(self)._renderAddOn_(html);
  961. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  962. return self}, function($ctx1) {$ctx1.fill(self,"renderTabsOn:",{html:html}, smalltalk.HLManager)})},
  963. messageSends: ["class:", "ul", "with:", "do:", "ifTrue:ifFalse:", "isActive", "li", "onClick:", "removeTab:", "tag:", "label", "a", "activate", "tabs", "renderAddOn:"]}),
  964. smalltalk.HLManager);
  965. smalltalk.addMethod(
  966. "_show_",
  967. smalltalk.method({
  968. selector: "show:",
  969. fn: function (aTab){
  970. var self=this;
  971. return smalltalk.withContext(function($ctx1) { _st(_st(window)._jQuery_("#container"))._empty();
  972. _st(_st(aTab)._widget())._appendToJQuery_(_st("#container")._asJQuery());
  973. return self}, function($ctx1) {$ctx1.fill(self,"show:",{aTab:aTab}, smalltalk.HLManager)})},
  974. messageSends: ["empty", "jQuery:", "appendToJQuery:", "asJQuery", "widget"]}),
  975. smalltalk.HLManager);
  976. smalltalk.addMethod(
  977. "_tabs",
  978. smalltalk.method({
  979. selector: "tabs",
  980. fn: function (){
  981. var self=this;
  982. return smalltalk.withContext(function($ctx1) { var $2,$1;
  983. $2=self["@tabs"];
  984. if(($receiver = $2) == nil || $receiver == undefined){
  985. self["@tabs"]=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
  986. $1=self["@tabs"];
  987. } else {
  988. $1=$2;
  989. };
  990. return $1;
  991. }, function($ctx1) {$ctx1.fill(self,"tabs",{}, smalltalk.HLManager)})},
  992. messageSends: ["ifNil:", "new"]}),
  993. smalltalk.HLManager);
  994. smalltalk.HLManager.klass.iVarNames = ['current'];
  995. smalltalk.addMethod(
  996. "_current",
  997. smalltalk.method({
  998. selector: "current",
  999. fn: function (){
  1000. var self=this;
  1001. return smalltalk.withContext(function($ctx1) { var $2,$1;
  1002. $2=self["@current"];
  1003. if(($receiver = $2) == nil || $receiver == undefined){
  1004. self["@current"]=_st(_st(self)._basicNew())._initialize();
  1005. $1=self["@current"];
  1006. } else {
  1007. $1=$2;
  1008. };
  1009. return $1;
  1010. }, function($ctx1) {$ctx1.fill(self,"current",{}, smalltalk.HLManager.klass)})},
  1011. messageSends: ["ifNil:", "initialize", "basicNew"]}),
  1012. smalltalk.HLManager.klass);
  1013. smalltalk.addMethod(
  1014. "_initialize",
  1015. smalltalk.method({
  1016. selector: "initialize",
  1017. fn: function (){
  1018. var self=this;
  1019. return smalltalk.withContext(function($ctx1) { _st(_st(self)._current())._appendToJQuery_(_st("body")._asJQuery());
  1020. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.HLManager.klass)})},
  1021. messageSends: ["appendToJQuery:", "asJQuery", "current"]}),
  1022. smalltalk.HLManager.klass);
  1023. smalltalk.addMethod(
  1024. "_new",
  1025. smalltalk.method({
  1026. selector: "new",
  1027. fn: function (){
  1028. var self=this;
  1029. return smalltalk.withContext(function($ctx1) { _st(self)._shouldNotImplement();
  1030. return self}, function($ctx1) {$ctx1.fill(self,"new",{}, smalltalk.HLManager.klass)})},
  1031. messageSends: ["shouldNotImplement"]}),
  1032. smalltalk.HLManager.klass);
  1033. smalltalk.addClass('HLSUnit', smalltalk.HLWidget, [], 'Helios-Core');
  1034. smalltalk.addMethod(
  1035. "_canBeOpenAsTab",
  1036. smalltalk.method({
  1037. selector: "canBeOpenAsTab",
  1038. fn: function (){
  1039. var self=this;
  1040. return smalltalk.withContext(function($ctx1) { return true;
  1041. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{}, smalltalk.HLSUnit.klass)})},
  1042. messageSends: []}),
  1043. smalltalk.HLSUnit.klass);
  1044. smalltalk.addMethod(
  1045. "_tabLabel",
  1046. smalltalk.method({
  1047. selector: "tabLabel",
  1048. fn: function (){
  1049. var self=this;
  1050. return smalltalk.withContext(function($ctx1) { return "SUnit";
  1051. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{}, smalltalk.HLSUnit.klass)})},
  1052. messageSends: []}),
  1053. smalltalk.HLSUnit.klass);
  1054. smalltalk.addMethod(
  1055. "_tabPriority",
  1056. smalltalk.method({
  1057. selector: "tabPriority",
  1058. fn: function (){
  1059. var self=this;
  1060. return smalltalk.withContext(function($ctx1) { return (1000);
  1061. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{}, smalltalk.HLSUnit.klass)})},
  1062. messageSends: []}),
  1063. smalltalk.HLSUnit.klass);
  1064. smalltalk.addClass('HLTranscript', smalltalk.HLWidget, [], 'Helios-Core');
  1065. smalltalk.addMethod(
  1066. "_canBeOpenAsTab",
  1067. smalltalk.method({
  1068. selector: "canBeOpenAsTab",
  1069. fn: function (){
  1070. var self=this;
  1071. return smalltalk.withContext(function($ctx1) { return true;
  1072. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{}, smalltalk.HLTranscript.klass)})},
  1073. messageSends: []}),
  1074. smalltalk.HLTranscript.klass);
  1075. smalltalk.addMethod(
  1076. "_tabLabel",
  1077. smalltalk.method({
  1078. selector: "tabLabel",
  1079. fn: function (){
  1080. var self=this;
  1081. return smalltalk.withContext(function($ctx1) { return "Transcript";
  1082. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{}, smalltalk.HLTranscript.klass)})},
  1083. messageSends: []}),
  1084. smalltalk.HLTranscript.klass);
  1085. smalltalk.addMethod(
  1086. "_tabPriority",
  1087. smalltalk.method({
  1088. selector: "tabPriority",
  1089. fn: function (){
  1090. var self=this;
  1091. return smalltalk.withContext(function($ctx1) { return (600);
  1092. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{}, smalltalk.HLTranscript.klass)})},
  1093. messageSends: []}),
  1094. smalltalk.HLTranscript.klass);