Helios-Core.js 70 KB

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