Helios-Core.js 71 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058
  1. smalltalk.addPackage('Helios-Core');
  2. smalltalk.addClass('HLTab', smalltalk.Widget, ['widget', 'label', 'root'], 'Helios-Core');
  3. smalltalk.addMethod(
  4. "_activate",
  5. smalltalk.method({
  6. selector: "activate",
  7. category: 'accessing',
  8. fn: function () {
  9. var self=this;
  10. return smalltalk.withContext(function($ctx1) { _st(_st(self)._manager())._activate_(self);
  11. return self}, function($ctx1) {$ctx1.fill(self,"activate",{},smalltalk.HLTab)});},
  12. args: [],
  13. source: "activate\x0a\x09self manager activate: self",
  14. messageSends: ["activate:", "manager"],
  15. referencedClasses: []
  16. }),
  17. smalltalk.HLTab);
  18. smalltalk.addMethod(
  19. "_add",
  20. smalltalk.method({
  21. selector: "add",
  22. category: 'accessing',
  23. fn: function () {
  24. var self=this;
  25. return smalltalk.withContext(function($ctx1) { _st(_st(self)._manager())._addTab_(self);
  26. return self}, function($ctx1) {$ctx1.fill(self,"add",{},smalltalk.HLTab)});},
  27. args: [],
  28. source: "add\x0a\x09self manager addTab: self",
  29. messageSends: ["addTab:", "manager"],
  30. referencedClasses: []
  31. }),
  32. smalltalk.HLTab);
  33. smalltalk.addMethod(
  34. "_displayLabel",
  35. smalltalk.method({
  36. selector: "displayLabel",
  37. category: 'accessing',
  38. fn: function () {
  39. var self=this;
  40. return smalltalk.withContext(function($ctx1) { var $2,$1;
  41. $2=_st(_st(_st(self)._label())._size()).__gt((20));
  42. if(smalltalk.assert($2)){
  43. $1=_st(_st(_st(self)._label())._first_((20))).__comma("...");
  44. } else {
  45. $1=_st(self)._label();
  46. };
  47. return $1;
  48. }, function($ctx1) {$ctx1.fill(self,"displayLabel",{},smalltalk.HLTab)});},
  49. args: [],
  50. source: "displayLabel\x0a\x09^ self label size > 20 \x0a\x09\x09ifTrue: [ (self label first: 20), '...' ]\x0a\x09\x09ifFalse: [ self label ]",
  51. messageSends: ["ifTrue:ifFalse:", ",", "first:", "label", ">", "size"],
  52. referencedClasses: []
  53. }),
  54. smalltalk.HLTab);
  55. smalltalk.addMethod(
  56. "_focus",
  57. smalltalk.method({
  58. selector: "focus",
  59. category: 'accessing',
  60. fn: function () {
  61. var self=this;
  62. return smalltalk.withContext(function($ctx1) { var $1;
  63. $1=_st(_st(self)._widget())._canHaveFocus();
  64. if(smalltalk.assert($1)){
  65. _st(_st(self)._widget())._focus();
  66. };
  67. return self}, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLTab)});},
  68. args: [],
  69. source: "focus\x0a\x09self widget canHaveFocus ifTrue: [\x0a\x09\x09self widget focus ]",
  70. messageSends: ["ifTrue:", "focus", "widget", "canHaveFocus"],
  71. referencedClasses: []
  72. }),
  73. smalltalk.HLTab);
  74. smalltalk.addMethod(
  75. "_hide",
  76. smalltalk.method({
  77. selector: "hide",
  78. category: 'actions',
  79. fn: function () {
  80. var self=this;
  81. return smalltalk.withContext(function($ctx1) { var $1;
  82. $1=self["@root"];
  83. if(($receiver = $1) == nil || $receiver == undefined){
  84. $1;
  85. } else {
  86. _st(_st(self["@root"])._asJQuery())._hide();
  87. };
  88. return self}, function($ctx1) {$ctx1.fill(self,"hide",{},smalltalk.HLTab)});},
  89. args: [],
  90. source: "hide\x0a\x09root ifNotNil: [\x0a\x09\x09root asJQuery hide ]",
  91. messageSends: ["ifNotNil:", "hide", "asJQuery"],
  92. referencedClasses: []
  93. }),
  94. smalltalk.HLTab);
  95. smalltalk.addMethod(
  96. "_isActive",
  97. smalltalk.method({
  98. selector: "isActive",
  99. category: 'testing',
  100. fn: function () {
  101. var self=this;
  102. return smalltalk.withContext(function($ctx1) { var $1;
  103. $1=_st(_st(_st(self)._manager())._activeTab()).__eq(self);
  104. return $1;
  105. }, function($ctx1) {$ctx1.fill(self,"isActive",{},smalltalk.HLTab)});},
  106. args: [],
  107. source: "isActive\x0a\x09^ self manager activeTab = self",
  108. messageSends: ["=", "activeTab", "manager"],
  109. referencedClasses: []
  110. }),
  111. smalltalk.HLTab);
  112. smalltalk.addMethod(
  113. "_label",
  114. smalltalk.method({
  115. selector: "label",
  116. category: 'accessing',
  117. fn: function () {
  118. var self=this;
  119. return smalltalk.withContext(function($ctx1) { var $2,$1;
  120. $2=self["@label"];
  121. if(($receiver = $2) == nil || $receiver == undefined){
  122. $1="";
  123. } else {
  124. $1=$2;
  125. };
  126. return $1;
  127. }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLTab)});},
  128. args: [],
  129. source: "label\x0a\x09^ label ifNil: [ '' ]",
  130. messageSends: ["ifNil:"],
  131. referencedClasses: []
  132. }),
  133. smalltalk.HLTab);
  134. smalltalk.addMethod(
  135. "_label_",
  136. smalltalk.method({
  137. selector: "label:",
  138. category: 'accessing',
  139. fn: function (aString) {
  140. var self=this;
  141. return smalltalk.withContext(function($ctx1) { self["@label"]=aString;
  142. return self}, function($ctx1) {$ctx1.fill(self,"label:",{aString:aString},smalltalk.HLTab)});},
  143. args: ["aString"],
  144. source: "label: aString\x0a\x09label := aString",
  145. messageSends: [],
  146. referencedClasses: []
  147. }),
  148. smalltalk.HLTab);
  149. smalltalk.addMethod(
  150. "_manager",
  151. smalltalk.method({
  152. selector: "manager",
  153. category: 'accessing',
  154. fn: function () {
  155. var self=this;
  156. return smalltalk.withContext(function($ctx1) { var $1;
  157. $1=_st((smalltalk.HLManager || HLManager))._current();
  158. return $1;
  159. }, function($ctx1) {$ctx1.fill(self,"manager",{},smalltalk.HLTab)});},
  160. args: [],
  161. source: "manager\x0a\x09^ HLManager current",
  162. messageSends: ["current"],
  163. referencedClasses: ["HLManager"]
  164. }),
  165. smalltalk.HLTab);
  166. smalltalk.addMethod(
  167. "_registerBindings",
  168. smalltalk.method({
  169. selector: "registerBindings",
  170. category: 'actions',
  171. fn: function () {
  172. var self=this;
  173. return smalltalk.withContext(function($ctx1) { _st(_st(self)._widget())._registerBindings();
  174. return self}, function($ctx1) {$ctx1.fill(self,"registerBindings",{},smalltalk.HLTab)});},
  175. args: [],
  176. source: "registerBindings\x0a\x09self widget registerBindings",
  177. messageSends: ["registerBindings", "widget"],
  178. referencedClasses: []
  179. }),
  180. smalltalk.HLTab);
  181. smalltalk.addMethod(
  182. "_remove",
  183. smalltalk.method({
  184. selector: "remove",
  185. category: 'actions',
  186. fn: function () {
  187. var self=this;
  188. return smalltalk.withContext(function($ctx1) { var $1;
  189. $1=self["@root"];
  190. if(($receiver = $1) == nil || $receiver == undefined){
  191. $1;
  192. } else {
  193. _st(_st(self["@root"])._asJQuery())._remove();
  194. };
  195. return self}, function($ctx1) {$ctx1.fill(self,"remove",{},smalltalk.HLTab)});},
  196. args: [],
  197. source: "remove\x0a\x09root ifNotNil: [ root asJQuery remove ]",
  198. messageSends: ["ifNotNil:", "remove", "asJQuery"],
  199. referencedClasses: []
  200. }),
  201. smalltalk.HLTab);
  202. smalltalk.addMethod(
  203. "_renderOn_",
  204. smalltalk.method({
  205. selector: "renderOn:",
  206. category: 'rendering',
  207. fn: function (html) {
  208. var self=this;
  209. return smalltalk.withContext(function($ctx1) { var $1,$2;
  210. $1=_st(html)._div();
  211. _st($1)._class_("tab");
  212. $2=_st($1)._yourself();
  213. self["@root"]=$2;
  214. _st(self)._renderTab();
  215. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.HLTab)});},
  216. args: ["html"],
  217. source: "renderOn: html\x0a\x09root := html div\x0a\x09\x09class: 'tab';\x0a\x09\x09yourself.\x0a\x09self renderTab",
  218. messageSends: ["class:", "div", "yourself", "renderTab"],
  219. referencedClasses: []
  220. }),
  221. smalltalk.HLTab);
  222. smalltalk.addMethod(
  223. "_renderTab",
  224. smalltalk.method({
  225. selector: "renderTab",
  226. category: 'rendering',
  227. fn: function () {
  228. var self=this;
  229. return smalltalk.withContext(function($ctx1) { var $1,$2;
  230. _st(self["@root"])._contents_((function(html){
  231. return smalltalk.withContext(function($ctx2) { $1=_st(html)._div();
  232. _st($1)._class_("amber_box");
  233. $2=_st($1)._with_((function(){
  234. return smalltalk.withContext(function($ctx3) { return _st(_st(self)._widget())._renderOn_(html);
  235. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  236. return $2;
  237. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}));
  238. return self}, function($ctx1) {$ctx1.fill(self,"renderTab",{},smalltalk.HLTab)});},
  239. args: [],
  240. source: "renderTab\x0a\x09root contents: [ :html |\x0a\x09\x09html div\x0a\x09\x09\x09class: 'amber_box';\x0a\x09\x09\x09with: [ self widget renderOn: html ] ]",
  241. messageSends: ["contents:", "class:", "div", "with:", "renderOn:", "widget"],
  242. referencedClasses: []
  243. }),
  244. smalltalk.HLTab);
  245. smalltalk.addMethod(
  246. "_show",
  247. smalltalk.method({
  248. selector: "show",
  249. category: 'actions',
  250. fn: function () {
  251. var self=this;
  252. return smalltalk.withContext(function($ctx1) { var $1;
  253. $1=self["@root"];
  254. if(($receiver = $1) == nil || $receiver == undefined){
  255. _st(self)._appendToJQuery_(_st("body")._asJQuery());
  256. } else {
  257. _st(_st(self["@root"])._asJQuery())._show();
  258. };
  259. return self}, function($ctx1) {$ctx1.fill(self,"show",{},smalltalk.HLTab)});},
  260. args: [],
  261. source: "show\x0a\x09root\x0a\x09\x09ifNil: [ self appendToJQuery: 'body' asJQuery ]\x0a\x09\x09ifNotNil: [ root asJQuery show ]\x09",
  262. messageSends: ["ifNil:ifNotNil:", "appendToJQuery:", "asJQuery", "show"],
  263. referencedClasses: []
  264. }),
  265. smalltalk.HLTab);
  266. smalltalk.addMethod(
  267. "_widget",
  268. smalltalk.method({
  269. selector: "widget",
  270. category: 'accessing',
  271. fn: function () {
  272. var self=this;
  273. return smalltalk.withContext(function($ctx1) { var $1;
  274. $1=self["@widget"];
  275. return $1;
  276. }, function($ctx1) {$ctx1.fill(self,"widget",{},smalltalk.HLTab)});},
  277. args: [],
  278. source: "widget\x0a\x09^ widget",
  279. messageSends: [],
  280. referencedClasses: []
  281. }),
  282. smalltalk.HLTab);
  283. smalltalk.addMethod(
  284. "_widget_",
  285. smalltalk.method({
  286. selector: "widget:",
  287. category: 'accessing',
  288. fn: function (aWidget) {
  289. var self=this;
  290. return smalltalk.withContext(function($ctx1) { self["@widget"]=aWidget;
  291. return self}, function($ctx1) {$ctx1.fill(self,"widget:",{aWidget:aWidget},smalltalk.HLTab)});},
  292. args: ["aWidget"],
  293. source: "widget: aWidget\x0a\x09widget := aWidget",
  294. messageSends: [],
  295. referencedClasses: []
  296. }),
  297. smalltalk.HLTab);
  298. smalltalk.addMethod(
  299. "_on_labelled_",
  300. smalltalk.method({
  301. selector: "on:labelled:",
  302. category: 'instance creation',
  303. fn: function (aWidget, aString) {
  304. var self=this;
  305. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  306. $2=_st(self)._new();
  307. _st($2)._widget_(aWidget);
  308. _st($2)._label_(aString);
  309. $3=_st($2)._yourself();
  310. $1=$3;
  311. return $1;
  312. }, function($ctx1) {$ctx1.fill(self,"on:labelled:",{aWidget:aWidget,aString:aString},smalltalk.HLTab.klass)});},
  313. args: ["aWidget", "aString"],
  314. source: "on: aWidget labelled: aString\x0a\x09^ self new\x0a\x09\x09widget: aWidget;\x0a\x09\x09label: aString;\x0a\x09\x09yourself",
  315. messageSends: ["widget:", "new", "label:", "yourself"],
  316. referencedClasses: []
  317. }),
  318. smalltalk.HLTab.klass);
  319. smalltalk.addClass('HLWidget', smalltalk.Widget, ['wrapper'], 'Helios-Core');
  320. smalltalk.addMethod(
  321. "_alert_",
  322. smalltalk.method({
  323. selector: "alert:",
  324. category: 'actions',
  325. fn: function (aString) {
  326. var self=this;
  327. return smalltalk.withContext(function($ctx1) { _st(window)._alert_(aString);
  328. return self}, function($ctx1) {$ctx1.fill(self,"alert:",{aString:aString}, smalltalk.HLWidget)});},
  329. args: ["aString"],
  330. source: "alert: aString\x0a\x09window alert: aString",
  331. messageSends: ["alert:"],
  332. referencedClasses: []
  333. }),
  334. smalltalk.HLWidget);
  335. smalltalk.addMethod(
  336. "_canHaveFocus",
  337. smalltalk.method({
  338. selector: "canHaveFocus",
  339. category: 'testing',
  340. fn: function () {
  341. var self=this;
  342. return smalltalk.withContext(function($ctx1) { return false;
  343. }, function($ctx1) {$ctx1.fill(self,"canHaveFocus",{},smalltalk.HLWidget)});},
  344. args: [],
  345. source: "canHaveFocus\x0a\x09^ false",
  346. messageSends: [],
  347. referencedClasses: []
  348. }),
  349. smalltalk.HLWidget);
  350. smalltalk.addMethod(
  351. "_confirm_",
  352. smalltalk.method({
  353. selector: "confirm:",
  354. category: 'actions',
  355. fn: function (aString) {
  356. var self=this;
  357. return smalltalk.withContext(function($ctx1) { var $1;
  358. $1=_st(window)._confirm_(aString);
  359. return $1;
  360. }, function($ctx1) {$ctx1.fill(self,"confirm:",{aString:aString}, smalltalk.HLWidget)});},
  361. args: ["aString"],
  362. source: "confirm: aString\x0a\x09^ window confirm: aString",
  363. messageSends: ["confirm:"],
  364. referencedClasses: []
  365. }),
  366. smalltalk.HLWidget);
  367. smalltalk.addMethod(
  368. "_execute_",
  369. smalltalk.method({
  370. selector: "execute:",
  371. category: 'actions',
  372. fn: function (aCommand){
  373. var self=this;
  374. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  375. return smalltalk.withContext(function($ctx1) {
  376. var $1,$2;
  377. $1=_st(_st($HLManager())._current())._keyBinder();
  378. _st($1)._activate();
  379. $2=_st($1)._applyBinding_(_st(aCommand)._asBinding());
  380. return self}, function($ctx1) {$ctx1.fill(self,"execute:",{aCommand:aCommand},smalltalk.HLWidget)})},
  381. args: ["aCommand"],
  382. source: "execute: aCommand\x0a\x09HLManager current keyBinder\x0a\x09\x09activate;\x0a\x09\x09applyBinding: aCommand asBinding",
  383. messageSends: ["activate", "keyBinder", "current", "applyBinding:", "asBinding"],
  384. referencedClasses: ["HLManager"]
  385. }),
  386. smalltalk.HLWidget);
  387. smalltalk.addMethod(
  388. "_manager",
  389. smalltalk.method({
  390. selector: "manager",
  391. category: 'accessing',
  392. fn: function () {
  393. var self=this;
  394. return smalltalk.withContext(function($ctx1) { var $1;
  395. $1=_st((smalltalk.HLManager || HLManager))._current();
  396. return $1;
  397. }, function($ctx1) {$ctx1.fill(self,"manager",{}, smalltalk.HLWidget)});},
  398. args: [],
  399. source: "manager\x0a\x09^ HLManager current",
  400. messageSends: ["current"],
  401. referencedClasses: ["HLManager"]
  402. }),
  403. smalltalk.HLWidget);
  404. smalltalk.addMethod(
  405. "_refresh",
  406. smalltalk.method({
  407. selector: "refresh",
  408. category: 'updating',
  409. fn: function () {
  410. var self=this;
  411. return smalltalk.withContext(function($ctx1) { var $1,$2;
  412. $1=_st(self)._wrapper();
  413. if(($receiver = $1) == nil || $receiver == undefined){
  414. $2=self;
  415. return $2;
  416. } else {
  417. $1;
  418. };
  419. _st(_st(_st(self)._wrapper())._asJQuery())._empty();
  420. _st((function(html){
  421. return smalltalk.withContext(function($ctx2) { return _st(self)._renderContentOn_(html);
  422. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}))._appendToJQuery_(_st(_st(self)._wrapper())._asJQuery());
  423. return self}, function($ctx1) {$ctx1.fill(self,"refresh",{}, smalltalk.HLWidget)});},
  424. args: [],
  425. source: "refresh\x0a\x09self wrapper ifNil: [ ^ self ].\x0a \x0a\x09self wrapper asJQuery empty.\x0a [ :html | self renderContentOn: html ] appendToJQuery: self wrapper asJQuery",
  426. messageSends: ["ifNil:", "wrapper", "empty", "asJQuery", "appendToJQuery:", "renderContentOn:"],
  427. referencedClasses: []
  428. }),
  429. smalltalk.HLWidget);
  430. smalltalk.addMethod(
  431. "_registerBindings",
  432. smalltalk.method({
  433. selector: "registerBindings",
  434. category: 'keybindings',
  435. fn: function () {
  436. var self=this;
  437. return smalltalk.withContext(function($ctx1) { _st(self)._registerBindingsOn_(_st(_st(_st(self)._manager())._keyBinder())._bindings());
  438. return self}, function($ctx1) {$ctx1.fill(self,"registerBindings",{}, smalltalk.HLWidget)});},
  439. args: [],
  440. source: "registerBindings\x0a\x09self registerBindingsOn: self manager keyBinder bindings",
  441. messageSends: ["registerBindingsOn:", "bindings", "keyBinder", "manager"],
  442. referencedClasses: []
  443. }),
  444. smalltalk.HLWidget);
  445. smalltalk.addMethod(
  446. "_registerBindingsOn_",
  447. smalltalk.method({
  448. selector: "registerBindingsOn:",
  449. category: 'keybindings',
  450. fn: function (aBindingGroup) {
  451. var self=this;
  452. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"registerBindingsOn:",{aBindingGroup:aBindingGroup}, smalltalk.HLWidget)});},
  453. args: ["aBindingGroup"],
  454. source: "registerBindingsOn: aBindingGroup",
  455. messageSends: [],
  456. referencedClasses: []
  457. }),
  458. smalltalk.HLWidget);
  459. smalltalk.addMethod(
  460. "_renderContentOn_",
  461. smalltalk.method({
  462. selector: "renderContentOn:",
  463. category: 'rendering',
  464. fn: function (html) {
  465. var self=this;
  466. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html}, smalltalk.HLWidget)});},
  467. args: ["html"],
  468. source: "renderContentOn: html\x0a",
  469. messageSends: [],
  470. referencedClasses: []
  471. }),
  472. smalltalk.HLWidget);
  473. smalltalk.addMethod(
  474. "_renderOn_",
  475. smalltalk.method({
  476. selector: "renderOn:",
  477. category: 'rendering',
  478. fn: function (html) {
  479. var self=this;
  480. return smalltalk.withContext(function($ctx1) { self["@wrapper"]=_st(html)._div();
  481. _st((function(renderer){
  482. return smalltalk.withContext(function($ctx2) { return _st(self)._renderContentOn_(renderer);
  483. }, function($ctx2) {$ctx2.fillBlock({renderer:renderer},$ctx1)})}))._appendToJQuery_(_st(self["@wrapper"])._asJQuery());
  484. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.HLWidget)});},
  485. args: ["html"],
  486. source: "renderOn: html\x0a\x09wrapper := html div.\x0a [ :renderer | self renderContentOn: renderer ] appendToJQuery: wrapper asJQuery",
  487. messageSends: ["div", "appendToJQuery:", "asJQuery", "renderContentOn:"],
  488. referencedClasses: []
  489. }),
  490. smalltalk.HLWidget);
  491. smalltalk.addMethod(
  492. "_wrapper",
  493. smalltalk.method({
  494. selector: "wrapper",
  495. category: 'accessing',
  496. fn: function () {
  497. var self=this;
  498. return smalltalk.withContext(function($ctx1) { var $1;
  499. $1=self["@wrapper"];
  500. return $1;
  501. }, function($ctx1) {$ctx1.fill(self,"wrapper",{}, smalltalk.HLWidget)});},
  502. args: [],
  503. source: "wrapper\x0a\x09^ wrapper",
  504. messageSends: [],
  505. referencedClasses: []
  506. }),
  507. smalltalk.HLWidget);
  508. smalltalk.addMethod(
  509. "_canBeOpenAsTab",
  510. smalltalk.method({
  511. selector: "canBeOpenAsTab",
  512. category: 'testing',
  513. fn: function () {
  514. var self=this;
  515. return smalltalk.withContext(function($ctx1) { return false;
  516. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{}, smalltalk.HLWidget.klass)});},
  517. args: [],
  518. source: "canBeOpenAsTab\x0a\x09^ false",
  519. messageSends: [],
  520. referencedClasses: []
  521. }),
  522. smalltalk.HLWidget.klass);
  523. smalltalk.addMethod(
  524. "_openAsTab",
  525. smalltalk.method({
  526. selector: "openAsTab",
  527. category: 'accessing',
  528. fn: function () {
  529. var self=this;
  530. return smalltalk.withContext(function($ctx1) { var $1,$2;
  531. $1=_st(self)._canBeOpenAsTab();
  532. if(! smalltalk.assert($1)){
  533. $2=self;
  534. return $2;
  535. };
  536. _st(_st((smalltalk.HLManager || HLManager))._current())._addTab_(_st((smalltalk.HLTab || HLTab))._on_labelled_(_st(self)._new(),_st(self)._tabLabel()));
  537. return self}, function($ctx1) {$ctx1.fill(self,"openAsTab",{}, smalltalk.HLWidget.klass)});},
  538. args: [],
  539. source: "openAsTab\x0a\x09self canBeOpenAsTab ifFalse: [ ^ self ].\x0a\x09HLManager current addTab: (HLTab on: self new labelled: self tabLabel)",
  540. messageSends: ["ifFalse:", "canBeOpenAsTab", "addTab:", "on:labelled:", "new", "tabLabel", "current"],
  541. referencedClasses: ["HLTab", "HLManager"]
  542. }),
  543. smalltalk.HLWidget.klass);
  544. smalltalk.addMethod(
  545. "_tabLabel",
  546. smalltalk.method({
  547. selector: "tabLabel",
  548. category: 'accessing',
  549. fn: function () {
  550. var self=this;
  551. return smalltalk.withContext(function($ctx1) { return "Tab";
  552. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{}, smalltalk.HLWidget.klass)});},
  553. args: [],
  554. source: "tabLabel\x0a\x09^ 'Tab'",
  555. messageSends: [],
  556. referencedClasses: []
  557. }),
  558. smalltalk.HLWidget.klass);
  559. smalltalk.addMethod(
  560. "_tabPriority",
  561. smalltalk.method({
  562. selector: "tabPriority",
  563. category: 'accessing',
  564. fn: function () {
  565. var self=this;
  566. return smalltalk.withContext(function($ctx1) { return (500);
  567. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{}, smalltalk.HLWidget.klass)});},
  568. args: [],
  569. source: "tabPriority\x0a\x09^ 500",
  570. messageSends: [],
  571. referencedClasses: []
  572. }),
  573. smalltalk.HLWidget.klass);
  574. smalltalk.addClass('HLDebugger', smalltalk.HLWidget, [], 'Helios-Core');
  575. smalltalk.addClass('HLFocusableWidget', smalltalk.HLWidget, ['hiddenInput'], 'Helios-Core');
  576. smalltalk.addMethod(
  577. "_blur",
  578. smalltalk.method({
  579. selector: "blur",
  580. category: 'events',
  581. fn: function () {
  582. var self=this;
  583. return smalltalk.withContext(function($ctx1) { _st(_st(self["@hiddenInput"])._asJQuery())._blur();
  584. return self}, function($ctx1) {$ctx1.fill(self,"blur",{}, smalltalk.HLFocusableWidget)});},
  585. args: [],
  586. source: "blur\x0a\x09hiddenInput asJQuery blur",
  587. messageSends: ["blur", "asJQuery"],
  588. referencedClasses: []
  589. }),
  590. smalltalk.HLFocusableWidget);
  591. smalltalk.addMethod(
  592. "_canHaveFocus",
  593. smalltalk.method({
  594. selector: "canHaveFocus",
  595. category: 'testing',
  596. fn: function () {
  597. var self=this;
  598. return smalltalk.withContext(function($ctx1) { return true;
  599. }, function($ctx1) {$ctx1.fill(self,"canHaveFocus",{},smalltalk.HLFocusableWidget)});},
  600. args: [],
  601. source: "canHaveFocus\x0a\x09^ true",
  602. messageSends: [],
  603. referencedClasses: []
  604. }),
  605. smalltalk.HLFocusableWidget);
  606. smalltalk.addMethod(
  607. "_focus",
  608. smalltalk.method({
  609. selector: "focus",
  610. category: 'events',
  611. fn: function () {
  612. var self=this;
  613. return smalltalk.withContext(function($ctx1) { _st(_st(self["@hiddenInput"])._asJQuery())._focus();
  614. return self}, function($ctx1) {$ctx1.fill(self,"focus",{}, smalltalk.HLFocusableWidget)});},
  615. args: [],
  616. source: "focus\x0a\x09hiddenInput asJQuery focus",
  617. messageSends: ["focus", "asJQuery"],
  618. referencedClasses: []
  619. }),
  620. smalltalk.HLFocusableWidget);
  621. smalltalk.addMethod(
  622. "_focusClass",
  623. smalltalk.method({
  624. selector: "focusClass",
  625. category: 'accessing',
  626. fn: function () {
  627. var self=this;
  628. return smalltalk.withContext(function($ctx1) { return "focused";
  629. }, function($ctx1) {$ctx1.fill(self,"focusClass",{}, smalltalk.HLFocusableWidget)});},
  630. args: [],
  631. source: "focusClass\x0a\x09^ 'focused'",
  632. messageSends: [],
  633. referencedClasses: []
  634. }),
  635. smalltalk.HLFocusableWidget);
  636. smalltalk.addMethod(
  637. "_hasFocus",
  638. smalltalk.method({
  639. selector: "hasFocus",
  640. category: 'events',
  641. fn: function () {
  642. var self=this;
  643. return smalltalk.withContext(function($ctx1) { var $1;
  644. $1=_st(_st(_st(self)._wrapper())._notNil())._and_((function(){
  645. return smalltalk.withContext(function($ctx2) { return _st(_st(_st(self)._wrapper())._asJQuery())._hasClass_(_st(self)._focusClass());
  646. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  647. return $1;
  648. }, function($ctx1) {$ctx1.fill(self,"hasFocus",{}, smalltalk.HLFocusableWidget)});},
  649. args: [],
  650. source: "hasFocus\x0a\x09^ self wrapper notNil and: [ self wrapper asJQuery hasClass: self focusClass ]",
  651. messageSends: ["and:", "hasClass:", "focusClass", "asJQuery", "wrapper", "notNil"],
  652. referencedClasses: []
  653. }),
  654. smalltalk.HLFocusableWidget);
  655. smalltalk.addMethod(
  656. "_renderContentOn_",
  657. smalltalk.method({
  658. selector: "renderContentOn:",
  659. category: 'rendering',
  660. fn: function (html) {
  661. var self=this;
  662. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html}, smalltalk.HLFocusableWidget)});},
  663. args: ["html"],
  664. source: "renderContentOn: html",
  665. messageSends: [],
  666. referencedClasses: []
  667. }),
  668. smalltalk.HLFocusableWidget);
  669. smalltalk.addMethod(
  670. "_renderHiddenInputOn_",
  671. smalltalk.method({
  672. selector: "renderHiddenInputOn:",
  673. category: 'rendering',
  674. fn: function (html) {
  675. var self=this;
  676. return smalltalk.withContext(function($ctx1) { var $1,$2;
  677. $1=_st(html)._input();
  678. _st($1)._style_("position: absolute; left: -100000px;");
  679. _st($1)._onBlur_((function(){
  680. return smalltalk.withContext(function($ctx2) { return _st(_st(_st(self)._wrapper())._asJQuery())._removeClass_(_st(self)._focusClass());
  681. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  682. $2=_st($1)._onFocus_((function(){
  683. return smalltalk.withContext(function($ctx2) { return _st(_st(_st(self)._wrapper())._asJQuery())._addClass_(_st(self)._focusClass());
  684. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  685. self["@hiddenInput"]=$2;
  686. return self}, function($ctx1) {$ctx1.fill(self,"renderHiddenInputOn:",{html:html}, smalltalk.HLFocusableWidget)});},
  687. args: ["html"],
  688. source: "renderHiddenInputOn: html\x0a\x09hiddenInput := html input\x0a \x09style: 'position: absolute; left: -100000px;';\x0a \x09onBlur: [ self wrapper asJQuery removeClass: self focusClass ];\x0a onFocus: [ self wrapper asJQuery addClass: self focusClass ]",
  689. messageSends: ["style:", "input", "onBlur:", "removeClass:", "focusClass", "asJQuery", "wrapper", "onFocus:", "addClass:"],
  690. referencedClasses: []
  691. }),
  692. smalltalk.HLFocusableWidget);
  693. smalltalk.addMethod(
  694. "_renderOn_",
  695. smalltalk.method({
  696. selector: "renderOn:",
  697. category: 'rendering',
  698. fn: function (html) {
  699. var self=this;
  700. return smalltalk.withContext(function($ctx1) { var $1,$2;
  701. _st(self)._registerBindings();
  702. _st(self)._renderHiddenInputOn_(html);
  703. $1=_st(html)._div();
  704. _st($1)._class_("hl_widget");
  705. _st($1)._onClick_((function(){
  706. return smalltalk.withContext(function($ctx2) { return _st(_st(self["@hiddenInput"])._asJQuery())._focus();
  707. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  708. $2=_st($1)._with_((function(){
  709. return smalltalk.withContext(function($ctx2) { return _st(self)._renderContentOn_(html);
  710. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  711. self["@wrapper"]=$2;
  712. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html}, smalltalk.HLFocusableWidget)});},
  713. args: ["html"],
  714. source: "renderOn: html\x0a\x09self registerBindings.\x0a\x09self renderHiddenInputOn: html.\x0a \x0a wrapper := html div \x0a \x09class: 'hl_widget'; \x0a onClick: [ hiddenInput asJQuery focus ];\x0a with: [\x0a\x09\x09\x09self renderContentOn: html ]",
  715. messageSends: ["registerBindings", "renderHiddenInputOn:", "class:", "div", "onClick:", "focus", "asJQuery", "with:", "renderContentOn:"],
  716. referencedClasses: []
  717. }),
  718. smalltalk.HLFocusableWidget);
  719. smalltalk.addClass('HLListWidget', smalltalk.HLFocusableWidget, ['items', 'selectedItem', 'mapping'], 'Helios-Core');
  720. smalltalk.addMethod(
  721. "_activateFirstListItem",
  722. smalltalk.method({
  723. selector: "activateFirstListItem",
  724. category: 'actions',
  725. fn: function () {
  726. var self=this;
  727. return smalltalk.withContext(function($ctx1) { _st(self)._activateListItem_(_st(window)._jQuery_(_st(_st(_st(self["@wrapper"])._asJQuery())._find_("li"))._get_((0))));
  728. return self}, function($ctx1) {$ctx1.fill(self,"activateFirstListItem",{}, smalltalk.HLListWidget)});},
  729. args: [],
  730. source: "activateFirstListItem\x0a\x09self activateListItem: (window jQuery: ((wrapper asJQuery find: 'li') get: 0))",
  731. messageSends: ["activateListItem:", "jQuery:", "get:", "find:", "asJQuery"],
  732. referencedClasses: []
  733. }),
  734. smalltalk.HLListWidget);
  735. smalltalk.addMethod(
  736. "_activateItem_",
  737. smalltalk.method({
  738. selector: "activateItem:",
  739. category: 'actions',
  740. fn: function (anObject) {
  741. var self=this;
  742. return smalltalk.withContext(function($ctx1) { var $1;
  743. var $early={};
  744. try {
  745. _st(self)._activateListItem_(_st(_st(self["@mapping"])._at_ifAbsent_(anObject,(function(){
  746. return smalltalk.withContext(function($ctx2) { $1=self;
  747. throw $early=[$1];
  748. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._asJQuery());
  749. return self}
  750. catch(e) {if(e===$early)return e[0]; throw e}
  751. }, function($ctx1) {$ctx1.fill(self,"activateItem:",{anObject:anObject},smalltalk.HLListWidget)});},
  752. args: ["anObject"],
  753. source: "activateItem: anObject\x0a\x09self activateListItem: (mapping \x0a\x09\x09at: anObject\x0a\x09\x09ifAbsent: [ ^ self ]) asJQuery",
  754. messageSends: ["activateListItem:", "asJQuery", "at:ifAbsent:"],
  755. referencedClasses: []
  756. }),
  757. smalltalk.HLListWidget);
  758. smalltalk.addMethod(
  759. "_activateListItem_",
  760. smalltalk.method({
  761. selector: "activateListItem:",
  762. category: 'actions',
  763. fn: function (aListItem) {
  764. var self=this;
  765. var parent,position,item;
  766. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5;
  767. $1=_st(aListItem)._get_((0));
  768. if(($receiver = $1) == nil || $receiver == undefined){
  769. $2=self;
  770. return $2;
  771. } else {
  772. $1;
  773. };
  774. position=_st(self)._positionOf_(aListItem);
  775. parent=_st(aListItem)._parent();
  776. _st(_st(parent)._children())._removeClass_("active");
  777. _st(aListItem)._addClass_("active");
  778. $3=_st(_st(_st(aListItem)._position())._top()).__lt((0));
  779. if(smalltalk.assert($3)){
  780. _st(_st(parent)._get_((0)))._scrollTop_(_st(_st(_st(_st(parent)._get_((0)))._scrollTop()).__plus(_st(_st(aListItem)._position())._top())).__minus((10)));
  781. };
  782. $4=_st(_st(_st(_st(aListItem)._position())._top()).__plus(_st(aListItem)._height())).__gt(_st(parent)._height());
  783. if(smalltalk.assert($4)){
  784. _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)));
  785. };
  786. item=_st(_st(self)._items())._at_(_st(_st(aListItem)._attr_("list-data"))._asNumber());
  787. $5=_st(_st(self)._selectedItem()).__eq_eq(item);
  788. if(! smalltalk.assert($5)){
  789. _st(self)._selectItem_(item);
  790. };
  791. return self}, function($ctx1) {$ctx1.fill(self,"activateListItem:",{aListItem:aListItem,parent:parent,position:position,item:item},smalltalk.HLListWidget)});},
  792. args: ["aListItem"],
  793. source: "activateListItem: aListItem\x0a\x09| parent position item |\x0a \x0a\x09(aListItem get: 0) ifNil: [ ^self ].\x0a\x0a\x09position := self positionOf: aListItem.\x0a\x0a parent := aListItem parent.\x0a\x09parent children removeClass: 'active'.\x0a\x09aListItem addClass: 'active'.\x0a \x0a \x22Move the scrollbar to show the active element\x22\x0a aListItem position top < 0 ifTrue: [\x0a\x09\x09(parent get: 0) scrollTop: ((parent get: 0) scrollTop + aListItem position top - 10) ].\x0a aListItem position top + aListItem height > parent height ifTrue: [ \x0a\x09\x09(parent get: 0) scrollTop: ((parent get: 0) scrollTop + aListItem height - (parent height - aListItem position top)) +10 ].\x0a \x0a \x22Activate the corresponding item\x22\x0a item := (self items at: (aListItem attr: 'list-data') asNumber).\x0a self selectedItem == item ifFalse: [\x0a\x09 self selectItem: item ]",
  794. messageSends: ["ifNil:", "get:", "positionOf:", "parent", "removeClass:", "children", "addClass:", "ifTrue:", "scrollTop:", "-", "+", "top", "position", "scrollTop", "<", "height", ">", "at:", "asNumber", "attr:", "items", "ifFalse:", "selectItem:", "==", "selectedItem"],
  795. referencedClasses: []
  796. }),
  797. smalltalk.HLListWidget);
  798. smalltalk.addMethod(
  799. "_activateNextListItem",
  800. smalltalk.method({
  801. selector: "activateNextListItem",
  802. category: 'actions',
  803. fn: function () {
  804. var self=this;
  805. return smalltalk.withContext(function($ctx1) { _st(self)._activateListItem_(_st(_st(window)._jQuery_(".focused .nav-pills .active"))._next());
  806. return self}, function($ctx1) {$ctx1.fill(self,"activateNextListItem",{},smalltalk.HLListWidget)});},
  807. args: [],
  808. source: "activateNextListItem\x0a\x09self activateListItem: (window jQuery: '.focused .nav-pills .active') next",
  809. messageSends: ["activateListItem:", "next", "jQuery:"],
  810. referencedClasses: []
  811. }),
  812. smalltalk.HLListWidget);
  813. smalltalk.addMethod(
  814. "_activatePreviousListItem",
  815. smalltalk.method({
  816. selector: "activatePreviousListItem",
  817. category: 'actions',
  818. fn: function () {
  819. var self=this;
  820. return smalltalk.withContext(function($ctx1) { _st(self)._activateListItem_(_st(_st(window)._jQuery_(".focused .nav-pills .active"))._prev());
  821. return self}, function($ctx1) {$ctx1.fill(self,"activatePreviousListItem",{},smalltalk.HLListWidget)});},
  822. args: [],
  823. source: "activatePreviousListItem\x0a\x09self activateListItem: (window jQuery: '.focused .nav-pills .active') prev",
  824. messageSends: ["activateListItem:", "prev", "jQuery:"],
  825. referencedClasses: []
  826. }),
  827. smalltalk.HLListWidget);
  828. smalltalk.addMethod(
  829. "_cssClassForItem_",
  830. smalltalk.method({
  831. selector: "cssClassForItem:",
  832. category: 'accessing',
  833. fn: function (anObject) {
  834. var self=this;
  835. return smalltalk.withContext(function($ctx1) { var $2,$1;
  836. $2=_st(_st(self)._selectedItem()).__eq(anObject);
  837. if(smalltalk.assert($2)){
  838. $1="active";
  839. } else {
  840. $1="inactive";
  841. };
  842. return $1;
  843. }, function($ctx1) {$ctx1.fill(self,"cssClassForItem:",{anObject:anObject}, smalltalk.HLListWidget)});},
  844. args: ["anObject"],
  845. source: "cssClassForItem: anObject\x0a\x09^ self selectedItem = anObject\x0a\x09\x09\x09ifTrue: [ 'active' ]\x0a\x09\x09\x09ifFalse: [ 'inactive' ]",
  846. messageSends: ["ifTrue:ifFalse:", "=", "selectedItem"],
  847. referencedClasses: []
  848. }),
  849. smalltalk.HLListWidget);
  850. smalltalk.addMethod(
  851. "_defaultItems",
  852. smalltalk.method({
  853. selector: "defaultItems",
  854. category: 'defaults',
  855. fn: function () {
  856. var self=this;
  857. return smalltalk.withContext(function($ctx1) { return [];
  858. }, function($ctx1) {$ctx1.fill(self,"defaultItems",{}, smalltalk.HLListWidget)});},
  859. args: [],
  860. source: "defaultItems\x0a\x09^ #()",
  861. messageSends: [],
  862. referencedClasses: []
  863. }),
  864. smalltalk.HLListWidget);
  865. smalltalk.addMethod(
  866. "_focus",
  867. smalltalk.method({
  868. selector: "focus",
  869. category: 'actions',
  870. fn: function () {
  871. var self=this;
  872. return smalltalk.withContext(function($ctx1) { var $1,$2;
  873. smalltalk.HLFocusableWidget.fn.prototype._focus.apply(_st(self), []);
  874. $1=_st(_st(self)._items())._isEmpty();
  875. if(! smalltalk.assert($1)){
  876. $2=_st(self)._selectedItem();
  877. if(($receiver = $2) == nil || $receiver == undefined){
  878. _st(self)._activateFirstListItem();
  879. } else {
  880. $2;
  881. };
  882. };
  883. return self}, function($ctx1) {$ctx1.fill(self,"focus",{}, smalltalk.HLListWidget)});},
  884. args: [],
  885. source: "focus\x0a\x09super focus.\x0a self items isEmpty ifFalse: [ \x0a\x09\x09self selectedItem ifNil: [ self activateFirstListItem ] ]",
  886. messageSends: ["focus", "ifFalse:", "ifNil:", "activateFirstListItem", "selectedItem", "isEmpty", "items"],
  887. referencedClasses: []
  888. }),
  889. smalltalk.HLListWidget);
  890. smalltalk.addMethod(
  891. "_iconForItem_",
  892. smalltalk.method({
  893. selector: "iconForItem:",
  894. category: 'accessing',
  895. fn: function (anObject) {
  896. var self=this;
  897. return smalltalk.withContext(function($ctx1) { return "";
  898. }, function($ctx1) {$ctx1.fill(self,"iconForItem:",{anObject:anObject}, smalltalk.HLListWidget)});},
  899. args: ["anObject"],
  900. source: "iconForItem: anObject\x0a\x09^ ''",
  901. messageSends: [],
  902. referencedClasses: []
  903. }),
  904. smalltalk.HLListWidget);
  905. smalltalk.addMethod(
  906. "_initialize",
  907. smalltalk.method({
  908. selector: "initialize",
  909. category: 'initialization',
  910. fn: function () {
  911. var self=this;
  912. return smalltalk.withContext(function($ctx1) { smalltalk.HLFocusableWidget.fn.prototype._initialize.apply(_st(self), []);
  913. self["@mapping"]=_st((smalltalk.Dictionary || Dictionary))._new();
  914. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.HLListWidget)});},
  915. args: [],
  916. source: "initialize\x0a\x09super initialize.\x0a\x09\x0a\x09mapping := Dictionary new.",
  917. messageSends: ["initialize", "new"],
  918. referencedClasses: ["Dictionary"]
  919. }),
  920. smalltalk.HLListWidget);
  921. smalltalk.addMethod(
  922. "_items",
  923. smalltalk.method({
  924. selector: "items",
  925. category: 'accessing',
  926. fn: function () {
  927. var self=this;
  928. return smalltalk.withContext(function($ctx1) { var $2,$1;
  929. $2=self["@items"];
  930. if(($receiver = $2) == nil || $receiver == undefined){
  931. self["@items"]=_st(self)._defaultItems();
  932. $1=self["@items"];
  933. } else {
  934. $1=$2;
  935. };
  936. return $1;
  937. }, function($ctx1) {$ctx1.fill(self,"items",{}, smalltalk.HLListWidget)});},
  938. args: [],
  939. source: "items\x0a\x09^ items ifNil: [ items := self defaultItems ]",
  940. messageSends: ["ifNil:", "defaultItems"],
  941. referencedClasses: []
  942. }),
  943. smalltalk.HLListWidget);
  944. smalltalk.addMethod(
  945. "_items_",
  946. smalltalk.method({
  947. selector: "items:",
  948. category: 'accessing',
  949. fn: function (aCollection) {
  950. var self=this;
  951. return smalltalk.withContext(function($ctx1) { self["@items"]=aCollection;
  952. return self}, function($ctx1) {$ctx1.fill(self,"items:",{aCollection:aCollection}, smalltalk.HLListWidget)});},
  953. args: ["aCollection"],
  954. source: "items: aCollection\x0a\x09items := aCollection",
  955. messageSends: [],
  956. referencedClasses: []
  957. }),
  958. smalltalk.HLListWidget);
  959. smalltalk.addMethod(
  960. "_positionOf_",
  961. smalltalk.method({
  962. selector: "positionOf:",
  963. category: 'accessing',
  964. fn: function (aListItem) {
  965. var self=this;
  966. return smalltalk.withContext(function($ctx1) {
  967. return aListItem.parent().children().get().indexOf(aListItem.get(0)) + 1
  968. ;
  969. return self}, function($ctx1) {$ctx1.fill(self,"positionOf:",{aListItem:aListItem}, smalltalk.HLListWidget)});},
  970. args: ["aListItem"],
  971. source: "positionOf: aListItem\x0a\x09<\x0a \x09return aListItem.parent().children().get().indexOf(aListItem.get(0)) + 1\x0a\x09>",
  972. messageSends: [],
  973. referencedClasses: []
  974. }),
  975. smalltalk.HLListWidget);
  976. smalltalk.addMethod(
  977. "_registerMappingFrom_to_",
  978. smalltalk.method({
  979. selector: "registerMappingFrom:to:",
  980. category: 'private',
  981. fn: function (anObject, aTag) {
  982. var self=this;
  983. return smalltalk.withContext(function($ctx1) { _st(self["@mapping"])._at_put_(anObject,aTag);
  984. return self}, function($ctx1) {$ctx1.fill(self,"registerMappingFrom:to:",{anObject:anObject,aTag:aTag},smalltalk.HLListWidget)});},
  985. args: ["anObject", "aTag"],
  986. source: "registerMappingFrom: anObject to: aTag\x0a\x09mapping at: anObject put: aTag",
  987. messageSends: ["at:put:"],
  988. referencedClasses: []
  989. }),
  990. smalltalk.HLListWidget);
  991. smalltalk.addMethod(
  992. "_renderButtonsOn_",
  993. smalltalk.method({
  994. selector: "renderButtonsOn:",
  995. category: 'rendering',
  996. fn: function (html) {
  997. var self=this;
  998. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html}, smalltalk.HLListWidget)});},
  999. args: ["html"],
  1000. source: "renderButtonsOn: html",
  1001. messageSends: [],
  1002. referencedClasses: []
  1003. }),
  1004. smalltalk.HLListWidget);
  1005. smalltalk.addMethod(
  1006. "_renderContentOn_",
  1007. smalltalk.method({
  1008. selector: "renderContentOn:",
  1009. category: 'rendering',
  1010. fn: function (html) {
  1011. var self=this;
  1012. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  1013. $1=_st(html)._ul();
  1014. _st($1)._class_("nav nav-pills nav-stacked");
  1015. $2=_st($1)._with_((function(){
  1016. return smalltalk.withContext(function($ctx2) { return _st(self)._renderListOn_(html);
  1017. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1018. $3=_st(html)._div();
  1019. _st($3)._class_("pane_actions form-actions");
  1020. $4=_st($3)._with_((function(){
  1021. return smalltalk.withContext(function($ctx2) { return _st(self)._renderButtonsOn_(html);
  1022. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1023. _st(self)._setupKeyBindings();
  1024. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html}, smalltalk.HLListWidget)});},
  1025. args: ["html"],
  1026. source: "renderContentOn: html\x0a\x09html ul \x0a \x09class: 'nav nav-pills nav-stacked';\x0a with: [ self renderListOn: html ].\x0a html div class: 'pane_actions form-actions'; with: [\x0a \x09self renderButtonsOn: html ].\x0a \x0a self setupKeyBindings",
  1027. messageSends: ["class:", "ul", "with:", "renderListOn:", "div", "renderButtonsOn:", "setupKeyBindings"],
  1028. referencedClasses: []
  1029. }),
  1030. smalltalk.HLListWidget);
  1031. smalltalk.addMethod(
  1032. "_renderItem_on_",
  1033. smalltalk.method({
  1034. selector: "renderItem:on:",
  1035. category: 'rendering',
  1036. fn: function (anObject, html) {
  1037. var self=this;
  1038. var li;
  1039. return smalltalk.withContext(function($ctx1) { var $1,$3,$4,$2;
  1040. li=_st(html)._li();
  1041. _st(self)._registerMappingFrom_to_(anObject,li);
  1042. $1=li;
  1043. _st($1)._class_(_st(self)._cssClassForItem_(anObject));
  1044. _st($1)._at_put_("list-data",_st(_st(_st(self)._items())._indexOf_(anObject))._asString());
  1045. $2=_st($1)._with_((function(){
  1046. return smalltalk.withContext(function($ctx2) { $3=_st(html)._a();
  1047. _st($3)._with_((function(){
  1048. return smalltalk.withContext(function($ctx3) { _st(_st(html)._tag_("i"))._class_(_st(self)._iconForItem_(anObject));
  1049. return _st(self)._renderItemLabel_on_(anObject,html);
  1050. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1051. $4=_st($3)._onClick_((function(){
  1052. return smalltalk.withContext(function($ctx3) { return _st(self)._activateListItem_(_st(li)._asJQuery());
  1053. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1054. return $4;
  1055. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1056. return self}, function($ctx1) {$ctx1.fill(self,"renderItem:on:",{anObject:anObject,html:html,li:li},smalltalk.HLListWidget)});},
  1057. args: ["anObject", "html"],
  1058. source: "renderItem: anObject on: html\x0a\x09| li |\x0a \x0a\x09li := html li.\x0a\x09self registerMappingFrom: anObject to: li.\x0a\x09\x0a li\x0a \x09class: (self cssClassForItem: anObject);\x0a at: 'list-data' put: (self items indexOf: anObject) asString;\x0a with: [ \x0a \x09html a\x0a \x09with: [ \x0a \x09\x09(html tag: 'i') class: (self iconForItem: anObject).\x0a \x09\x09\x09\x09\x09self renderItemLabel: anObject on: html ];\x0a\x09\x09\x09\x09onClick: [\x0a \x09self activateListItem: li asJQuery ] ]",
  1059. messageSends: ["li", "registerMappingFrom:to:", "class:", "cssClassForItem:", "at:put:", "asString", "indexOf:", "items", "with:", "iconForItem:", "tag:", "renderItemLabel:on:", "a", "onClick:", "activateListItem:", "asJQuery"],
  1060. referencedClasses: []
  1061. }),
  1062. smalltalk.HLListWidget);
  1063. smalltalk.addMethod(
  1064. "_renderItemLabel_on_",
  1065. smalltalk.method({
  1066. selector: "renderItemLabel:on:",
  1067. category: 'rendering',
  1068. fn: function (anObject, html) {
  1069. var self=this;
  1070. return smalltalk.withContext(function($ctx1) { _st(html)._with_(_st(anObject)._asString());
  1071. return self}, function($ctx1) {$ctx1.fill(self,"renderItemLabel:on:",{anObject:anObject,html:html}, smalltalk.HLListWidget)});},
  1072. args: ["anObject", "html"],
  1073. source: "renderItemLabel: anObject on: html\x0a\x09html with: anObject asString",
  1074. messageSends: ["with:", "asString"],
  1075. referencedClasses: []
  1076. }),
  1077. smalltalk.HLListWidget);
  1078. smalltalk.addMethod(
  1079. "_renderListOn_",
  1080. smalltalk.method({
  1081. selector: "renderListOn:",
  1082. category: 'rendering',
  1083. fn: function (html) {
  1084. var self=this;
  1085. return smalltalk.withContext(function($ctx1) { self["@mapping"]=_st((smalltalk.Dictionary || Dictionary))._new();
  1086. _st(_st(self)._items())._do_((function(each){
  1087. return smalltalk.withContext(function($ctx2) { return _st(self)._renderItem_on_(each,html);
  1088. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1089. return self}, function($ctx1) {$ctx1.fill(self,"renderListOn:",{html:html},smalltalk.HLListWidget)});},
  1090. args: ["html"],
  1091. source: "renderListOn: html\x0a\x09mapping := Dictionary new.\x0a\x09\x0a\x09self items do: [ :each | \x0a \x09self renderItem: each on: html ]",
  1092. messageSends: ["new", "do:", "renderItem:on:", "items"],
  1093. referencedClasses: ["Dictionary"]
  1094. }),
  1095. smalltalk.HLListWidget);
  1096. smalltalk.addMethod(
  1097. "_selectItem_",
  1098. smalltalk.method({
  1099. selector: "selectItem:",
  1100. category: 'actions',
  1101. fn: function (anObject) {
  1102. var self=this;
  1103. return smalltalk.withContext(function($ctx1) { _st(self)._selectedItem_(anObject);
  1104. return self}, function($ctx1) {$ctx1.fill(self,"selectItem:",{anObject:anObject}, smalltalk.HLListWidget)});},
  1105. args: ["anObject"],
  1106. source: "selectItem: anObject\x0a\x09self selectedItem: anObject",
  1107. messageSends: ["selectedItem:"],
  1108. referencedClasses: []
  1109. }),
  1110. smalltalk.HLListWidget);
  1111. smalltalk.addMethod(
  1112. "_selectedItem",
  1113. smalltalk.method({
  1114. selector: "selectedItem",
  1115. category: 'accessing',
  1116. fn: function () {
  1117. var self=this;
  1118. return smalltalk.withContext(function($ctx1) { var $1;
  1119. $1=self["@selectedItem"];
  1120. return $1;
  1121. }, function($ctx1) {$ctx1.fill(self,"selectedItem",{}, smalltalk.HLListWidget)});},
  1122. args: [],
  1123. source: "selectedItem\x0a\x09^ selectedItem",
  1124. messageSends: [],
  1125. referencedClasses: []
  1126. }),
  1127. smalltalk.HLListWidget);
  1128. smalltalk.addMethod(
  1129. "_selectedItem_",
  1130. smalltalk.method({
  1131. selector: "selectedItem:",
  1132. category: 'accessing',
  1133. fn: function (anObject) {
  1134. var self=this;
  1135. return smalltalk.withContext(function($ctx1) { self["@selectedItem"]=anObject;
  1136. return self}, function($ctx1) {$ctx1.fill(self,"selectedItem:",{anObject:anObject}, smalltalk.HLListWidget)});},
  1137. args: ["anObject"],
  1138. source: "selectedItem: anObject\x0a\x09selectedItem := anObject",
  1139. messageSends: [],
  1140. referencedClasses: []
  1141. }),
  1142. smalltalk.HLListWidget);
  1143. smalltalk.addMethod(
  1144. "_setupKeyBindings",
  1145. smalltalk.method({
  1146. selector: "setupKeyBindings",
  1147. category: 'events',
  1148. fn: function () {
  1149. var self=this;
  1150. var active,interval,delay,repeatInterval;
  1151. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5;
  1152. active=false;
  1153. repeatInterval=(70);
  1154. _st(_st(self["@hiddenInput"])._asJQuery())._unbind_("keydown");
  1155. _st(_st(self["@hiddenInput"])._asJQuery())._keydown_((function(e){
  1156. return smalltalk.withContext(function($ctx2) { $1=_st(_st(_st(e)._which()).__eq((38)))._and_((function(){
  1157. return smalltalk.withContext(function($ctx3) { return _st(active).__eq(false);
  1158. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1159. if(smalltalk.assert($1)){
  1160. active=true;
  1161. active;
  1162. _st(self)._activatePreviousListItem();
  1163. delay=_st((function(){
  1164. return smalltalk.withContext(function($ctx3) { interval=_st((function(){
  1165. return smalltalk.withContext(function($ctx4) { return _st(self)._activatePreviousListItem();
  1166. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}))._valueWithInterval_(repeatInterval);
  1167. return interval;
  1168. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}))._valueWithTimeout_((300));
  1169. delay;
  1170. };
  1171. $2=_st(_st(_st(e)._which()).__eq((40)))._and_((function(){
  1172. return smalltalk.withContext(function($ctx3) { return _st(active).__eq(false);
  1173. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1174. if(smalltalk.assert($2)){
  1175. active=true;
  1176. active;
  1177. _st(self)._activateNextListItem();
  1178. delay=_st((function(){
  1179. return smalltalk.withContext(function($ctx3) { interval=_st((function(){
  1180. return smalltalk.withContext(function($ctx4) { return _st(self)._activateNextListItem();
  1181. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}))._valueWithInterval_(repeatInterval);
  1182. return interval;
  1183. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}))._valueWithTimeout_((300));
  1184. return delay;
  1185. };
  1186. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1)})}));
  1187. _st(_st(self["@hiddenInput"])._asJQuery())._keyup_((function(e){
  1188. return smalltalk.withContext(function($ctx2) { $3=active;
  1189. if(smalltalk.assert($3)){
  1190. active=false;
  1191. active;
  1192. $4=interval;
  1193. if(($receiver = $4) == nil || $receiver == undefined){
  1194. $4;
  1195. } else {
  1196. _st(interval)._clearInterval();
  1197. };
  1198. $5=delay;
  1199. if(($receiver = $5) == nil || $receiver == undefined){
  1200. return $5;
  1201. } else {
  1202. return _st(delay)._clearTimeout();
  1203. };
  1204. };
  1205. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1)})}));
  1206. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyBindings",{active:active,interval:interval,delay:delay,repeatInterval:repeatInterval},smalltalk.HLListWidget)});},
  1207. args: [],
  1208. source: "setupKeyBindings\x0a\x09\x22TODO: refactor this!\x22\x0a\x09\x0a\x09| active interval delay repeatInterval |\x0a\x09\x0a\x09active := false.\x0a\x09repeatInterval := 70.\x0a\x09hiddenInput asJQuery unbind: 'keydown'.\x0a\x0a\x09hiddenInput asJQuery keydown: [ :e |\x0a\x09\x09\x0a (e which = 38 and: [ active = false ]) ifTrue: [ \x0a\x09\x09\x09active := true.\x0a\x09\x09\x09self activatePreviousListItem.\x0a \x09delay := [\x0a\x09\x09\x09\x09interval := [ self activatePreviousListItem ]\x0a\x09\x09\x09\x09\x09valueWithInterval: repeatInterval ]\x0a\x09\x09\x09\x09\x09\x09valueWithTimeout: 300 ].\x0a\x09\x09\x09\x0a \x09(e which = 40 and: [ active = false ]) ifTrue: [\x0a active := true.\x0a\x09\x09\x09self activateNextListItem.\x0a \x09delay := [\x0a\x09\x09\x09\x09interval := [ self activateNextListItem ]\x0a\x09\x09\x09\x09\x09valueWithInterval: repeatInterval ]\x0a\x09\x09\x09\x09\x09\x09valueWithTimeout: 300 ] ].\x0a\x09\x0a\x09hiddenInput asJQuery keyup: [ :e |\x0a\x09\x09active ifTrue: [\x0a\x09\x09\x09active := false.\x0a\x09\x09\x09interval ifNotNil: [ interval clearInterval ].\x0a\x09\x09\x09delay ifNotNil: [ delay clearTimeout] ] ]",
  1209. messageSends: ["unbind:", "asJQuery", "keydown:", "ifTrue:", "activatePreviousListItem", "valueWithTimeout:", "valueWithInterval:", "and:", "=", "which", "activateNextListItem", "keyup:", "ifNotNil:", "clearInterval", "clearTimeout"],
  1210. referencedClasses: []
  1211. }),
  1212. smalltalk.HLListWidget);
  1213. smalltalk.addClass('HLNavigationListWidget', smalltalk.HLListWidget, ['previous', 'next'], 'Helios-Core');
  1214. smalltalk.addMethod(
  1215. "_next",
  1216. smalltalk.method({
  1217. selector: "next",
  1218. category: 'accessing',
  1219. fn: function () {
  1220. var self=this;
  1221. return smalltalk.withContext(function($ctx1) { var $1;
  1222. $1=self["@next"];
  1223. return $1;
  1224. }, function($ctx1) {$ctx1.fill(self,"next",{}, smalltalk.HLNavigationListWidget)});},
  1225. args: [],
  1226. source: "next\x0a\x09^ next",
  1227. messageSends: [],
  1228. referencedClasses: []
  1229. }),
  1230. smalltalk.HLNavigationListWidget);
  1231. smalltalk.addMethod(
  1232. "_next_",
  1233. smalltalk.method({
  1234. selector: "next:",
  1235. category: 'accessing',
  1236. fn: function (aWidget) {
  1237. var self=this;
  1238. return smalltalk.withContext(function($ctx1) { var $1;
  1239. self["@next"]=aWidget;
  1240. $1=_st(_st(aWidget)._previous()).__eq(self);
  1241. if(! smalltalk.assert($1)){
  1242. _st(aWidget)._previous_(self);
  1243. };
  1244. return self}, function($ctx1) {$ctx1.fill(self,"next:",{aWidget:aWidget}, smalltalk.HLNavigationListWidget)});},
  1245. args: ["aWidget"],
  1246. source: "next: aWidget\x0a\x09next := aWidget.\x0a aWidget previous = self ifFalse: [ aWidget previous: self ]",
  1247. messageSends: ["ifFalse:", "previous:", "=", "previous"],
  1248. referencedClasses: []
  1249. }),
  1250. smalltalk.HLNavigationListWidget);
  1251. smalltalk.addMethod(
  1252. "_nextFocus",
  1253. smalltalk.method({
  1254. selector: "nextFocus",
  1255. category: 'actions',
  1256. fn: function () {
  1257. var self=this;
  1258. return smalltalk.withContext(function($ctx1) { var $1;
  1259. $1=_st(self)._next();
  1260. if(($receiver = $1) == nil || $receiver == undefined){
  1261. $1;
  1262. } else {
  1263. _st(_st(self)._next())._focus();
  1264. };
  1265. return self}, function($ctx1) {$ctx1.fill(self,"nextFocus",{}, smalltalk.HLNavigationListWidget)});},
  1266. args: [],
  1267. source: "nextFocus\x0a\x09self next ifNotNil: [ self next focus ]",
  1268. messageSends: ["ifNotNil:", "focus", "next"],
  1269. referencedClasses: []
  1270. }),
  1271. smalltalk.HLNavigationListWidget);
  1272. smalltalk.addMethod(
  1273. "_previous",
  1274. smalltalk.method({
  1275. selector: "previous",
  1276. category: 'accessing',
  1277. fn: function () {
  1278. var self=this;
  1279. return smalltalk.withContext(function($ctx1) { var $1;
  1280. $1=self["@previous"];
  1281. return $1;
  1282. }, function($ctx1) {$ctx1.fill(self,"previous",{}, smalltalk.HLNavigationListWidget)});},
  1283. args: [],
  1284. source: "previous\x0a\x09^ previous",
  1285. messageSends: [],
  1286. referencedClasses: []
  1287. }),
  1288. smalltalk.HLNavigationListWidget);
  1289. smalltalk.addMethod(
  1290. "_previous_",
  1291. smalltalk.method({
  1292. selector: "previous:",
  1293. category: 'accessing',
  1294. fn: function (aWidget) {
  1295. var self=this;
  1296. return smalltalk.withContext(function($ctx1) { var $1;
  1297. self["@previous"]=aWidget;
  1298. $1=_st(_st(aWidget)._next()).__eq(self);
  1299. if(! smalltalk.assert($1)){
  1300. _st(aWidget)._next_(self);
  1301. };
  1302. return self}, function($ctx1) {$ctx1.fill(self,"previous:",{aWidget:aWidget}, smalltalk.HLNavigationListWidget)});},
  1303. args: ["aWidget"],
  1304. source: "previous: aWidget\x0a\x09previous := aWidget.\x0a aWidget next = self ifFalse: [ aWidget next: self ]",
  1305. messageSends: ["ifFalse:", "next:", "=", "next"],
  1306. referencedClasses: []
  1307. }),
  1308. smalltalk.HLNavigationListWidget);
  1309. smalltalk.addMethod(
  1310. "_previousFocus",
  1311. smalltalk.method({
  1312. selector: "previousFocus",
  1313. category: 'actions',
  1314. fn: function () {
  1315. var self=this;
  1316. return smalltalk.withContext(function($ctx1) { var $1;
  1317. $1=_st(self)._previous();
  1318. if(($receiver = $1) == nil || $receiver == undefined){
  1319. $1;
  1320. } else {
  1321. _st(_st(self)._previous())._focus();
  1322. };
  1323. return self}, function($ctx1) {$ctx1.fill(self,"previousFocus",{}, smalltalk.HLNavigationListWidget)});},
  1324. args: [],
  1325. source: "previousFocus\x0a\x09self previous ifNotNil: [ self previous focus ]",
  1326. messageSends: ["ifNotNil:", "focus", "previous"],
  1327. referencedClasses: []
  1328. }),
  1329. smalltalk.HLNavigationListWidget);
  1330. smalltalk.addMethod(
  1331. "_setupKeyBindings",
  1332. smalltalk.method({
  1333. selector: "setupKeyBindings",
  1334. category: 'events',
  1335. fn: function () {
  1336. var self=this;
  1337. return smalltalk.withContext(function($ctx1) { var $1,$2;
  1338. smalltalk.HLListWidget.fn.prototype._setupKeyBindings.apply(_st(self), []);
  1339. _st(_st(self["@hiddenInput"])._asJQuery())._keydown_((function(e){
  1340. return smalltalk.withContext(function($ctx2) { $1=_st(_st(e)._which()).__eq((39));
  1341. if(smalltalk.assert($1)){
  1342. _st(self)._nextFocus();
  1343. };
  1344. $2=_st(_st(e)._which()).__eq((37));
  1345. if(smalltalk.assert($2)){
  1346. return _st(self)._previousFocus();
  1347. };
  1348. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1)})}));
  1349. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyBindings",{}, smalltalk.HLNavigationListWidget)});},
  1350. args: [],
  1351. source: "setupKeyBindings\x0a\x09super setupKeyBindings.\x0a\x0a\x09hiddenInput asJQuery keydown: [ :e |\x0a e which = 39 ifTrue: [ \x0a \x09self nextFocus ].\x0a\x09\x09e which = 37 ifTrue: [ \x0a \x09self previousFocus ] ]",
  1352. messageSends: ["setupKeyBindings", "keydown:", "ifTrue:", "nextFocus", "=", "which", "previousFocus", "asJQuery"],
  1353. referencedClasses: []
  1354. }),
  1355. smalltalk.HLNavigationListWidget);
  1356. smalltalk.addClass('HLManager', smalltalk.HLWidget, ['tabs', 'activeTab', 'keyBinder', 'environment', 'history'], 'Helios-Core');
  1357. smalltalk.addMethod(
  1358. "_activate_",
  1359. smalltalk.method({
  1360. selector: "activate:",
  1361. category: 'actions',
  1362. fn: function (aTab) {
  1363. var self=this;
  1364. return smalltalk.withContext(function($ctx1) { var $1,$2;
  1365. _st(_st(self)._keyBinder())._flushBindings();
  1366. _st(aTab)._registerBindings();
  1367. self["@activeTab"]=aTab;
  1368. $1=self;
  1369. _st($1)._refresh();
  1370. _st($1)._addToHistory_(aTab);
  1371. $2=_st($1)._show_(aTab);
  1372. return self}, function($ctx1) {$ctx1.fill(self,"activate:",{aTab:aTab},smalltalk.HLManager)});},
  1373. args: ["aTab"],
  1374. source: "activate: aTab\x0a\x09self keyBinder flushBindings.\x0a\x09aTab registerBindings.\x0a\x09activeTab := aTab.\x0a\x09\x0a\x09self \x0a\x09\x09refresh;\x0a\x09\x09addToHistory: aTab;\x0a\x09\x09show: aTab",
  1375. messageSends: ["flushBindings", "keyBinder", "registerBindings", "refresh", "addToHistory:", "show:"],
  1376. referencedClasses: []
  1377. }),
  1378. smalltalk.HLManager);
  1379. smalltalk.addMethod(
  1380. "_activeTab",
  1381. smalltalk.method({
  1382. selector: "activeTab",
  1383. category: 'accessing',
  1384. fn: function () {
  1385. var self=this;
  1386. return smalltalk.withContext(function($ctx1) { var $1;
  1387. $1=self["@activeTab"];
  1388. return $1;
  1389. }, function($ctx1) {$ctx1.fill(self,"activeTab",{}, smalltalk.HLManager)});},
  1390. args: [],
  1391. source: "activeTab\x0a\x09^ activeTab",
  1392. messageSends: [],
  1393. referencedClasses: []
  1394. }),
  1395. smalltalk.HLManager);
  1396. smalltalk.addMethod(
  1397. "_addTab_",
  1398. smalltalk.method({
  1399. selector: "addTab:",
  1400. category: 'actions',
  1401. fn: function (aTab) {
  1402. var self=this;
  1403. return smalltalk.withContext(function($ctx1) { _st(_st(self)._tabs())._add_(aTab);
  1404. _st(self)._activate_(aTab);
  1405. return self}, function($ctx1) {$ctx1.fill(self,"addTab:",{aTab:aTab}, smalltalk.HLManager)});},
  1406. args: ["aTab"],
  1407. source: "addTab: aTab\x0a\x09self tabs add: aTab.\x0a self activate: aTab",
  1408. messageSends: ["add:", "tabs", "activate:"],
  1409. referencedClasses: []
  1410. }),
  1411. smalltalk.HLManager);
  1412. smalltalk.addMethod(
  1413. "_addToHistory_",
  1414. smalltalk.method({
  1415. selector: "addToHistory:",
  1416. category: 'actions',
  1417. fn: function (aTab) {
  1418. var self=this;
  1419. return smalltalk.withContext(function($ctx1) { _st(self)._removeFromHistory_(aTab);
  1420. _st(_st(self)._history())._add_(aTab);
  1421. return self}, function($ctx1) {$ctx1.fill(self,"addToHistory:",{aTab:aTab}, smalltalk.HLManager)});},
  1422. args: ["aTab"],
  1423. source: "addToHistory: aTab\x0a\x09self removeFromHistory: aTab.\x0a\x09self history add: aTab",
  1424. messageSends: ["removeFromHistory:", "add:", "history"],
  1425. referencedClasses: []
  1426. }),
  1427. smalltalk.HLManager);
  1428. smalltalk.addMethod(
  1429. "_defaultEnvironment",
  1430. smalltalk.method({
  1431. selector: "defaultEnvironment",
  1432. category: 'defaults',
  1433. fn: function () {
  1434. var self=this;
  1435. return smalltalk.withContext(function($ctx1) { var $1;
  1436. $1=_st((smalltalk.HLLocalEnvironment || HLLocalEnvironment))._new();
  1437. return $1;
  1438. }, function($ctx1) {$ctx1.fill(self,"defaultEnvironment",{}, smalltalk.HLManager)});},
  1439. args: [],
  1440. source: "defaultEnvironment\x0a\x09^ HLLocalEnvironment new",
  1441. messageSends: ["new"],
  1442. referencedClasses: ["HLLocalEnvironment"]
  1443. }),
  1444. smalltalk.HLManager);
  1445. smalltalk.addMethod(
  1446. "_environment",
  1447. smalltalk.method({
  1448. selector: "environment",
  1449. category: 'accessing',
  1450. fn: function () {
  1451. var self=this;
  1452. return smalltalk.withContext(function($ctx1) { var $2,$1;
  1453. $2=self["@environment"];
  1454. if(($receiver = $2) == nil || $receiver == undefined){
  1455. self["@environment"]=_st(self)._defaultEnvironment();
  1456. $1=self["@environment"];
  1457. } else {
  1458. $1=$2;
  1459. };
  1460. return $1;
  1461. }, function($ctx1) {$ctx1.fill(self,"environment",{}, smalltalk.HLManager)});},
  1462. args: [],
  1463. source: "environment\x0a\x09\x22The default environment used by all Helios objects\x22\x0a \x0a\x09^ environment ifNil: [ environment := self defaultEnvironment ]",
  1464. messageSends: ["ifNil:", "defaultEnvironment"],
  1465. referencedClasses: []
  1466. }),
  1467. smalltalk.HLManager);
  1468. smalltalk.addMethod(
  1469. "_environment_",
  1470. smalltalk.method({
  1471. selector: "environment:",
  1472. category: 'accessing',
  1473. fn: function (anEnvironment) {
  1474. var self=this;
  1475. return smalltalk.withContext(function($ctx1) { self["@environment"]=anEnvironment;
  1476. return self}, function($ctx1) {$ctx1.fill(self,"environment:",{anEnvironment:anEnvironment}, smalltalk.HLManager)});},
  1477. args: ["anEnvironment"],
  1478. source: "environment: anEnvironment\x0a\x09environment := anEnvironment",
  1479. messageSends: [],
  1480. referencedClasses: []
  1481. }),
  1482. smalltalk.HLManager);
  1483. smalltalk.addMethod(
  1484. "_history",
  1485. smalltalk.method({
  1486. selector: "history",
  1487. category: 'accessing',
  1488. fn: function () {
  1489. var self=this;
  1490. return smalltalk.withContext(function($ctx1) { var $2,$1;
  1491. $2=self["@history"];
  1492. if(($receiver = $2) == nil || $receiver == undefined){
  1493. self["@history"]=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
  1494. $1=self["@history"];
  1495. } else {
  1496. $1=$2;
  1497. };
  1498. return $1;
  1499. }, function($ctx1) {$ctx1.fill(self,"history",{}, smalltalk.HLManager)});},
  1500. args: [],
  1501. source: "history\x0a\x09^ history ifNil: [ history := OrderedCollection new ]",
  1502. messageSends: ["ifNil:", "new"],
  1503. referencedClasses: ["OrderedCollection"]
  1504. }),
  1505. smalltalk.HLManager);
  1506. smalltalk.addMethod(
  1507. "_history_",
  1508. smalltalk.method({
  1509. selector: "history:",
  1510. category: 'accessing',
  1511. fn: function (aCollection) {
  1512. var self=this;
  1513. return smalltalk.withContext(function($ctx1) { self["@history"]=aCollection;
  1514. return self}, function($ctx1) {$ctx1.fill(self,"history:",{aCollection:aCollection}, smalltalk.HLManager)});},
  1515. args: ["aCollection"],
  1516. source: "history: aCollection\x0a\x09history := aCollection",
  1517. messageSends: [],
  1518. referencedClasses: []
  1519. }),
  1520. smalltalk.HLManager);
  1521. smalltalk.addMethod(
  1522. "_initialize",
  1523. smalltalk.method({
  1524. selector: "initialize",
  1525. category: 'initialization',
  1526. fn: function () {
  1527. var self=this;
  1528. return smalltalk.withContext(function($ctx1) { smalltalk.HLWidget.fn.prototype._initialize.apply(_st(self), []);
  1529. _st(_st(self)._keyBinder())._setupEvents();
  1530. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.HLManager)});},
  1531. args: [],
  1532. source: "initialize\x0a\x09super initialize.\x0a self keyBinder setupEvents",
  1533. messageSends: ["initialize", "setupEvents", "keyBinder"],
  1534. referencedClasses: []
  1535. }),
  1536. smalltalk.HLManager);
  1537. smalltalk.addMethod(
  1538. "_keyBinder",
  1539. smalltalk.method({
  1540. selector: "keyBinder",
  1541. category: 'accessing',
  1542. fn: function () {
  1543. var self=this;
  1544. return smalltalk.withContext(function($ctx1) { var $2,$1;
  1545. $2=self["@keyBinder"];
  1546. if(($receiver = $2) == nil || $receiver == undefined){
  1547. self["@keyBinder"]=_st((smalltalk.HLKeyBinder || HLKeyBinder))._new();
  1548. $1=self["@keyBinder"];
  1549. } else {
  1550. $1=$2;
  1551. };
  1552. return $1;
  1553. }, function($ctx1) {$ctx1.fill(self,"keyBinder",{}, smalltalk.HLManager)});},
  1554. args: [],
  1555. source: "keyBinder\x0a\x09^ keyBinder ifNil: [ keyBinder := HLKeyBinder new ]",
  1556. messageSends: ["ifNil:", "new"],
  1557. referencedClasses: ["HLKeyBinder"]
  1558. }),
  1559. smalltalk.HLManager);
  1560. smalltalk.addMethod(
  1561. "_refresh",
  1562. smalltalk.method({
  1563. selector: "refresh",
  1564. category: 'rendering',
  1565. fn: function () {
  1566. var self=this;
  1567. return smalltalk.withContext(function($ctx1) { _st(_st(window)._jQuery_(".navbar"))._remove();
  1568. _st(self)._appendToJQuery_(_st("body")._asJQuery());
  1569. return self}, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.HLManager)});},
  1570. args: [],
  1571. source: "refresh\x0a\x09(window jQuery: '.navbar') remove.\x0a\x09self appendToJQuery: 'body' asJQuery",
  1572. messageSends: ["remove", "jQuery:", "appendToJQuery:", "asJQuery"],
  1573. referencedClasses: []
  1574. }),
  1575. smalltalk.HLManager);
  1576. smalltalk.addMethod(
  1577. "_removeActiveTab",
  1578. smalltalk.method({
  1579. selector: "removeActiveTab",
  1580. category: 'actions',
  1581. fn: function () {
  1582. var self=this;
  1583. return smalltalk.withContext(function($ctx1) { _st(self)._removeTab_(_st(self)._activeTab());
  1584. return self}, function($ctx1) {$ctx1.fill(self,"removeActiveTab",{}, smalltalk.HLManager)});},
  1585. args: [],
  1586. source: "removeActiveTab\x0a\x09self removeTab: self activeTab",
  1587. messageSends: ["removeTab:", "activeTab"],
  1588. referencedClasses: []
  1589. }),
  1590. smalltalk.HLManager);
  1591. smalltalk.addMethod(
  1592. "_removeFromHistory_",
  1593. smalltalk.method({
  1594. selector: "removeFromHistory:",
  1595. category: 'actions',
  1596. fn: function (aTab) {
  1597. var self=this;
  1598. return smalltalk.withContext(function($ctx1) { _st(self)._history_(_st(_st(self)._history())._reject_((function(each){
  1599. return smalltalk.withContext(function($ctx2) { return _st(each).__eq_eq(aTab);
  1600. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})));
  1601. return self}, function($ctx1) {$ctx1.fill(self,"removeFromHistory:",{aTab:aTab}, smalltalk.HLManager)});},
  1602. args: ["aTab"],
  1603. source: "removeFromHistory: aTab\x0a\x09self history: (self history reject: [ :each | each == aTab ])",
  1604. messageSends: ["history:", "reject:", "==", "history"],
  1605. referencedClasses: []
  1606. }),
  1607. smalltalk.HLManager);
  1608. smalltalk.addMethod(
  1609. "_removeTab_",
  1610. smalltalk.method({
  1611. selector: "removeTab:",
  1612. category: 'actions',
  1613. fn: function (aTab) {
  1614. var self=this;
  1615. return smalltalk.withContext(function($ctx1) { var $1,$2;
  1616. $1=_st(_st(self)._tabs())._includes_(aTab);
  1617. if(! smalltalk.assert($1)){
  1618. $2=self;
  1619. return $2;
  1620. };
  1621. _st(self)._removeFromHistory_(aTab);
  1622. _st(_st(self)._tabs())._remove_(aTab);
  1623. _st(_st(self)._keyBinder())._flushBindings();
  1624. _st(aTab)._remove();
  1625. _st(self)._refresh();
  1626. _st(_st(self)._history())._ifNotEmpty_((function(){
  1627. return smalltalk.withContext(function($ctx2) { return _st(_st(_st(self)._history())._last())._activate();
  1628. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1629. return self}, function($ctx1) {$ctx1.fill(self,"removeTab:",{aTab:aTab},smalltalk.HLManager)});},
  1630. args: ["aTab"],
  1631. source: "removeTab: aTab\x0a\x09(self tabs includes: aTab) ifFalse: [ ^ self ].\x0a\x0a\x09self removeFromHistory: aTab.\x0a\x09self tabs remove: aTab.\x0a\x09self keyBinder flushBindings.\x0a\x09aTab remove.\x0a\x09self refresh.\x0a\x09self history ifNotEmpty: [\x0a\x09\x09self history last activate ]",
  1632. messageSends: ["ifFalse:", "includes:", "tabs", "removeFromHistory:", "remove:", "flushBindings", "keyBinder", "remove", "refresh", "ifNotEmpty:", "activate", "last", "history"],
  1633. referencedClasses: []
  1634. }),
  1635. smalltalk.HLManager);
  1636. smalltalk.addMethod(
  1637. "_renderAddOn_",
  1638. smalltalk.method({
  1639. selector: "renderAddOn:",
  1640. category: 'rendering',
  1641. fn: function (html) {
  1642. var self=this;
  1643. return smalltalk.withContext(function($ctx1) { var $1,$3,$4,$5,$7,$8,$6,$2;
  1644. $1=_st(html)._li();
  1645. _st($1)._class_("dropdown");
  1646. $2=_st($1)._with_((function(){
  1647. return smalltalk.withContext(function($ctx2) { $3=_st(html)._a();
  1648. _st($3)._class_("dropdown-toggle");
  1649. _st($3)._at_put_("data-toggle","dropdown");
  1650. $4=_st($3)._with_((function(){
  1651. return smalltalk.withContext(function($ctx3) { _st(html)._with_("Open...");
  1652. return _st(_st(html)._tag_("b"))._class_("caret");
  1653. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1654. $4;
  1655. $5=_st(html)._ul();
  1656. _st($5)._class_("dropdown-menu");
  1657. $6=_st($5)._with_((function(){
  1658. return smalltalk.withContext(function($ctx3) { return _st(_st(_st(_st((smalltalk.HLWidget || HLWidget))._withAllSubclasses())._select_((function(each){
  1659. return smalltalk.withContext(function($ctx4) { return _st(each)._canBeOpenAsTab();
  1660. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx1)})})))._sorted_((function(a,b){
  1661. return smalltalk.withContext(function($ctx4) { return _st(_st(a)._tabPriority()).__lt(_st(b)._tabPriority());
  1662. }, function($ctx4) {$ctx4.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(each){
  1663. return smalltalk.withContext(function($ctx4) { return _st(_st(html)._li())._with_((function(){
  1664. return smalltalk.withContext(function($ctx5) { $7=_st(html)._a();
  1665. _st($7)._with_(_st(each)._tabLabel());
  1666. $8=_st($7)._onClick_((function(){
  1667. return smalltalk.withContext(function($ctx6) { return _st(each)._openAsTab();
  1668. }, function($ctx6) {$ctx6.fillBlock({},$ctx1)})}));
  1669. return $8;
  1670. }, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
  1671. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx1)})}));
  1672. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1673. return $6;
  1674. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1675. return self}, function($ctx1) {$ctx1.fill(self,"renderAddOn:",{html:html}, smalltalk.HLManager)});},
  1676. args: ["html"],
  1677. source: "renderAddOn: html\x0a html li \x0a \x09class: 'dropdown';\x0a with: [ \x0a\x09\x09\x09html a \x0a \x09\x09class: 'dropdown-toggle';\x0a \x09 \x09at: 'data-toggle' put: 'dropdown';\x0a \x09with: [ \x0a \x09\x09html with: 'Open...'.\x0a \x09\x09\x09\x09\x09(html tag: 'b') class: 'caret' ].\x0a html ul \x0a \x09\x09class: 'dropdown-menu';\x0a with: [\x0a \x09((HLWidget withAllSubclasses\x0a \x09select: [ :each | each canBeOpenAsTab ])\x0a sorted: [ :a :b | a tabPriority < b tabPriority ])\x0a do: [ :each |\x0a \x09\x09\x09\x09\x09\x09\x09html li with: [\x0a \x09\x09\x09html a \x0a \x09with: each tabLabel;\x0a \x09\x09\x09\x09\x09\x09\x09\x09onClick: [ each openAsTab ] ] ] ] ]",
  1678. messageSends: ["class:", "li", "with:", "a", "at:put:", "tag:", "ul", "do:", "tabLabel", "onClick:", "openAsTab", "sorted:", "<", "tabPriority", "select:", "canBeOpenAsTab", "withAllSubclasses"],
  1679. referencedClasses: ["HLWidget"]
  1680. }),
  1681. smalltalk.HLManager);
  1682. smalltalk.addMethod(
  1683. "_renderContentOn_",
  1684. smalltalk.method({
  1685. selector: "renderContentOn:",
  1686. category: 'rendering',
  1687. fn: function (html) {
  1688. var self=this;
  1689. return smalltalk.withContext(function($ctx1) { var $1,$3,$4,$2;
  1690. $1=_st(html)._div();
  1691. _st($1)._class_("navbar navbar-fixed-top");
  1692. $2=_st($1)._with_((function(){
  1693. return smalltalk.withContext(function($ctx2) { $3=_st(html)._div();
  1694. _st($3)._class_("navbar-inner");
  1695. $4=_st($3)._with_((function(){
  1696. return smalltalk.withContext(function($ctx3) { return _st(self)._renderTabsOn_(html);
  1697. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1698. return $4;
  1699. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1700. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLManager)});},
  1701. args: ["html"],
  1702. source: "renderContentOn: html\x0a\x09html div \x0a\x09\x09class: 'navbar navbar-fixed-top';\x0a\x09\x09with: [ html div \x0a\x09\x09\x09class: 'navbar-inner';\x0a\x09\x09\x09with: [ self renderTabsOn: html ] ]",
  1703. messageSends: ["class:", "div", "with:", "renderTabsOn:"],
  1704. referencedClasses: []
  1705. }),
  1706. smalltalk.HLManager);
  1707. smalltalk.addMethod(
  1708. "_renderTabsOn_",
  1709. smalltalk.method({
  1710. selector: "renderTabsOn:",
  1711. category: 'rendering',
  1712. fn: function (html) {
  1713. var self=this;
  1714. return smalltalk.withContext(function($ctx1) { var $1,$3,$4,$6,$5,$8,$9,$7,$2;
  1715. $1=_st(html)._ul();
  1716. _st($1)._class_("nav");
  1717. $2=_st($1)._with_((function(){
  1718. return smalltalk.withContext(function($ctx2) { _st(_st(self)._tabs())._do_((function(each){
  1719. return smalltalk.withContext(function($ctx3) { $3=_st(html)._li();
  1720. $4=$3;
  1721. $6=_st(each)._isActive();
  1722. if(smalltalk.assert($6)){
  1723. $5="active";
  1724. } else {
  1725. $5="inactive";
  1726. };
  1727. _st($4)._class_($5);
  1728. $7=_st($3)._with_((function(){
  1729. return smalltalk.withContext(function($ctx4) { $8=_st(html)._a();
  1730. _st($8)._with_((function(){
  1731. return smalltalk.withContext(function($ctx5) { _st(_st(_st(html)._tag_("i"))._class_("icon-remove"))._onClick_((function(){
  1732. return smalltalk.withContext(function($ctx6) { return _st(self)._removeTab_(each);
  1733. }, function($ctx6) {$ctx6.fillBlock({},$ctx1)})}));
  1734. return _st(html)._with_(_st(each)._displayLabel());
  1735. }, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
  1736. $9=_st($8)._onClick_((function(){
  1737. return smalltalk.withContext(function($ctx5) { return _st(each)._activate();
  1738. }, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
  1739. return $9;
  1740. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
  1741. return $7;
  1742. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  1743. return _st(self)._renderAddOn_(html);
  1744. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1745. return self}, function($ctx1) {$ctx1.fill(self,"renderTabsOn:",{html:html},smalltalk.HLManager)});},
  1746. args: ["html"],
  1747. source: "renderTabsOn: html\x0a\x09html ul \x0a\x09\x09class: 'nav';\x0a\x09\x09with: [ \x0a \x09self tabs do: [ :each |\x0a\x09\x09\x09\x09html li \x0a\x09\x09\x09\x09\x09class: (each isActive ifTrue: [ 'active' ] ifFalse: [ 'inactive' ]);\x0a\x09\x09\x09\x09\x09with: [\x0a\x09\x09\x09\x09\x09\x09html a\x0a\x09\x09\x09\x09\x09\x09\x09with: [\x0a \x09\x09\x09\x09\x09\x09\x09((html tag: 'i') class: 'icon-remove')\x0a \x09\x09\x09\x09\x09\x09\x09\x09\x09onClick: [ self removeTab: each ].\x0a \x09html with: each displayLabel ];\x0a\x09\x09\x09\x09\x09\x09\x09onClick: [ each activate ] ] ].\x0a\x09\x09\x09self renderAddOn: html ]",
  1748. messageSends: ["class:", "ul", "with:", "do:", "ifTrue:ifFalse:", "isActive", "li", "onClick:", "removeTab:", "tag:", "displayLabel", "a", "activate", "tabs", "renderAddOn:"],
  1749. referencedClasses: []
  1750. }),
  1751. smalltalk.HLManager);
  1752. smalltalk.addMethod(
  1753. "_show_",
  1754. smalltalk.method({
  1755. selector: "show:",
  1756. category: 'rendering',
  1757. fn: function (aTab) {
  1758. var self=this;
  1759. return smalltalk.withContext(function($ctx1) { var $1,$2;
  1760. _st(_st(self)._tabs())._do_((function(each){
  1761. return smalltalk.withContext(function($ctx2) { return _st(each)._hide();
  1762. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1763. $1=aTab;
  1764. _st($1)._show();
  1765. $2=_st($1)._focus();
  1766. return self}, function($ctx1) {$ctx1.fill(self,"show:",{aTab:aTab},smalltalk.HLManager)});},
  1767. args: ["aTab"],
  1768. source: "show: aTab\x0a\x09self tabs do: [ :each | each hide ].\x0a\x09aTab show; focus",
  1769. messageSends: ["do:", "hide", "tabs", "show", "focus"],
  1770. referencedClasses: []
  1771. }),
  1772. smalltalk.HLManager);
  1773. smalltalk.addMethod(
  1774. "_tabs",
  1775. smalltalk.method({
  1776. selector: "tabs",
  1777. category: 'accessing',
  1778. fn: function () {
  1779. var self=this;
  1780. return smalltalk.withContext(function($ctx1) { var $2,$1;
  1781. $2=self["@tabs"];
  1782. if(($receiver = $2) == nil || $receiver == undefined){
  1783. self["@tabs"]=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
  1784. $1=self["@tabs"];
  1785. } else {
  1786. $1=$2;
  1787. };
  1788. return $1;
  1789. }, function($ctx1) {$ctx1.fill(self,"tabs",{}, smalltalk.HLManager)});},
  1790. args: [],
  1791. source: "tabs\x0a\x09^ tabs ifNil: [ tabs := OrderedCollection new ]",
  1792. messageSends: ["ifNil:", "new"],
  1793. referencedClasses: ["OrderedCollection"]
  1794. }),
  1795. smalltalk.HLManager);
  1796. smalltalk.HLManager.klass.iVarNames = ['current'];
  1797. smalltalk.addMethod(
  1798. "_current",
  1799. smalltalk.method({
  1800. selector: "current",
  1801. category: 'accessing',
  1802. fn: function () {
  1803. var self=this;
  1804. return smalltalk.withContext(function($ctx1) { var $2,$1;
  1805. $2=self["@current"];
  1806. if(($receiver = $2) == nil || $receiver == undefined){
  1807. self["@current"]=_st(_st(self)._basicNew())._initialize();
  1808. $1=self["@current"];
  1809. } else {
  1810. $1=$2;
  1811. };
  1812. return $1;
  1813. }, function($ctx1) {$ctx1.fill(self,"current",{}, smalltalk.HLManager.klass)});},
  1814. args: [],
  1815. source: "current\x0a\x09^ current ifNil: [ current := self basicNew initialize ]",
  1816. messageSends: ["ifNil:", "initialize", "basicNew"],
  1817. referencedClasses: []
  1818. }),
  1819. smalltalk.HLManager.klass);
  1820. smalltalk.addMethod(
  1821. "_initialize",
  1822. smalltalk.method({
  1823. selector: "initialize",
  1824. category: 'initialization',
  1825. fn: function () {
  1826. var self=this;
  1827. return smalltalk.withContext(function($ctx1) { _st(_st(self)._current())._appendToJQuery_(_st("body")._asJQuery());
  1828. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.HLManager.klass)});},
  1829. args: [],
  1830. source: "initialize\x0a\x09self current appendToJQuery: 'body' asJQuery",
  1831. messageSends: ["appendToJQuery:", "asJQuery", "current"],
  1832. referencedClasses: []
  1833. }),
  1834. smalltalk.HLManager.klass);
  1835. smalltalk.addMethod(
  1836. "_new",
  1837. smalltalk.method({
  1838. selector: "new",
  1839. category: 'instance creation',
  1840. fn: function () {
  1841. var self=this;
  1842. return smalltalk.withContext(function($ctx1) { _st(self)._shouldNotImplement();
  1843. return self}, function($ctx1) {$ctx1.fill(self,"new",{}, smalltalk.HLManager.klass)});},
  1844. args: [],
  1845. source: "new\x0a\x09\x22Use current instead\x22\x0a\x0a\x09self shouldNotImplement",
  1846. messageSends: ["shouldNotImplement"],
  1847. referencedClasses: []
  1848. }),
  1849. smalltalk.HLManager.klass);
  1850. smalltalk.addClass('HLSUnit', smalltalk.HLWidget, [], 'Helios-Core');
  1851. smalltalk.addMethod(
  1852. "_canBeOpenAsTab",
  1853. smalltalk.method({
  1854. selector: "canBeOpenAsTab",
  1855. category: 'testing',
  1856. fn: function () {
  1857. var self=this;
  1858. return smalltalk.withContext(function($ctx1) { return true;
  1859. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{}, smalltalk.HLSUnit.klass)});},
  1860. args: [],
  1861. source: "canBeOpenAsTab\x0a\x09^ true",
  1862. messageSends: [],
  1863. referencedClasses: []
  1864. }),
  1865. smalltalk.HLSUnit.klass);
  1866. smalltalk.addMethod(
  1867. "_tabLabel",
  1868. smalltalk.method({
  1869. selector: "tabLabel",
  1870. category: 'accessing',
  1871. fn: function () {
  1872. var self=this;
  1873. return smalltalk.withContext(function($ctx1) { return "SUnit";
  1874. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{}, smalltalk.HLSUnit.klass)});},
  1875. args: [],
  1876. source: "tabLabel\x0a\x09^ 'SUnit'",
  1877. messageSends: [],
  1878. referencedClasses: []
  1879. }),
  1880. smalltalk.HLSUnit.klass);
  1881. smalltalk.addMethod(
  1882. "_tabPriority",
  1883. smalltalk.method({
  1884. selector: "tabPriority",
  1885. category: 'accessing',
  1886. fn: function () {
  1887. var self=this;
  1888. return smalltalk.withContext(function($ctx1) { return (1000);
  1889. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{}, smalltalk.HLSUnit.klass)});},
  1890. args: [],
  1891. source: "tabPriority\x0a\x09^ 1000",
  1892. messageSends: [],
  1893. referencedClasses: []
  1894. }),
  1895. smalltalk.HLSUnit.klass);
  1896. smalltalk.addClass('HLTranscript', smalltalk.HLWidget, [], 'Helios-Core');
  1897. smalltalk.addMethod(
  1898. "_canBeOpenAsTab",
  1899. smalltalk.method({
  1900. selector: "canBeOpenAsTab",
  1901. category: 'testing',
  1902. fn: function () {
  1903. var self=this;
  1904. return smalltalk.withContext(function($ctx1) { return true;
  1905. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{}, smalltalk.HLTranscript.klass)});},
  1906. args: [],
  1907. source: "canBeOpenAsTab\x0a\x09^ true",
  1908. messageSends: [],
  1909. referencedClasses: []
  1910. }),
  1911. smalltalk.HLTranscript.klass);
  1912. smalltalk.addMethod(
  1913. "_tabLabel",
  1914. smalltalk.method({
  1915. selector: "tabLabel",
  1916. category: 'accessing',
  1917. fn: function () {
  1918. var self=this;
  1919. return smalltalk.withContext(function($ctx1) { return "Transcript";
  1920. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{}, smalltalk.HLTranscript.klass)});},
  1921. args: [],
  1922. source: "tabLabel\x0a\x09^ 'Transcript'",
  1923. messageSends: [],
  1924. referencedClasses: []
  1925. }),
  1926. smalltalk.HLTranscript.klass);
  1927. smalltalk.addMethod(
  1928. "_tabPriority",
  1929. smalltalk.method({
  1930. selector: "tabPriority",
  1931. category: 'accessing',
  1932. fn: function () {
  1933. var self=this;
  1934. return smalltalk.withContext(function($ctx1) { return (600);
  1935. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{}, smalltalk.HLTranscript.klass)});},
  1936. args: [],
  1937. source: "tabPriority\x0a\x09^ 600",
  1938. messageSends: [],
  1939. referencedClasses: []
  1940. }),
  1941. smalltalk.HLTranscript.klass);