Helios-Core.js 70 KB

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