Helios-Core.js 72 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154
  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)._activateListItem_(_st(window)._jQuery_(_st(_st(_st(self["@wrapper"])._asJQuery())._find_("li.inactive"))._get_((0))));
  722. return self}, function($ctx1) {$ctx1.fill(self,"activateFirstListItem",{},smalltalk.HLListWidget)})},
  723. args: [],
  724. source: "activateFirstListItem\x0a\x09self activateListItem: (window jQuery: ((wrapper asJQuery find: 'li.inactive') get: 0))",
  725. messageSends: ["activateListItem:", "jQuery:", "get:", "find:", "asJQuery"],
  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 item;
  760. return smalltalk.withContext(function($ctx1) {
  761. var $1,$2,$3;
  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. _st(_st(_st(aListItem)._parent())._children())._removeClass_("active");
  770. _st(aListItem)._addClass_("active");
  771. _st(self)._ensureVisible_(aListItem);
  772. item=_st(_st(self)._items())._at_(_st(_st(aListItem)._attr_("list-data"))._asNumber());
  773. $3=_st(_st(self)._selectedItem()).__eq_eq(item);
  774. if(! smalltalk.assert($3)){
  775. _st(self)._selectItem_(item);
  776. };
  777. return self}, function($ctx1) {$ctx1.fill(self,"activateListItem:",{aListItem:aListItem,item:item},smalltalk.HLListWidget)})},
  778. args: ["aListItem"],
  779. source: "activateListItem: aListItem\x0a\x09| item |\x0a \x0a\x09(aListItem get: 0) ifNil: [ ^self ].\x0a\x09aListItem parent children removeClass: 'active'.\x0a\x09aListItem addClass: 'active'.\x0a \x0a\x09self ensureVisible: aListItem.\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 ]",
  780. messageSends: ["ifNil:", "get:", "removeClass:", "children", "parent", "addClass:", "ensureVisible:", "at:", "asNumber", "attr:", "items", "ifFalse:", "selectItem:", "==", "selectedItem"],
  781. referencedClasses: []
  782. }),
  783. smalltalk.HLListWidget);
  784. smalltalk.addMethod(
  785. smalltalk.method({
  786. selector: "activateNextListItem",
  787. category: 'actions',
  788. fn: function (){
  789. var self=this;
  790. return smalltalk.withContext(function($ctx1) {
  791. _st(self)._activateListItem_(_st(_st(window)._jQuery_(".focused .nav-pills .active"))._next());
  792. _st(_st(_st(window)._jQuery_(".focused .nav-pills .active"))._get())._ifEmpty_((function(){
  793. return smalltalk.withContext(function($ctx2) {
  794. return _st(self)._activateFirstListItem();
  795. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  796. return self}, function($ctx1) {$ctx1.fill(self,"activateNextListItem",{},smalltalk.HLListWidget)})},
  797. args: [],
  798. 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 ]",
  799. messageSends: ["activateListItem:", "next", "jQuery:", "ifEmpty:", "activateFirstListItem", "get"],
  800. referencedClasses: []
  801. }),
  802. smalltalk.HLListWidget);
  803. smalltalk.addMethod(
  804. smalltalk.method({
  805. selector: "activatePreviousListItem",
  806. category: 'actions',
  807. fn: function (){
  808. var self=this;
  809. return smalltalk.withContext(function($ctx1) {
  810. _st(self)._activateListItem_(_st(_st(window)._jQuery_(".focused .nav-pills .active"))._prev());
  811. return self}, function($ctx1) {$ctx1.fill(self,"activatePreviousListItem",{},smalltalk.HLListWidget)})},
  812. args: [],
  813. source: "activatePreviousListItem\x0a\x09self activateListItem: (window jQuery: '.focused .nav-pills .active') prev",
  814. messageSends: ["activateListItem:", "prev", "jQuery:"],
  815. referencedClasses: []
  816. }),
  817. smalltalk.HLListWidget);
  818. smalltalk.addMethod(
  819. smalltalk.method({
  820. selector: "cssClassForItem:",
  821. category: 'accessing',
  822. fn: function (anObject){
  823. var self=this;
  824. return smalltalk.withContext(function($ctx1) {
  825. var $2,$1;
  826. $2=_st(_st(self)._selectedItem()).__eq(anObject);
  827. if(smalltalk.assert($2)){
  828. $1="active";
  829. } else {
  830. $1="inactive";
  831. };
  832. return $1;
  833. }, function($ctx1) {$ctx1.fill(self,"cssClassForItem:",{anObject:anObject},smalltalk.HLListWidget)})},
  834. args: ["anObject"],
  835. source: "cssClassForItem: anObject\x0a\x09^ self selectedItem = anObject\x0a\x09\x09\x09ifTrue: [ 'active' ]\x0a\x09\x09\x09ifFalse: [ 'inactive' ]",
  836. messageSends: ["ifTrue:ifFalse:", "=", "selectedItem"],
  837. referencedClasses: []
  838. }),
  839. smalltalk.HLListWidget);
  840. smalltalk.addMethod(
  841. smalltalk.method({
  842. selector: "defaultItems",
  843. category: 'defaults',
  844. fn: function (){
  845. var self=this;
  846. return smalltalk.withContext(function($ctx1) {
  847. var $1;
  848. $1=[];
  849. return $1;
  850. }, function($ctx1) {$ctx1.fill(self,"defaultItems",{},smalltalk.HLListWidget)})},
  851. args: [],
  852. source: "defaultItems\x0a\x09^ #()",
  853. messageSends: [],
  854. referencedClasses: []
  855. }),
  856. smalltalk.HLListWidget);
  857. smalltalk.addMethod(
  858. smalltalk.method({
  859. selector: "ensureVisible:",
  860. category: 'actions',
  861. fn: function (aListItem){
  862. var self=this;
  863. var perent,position;
  864. return smalltalk.withContext(function($ctx1) {
  865. var $1,$2;
  866. position=_st(self)._positionOf_(aListItem);
  867. parent=_st(aListItem)._parent();
  868. $1=_st(_st(_st(aListItem)._position())._top()).__lt((0));
  869. if(smalltalk.assert($1)){
  870. _st(_st(parent)._get_((0)))._scrollTop_(_st(_st(_st(_st(parent)._get_((0)))._scrollTop()).__plus(_st(_st(aListItem)._position())._top())).__minus((10)));
  871. };
  872. $2=_st(_st(_st(_st(aListItem)._position())._top()).__plus(_st(aListItem)._height())).__gt(_st(parent)._height());
  873. if(smalltalk.assert($2)){
  874. _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)));
  875. };
  876. return self}, function($ctx1) {$ctx1.fill(self,"ensureVisible:",{aListItem:aListItem,perent:perent,position:position},smalltalk.HLListWidget)})},
  877. args: ["aListItem"],
  878. source: "ensureVisible: aListItem\x09\x0a\x09\x22Move the scrollbar to show the active element\x22\x0a\x09\x0a\x09| perent position |\x0a\x09\x0a\x09position := self positionOf: aListItem.\x0a\x09parent := aListItem parent.\x0a\x09\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 ]",
  879. messageSends: ["positionOf:", "parent", "ifTrue:", "scrollTop:", "-", "+", "top", "position", "scrollTop", "get:", "<", "height", ">"],
  880. referencedClasses: []
  881. }),
  882. smalltalk.HLListWidget);
  883. smalltalk.addMethod(
  884. smalltalk.method({
  885. selector: "focus",
  886. category: 'actions',
  887. fn: function (){
  888. var self=this;
  889. return smalltalk.withContext(function($ctx1) {
  890. var $1,$2;
  891. smalltalk.HLFocusableWidget.fn.prototype._focus.apply(_st(self), []);
  892. $1=_st(_st(self)._items())._isEmpty();
  893. if(! smalltalk.assert($1)){
  894. $2=_st(self)._selectedItem();
  895. if(($receiver = $2) == nil || $receiver == undefined){
  896. _st(self)._activateFirstListItem();
  897. } else {
  898. $2;
  899. };
  900. };
  901. return self}, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLListWidget)})},
  902. args: [],
  903. source: "focus\x0a\x09super focus.\x0a self items isEmpty ifFalse: [ \x0a\x09\x09self selectedItem ifNil: [ self activateFirstListItem ] ]",
  904. messageSends: ["focus", "ifFalse:", "ifNil:", "activateFirstListItem", "selectedItem", "isEmpty", "items"],
  905. referencedClasses: []
  906. }),
  907. smalltalk.HLListWidget);
  908. smalltalk.addMethod(
  909. smalltalk.method({
  910. selector: "iconForItem:",
  911. category: 'accessing',
  912. fn: function (anObject){
  913. var self=this;
  914. return smalltalk.withContext(function($ctx1) {
  915. return "";
  916. }, function($ctx1) {$ctx1.fill(self,"iconForItem:",{anObject:anObject},smalltalk.HLListWidget)})},
  917. args: ["anObject"],
  918. source: "iconForItem: anObject\x0a\x09^ ''",
  919. messageSends: [],
  920. referencedClasses: []
  921. }),
  922. smalltalk.HLListWidget);
  923. smalltalk.addMethod(
  924. smalltalk.method({
  925. selector: "initialize",
  926. category: 'initialization',
  927. fn: function (){
  928. var self=this;
  929. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  930. return smalltalk.withContext(function($ctx1) {
  931. smalltalk.HLFocusableWidget.fn.prototype._initialize.apply(_st(self), []);
  932. self["@mapping"]=_st($Dictionary())._new();
  933. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.HLListWidget)})},
  934. args: [],
  935. source: "initialize\x0a\x09super initialize.\x0a\x09\x0a\x09mapping := Dictionary new.",
  936. messageSends: ["initialize", "new"],
  937. referencedClasses: ["Dictionary"]
  938. }),
  939. smalltalk.HLListWidget);
  940. smalltalk.addMethod(
  941. smalltalk.method({
  942. selector: "items",
  943. category: 'accessing',
  944. fn: function (){
  945. var self=this;
  946. return smalltalk.withContext(function($ctx1) {
  947. var $2,$1;
  948. $2=self["@items"];
  949. if(($receiver = $2) == nil || $receiver == undefined){
  950. self["@items"]=_st(self)._defaultItems();
  951. $1=self["@items"];
  952. } else {
  953. $1=$2;
  954. };
  955. return $1;
  956. }, function($ctx1) {$ctx1.fill(self,"items",{},smalltalk.HLListWidget)})},
  957. args: [],
  958. source: "items\x0a\x09^ items ifNil: [ items := self defaultItems ]",
  959. messageSends: ["ifNil:", "defaultItems"],
  960. referencedClasses: []
  961. }),
  962. smalltalk.HLListWidget);
  963. smalltalk.addMethod(
  964. smalltalk.method({
  965. selector: "items:",
  966. category: 'accessing',
  967. fn: function (aCollection){
  968. var self=this;
  969. return smalltalk.withContext(function($ctx1) {
  970. self["@items"]=aCollection;
  971. return self}, function($ctx1) {$ctx1.fill(self,"items:",{aCollection:aCollection},smalltalk.HLListWidget)})},
  972. args: ["aCollection"],
  973. source: "items: aCollection\x0a\x09items := aCollection",
  974. messageSends: [],
  975. referencedClasses: []
  976. }),
  977. smalltalk.HLListWidget);
  978. smalltalk.addMethod(
  979. smalltalk.method({
  980. selector: "positionOf:",
  981. category: 'accessing',
  982. fn: function (aListItem){
  983. var self=this;
  984. return smalltalk.withContext(function($ctx1) {
  985. return aListItem.parent().children().get().indexOf(aListItem.get(0)) + 1
  986. ;
  987. return self}, function($ctx1) {$ctx1.fill(self,"positionOf:",{aListItem:aListItem},smalltalk.HLListWidget)})},
  988. args: ["aListItem"],
  989. source: "positionOf: aListItem\x0a\x09<\x0a \x09return aListItem.parent().children().get().indexOf(aListItem.get(0)) + 1\x0a\x09>",
  990. messageSends: [],
  991. referencedClasses: []
  992. }),
  993. smalltalk.HLListWidget);
  994. smalltalk.addMethod(
  995. smalltalk.method({
  996. selector: "refresh",
  997. category: 'actions',
  998. fn: function (){
  999. var self=this;
  1000. return smalltalk.withContext(function($ctx1) {
  1001. var $1;
  1002. var $early={};
  1003. try {
  1004. smalltalk.HLFocusableWidget.fn.prototype._refresh.apply(_st(self), []);
  1005. _st(self)._ensureVisible_(_st(_st(self["@mapping"])._at_ifAbsent_(_st(self)._selectedItem(),(function(){
  1006. return smalltalk.withContext(function($ctx2) {
  1007. $1=self;
  1008. throw $early=[$1];
  1009. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._asJQuery());
  1010. return self}
  1011. catch(e) {if(e===$early)return e[0]; throw e}
  1012. }, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.HLListWidget)})},
  1013. args: [],
  1014. source: "refresh\x0a\x09super refresh.\x0a\x09\x0a\x09self ensureVisible: (mapping \x0a\x09\x09at: self selectedItem\x0a\x09\x09ifAbsent: [ ^ self ]) asJQuery",
  1015. messageSends: ["refresh", "ensureVisible:", "asJQuery", "at:ifAbsent:", "selectedItem"],
  1016. referencedClasses: []
  1017. }),
  1018. smalltalk.HLListWidget);
  1019. smalltalk.addMethod(
  1020. smalltalk.method({
  1021. selector: "registerMappingFrom:to:",
  1022. category: 'private',
  1023. fn: function (anObject,aTag){
  1024. var self=this;
  1025. return smalltalk.withContext(function($ctx1) {
  1026. _st(self["@mapping"])._at_put_(anObject,aTag);
  1027. return self}, function($ctx1) {$ctx1.fill(self,"registerMappingFrom:to:",{anObject:anObject,aTag:aTag},smalltalk.HLListWidget)})},
  1028. args: ["anObject", "aTag"],
  1029. source: "registerMappingFrom: anObject to: aTag\x0a\x09mapping at: anObject put: aTag",
  1030. messageSends: ["at:put:"],
  1031. referencedClasses: []
  1032. }),
  1033. smalltalk.HLListWidget);
  1034. smalltalk.addMethod(
  1035. smalltalk.method({
  1036. selector: "renderButtonsOn:",
  1037. category: 'rendering',
  1038. fn: function (html){
  1039. var self=this;
  1040. return smalltalk.withContext(function($ctx1) {
  1041. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},smalltalk.HLListWidget)})},
  1042. args: ["html"],
  1043. source: "renderButtonsOn: html",
  1044. messageSends: [],
  1045. referencedClasses: []
  1046. }),
  1047. smalltalk.HLListWidget);
  1048. smalltalk.addMethod(
  1049. smalltalk.method({
  1050. selector: "renderContentOn:",
  1051. category: 'rendering',
  1052. fn: function (html){
  1053. var self=this;
  1054. return smalltalk.withContext(function($ctx1) {
  1055. var $1,$2,$3,$4;
  1056. $1=_st(html)._ul();
  1057. _st($1)._class_("nav nav-pills nav-stacked");
  1058. $2=_st($1)._with_((function(){
  1059. return smalltalk.withContext(function($ctx2) {
  1060. return _st(self)._renderListOn_(html);
  1061. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1062. $3=_st(html)._div();
  1063. _st($3)._class_("pane_actions form-actions");
  1064. $4=_st($3)._with_((function(){
  1065. return smalltalk.withContext(function($ctx2) {
  1066. return _st(self)._renderButtonsOn_(html);
  1067. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1068. _st(self)._setupKeyBindings();
  1069. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLListWidget)})},
  1070. args: ["html"],
  1071. 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",
  1072. messageSends: ["class:", "ul", "with:", "renderListOn:", "div", "renderButtonsOn:", "setupKeyBindings"],
  1073. referencedClasses: []
  1074. }),
  1075. smalltalk.HLListWidget);
  1076. smalltalk.addMethod(
  1077. smalltalk.method({
  1078. selector: "renderItem:on:",
  1079. category: 'rendering',
  1080. fn: function (anObject,html){
  1081. var self=this;
  1082. var li;
  1083. return smalltalk.withContext(function($ctx1) {
  1084. var $1,$3,$4,$2;
  1085. li=_st(html)._li();
  1086. _st(self)._registerMappingFrom_to_(anObject,li);
  1087. $1=li;
  1088. _st($1)._class_(_st(self)._cssClassForItem_(anObject));
  1089. _st($1)._at_put_("list-data",_st(_st(_st(self)._items())._indexOf_(anObject))._asString());
  1090. $2=_st($1)._with_((function(){
  1091. return smalltalk.withContext(function($ctx2) {
  1092. $3=_st(html)._a();
  1093. _st($3)._with_((function(){
  1094. return smalltalk.withContext(function($ctx3) {
  1095. _st(_st(html)._tag_("i"))._class_(_st(self)._iconForItem_(anObject));
  1096. return _st(self)._renderItemLabel_on_(anObject,html);
  1097. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1098. $4=_st($3)._onClick_((function(){
  1099. return smalltalk.withContext(function($ctx3) {
  1100. return _st(self)._activateListItem_(_st(li)._asJQuery());
  1101. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1102. return $4;
  1103. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1104. return self}, function($ctx1) {$ctx1.fill(self,"renderItem:on:",{anObject:anObject,html:html,li:li},smalltalk.HLListWidget)})},
  1105. args: ["anObject", "html"],
  1106. 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 ] ]",
  1107. messageSends: ["li", "registerMappingFrom:to:", "class:", "cssClassForItem:", "at:put:", "asString", "indexOf:", "items", "with:", "iconForItem:", "tag:", "renderItemLabel:on:", "a", "onClick:", "activateListItem:", "asJQuery"],
  1108. referencedClasses: []
  1109. }),
  1110. smalltalk.HLListWidget);
  1111. smalltalk.addMethod(
  1112. smalltalk.method({
  1113. selector: "renderItemLabel:on:",
  1114. category: 'rendering',
  1115. fn: function (anObject,html){
  1116. var self=this;
  1117. return smalltalk.withContext(function($ctx1) {
  1118. _st(html)._with_(_st(anObject)._asString());
  1119. return self}, function($ctx1) {$ctx1.fill(self,"renderItemLabel:on:",{anObject:anObject,html:html},smalltalk.HLListWidget)})},
  1120. args: ["anObject", "html"],
  1121. source: "renderItemLabel: anObject on: html\x0a\x09html with: anObject asString",
  1122. messageSends: ["with:", "asString"],
  1123. referencedClasses: []
  1124. }),
  1125. smalltalk.HLListWidget);
  1126. smalltalk.addMethod(
  1127. smalltalk.method({
  1128. selector: "renderListOn:",
  1129. category: 'rendering',
  1130. fn: function (html){
  1131. var self=this;
  1132. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  1133. return smalltalk.withContext(function($ctx1) {
  1134. self["@mapping"]=_st($Dictionary())._new();
  1135. _st(_st(self)._items())._do_((function(each){
  1136. return smalltalk.withContext(function($ctx2) {
  1137. return _st(self)._renderItem_on_(each,html);
  1138. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1139. return self}, function($ctx1) {$ctx1.fill(self,"renderListOn:",{html:html},smalltalk.HLListWidget)})},
  1140. args: ["html"],
  1141. source: "renderListOn: html\x0a\x09mapping := Dictionary new.\x0a\x09\x0a\x09self items do: [ :each | \x0a \x09self renderItem: each on: html ]",
  1142. messageSends: ["new", "do:", "renderItem:on:", "items"],
  1143. referencedClasses: ["Dictionary"]
  1144. }),
  1145. smalltalk.HLListWidget);
  1146. smalltalk.addMethod(
  1147. smalltalk.method({
  1148. selector: "selectItem:",
  1149. category: 'actions',
  1150. fn: function (anObject){
  1151. var self=this;
  1152. return smalltalk.withContext(function($ctx1) {
  1153. _st(self)._selectedItem_(anObject);
  1154. return self}, function($ctx1) {$ctx1.fill(self,"selectItem:",{anObject:anObject},smalltalk.HLListWidget)})},
  1155. args: ["anObject"],
  1156. source: "selectItem: anObject\x0a\x09self selectedItem: anObject",
  1157. messageSends: ["selectedItem:"],
  1158. referencedClasses: []
  1159. }),
  1160. smalltalk.HLListWidget);
  1161. smalltalk.addMethod(
  1162. smalltalk.method({
  1163. selector: "selectedItem",
  1164. category: 'accessing',
  1165. fn: function (){
  1166. var self=this;
  1167. return smalltalk.withContext(function($ctx1) {
  1168. var $1;
  1169. $1=self["@selectedItem"];
  1170. return $1;
  1171. }, function($ctx1) {$ctx1.fill(self,"selectedItem",{},smalltalk.HLListWidget)})},
  1172. args: [],
  1173. source: "selectedItem\x0a\x09^ selectedItem",
  1174. messageSends: [],
  1175. referencedClasses: []
  1176. }),
  1177. smalltalk.HLListWidget);
  1178. smalltalk.addMethod(
  1179. smalltalk.method({
  1180. selector: "selectedItem:",
  1181. category: 'accessing',
  1182. fn: function (anObject){
  1183. var self=this;
  1184. return smalltalk.withContext(function($ctx1) {
  1185. self["@selectedItem"]=anObject;
  1186. return self}, function($ctx1) {$ctx1.fill(self,"selectedItem:",{anObject:anObject},smalltalk.HLListWidget)})},
  1187. args: ["anObject"],
  1188. source: "selectedItem: anObject\x0a\x09selectedItem := anObject",
  1189. messageSends: [],
  1190. referencedClasses: []
  1191. }),
  1192. smalltalk.HLListWidget);
  1193. smalltalk.addMethod(
  1194. smalltalk.method({
  1195. selector: "setupKeyBindings",
  1196. category: 'events',
  1197. fn: function (){
  1198. var self=this;
  1199. var active,interval,delay,repeatInterval;
  1200. return smalltalk.withContext(function($ctx1) {
  1201. var $1,$2,$3,$4,$5;
  1202. active=false;
  1203. repeatInterval=(70);
  1204. _st(_st(_st(self)._wrapper())._asJQuery())._unbind_("keydown");
  1205. _st(_st(_st(self)._wrapper())._asJQuery())._keydown_((function(e){
  1206. return smalltalk.withContext(function($ctx2) {
  1207. $1=_st(_st(_st(e)._which()).__eq((38)))._and_((function(){
  1208. return smalltalk.withContext(function($ctx3) {
  1209. return _st(active).__eq(false);
  1210. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1211. if(smalltalk.assert($1)){
  1212. active=true;
  1213. active;
  1214. _st(self)._activatePreviousListItem();
  1215. delay=_st((function(){
  1216. return smalltalk.withContext(function($ctx3) {
  1217. interval=_st((function(){
  1218. return smalltalk.withContext(function($ctx4) {
  1219. return _st(self)._activatePreviousListItem();
  1220. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}))._valueWithInterval_(repeatInterval);
  1221. return interval;
  1222. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}))._valueWithTimeout_((300));
  1223. delay;
  1224. };
  1225. $2=_st(_st(_st(e)._which()).__eq((40)))._and_((function(){
  1226. return smalltalk.withContext(function($ctx3) {
  1227. return _st(active).__eq(false);
  1228. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1229. if(smalltalk.assert($2)){
  1230. active=true;
  1231. active;
  1232. _st(self)._activateNextListItem();
  1233. delay=_st((function(){
  1234. return smalltalk.withContext(function($ctx3) {
  1235. interval=_st((function(){
  1236. return smalltalk.withContext(function($ctx4) {
  1237. return _st(self)._activateNextListItem();
  1238. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}))._valueWithInterval_(repeatInterval);
  1239. return interval;
  1240. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}))._valueWithTimeout_((300));
  1241. return delay;
  1242. };
  1243. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1)})}));
  1244. _st(_st(_st(self)._wrapper())._asJQuery())._keyup_((function(e){
  1245. return smalltalk.withContext(function($ctx2) {
  1246. $3=active;
  1247. if(smalltalk.assert($3)){
  1248. active=false;
  1249. active;
  1250. $4=interval;
  1251. if(($receiver = $4) == nil || $receiver == undefined){
  1252. $4;
  1253. } else {
  1254. _st(interval)._clearInterval();
  1255. };
  1256. $5=delay;
  1257. if(($receiver = $5) == nil || $receiver == undefined){
  1258. return $5;
  1259. } else {
  1260. return _st(delay)._clearTimeout();
  1261. };
  1262. };
  1263. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1)})}));
  1264. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyBindings",{active:active,interval:interval,delay:delay,repeatInterval:repeatInterval},smalltalk.HLListWidget)})},
  1265. args: [],
  1266. 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] ] ]",
  1267. messageSends: ["unbind:", "asJQuery", "wrapper", "keydown:", "ifTrue:", "activatePreviousListItem", "valueWithTimeout:", "valueWithInterval:", "and:", "=", "which", "activateNextListItem", "keyup:", "ifNotNil:", "clearInterval", "clearTimeout"],
  1268. referencedClasses: []
  1269. }),
  1270. smalltalk.HLListWidget);
  1271. smalltalk.addClass('HLNavigationListWidget', smalltalk.HLListWidget, ['previous', 'next'], 'Helios-Core');
  1272. smalltalk.addMethod(
  1273. smalltalk.method({
  1274. selector: "next",
  1275. category: 'accessing',
  1276. fn: function (){
  1277. var self=this;
  1278. return smalltalk.withContext(function($ctx1) {
  1279. var $1;
  1280. $1=self["@next"];
  1281. return $1;
  1282. }, function($ctx1) {$ctx1.fill(self,"next",{},smalltalk.HLNavigationListWidget)})},
  1283. args: [],
  1284. source: "next\x0a\x09^ next",
  1285. messageSends: [],
  1286. referencedClasses: []
  1287. }),
  1288. smalltalk.HLNavigationListWidget);
  1289. smalltalk.addMethod(
  1290. smalltalk.method({
  1291. selector: "next:",
  1292. category: 'accessing',
  1293. fn: function (aWidget){
  1294. var self=this;
  1295. return smalltalk.withContext(function($ctx1) {
  1296. var $1;
  1297. self["@next"]=aWidget;
  1298. $1=_st(_st(aWidget)._previous()).__eq(self);
  1299. if(! smalltalk.assert($1)){
  1300. _st(aWidget)._previous_(self);
  1301. };
  1302. return self}, function($ctx1) {$ctx1.fill(self,"next:",{aWidget:aWidget},smalltalk.HLNavigationListWidget)})},
  1303. args: ["aWidget"],
  1304. source: "next: aWidget\x0a\x09next := aWidget.\x0a aWidget previous = self ifFalse: [ aWidget previous: self ]",
  1305. messageSends: ["ifFalse:", "previous:", "=", "previous"],
  1306. referencedClasses: []
  1307. }),
  1308. smalltalk.HLNavigationListWidget);
  1309. smalltalk.addMethod(
  1310. smalltalk.method({
  1311. selector: "nextFocus",
  1312. category: 'actions',
  1313. fn: function (){
  1314. var self=this;
  1315. return smalltalk.withContext(function($ctx1) {
  1316. var $1;
  1317. $1=_st(self)._next();
  1318. if(($receiver = $1) == nil || $receiver == undefined){
  1319. $1;
  1320. } else {
  1321. _st(_st(self)._next())._focus();
  1322. };
  1323. return self}, function($ctx1) {$ctx1.fill(self,"nextFocus",{},smalltalk.HLNavigationListWidget)})},
  1324. args: [],
  1325. source: "nextFocus\x0a\x09self next ifNotNil: [ self next focus ]",
  1326. messageSends: ["ifNotNil:", "focus", "next"],
  1327. referencedClasses: []
  1328. }),
  1329. smalltalk.HLNavigationListWidget);
  1330. smalltalk.addMethod(
  1331. smalltalk.method({
  1332. selector: "previous",
  1333. category: 'accessing',
  1334. fn: function (){
  1335. var self=this;
  1336. return smalltalk.withContext(function($ctx1) {
  1337. var $1;
  1338. $1=self["@previous"];
  1339. return $1;
  1340. }, function($ctx1) {$ctx1.fill(self,"previous",{},smalltalk.HLNavigationListWidget)})},
  1341. args: [],
  1342. source: "previous\x0a\x09^ previous",
  1343. messageSends: [],
  1344. referencedClasses: []
  1345. }),
  1346. smalltalk.HLNavigationListWidget);
  1347. smalltalk.addMethod(
  1348. smalltalk.method({
  1349. selector: "previous:",
  1350. category: 'accessing',
  1351. fn: function (aWidget){
  1352. var self=this;
  1353. return smalltalk.withContext(function($ctx1) {
  1354. var $1;
  1355. self["@previous"]=aWidget;
  1356. $1=_st(_st(aWidget)._next()).__eq(self);
  1357. if(! smalltalk.assert($1)){
  1358. _st(aWidget)._next_(self);
  1359. };
  1360. return self}, function($ctx1) {$ctx1.fill(self,"previous:",{aWidget:aWidget},smalltalk.HLNavigationListWidget)})},
  1361. args: ["aWidget"],
  1362. source: "previous: aWidget\x0a\x09previous := aWidget.\x0a aWidget next = self ifFalse: [ aWidget next: self ]",
  1363. messageSends: ["ifFalse:", "next:", "=", "next"],
  1364. referencedClasses: []
  1365. }),
  1366. smalltalk.HLNavigationListWidget);
  1367. smalltalk.addMethod(
  1368. smalltalk.method({
  1369. selector: "previousFocus",
  1370. category: 'actions',
  1371. fn: function (){
  1372. var self=this;
  1373. return smalltalk.withContext(function($ctx1) {
  1374. var $1;
  1375. $1=_st(self)._previous();
  1376. if(($receiver = $1) == nil || $receiver == undefined){
  1377. $1;
  1378. } else {
  1379. _st(_st(self)._previous())._focus();
  1380. };
  1381. return self}, function($ctx1) {$ctx1.fill(self,"previousFocus",{},smalltalk.HLNavigationListWidget)})},
  1382. args: [],
  1383. source: "previousFocus\x0a\x09self previous ifNotNil: [ self previous focus ]",
  1384. messageSends: ["ifNotNil:", "focus", "previous"],
  1385. referencedClasses: []
  1386. }),
  1387. smalltalk.HLNavigationListWidget);
  1388. smalltalk.addMethod(
  1389. smalltalk.method({
  1390. selector: "setupKeyBindings",
  1391. category: 'events',
  1392. fn: function (){
  1393. var self=this;
  1394. return smalltalk.withContext(function($ctx1) {
  1395. var $1,$2;
  1396. smalltalk.HLListWidget.fn.prototype._setupKeyBindings.apply(_st(self), []);
  1397. _st(_st(_st(self)._wrapper())._asJQuery())._keydown_((function(e){
  1398. return smalltalk.withContext(function($ctx2) {
  1399. $1=_st(_st(e)._which()).__eq((39));
  1400. if(smalltalk.assert($1)){
  1401. _st(self)._nextFocus();
  1402. };
  1403. $2=_st(_st(e)._which()).__eq((37));
  1404. if(smalltalk.assert($2)){
  1405. return _st(self)._previousFocus();
  1406. };
  1407. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1)})}));
  1408. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyBindings",{},smalltalk.HLNavigationListWidget)})},
  1409. args: [],
  1410. 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 ] ]",
  1411. messageSends: ["setupKeyBindings", "keydown:", "ifTrue:", "nextFocus", "=", "which", "previousFocus", "asJQuery", "wrapper"],
  1412. referencedClasses: []
  1413. }),
  1414. smalltalk.HLNavigationListWidget);
  1415. smalltalk.addClass('HLManager', smalltalk.HLWidget, ['tabs', 'activeTab', 'keyBinder', 'environment', 'history'], 'Helios-Core');
  1416. smalltalk.addMethod(
  1417. smalltalk.method({
  1418. selector: "activate:",
  1419. category: 'actions',
  1420. fn: function (aTab){
  1421. var self=this;
  1422. return smalltalk.withContext(function($ctx1) {
  1423. var $1,$2;
  1424. _st(_st(self)._keyBinder())._flushBindings();
  1425. _st(aTab)._registerBindings();
  1426. self["@activeTab"]=aTab;
  1427. $1=self;
  1428. _st($1)._refresh();
  1429. _st($1)._addToHistory_(aTab);
  1430. $2=_st($1)._show_(aTab);
  1431. return self}, function($ctx1) {$ctx1.fill(self,"activate:",{aTab:aTab},smalltalk.HLManager)})},
  1432. args: ["aTab"],
  1433. 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",
  1434. messageSends: ["flushBindings", "keyBinder", "registerBindings", "refresh", "addToHistory:", "show:"],
  1435. referencedClasses: []
  1436. }),
  1437. smalltalk.HLManager);
  1438. smalltalk.addMethod(
  1439. smalltalk.method({
  1440. selector: "activeTab",
  1441. category: 'accessing',
  1442. fn: function (){
  1443. var self=this;
  1444. return smalltalk.withContext(function($ctx1) {
  1445. var $1;
  1446. $1=self["@activeTab"];
  1447. return $1;
  1448. }, function($ctx1) {$ctx1.fill(self,"activeTab",{},smalltalk.HLManager)})},
  1449. args: [],
  1450. source: "activeTab\x0a\x09^ activeTab",
  1451. messageSends: [],
  1452. referencedClasses: []
  1453. }),
  1454. smalltalk.HLManager);
  1455. smalltalk.addMethod(
  1456. smalltalk.method({
  1457. selector: "addTab:",
  1458. category: 'actions',
  1459. fn: function (aTab){
  1460. var self=this;
  1461. return smalltalk.withContext(function($ctx1) {
  1462. _st(_st(self)._tabs())._add_(aTab);
  1463. _st(self)._activate_(aTab);
  1464. return self}, function($ctx1) {$ctx1.fill(self,"addTab:",{aTab:aTab},smalltalk.HLManager)})},
  1465. args: ["aTab"],
  1466. source: "addTab: aTab\x0a\x09self tabs add: aTab.\x0a self activate: aTab",
  1467. messageSends: ["add:", "tabs", "activate:"],
  1468. referencedClasses: []
  1469. }),
  1470. smalltalk.HLManager);
  1471. smalltalk.addMethod(
  1472. smalltalk.method({
  1473. selector: "addToHistory:",
  1474. category: 'actions',
  1475. fn: function (aTab){
  1476. var self=this;
  1477. return smalltalk.withContext(function($ctx1) {
  1478. _st(self)._removeFromHistory_(aTab);
  1479. _st(_st(self)._history())._add_(aTab);
  1480. return self}, function($ctx1) {$ctx1.fill(self,"addToHistory:",{aTab:aTab},smalltalk.HLManager)})},
  1481. args: ["aTab"],
  1482. source: "addToHistory: aTab\x0a\x09self removeFromHistory: aTab.\x0a\x09self history add: aTab",
  1483. messageSends: ["removeFromHistory:", "add:", "history"],
  1484. referencedClasses: []
  1485. }),
  1486. smalltalk.HLManager);
  1487. smalltalk.addMethod(
  1488. smalltalk.method({
  1489. selector: "defaultEnvironment",
  1490. category: 'defaults',
  1491. fn: function (){
  1492. var self=this;
  1493. function $Environment(){return smalltalk.Environment||(typeof Environment=="undefined"?nil:Environment)}
  1494. return smalltalk.withContext(function($ctx1) {
  1495. var $1,$2,$3;
  1496. $1=_st(window)._parent();
  1497. if(($receiver = $1) == nil || $receiver == undefined){
  1498. $2=_st($Environment())._new();
  1499. return $2;
  1500. } else {
  1501. $1;
  1502. };
  1503. $3=_st(_st(_st(_st(window)._parent())._at_("smalltalk"))._at_("Environment"))._new();
  1504. return $3;
  1505. }, function($ctx1) {$ctx1.fill(self,"defaultEnvironment",{},smalltalk.HLManager)})},
  1506. args: [],
  1507. 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",
  1508. messageSends: ["ifNil:", "new", "parent", "at:"],
  1509. referencedClasses: ["Environment"]
  1510. }),
  1511. smalltalk.HLManager);
  1512. smalltalk.addMethod(
  1513. smalltalk.method({
  1514. selector: "environment",
  1515. category: 'accessing',
  1516. fn: function (){
  1517. var self=this;
  1518. return smalltalk.withContext(function($ctx1) {
  1519. var $2,$1;
  1520. $2=self["@environment"];
  1521. if(($receiver = $2) == nil || $receiver == undefined){
  1522. self["@environment"]=_st(self)._defaultEnvironment();
  1523. $1=self["@environment"];
  1524. } else {
  1525. $1=$2;
  1526. };
  1527. return $1;
  1528. }, function($ctx1) {$ctx1.fill(self,"environment",{},smalltalk.HLManager)})},
  1529. args: [],
  1530. source: "environment\x0a\x09\x22The default environment used by all Helios objects\x22\x0a \x0a\x09^ environment ifNil: [ environment := self defaultEnvironment ]",
  1531. messageSends: ["ifNil:", "defaultEnvironment"],
  1532. referencedClasses: []
  1533. }),
  1534. smalltalk.HLManager);
  1535. smalltalk.addMethod(
  1536. smalltalk.method({
  1537. selector: "environment:",
  1538. category: 'accessing',
  1539. fn: function (anEnvironment){
  1540. var self=this;
  1541. return smalltalk.withContext(function($ctx1) {
  1542. self["@environment"]=anEnvironment;
  1543. return self}, function($ctx1) {$ctx1.fill(self,"environment:",{anEnvironment:anEnvironment},smalltalk.HLManager)})},
  1544. args: ["anEnvironment"],
  1545. source: "environment: anEnvironment\x0a\x09environment := anEnvironment",
  1546. messageSends: [],
  1547. referencedClasses: []
  1548. }),
  1549. smalltalk.HLManager);
  1550. smalltalk.addMethod(
  1551. smalltalk.method({
  1552. selector: "history",
  1553. category: 'accessing',
  1554. fn: function (){
  1555. var self=this;
  1556. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  1557. return smalltalk.withContext(function($ctx1) {
  1558. var $2,$1;
  1559. $2=self["@history"];
  1560. if(($receiver = $2) == nil || $receiver == undefined){
  1561. self["@history"]=_st($OrderedCollection())._new();
  1562. $1=self["@history"];
  1563. } else {
  1564. $1=$2;
  1565. };
  1566. return $1;
  1567. }, function($ctx1) {$ctx1.fill(self,"history",{},smalltalk.HLManager)})},
  1568. args: [],
  1569. source: "history\x0a\x09^ history ifNil: [ history := OrderedCollection new ]",
  1570. messageSends: ["ifNil:", "new"],
  1571. referencedClasses: ["OrderedCollection"]
  1572. }),
  1573. smalltalk.HLManager);
  1574. smalltalk.addMethod(
  1575. smalltalk.method({
  1576. selector: "history:",
  1577. category: 'accessing',
  1578. fn: function (aCollection){
  1579. var self=this;
  1580. return smalltalk.withContext(function($ctx1) {
  1581. self["@history"]=aCollection;
  1582. return self}, function($ctx1) {$ctx1.fill(self,"history:",{aCollection:aCollection},smalltalk.HLManager)})},
  1583. args: ["aCollection"],
  1584. source: "history: aCollection\x0a\x09history := aCollection",
  1585. messageSends: [],
  1586. referencedClasses: []
  1587. }),
  1588. smalltalk.HLManager);
  1589. smalltalk.addMethod(
  1590. smalltalk.method({
  1591. selector: "initialize",
  1592. category: 'initialization',
  1593. fn: function (){
  1594. var self=this;
  1595. return smalltalk.withContext(function($ctx1) {
  1596. smalltalk.HLWidget.fn.prototype._initialize.apply(_st(self), []);
  1597. _st(_st(self)._keyBinder())._setupEvents();
  1598. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.HLManager)})},
  1599. args: [],
  1600. source: "initialize\x0a\x09super initialize.\x0a self keyBinder setupEvents",
  1601. messageSends: ["initialize", "setupEvents", "keyBinder"],
  1602. referencedClasses: []
  1603. }),
  1604. smalltalk.HLManager);
  1605. smalltalk.addMethod(
  1606. smalltalk.method({
  1607. selector: "keyBinder",
  1608. category: 'accessing',
  1609. fn: function (){
  1610. var self=this;
  1611. function $HLKeyBinder(){return smalltalk.HLKeyBinder||(typeof HLKeyBinder=="undefined"?nil:HLKeyBinder)}
  1612. return smalltalk.withContext(function($ctx1) {
  1613. var $2,$1;
  1614. $2=self["@keyBinder"];
  1615. if(($receiver = $2) == nil || $receiver == undefined){
  1616. self["@keyBinder"]=_st($HLKeyBinder())._new();
  1617. $1=self["@keyBinder"];
  1618. } else {
  1619. $1=$2;
  1620. };
  1621. return $1;
  1622. }, function($ctx1) {$ctx1.fill(self,"keyBinder",{},smalltalk.HLManager)})},
  1623. args: [],
  1624. source: "keyBinder\x0a\x09^ keyBinder ifNil: [ keyBinder := HLKeyBinder new ]",
  1625. messageSends: ["ifNil:", "new"],
  1626. referencedClasses: ["HLKeyBinder"]
  1627. }),
  1628. smalltalk.HLManager);
  1629. smalltalk.addMethod(
  1630. smalltalk.method({
  1631. selector: "refresh",
  1632. category: 'rendering',
  1633. fn: function (){
  1634. var self=this;
  1635. return smalltalk.withContext(function($ctx1) {
  1636. _st(_st(window)._jQuery_(".navbar"))._remove();
  1637. _st(self)._appendToJQuery_(_st("body")._asJQuery());
  1638. return self}, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.HLManager)})},
  1639. args: [],
  1640. source: "refresh\x0a\x09(window jQuery: '.navbar') remove.\x0a\x09self appendToJQuery: 'body' asJQuery",
  1641. messageSends: ["remove", "jQuery:", "appendToJQuery:", "asJQuery"],
  1642. referencedClasses: []
  1643. }),
  1644. smalltalk.HLManager);
  1645. smalltalk.addMethod(
  1646. smalltalk.method({
  1647. selector: "removeActiveTab",
  1648. category: 'actions',
  1649. fn: function (){
  1650. var self=this;
  1651. return smalltalk.withContext(function($ctx1) {
  1652. _st(self)._removeTab_(_st(self)._activeTab());
  1653. return self}, function($ctx1) {$ctx1.fill(self,"removeActiveTab",{},smalltalk.HLManager)})},
  1654. args: [],
  1655. source: "removeActiveTab\x0a\x09self removeTab: self activeTab",
  1656. messageSends: ["removeTab:", "activeTab"],
  1657. referencedClasses: []
  1658. }),
  1659. smalltalk.HLManager);
  1660. smalltalk.addMethod(
  1661. smalltalk.method({
  1662. selector: "removeFromHistory:",
  1663. category: 'actions',
  1664. fn: function (aTab){
  1665. var self=this;
  1666. return smalltalk.withContext(function($ctx1) {
  1667. _st(self)._history_(_st(_st(self)._history())._reject_((function(each){
  1668. return smalltalk.withContext(function($ctx2) {
  1669. return _st(each).__eq_eq(aTab);
  1670. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})));
  1671. return self}, function($ctx1) {$ctx1.fill(self,"removeFromHistory:",{aTab:aTab},smalltalk.HLManager)})},
  1672. args: ["aTab"],
  1673. source: "removeFromHistory: aTab\x0a\x09self history: (self history reject: [ :each | each == aTab ])",
  1674. messageSends: ["history:", "reject:", "==", "history"],
  1675. referencedClasses: []
  1676. }),
  1677. smalltalk.HLManager);
  1678. smalltalk.addMethod(
  1679. smalltalk.method({
  1680. selector: "removeTab:",
  1681. category: 'actions',
  1682. fn: function (aTab){
  1683. var self=this;
  1684. return smalltalk.withContext(function($ctx1) {
  1685. var $1,$2;
  1686. $1=_st(_st(self)._tabs())._includes_(aTab);
  1687. if(! smalltalk.assert($1)){
  1688. $2=self;
  1689. return $2;
  1690. };
  1691. _st(self)._removeFromHistory_(aTab);
  1692. _st(_st(self)._tabs())._remove_(aTab);
  1693. _st(_st(self)._keyBinder())._flushBindings();
  1694. _st(aTab)._remove();
  1695. _st(self)._refresh();
  1696. _st(_st(self)._history())._ifNotEmpty_((function(){
  1697. return smalltalk.withContext(function($ctx2) {
  1698. return _st(_st(_st(self)._history())._last())._activate();
  1699. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1700. return self}, function($ctx1) {$ctx1.fill(self,"removeTab:",{aTab:aTab},smalltalk.HLManager)})},
  1701. args: ["aTab"],
  1702. 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 ]",
  1703. messageSends: ["ifFalse:", "includes:", "tabs", "removeFromHistory:", "remove:", "flushBindings", "keyBinder", "remove", "refresh", "ifNotEmpty:", "activate", "last", "history"],
  1704. referencedClasses: []
  1705. }),
  1706. smalltalk.HLManager);
  1707. smalltalk.addMethod(
  1708. smalltalk.method({
  1709. selector: "renderAddOn:",
  1710. category: 'rendering',
  1711. fn: function (html){
  1712. var self=this;
  1713. function $HLWidget(){return smalltalk.HLWidget||(typeof HLWidget=="undefined"?nil:HLWidget)}
  1714. return smalltalk.withContext(function($ctx1) {
  1715. var $1,$3,$4,$5,$7,$8,$6,$2;
  1716. $1=_st(html)._li();
  1717. _st($1)._class_("dropdown");
  1718. $2=_st($1)._with_((function(){
  1719. return smalltalk.withContext(function($ctx2) {
  1720. $3=_st(html)._a();
  1721. _st($3)._class_("dropdown-toggle");
  1722. _st($3)._at_put_("data-toggle","dropdown");
  1723. $4=_st($3)._with_((function(){
  1724. return smalltalk.withContext(function($ctx3) {
  1725. _st(html)._with_("Open...");
  1726. return _st(_st(html)._tag_("b"))._class_("caret");
  1727. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1728. $4;
  1729. $5=_st(html)._ul();
  1730. _st($5)._class_("dropdown-menu");
  1731. $6=_st($5)._with_((function(){
  1732. return smalltalk.withContext(function($ctx3) {
  1733. return _st(_st(_st(_st($HLWidget())._withAllSubclasses())._select_((function(each){
  1734. return smalltalk.withContext(function($ctx4) {
  1735. return _st(each)._canBeOpenAsTab();
  1736. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx1)})})))._sorted_((function(a,b){
  1737. return smalltalk.withContext(function($ctx4) {
  1738. return _st(_st(a)._tabPriority()).__lt(_st(b)._tabPriority());
  1739. }, function($ctx4) {$ctx4.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(each){
  1740. return smalltalk.withContext(function($ctx4) {
  1741. return _st(_st(html)._li())._with_((function(){
  1742. return smalltalk.withContext(function($ctx5) {
  1743. $7=_st(html)._a();
  1744. _st($7)._with_(_st(each)._tabLabel());
  1745. $8=_st($7)._onClick_((function(){
  1746. return smalltalk.withContext(function($ctx6) {
  1747. return _st(each)._openAsTab();
  1748. }, function($ctx6) {$ctx6.fillBlock({},$ctx1)})}));
  1749. return $8;
  1750. }, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
  1751. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx1)})}));
  1752. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1753. return $6;
  1754. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1755. return self}, function($ctx1) {$ctx1.fill(self,"renderAddOn:",{html:html},smalltalk.HLManager)})},
  1756. args: ["html"],
  1757. 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 ] ] ] ] ]",
  1758. messageSends: ["class:", "li", "with:", "a", "at:put:", "tag:", "ul", "do:", "tabLabel", "onClick:", "openAsTab", "sorted:", "<", "tabPriority", "select:", "canBeOpenAsTab", "withAllSubclasses"],
  1759. referencedClasses: ["HLWidget"]
  1760. }),
  1761. smalltalk.HLManager);
  1762. smalltalk.addMethod(
  1763. smalltalk.method({
  1764. selector: "renderContentOn:",
  1765. category: 'rendering',
  1766. fn: function (html){
  1767. var self=this;
  1768. return smalltalk.withContext(function($ctx1) {
  1769. var $1,$3,$4,$2;
  1770. $1=_st(html)._div();
  1771. _st($1)._class_("navbar navbar-fixed-top");
  1772. $2=_st($1)._with_((function(){
  1773. return smalltalk.withContext(function($ctx2) {
  1774. $3=_st(html)._div();
  1775. _st($3)._class_("navbar-inner");
  1776. $4=_st($3)._with_((function(){
  1777. return smalltalk.withContext(function($ctx3) {
  1778. return _st(self)._renderTabsOn_(html);
  1779. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1780. return $4;
  1781. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1782. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLManager)})},
  1783. args: ["html"],
  1784. 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 ] ]",
  1785. messageSends: ["class:", "div", "with:", "renderTabsOn:"],
  1786. referencedClasses: []
  1787. }),
  1788. smalltalk.HLManager);
  1789. smalltalk.addMethod(
  1790. smalltalk.method({
  1791. selector: "renderTabsOn:",
  1792. category: 'rendering',
  1793. fn: function (html){
  1794. var self=this;
  1795. return smalltalk.withContext(function($ctx1) {
  1796. var $1,$3,$4,$6,$5,$8,$9,$7,$2;
  1797. $1=_st(html)._ul();
  1798. _st($1)._class_("nav");
  1799. $2=_st($1)._with_((function(){
  1800. return smalltalk.withContext(function($ctx2) {
  1801. _st(_st(self)._tabs())._do_((function(each){
  1802. return smalltalk.withContext(function($ctx3) {
  1803. $3=_st(html)._li();
  1804. $4=$3;
  1805. $6=_st(each)._isActive();
  1806. if(smalltalk.assert($6)){
  1807. $5="active";
  1808. } else {
  1809. $5="inactive";
  1810. };
  1811. _st($4)._class_($5);
  1812. $7=_st($3)._with_((function(){
  1813. return smalltalk.withContext(function($ctx4) {
  1814. $8=_st(html)._a();
  1815. _st($8)._with_((function(){
  1816. return smalltalk.withContext(function($ctx5) {
  1817. _st(_st(_st(html)._tag_("i"))._class_("icon-remove"))._onClick_((function(){
  1818. return smalltalk.withContext(function($ctx6) {
  1819. return _st(self)._removeTab_(each);
  1820. }, function($ctx6) {$ctx6.fillBlock({},$ctx1)})}));
  1821. return _st(html)._with_(_st(each)._displayLabel());
  1822. }, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
  1823. $9=_st($8)._onClick_((function(){
  1824. return smalltalk.withContext(function($ctx5) {
  1825. return _st(each)._activate();
  1826. }, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
  1827. return $9;
  1828. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
  1829. return $7;
  1830. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  1831. return _st(self)._renderAddOn_(html);
  1832. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1833. return self}, function($ctx1) {$ctx1.fill(self,"renderTabsOn:",{html:html},smalltalk.HLManager)})},
  1834. args: ["html"],
  1835. 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 ]",
  1836. messageSends: ["class:", "ul", "with:", "do:", "ifTrue:ifFalse:", "isActive", "li", "onClick:", "removeTab:", "tag:", "displayLabel", "a", "activate", "tabs", "renderAddOn:"],
  1837. referencedClasses: []
  1838. }),
  1839. smalltalk.HLManager);
  1840. smalltalk.addMethod(
  1841. smalltalk.method({
  1842. selector: "show:",
  1843. category: 'rendering',
  1844. fn: function (aTab){
  1845. var self=this;
  1846. return smalltalk.withContext(function($ctx1) {
  1847. var $1,$2;
  1848. _st(_st(self)._tabs())._do_((function(each){
  1849. return smalltalk.withContext(function($ctx2) {
  1850. return _st(each)._hide();
  1851. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1852. $1=aTab;
  1853. _st($1)._show();
  1854. $2=_st($1)._focus();
  1855. return self}, function($ctx1) {$ctx1.fill(self,"show:",{aTab:aTab},smalltalk.HLManager)})},
  1856. args: ["aTab"],
  1857. source: "show: aTab\x0a\x09self tabs do: [ :each | each hide ].\x0a\x09aTab show; focus",
  1858. messageSends: ["do:", "hide", "tabs", "show", "focus"],
  1859. referencedClasses: []
  1860. }),
  1861. smalltalk.HLManager);
  1862. smalltalk.addMethod(
  1863. smalltalk.method({
  1864. selector: "tabs",
  1865. category: 'accessing',
  1866. fn: function (){
  1867. var self=this;
  1868. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  1869. return smalltalk.withContext(function($ctx1) {
  1870. var $2,$1;
  1871. $2=self["@tabs"];
  1872. if(($receiver = $2) == nil || $receiver == undefined){
  1873. self["@tabs"]=_st($OrderedCollection())._new();
  1874. $1=self["@tabs"];
  1875. } else {
  1876. $1=$2;
  1877. };
  1878. return $1;
  1879. }, function($ctx1) {$ctx1.fill(self,"tabs",{},smalltalk.HLManager)})},
  1880. args: [],
  1881. source: "tabs\x0a\x09^ tabs ifNil: [ tabs := OrderedCollection new ]",
  1882. messageSends: ["ifNil:", "new"],
  1883. referencedClasses: ["OrderedCollection"]
  1884. }),
  1885. smalltalk.HLManager);
  1886. smalltalk.HLManager.klass.iVarNames = ['current'];
  1887. smalltalk.addMethod(
  1888. smalltalk.method({
  1889. selector: "current",
  1890. category: 'accessing',
  1891. fn: function (){
  1892. var self=this;
  1893. return smalltalk.withContext(function($ctx1) {
  1894. var $2,$1;
  1895. $2=self["@current"];
  1896. if(($receiver = $2) == nil || $receiver == undefined){
  1897. self["@current"]=_st(_st(self)._basicNew())._initialize();
  1898. $1=self["@current"];
  1899. } else {
  1900. $1=$2;
  1901. };
  1902. return $1;
  1903. }, function($ctx1) {$ctx1.fill(self,"current",{},smalltalk.HLManager.klass)})},
  1904. args: [],
  1905. source: "current\x0a\x09^ current ifNil: [ current := self basicNew initialize ]",
  1906. messageSends: ["ifNil:", "initialize", "basicNew"],
  1907. referencedClasses: []
  1908. }),
  1909. smalltalk.HLManager.klass);
  1910. smalltalk.addMethod(
  1911. smalltalk.method({
  1912. selector: "initialize",
  1913. category: 'initialization',
  1914. fn: function (){
  1915. var self=this;
  1916. return smalltalk.withContext(function($ctx1) {
  1917. _st(_st(self)._current())._appendToJQuery_(_st("body")._asJQuery());
  1918. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.HLManager.klass)})},
  1919. args: [],
  1920. source: "initialize\x0a\x09self current appendToJQuery: 'body' asJQuery",
  1921. messageSends: ["appendToJQuery:", "asJQuery", "current"],
  1922. referencedClasses: []
  1923. }),
  1924. smalltalk.HLManager.klass);
  1925. smalltalk.addMethod(
  1926. smalltalk.method({
  1927. selector: "new",
  1928. category: 'instance creation',
  1929. fn: function (){
  1930. var self=this;
  1931. return smalltalk.withContext(function($ctx1) {
  1932. _st(self)._shouldNotImplement();
  1933. return self}, function($ctx1) {$ctx1.fill(self,"new",{},smalltalk.HLManager.klass)})},
  1934. args: [],
  1935. source: "new\x0a\x09\x22Use current instead\x22\x0a\x0a\x09self shouldNotImplement",
  1936. messageSends: ["shouldNotImplement"],
  1937. referencedClasses: []
  1938. }),
  1939. smalltalk.HLManager.klass);
  1940. smalltalk.addClass('HLSUnit', smalltalk.HLWidget, [], 'Helios-Core');
  1941. smalltalk.addMethod(
  1942. smalltalk.method({
  1943. selector: "canBeOpenAsTab",
  1944. category: 'testing',
  1945. fn: function (){
  1946. var self=this;
  1947. return smalltalk.withContext(function($ctx1) {
  1948. return true;
  1949. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLSUnit.klass)})},
  1950. args: [],
  1951. source: "canBeOpenAsTab\x0a\x09^ true",
  1952. messageSends: [],
  1953. referencedClasses: []
  1954. }),
  1955. smalltalk.HLSUnit.klass);
  1956. smalltalk.addMethod(
  1957. smalltalk.method({
  1958. selector: "tabLabel",
  1959. category: 'accessing',
  1960. fn: function (){
  1961. var self=this;
  1962. return smalltalk.withContext(function($ctx1) {
  1963. return "SUnit";
  1964. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{},smalltalk.HLSUnit.klass)})},
  1965. args: [],
  1966. source: "tabLabel\x0a\x09^ 'SUnit'",
  1967. messageSends: [],
  1968. referencedClasses: []
  1969. }),
  1970. smalltalk.HLSUnit.klass);
  1971. smalltalk.addMethod(
  1972. smalltalk.method({
  1973. selector: "tabPriority",
  1974. category: 'accessing',
  1975. fn: function (){
  1976. var self=this;
  1977. return smalltalk.withContext(function($ctx1) {
  1978. var $1;
  1979. $1=(1000);
  1980. return $1;
  1981. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{},smalltalk.HLSUnit.klass)})},
  1982. args: [],
  1983. source: "tabPriority\x0a\x09^ 1000",
  1984. messageSends: [],
  1985. referencedClasses: []
  1986. }),
  1987. smalltalk.HLSUnit.klass);
  1988. smalltalk.addClass('HLTranscript', smalltalk.HLWidget, [], 'Helios-Core');
  1989. smalltalk.addMethod(
  1990. smalltalk.method({
  1991. selector: "canBeOpenAsTab",
  1992. category: 'testing',
  1993. fn: function (){
  1994. var self=this;
  1995. return smalltalk.withContext(function($ctx1) {
  1996. return true;
  1997. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLTranscript.klass)})},
  1998. args: [],
  1999. source: "canBeOpenAsTab\x0a\x09^ true",
  2000. messageSends: [],
  2001. referencedClasses: []
  2002. }),
  2003. smalltalk.HLTranscript.klass);
  2004. smalltalk.addMethod(
  2005. smalltalk.method({
  2006. selector: "tabLabel",
  2007. category: 'accessing',
  2008. fn: function (){
  2009. var self=this;
  2010. return smalltalk.withContext(function($ctx1) {
  2011. return "Transcript";
  2012. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{},smalltalk.HLTranscript.klass)})},
  2013. args: [],
  2014. source: "tabLabel\x0a\x09^ 'Transcript'",
  2015. messageSends: [],
  2016. referencedClasses: []
  2017. }),
  2018. smalltalk.HLTranscript.klass);
  2019. smalltalk.addMethod(
  2020. smalltalk.method({
  2021. selector: "tabPriority",
  2022. category: 'accessing',
  2023. fn: function (){
  2024. var self=this;
  2025. return smalltalk.withContext(function($ctx1) {
  2026. var $1;
  2027. $1=(600);
  2028. return $1;
  2029. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{},smalltalk.HLTranscript.klass)})},
  2030. args: [],
  2031. source: "tabPriority\x0a\x09^ 600",
  2032. messageSends: [],
  2033. referencedClasses: []
  2034. }),
  2035. smalltalk.HLTranscript.klass);