2
0

Helios-Core.js 73 KB

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