1
0

Helios-Core.js 67 KB

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