Helios-Core.js 58 KB

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