1
0

Helios-Core.deploy.js 53 KB

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