1
0

Helios-Core.js 71 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029
  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 active,selected,interval,repeatInterval;
  1101. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  1102. active=false;
  1103. repeatInterval=(60);
  1104. _st(_st(self["@hiddenInput"])._asJQuery())._unbind_("keydown");
  1105. _st(_st(self["@hiddenInput"])._asJQuery())._keydown_((function(e){
  1106. return smalltalk.withContext(function($ctx2) { $1=_st(_st(_st(e)._which()).__eq((38)))._and_((function(){
  1107. return smalltalk.withContext(function($ctx3) { return _st(active).__eq(false);
  1108. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1109. if(smalltalk.assert($1)){
  1110. active=true;
  1111. active;
  1112. interval=_st((function(){
  1113. return smalltalk.withContext(function($ctx3) { selected=_st(window)._jQuery_(".focused .nav-pills .active");
  1114. selected;
  1115. return _st(self)._activateListItem_(_st(selected)._prev());
  1116. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}))._valueWithInterval_(repeatInterval);
  1117. interval;
  1118. };
  1119. $2=_st(_st(_st(e)._which()).__eq((40)))._and_((function(){
  1120. return smalltalk.withContext(function($ctx3) { return _st(active).__eq(false);
  1121. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1122. if(smalltalk.assert($2)){
  1123. active=true;
  1124. active;
  1125. interval=_st((function(){
  1126. return smalltalk.withContext(function($ctx3) { selected=_st(window)._jQuery_(".focused .nav-pills .active");
  1127. selected;
  1128. return _st(self)._activateListItem_(_st(selected)._next());
  1129. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}))._valueWithInterval_(repeatInterval);
  1130. return interval;
  1131. };
  1132. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1)})}));
  1133. _st(_st(self["@hiddenInput"])._asJQuery())._keyup_((function(e){
  1134. return smalltalk.withContext(function($ctx2) { $3=active;
  1135. if(smalltalk.assert($3)){
  1136. active=false;
  1137. active;
  1138. return _st(interval)._clearInterval();
  1139. };
  1140. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1)})}));
  1141. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyBindings",{active:active,selected:selected,interval:interval,repeatInterval:repeatInterval},smalltalk.HLListWidget)})},
  1142. args: [],
  1143. source: "setupKeyBindings\x0a\x09\x22TODO: refactor\x22\x0a\x09| active selected interval repeatInterval |\x0a\x09\x0a\x09active := false.\x0a\x09repeatInterval := 60.\x0a\x09hiddenInput asJQuery unbind: 'keydown'.\x0a\x0a\x09hiddenInput asJQuery keydown: [ :e |\x0a\x09\x09\x0a (e which = 38 and: [ active = false ]) ifTrue: [ \x0a\x09\x09\x09active := true.\x0a \x09interval := [ \x0a\x09\x09\x09\x09selected := window jQuery: '.focused .nav-pills .active'.\x0a\x09\x09\x09\x09self activateListItem: selected prev ]\x0a\x09\x09\x09\x09\x09valueWithInterval: repeatInterval ].\x0a\x09\x09\x09\x0a \x09(e which = 40 and: [ active = false ]) ifTrue: [\x0a active := true.\x0a\x09\x09\x09\x22(next get: 0) ifNil: [ next := window jQuery: '.focused .nav-pills li:first-child' ].\x22\x0a\x09\x09\x09interval := [ \x0a\x09\x09\x09\x09selected := window jQuery: '.focused .nav-pills .active'.\x0a\x09\x09\x09\x09self activateListItem: selected next ]\x0a\x09\x09\x09\x09valueWithInterval: repeatInterval ] ].\x0a\x09\x0a\x09hiddenInput asJQuery keyup: [ :e |\x0a\x09\x09active ifTrue: [\x0a\x09\x09\x09active := false.\x0a\x09\x09\x09interval clearInterval ] ]",
  1144. messageSends: ["unbind:", "asJQuery", "keydown:", "ifTrue:", "valueWithInterval:", "jQuery:", "activateListItem:", "prev", "and:", "=", "which", "next", "keyup:", "clearInterval"],
  1145. referencedClasses: []
  1146. }),
  1147. smalltalk.HLListWidget);
  1148. smalltalk.addClass('HLNavigationListWidget', smalltalk.HLListWidget, ['previous', 'next'], 'Helios-Core');
  1149. smalltalk.addMethod(
  1150. "_next",
  1151. smalltalk.method({
  1152. selector: "next",
  1153. category: 'accessing',
  1154. fn: function (){
  1155. var self=this;
  1156. return smalltalk.withContext(function($ctx1) { var $1;
  1157. $1=self["@next"];
  1158. return $1;
  1159. }, function($ctx1) {$ctx1.fill(self,"next",{}, smalltalk.HLNavigationListWidget)})},
  1160. args: [],
  1161. source: "next\x0a\x09^ next",
  1162. messageSends: [],
  1163. referencedClasses: []
  1164. }),
  1165. smalltalk.HLNavigationListWidget);
  1166. smalltalk.addMethod(
  1167. "_next_",
  1168. smalltalk.method({
  1169. selector: "next:",
  1170. category: 'accessing',
  1171. fn: function (aWidget){
  1172. var self=this;
  1173. return smalltalk.withContext(function($ctx1) { var $1;
  1174. self["@next"]=aWidget;
  1175. $1=_st(_st(aWidget)._previous()).__eq(self);
  1176. if(! smalltalk.assert($1)){
  1177. _st(aWidget)._previous_(self);
  1178. };
  1179. return self}, function($ctx1) {$ctx1.fill(self,"next:",{aWidget:aWidget}, smalltalk.HLNavigationListWidget)})},
  1180. args: ["aWidget"],
  1181. source: "next: aWidget\x0a\x09next := aWidget.\x0a aWidget previous = self ifFalse: [ aWidget previous: self ]",
  1182. messageSends: ["ifFalse:", "previous:", "=", "previous"],
  1183. referencedClasses: []
  1184. }),
  1185. smalltalk.HLNavigationListWidget);
  1186. smalltalk.addMethod(
  1187. "_nextFocus",
  1188. smalltalk.method({
  1189. selector: "nextFocus",
  1190. category: 'actions',
  1191. fn: function (){
  1192. var self=this;
  1193. return smalltalk.withContext(function($ctx1) { var $1;
  1194. $1=_st(self)._next();
  1195. if(($receiver = $1) == nil || $receiver == undefined){
  1196. $1;
  1197. } else {
  1198. _st(_st(self)._next())._focus();
  1199. };
  1200. return self}, function($ctx1) {$ctx1.fill(self,"nextFocus",{}, smalltalk.HLNavigationListWidget)})},
  1201. args: [],
  1202. source: "nextFocus\x0a\x09self next ifNotNil: [ self next focus ]",
  1203. messageSends: ["ifNotNil:", "focus", "next"],
  1204. referencedClasses: []
  1205. }),
  1206. smalltalk.HLNavigationListWidget);
  1207. smalltalk.addMethod(
  1208. "_previous",
  1209. smalltalk.method({
  1210. selector: "previous",
  1211. category: 'accessing',
  1212. fn: function (){
  1213. var self=this;
  1214. return smalltalk.withContext(function($ctx1) { var $1;
  1215. $1=self["@previous"];
  1216. return $1;
  1217. }, function($ctx1) {$ctx1.fill(self,"previous",{}, smalltalk.HLNavigationListWidget)})},
  1218. args: [],
  1219. source: "previous\x0a\x09^ previous",
  1220. messageSends: [],
  1221. referencedClasses: []
  1222. }),
  1223. smalltalk.HLNavigationListWidget);
  1224. smalltalk.addMethod(
  1225. "_previous_",
  1226. smalltalk.method({
  1227. selector: "previous:",
  1228. category: 'accessing',
  1229. fn: function (aWidget){
  1230. var self=this;
  1231. return smalltalk.withContext(function($ctx1) { var $1;
  1232. self["@previous"]=aWidget;
  1233. $1=_st(_st(aWidget)._next()).__eq(self);
  1234. if(! smalltalk.assert($1)){
  1235. _st(aWidget)._next_(self);
  1236. };
  1237. return self}, function($ctx1) {$ctx1.fill(self,"previous:",{aWidget:aWidget}, smalltalk.HLNavigationListWidget)})},
  1238. args: ["aWidget"],
  1239. source: "previous: aWidget\x0a\x09previous := aWidget.\x0a aWidget next = self ifFalse: [ aWidget next: self ]",
  1240. messageSends: ["ifFalse:", "next:", "=", "next"],
  1241. referencedClasses: []
  1242. }),
  1243. smalltalk.HLNavigationListWidget);
  1244. smalltalk.addMethod(
  1245. "_previousFocus",
  1246. smalltalk.method({
  1247. selector: "previousFocus",
  1248. category: 'actions',
  1249. fn: function (){
  1250. var self=this;
  1251. return smalltalk.withContext(function($ctx1) { var $1;
  1252. $1=_st(self)._previous();
  1253. if(($receiver = $1) == nil || $receiver == undefined){
  1254. $1;
  1255. } else {
  1256. _st(_st(self)._previous())._focus();
  1257. };
  1258. return self}, function($ctx1) {$ctx1.fill(self,"previousFocus",{}, smalltalk.HLNavigationListWidget)})},
  1259. args: [],
  1260. source: "previousFocus\x0a\x09self previous ifNotNil: [ self previous focus ]",
  1261. messageSends: ["ifNotNil:", "focus", "previous"],
  1262. referencedClasses: []
  1263. }),
  1264. smalltalk.HLNavigationListWidget);
  1265. smalltalk.addMethod(
  1266. "_setupKeyBindings",
  1267. smalltalk.method({
  1268. selector: "setupKeyBindings",
  1269. category: 'events',
  1270. fn: function (){
  1271. var self=this;
  1272. return smalltalk.withContext(function($ctx1) { var $1,$2;
  1273. smalltalk.HLListWidget.fn.prototype._setupKeyBindings.apply(_st(self), []);
  1274. _st(_st(self["@hiddenInput"])._asJQuery())._keydown_((function(e){
  1275. return smalltalk.withContext(function($ctx2) { $1=_st(_st(e)._which()).__eq((39));
  1276. if(smalltalk.assert($1)){
  1277. _st(self)._nextFocus();
  1278. };
  1279. $2=_st(_st(e)._which()).__eq((37));
  1280. if(smalltalk.assert($2)){
  1281. return _st(self)._previousFocus();
  1282. };
  1283. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1)})}));
  1284. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyBindings",{}, smalltalk.HLNavigationListWidget)})},
  1285. args: [],
  1286. 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 ] ]",
  1287. messageSends: ["setupKeyBindings", "keydown:", "ifTrue:", "nextFocus", "=", "which", "previousFocus", "asJQuery"],
  1288. referencedClasses: []
  1289. }),
  1290. smalltalk.HLNavigationListWidget);
  1291. smalltalk.addClass('HLManager', smalltalk.HLWidget, ['tabs', 'activeTab', 'keyBinder', 'environment', 'history'], 'Helios-Core');
  1292. smalltalk.addMethod(
  1293. "_activate_",
  1294. smalltalk.method({
  1295. selector: "activate:",
  1296. category: 'actions',
  1297. fn: function (aTab){
  1298. var self=this;
  1299. return smalltalk.withContext(function($ctx1) { var $1,$2;
  1300. _st(_st(self)._keyBinder())._flushBindings();
  1301. _st(aTab)._registerBindings();
  1302. self["@activeTab"]=aTab;
  1303. $1=self;
  1304. _st($1)._refresh();
  1305. _st($1)._addToHistory_(aTab);
  1306. $2=_st($1)._show_(aTab);
  1307. return self}, function($ctx1) {$ctx1.fill(self,"activate:",{aTab:aTab},smalltalk.HLManager)})},
  1308. args: ["aTab"],
  1309. 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",
  1310. messageSends: ["flushBindings", "keyBinder", "registerBindings", "refresh", "addToHistory:", "show:"],
  1311. referencedClasses: []
  1312. }),
  1313. smalltalk.HLManager);
  1314. smalltalk.addMethod(
  1315. "_activeTab",
  1316. smalltalk.method({
  1317. selector: "activeTab",
  1318. category: 'accessing',
  1319. fn: function (){
  1320. var self=this;
  1321. return smalltalk.withContext(function($ctx1) { var $1;
  1322. $1=self["@activeTab"];
  1323. return $1;
  1324. }, function($ctx1) {$ctx1.fill(self,"activeTab",{}, smalltalk.HLManager)})},
  1325. args: [],
  1326. source: "activeTab\x0a\x09^ activeTab",
  1327. messageSends: [],
  1328. referencedClasses: []
  1329. }),
  1330. smalltalk.HLManager);
  1331. smalltalk.addMethod(
  1332. "_addTab_",
  1333. smalltalk.method({
  1334. selector: "addTab:",
  1335. category: 'actions',
  1336. fn: function (aTab){
  1337. var self=this;
  1338. return smalltalk.withContext(function($ctx1) { _st(_st(self)._tabs())._add_(aTab);
  1339. _st(self)._activate_(aTab);
  1340. return self}, function($ctx1) {$ctx1.fill(self,"addTab:",{aTab:aTab}, smalltalk.HLManager)})},
  1341. args: ["aTab"],
  1342. source: "addTab: aTab\x0a\x09self tabs add: aTab.\x0a self activate: aTab",
  1343. messageSends: ["add:", "tabs", "activate:"],
  1344. referencedClasses: []
  1345. }),
  1346. smalltalk.HLManager);
  1347. smalltalk.addMethod(
  1348. "_addToHistory_",
  1349. smalltalk.method({
  1350. selector: "addToHistory:",
  1351. category: 'actions',
  1352. fn: function (aTab){
  1353. var self=this;
  1354. return smalltalk.withContext(function($ctx1) { _st(self)._removeFromHistory_(aTab);
  1355. _st(_st(self)._history())._add_(aTab);
  1356. return self}, function($ctx1) {$ctx1.fill(self,"addToHistory:",{aTab:aTab}, smalltalk.HLManager)})},
  1357. args: ["aTab"],
  1358. source: "addToHistory: aTab\x0a\x09self removeFromHistory: aTab.\x0a\x09self history add: aTab",
  1359. messageSends: ["removeFromHistory:", "add:", "history"],
  1360. referencedClasses: []
  1361. }),
  1362. smalltalk.HLManager);
  1363. smalltalk.addMethod(
  1364. "_defaultEnvironment",
  1365. smalltalk.method({
  1366. selector: "defaultEnvironment",
  1367. category: 'defaults',
  1368. fn: function (){
  1369. var self=this;
  1370. return smalltalk.withContext(function($ctx1) { var $1;
  1371. $1=_st((smalltalk.HLLocalEnvironment || HLLocalEnvironment))._new();
  1372. return $1;
  1373. }, function($ctx1) {$ctx1.fill(self,"defaultEnvironment",{}, smalltalk.HLManager)})},
  1374. args: [],
  1375. source: "defaultEnvironment\x0a\x09^ HLLocalEnvironment new",
  1376. messageSends: ["new"],
  1377. referencedClasses: ["HLLocalEnvironment"]
  1378. }),
  1379. smalltalk.HLManager);
  1380. smalltalk.addMethod(
  1381. "_environment",
  1382. smalltalk.method({
  1383. selector: "environment",
  1384. category: 'accessing',
  1385. fn: function (){
  1386. var self=this;
  1387. return smalltalk.withContext(function($ctx1) { var $2,$1;
  1388. $2=self["@environment"];
  1389. if(($receiver = $2) == nil || $receiver == undefined){
  1390. self["@environment"]=_st(self)._defaultEnvironment();
  1391. $1=self["@environment"];
  1392. } else {
  1393. $1=$2;
  1394. };
  1395. return $1;
  1396. }, function($ctx1) {$ctx1.fill(self,"environment",{}, smalltalk.HLManager)})},
  1397. args: [],
  1398. source: "environment\x0a\x09\x22The default environment used by all Helios objects\x22\x0a \x0a\x09^ environment ifNil: [ environment := self defaultEnvironment ]",
  1399. messageSends: ["ifNil:", "defaultEnvironment"],
  1400. referencedClasses: []
  1401. }),
  1402. smalltalk.HLManager);
  1403. smalltalk.addMethod(
  1404. "_environment_",
  1405. smalltalk.method({
  1406. selector: "environment:",
  1407. category: 'accessing',
  1408. fn: function (anEnvironment){
  1409. var self=this;
  1410. return smalltalk.withContext(function($ctx1) { self["@environment"]=anEnvironment;
  1411. return self}, function($ctx1) {$ctx1.fill(self,"environment:",{anEnvironment:anEnvironment}, smalltalk.HLManager)})},
  1412. args: ["anEnvironment"],
  1413. source: "environment: anEnvironment\x0a\x09environment := anEnvironment",
  1414. messageSends: [],
  1415. referencedClasses: []
  1416. }),
  1417. smalltalk.HLManager);
  1418. smalltalk.addMethod(
  1419. "_history",
  1420. smalltalk.method({
  1421. selector: "history",
  1422. category: 'accessing',
  1423. fn: function (){
  1424. var self=this;
  1425. return smalltalk.withContext(function($ctx1) { var $2,$1;
  1426. $2=self["@history"];
  1427. if(($receiver = $2) == nil || $receiver == undefined){
  1428. self["@history"]=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
  1429. $1=self["@history"];
  1430. } else {
  1431. $1=$2;
  1432. };
  1433. return $1;
  1434. }, function($ctx1) {$ctx1.fill(self,"history",{}, smalltalk.HLManager)})},
  1435. args: [],
  1436. source: "history\x0a\x09^ history ifNil: [ history := OrderedCollection new ]",
  1437. messageSends: ["ifNil:", "new"],
  1438. referencedClasses: ["OrderedCollection"]
  1439. }),
  1440. smalltalk.HLManager);
  1441. smalltalk.addMethod(
  1442. "_history_",
  1443. smalltalk.method({
  1444. selector: "history:",
  1445. category: 'accessing',
  1446. fn: function (aCollection){
  1447. var self=this;
  1448. return smalltalk.withContext(function($ctx1) { self["@history"]=aCollection;
  1449. return self}, function($ctx1) {$ctx1.fill(self,"history:",{aCollection:aCollection}, smalltalk.HLManager)})},
  1450. args: ["aCollection"],
  1451. source: "history: aCollection\x0a\x09history := aCollection",
  1452. messageSends: [],
  1453. referencedClasses: []
  1454. }),
  1455. smalltalk.HLManager);
  1456. smalltalk.addMethod(
  1457. "_initialize",
  1458. smalltalk.method({
  1459. selector: "initialize",
  1460. category: 'initialization',
  1461. fn: function (){
  1462. var self=this;
  1463. return smalltalk.withContext(function($ctx1) { smalltalk.HLWidget.fn.prototype._initialize.apply(_st(self), []);
  1464. _st(_st(self)._keyBinder())._setupEvents();
  1465. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.HLManager)})},
  1466. args: [],
  1467. source: "initialize\x0a\x09super initialize.\x0a self keyBinder setupEvents",
  1468. messageSends: ["initialize", "setupEvents", "keyBinder"],
  1469. referencedClasses: []
  1470. }),
  1471. smalltalk.HLManager);
  1472. smalltalk.addMethod(
  1473. "_keyBinder",
  1474. smalltalk.method({
  1475. selector: "keyBinder",
  1476. category: 'accessing',
  1477. fn: function (){
  1478. var self=this;
  1479. return smalltalk.withContext(function($ctx1) { var $2,$1;
  1480. $2=self["@keyBinder"];
  1481. if(($receiver = $2) == nil || $receiver == undefined){
  1482. self["@keyBinder"]=_st((smalltalk.HLKeyBinder || HLKeyBinder))._new();
  1483. $1=self["@keyBinder"];
  1484. } else {
  1485. $1=$2;
  1486. };
  1487. return $1;
  1488. }, function($ctx1) {$ctx1.fill(self,"keyBinder",{}, smalltalk.HLManager)})},
  1489. args: [],
  1490. source: "keyBinder\x0a\x09^ keyBinder ifNil: [ keyBinder := HLKeyBinder new ]",
  1491. messageSends: ["ifNil:", "new"],
  1492. referencedClasses: ["HLKeyBinder"]
  1493. }),
  1494. smalltalk.HLManager);
  1495. smalltalk.addMethod(
  1496. "_refresh",
  1497. smalltalk.method({
  1498. selector: "refresh",
  1499. category: 'rendering',
  1500. fn: function (){
  1501. var self=this;
  1502. return smalltalk.withContext(function($ctx1) { _st(_st(window)._jQuery_(".navbar"))._remove();
  1503. _st(self)._appendToJQuery_(_st("body")._asJQuery());
  1504. return self}, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.HLManager)})},
  1505. args: [],
  1506. source: "refresh\x0a\x09(window jQuery: '.navbar') remove.\x0a\x09self appendToJQuery: 'body' asJQuery",
  1507. messageSends: ["remove", "jQuery:", "appendToJQuery:", "asJQuery"],
  1508. referencedClasses: []
  1509. }),
  1510. smalltalk.HLManager);
  1511. smalltalk.addMethod(
  1512. "_removeActiveTab",
  1513. smalltalk.method({
  1514. selector: "removeActiveTab",
  1515. category: 'actions',
  1516. fn: function (){
  1517. var self=this;
  1518. return smalltalk.withContext(function($ctx1) { _st(self)._removeTab_(_st(self)._activeTab());
  1519. return self}, function($ctx1) {$ctx1.fill(self,"removeActiveTab",{}, smalltalk.HLManager)})},
  1520. args: [],
  1521. source: "removeActiveTab\x0a\x09self removeTab: self activeTab",
  1522. messageSends: ["removeTab:", "activeTab"],
  1523. referencedClasses: []
  1524. }),
  1525. smalltalk.HLManager);
  1526. smalltalk.addMethod(
  1527. "_removeFromHistory_",
  1528. smalltalk.method({
  1529. selector: "removeFromHistory:",
  1530. category: 'actions',
  1531. fn: function (aTab){
  1532. var self=this;
  1533. return smalltalk.withContext(function($ctx1) { _st(self)._history_(_st(_st(self)._history())._reject_((function(each){
  1534. return smalltalk.withContext(function($ctx2) { return _st(each).__eq_eq(aTab);
  1535. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})));
  1536. return self}, function($ctx1) {$ctx1.fill(self,"removeFromHistory:",{aTab:aTab}, smalltalk.HLManager)})},
  1537. args: ["aTab"],
  1538. source: "removeFromHistory: aTab\x0a\x09self history: (self history reject: [ :each | each == aTab ])",
  1539. messageSends: ["history:", "reject:", "==", "history"],
  1540. referencedClasses: []
  1541. }),
  1542. smalltalk.HLManager);
  1543. smalltalk.addMethod(
  1544. "_removeTab_",
  1545. smalltalk.method({
  1546. selector: "removeTab:",
  1547. category: 'actions',
  1548. fn: function (aTab){
  1549. var self=this;
  1550. return smalltalk.withContext(function($ctx1) { var $1,$2;
  1551. $1=_st(_st(self)._tabs())._includes_(aTab);
  1552. if(! smalltalk.assert($1)){
  1553. $2=self;
  1554. return $2;
  1555. };
  1556. _st(self)._removeFromHistory_(aTab);
  1557. _st(_st(self)._tabs())._remove_(aTab);
  1558. _st(_st(self)._keyBinder())._flushBindings();
  1559. _st(aTab)._remove();
  1560. _st(self)._refresh();
  1561. _st(_st(self)._history())._ifNotEmpty_((function(){
  1562. return smalltalk.withContext(function($ctx2) { return _st(_st(_st(self)._history())._last())._activate();
  1563. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1564. return self}, function($ctx1) {$ctx1.fill(self,"removeTab:",{aTab:aTab},smalltalk.HLManager)})},
  1565. args: ["aTab"],
  1566. 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 ]",
  1567. messageSends: ["ifFalse:", "includes:", "tabs", "removeFromHistory:", "remove:", "flushBindings", "keyBinder", "remove", "refresh", "ifNotEmpty:", "activate", "last", "history"],
  1568. referencedClasses: []
  1569. }),
  1570. smalltalk.HLManager);
  1571. smalltalk.addMethod(
  1572. "_renderAddOn_",
  1573. smalltalk.method({
  1574. selector: "renderAddOn:",
  1575. category: 'rendering',
  1576. fn: function (html){
  1577. var self=this;
  1578. return smalltalk.withContext(function($ctx1) { var $1,$3,$4,$5,$7,$8,$6,$2;
  1579. $1=_st(html)._li();
  1580. _st($1)._class_("dropdown");
  1581. $2=_st($1)._with_((function(){
  1582. return smalltalk.withContext(function($ctx2) { $3=_st(html)._a();
  1583. _st($3)._class_("dropdown-toggle");
  1584. _st($3)._at_put_("data-toggle","dropdown");
  1585. $4=_st($3)._with_((function(){
  1586. return smalltalk.withContext(function($ctx3) { _st(html)._with_("Open...");
  1587. return _st(_st(html)._tag_("b"))._class_("caret");
  1588. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1589. $4;
  1590. $5=_st(html)._ul();
  1591. _st($5)._class_("dropdown-menu");
  1592. $6=_st($5)._with_((function(){
  1593. return smalltalk.withContext(function($ctx3) { return _st(_st(_st(_st((smalltalk.HLWidget || HLWidget))._withAllSubclasses())._select_((function(each){
  1594. return smalltalk.withContext(function($ctx4) { return _st(each)._canBeOpenAsTab();
  1595. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx1)})})))._sorted_((function(a,b){
  1596. return smalltalk.withContext(function($ctx4) { return _st(_st(a)._tabPriority()).__lt(_st(b)._tabPriority());
  1597. }, function($ctx4) {$ctx4.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(each){
  1598. return smalltalk.withContext(function($ctx4) { return _st(_st(html)._li())._with_((function(){
  1599. return smalltalk.withContext(function($ctx5) { $7=_st(html)._a();
  1600. _st($7)._with_(_st(each)._tabLabel());
  1601. $8=_st($7)._onClick_((function(){
  1602. return smalltalk.withContext(function($ctx6) { return _st(each)._openAsTab();
  1603. }, function($ctx6) {$ctx6.fillBlock({},$ctx1)})}));
  1604. return $8;
  1605. }, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
  1606. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx1)})}));
  1607. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1608. return $6;
  1609. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1610. return self}, function($ctx1) {$ctx1.fill(self,"renderAddOn:",{html:html}, smalltalk.HLManager)})},
  1611. args: ["html"],
  1612. 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 ] ] ] ] ]",
  1613. messageSends: ["class:", "li", "with:", "a", "at:put:", "tag:", "ul", "do:", "tabLabel", "onClick:", "openAsTab", "sorted:", "<", "tabPriority", "select:", "canBeOpenAsTab", "withAllSubclasses"],
  1614. referencedClasses: ["HLWidget"]
  1615. }),
  1616. smalltalk.HLManager);
  1617. smalltalk.addMethod(
  1618. "_renderContentOn_",
  1619. smalltalk.method({
  1620. selector: "renderContentOn:",
  1621. category: 'rendering',
  1622. fn: function (html){
  1623. var self=this;
  1624. return smalltalk.withContext(function($ctx1) { var $1,$3,$4,$2;
  1625. $1=_st(html)._div();
  1626. _st($1)._class_("navbar navbar-fixed-top");
  1627. $2=_st($1)._with_((function(){
  1628. return smalltalk.withContext(function($ctx2) { $3=_st(html)._div();
  1629. _st($3)._class_("navbar-inner");
  1630. $4=_st($3)._with_((function(){
  1631. return smalltalk.withContext(function($ctx3) { return _st(self)._renderTabsOn_(html);
  1632. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1633. return $4;
  1634. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1635. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLManager)})},
  1636. args: ["html"],
  1637. 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 ] ]",
  1638. messageSends: ["class:", "div", "with:", "renderTabsOn:"],
  1639. referencedClasses: []
  1640. }),
  1641. smalltalk.HLManager);
  1642. smalltalk.addMethod(
  1643. "_renderTabsOn_",
  1644. smalltalk.method({
  1645. selector: "renderTabsOn:",
  1646. category: 'rendering',
  1647. fn: function (html){
  1648. var self=this;
  1649. return smalltalk.withContext(function($ctx1) { var $1,$3,$4,$6,$5,$8,$9,$7,$2;
  1650. $1=_st(html)._ul();
  1651. _st($1)._class_("nav");
  1652. $2=_st($1)._with_((function(){
  1653. return smalltalk.withContext(function($ctx2) { _st(_st(self)._tabs())._do_((function(each){
  1654. return smalltalk.withContext(function($ctx3) { $3=_st(html)._li();
  1655. $4=$3;
  1656. $6=_st(each)._isActive();
  1657. if(smalltalk.assert($6)){
  1658. $5="active";
  1659. } else {
  1660. $5="inactive";
  1661. };
  1662. _st($4)._class_($5);
  1663. $7=_st($3)._with_((function(){
  1664. return smalltalk.withContext(function($ctx4) { $8=_st(html)._a();
  1665. _st($8)._with_((function(){
  1666. return smalltalk.withContext(function($ctx5) { _st(_st(_st(html)._tag_("i"))._class_("icon-remove"))._onClick_((function(){
  1667. return smalltalk.withContext(function($ctx6) { return _st(self)._removeTab_(each);
  1668. }, function($ctx6) {$ctx6.fillBlock({},$ctx1)})}));
  1669. return _st(html)._with_(_st(each)._displayLabel());
  1670. }, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
  1671. $9=_st($8)._onClick_((function(){
  1672. return smalltalk.withContext(function($ctx5) { return _st(each)._activate();
  1673. }, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
  1674. return $9;
  1675. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
  1676. return $7;
  1677. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  1678. return _st(self)._renderAddOn_(html);
  1679. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1680. return self}, function($ctx1) {$ctx1.fill(self,"renderTabsOn:",{html:html},smalltalk.HLManager)})},
  1681. args: ["html"],
  1682. 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 ]",
  1683. messageSends: ["class:", "ul", "with:", "do:", "ifTrue:ifFalse:", "isActive", "li", "onClick:", "removeTab:", "tag:", "displayLabel", "a", "activate", "tabs", "renderAddOn:"],
  1684. referencedClasses: []
  1685. }),
  1686. smalltalk.HLManager);
  1687. smalltalk.addMethod(
  1688. "_show_",
  1689. smalltalk.method({
  1690. selector: "show:",
  1691. category: 'rendering',
  1692. fn: function (aTab){
  1693. var self=this;
  1694. return smalltalk.withContext(function($ctx1) { var $1,$2;
  1695. _st(_st(self)._tabs())._do_((function(each){
  1696. return smalltalk.withContext(function($ctx2) { return _st(each)._hide();
  1697. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1698. $1=aTab;
  1699. _st($1)._show();
  1700. $2=_st($1)._focus();
  1701. return self}, function($ctx1) {$ctx1.fill(self,"show:",{aTab:aTab},smalltalk.HLManager)})},
  1702. args: ["aTab"],
  1703. source: "show: aTab\x0a\x09self tabs do: [ :each | each hide ].\x0a\x09aTab show; focus",
  1704. messageSends: ["do:", "hide", "tabs", "show", "focus"],
  1705. referencedClasses: []
  1706. }),
  1707. smalltalk.HLManager);
  1708. smalltalk.addMethod(
  1709. "_tabs",
  1710. smalltalk.method({
  1711. selector: "tabs",
  1712. category: 'accessing',
  1713. fn: function (){
  1714. var self=this;
  1715. return smalltalk.withContext(function($ctx1) { var $2,$1;
  1716. $2=self["@tabs"];
  1717. if(($receiver = $2) == nil || $receiver == undefined){
  1718. self["@tabs"]=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
  1719. $1=self["@tabs"];
  1720. } else {
  1721. $1=$2;
  1722. };
  1723. return $1;
  1724. }, function($ctx1) {$ctx1.fill(self,"tabs",{}, smalltalk.HLManager)})},
  1725. args: [],
  1726. source: "tabs\x0a\x09^ tabs ifNil: [ tabs := OrderedCollection new ]",
  1727. messageSends: ["ifNil:", "new"],
  1728. referencedClasses: ["OrderedCollection"]
  1729. }),
  1730. smalltalk.HLManager);
  1731. smalltalk.HLManager.klass.iVarNames = ['current'];
  1732. smalltalk.addMethod(
  1733. "_current",
  1734. smalltalk.method({
  1735. selector: "current",
  1736. category: 'accessing',
  1737. fn: function (){
  1738. var self=this;
  1739. return smalltalk.withContext(function($ctx1) { var $2,$1;
  1740. $2=self["@current"];
  1741. if(($receiver = $2) == nil || $receiver == undefined){
  1742. self["@current"]=_st(_st(self)._basicNew())._initialize();
  1743. $1=self["@current"];
  1744. } else {
  1745. $1=$2;
  1746. };
  1747. return $1;
  1748. }, function($ctx1) {$ctx1.fill(self,"current",{}, smalltalk.HLManager.klass)})},
  1749. args: [],
  1750. source: "current\x0a\x09^ current ifNil: [ current := self basicNew initialize ]",
  1751. messageSends: ["ifNil:", "initialize", "basicNew"],
  1752. referencedClasses: []
  1753. }),
  1754. smalltalk.HLManager.klass);
  1755. smalltalk.addMethod(
  1756. "_initialize",
  1757. smalltalk.method({
  1758. selector: "initialize",
  1759. category: 'initialization',
  1760. fn: function (){
  1761. var self=this;
  1762. return smalltalk.withContext(function($ctx1) { _st(_st(self)._current())._appendToJQuery_(_st("body")._asJQuery());
  1763. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.HLManager.klass)})},
  1764. args: [],
  1765. source: "initialize\x0a\x09self current appendToJQuery: 'body' asJQuery",
  1766. messageSends: ["appendToJQuery:", "asJQuery", "current"],
  1767. referencedClasses: []
  1768. }),
  1769. smalltalk.HLManager.klass);
  1770. smalltalk.addMethod(
  1771. "_new",
  1772. smalltalk.method({
  1773. selector: "new",
  1774. category: 'instance creation',
  1775. fn: function (){
  1776. var self=this;
  1777. return smalltalk.withContext(function($ctx1) { _st(self)._shouldNotImplement();
  1778. return self}, function($ctx1) {$ctx1.fill(self,"new",{}, smalltalk.HLManager.klass)})},
  1779. args: [],
  1780. source: "new\x0a\x09\x22Use current instead\x22\x0a\x0a\x09self shouldNotImplement",
  1781. messageSends: ["shouldNotImplement"],
  1782. referencedClasses: []
  1783. }),
  1784. smalltalk.HLManager.klass);
  1785. smalltalk.addClass('HLSUnit', smalltalk.HLWidget, [], 'Helios-Core');
  1786. smalltalk.addMethod(
  1787. "_canBeOpenAsTab",
  1788. smalltalk.method({
  1789. selector: "canBeOpenAsTab",
  1790. category: 'testing',
  1791. fn: function (){
  1792. var self=this;
  1793. return smalltalk.withContext(function($ctx1) { return true;
  1794. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{}, smalltalk.HLSUnit.klass)})},
  1795. args: [],
  1796. source: "canBeOpenAsTab\x0a\x09^ true",
  1797. messageSends: [],
  1798. referencedClasses: []
  1799. }),
  1800. smalltalk.HLSUnit.klass);
  1801. smalltalk.addMethod(
  1802. "_tabLabel",
  1803. smalltalk.method({
  1804. selector: "tabLabel",
  1805. category: 'accessing',
  1806. fn: function (){
  1807. var self=this;
  1808. return smalltalk.withContext(function($ctx1) { return "SUnit";
  1809. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{}, smalltalk.HLSUnit.klass)})},
  1810. args: [],
  1811. source: "tabLabel\x0a\x09^ 'SUnit'",
  1812. messageSends: [],
  1813. referencedClasses: []
  1814. }),
  1815. smalltalk.HLSUnit.klass);
  1816. smalltalk.addMethod(
  1817. "_tabPriority",
  1818. smalltalk.method({
  1819. selector: "tabPriority",
  1820. category: 'accessing',
  1821. fn: function (){
  1822. var self=this;
  1823. return smalltalk.withContext(function($ctx1) { return (1000);
  1824. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{}, smalltalk.HLSUnit.klass)})},
  1825. args: [],
  1826. source: "tabPriority\x0a\x09^ 1000",
  1827. messageSends: [],
  1828. referencedClasses: []
  1829. }),
  1830. smalltalk.HLSUnit.klass);
  1831. smalltalk.addClass('HLTranscript', smalltalk.HLWidget, [], 'Helios-Core');
  1832. smalltalk.addMethod(
  1833. "_canBeOpenAsTab",
  1834. smalltalk.method({
  1835. selector: "canBeOpenAsTab",
  1836. category: 'testing',
  1837. fn: function (){
  1838. var self=this;
  1839. return smalltalk.withContext(function($ctx1) { return true;
  1840. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{}, smalltalk.HLTranscript.klass)})},
  1841. args: [],
  1842. source: "canBeOpenAsTab\x0a\x09^ true",
  1843. messageSends: [],
  1844. referencedClasses: []
  1845. }),
  1846. smalltalk.HLTranscript.klass);
  1847. smalltalk.addMethod(
  1848. "_tabLabel",
  1849. smalltalk.method({
  1850. selector: "tabLabel",
  1851. category: 'accessing',
  1852. fn: function (){
  1853. var self=this;
  1854. return smalltalk.withContext(function($ctx1) { return "Transcript";
  1855. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{}, smalltalk.HLTranscript.klass)})},
  1856. args: [],
  1857. source: "tabLabel\x0a\x09^ 'Transcript'",
  1858. messageSends: [],
  1859. referencedClasses: []
  1860. }),
  1861. smalltalk.HLTranscript.klass);
  1862. smalltalk.addMethod(
  1863. "_tabPriority",
  1864. smalltalk.method({
  1865. selector: "tabPriority",
  1866. category: 'accessing',
  1867. fn: function (){
  1868. var self=this;
  1869. return smalltalk.withContext(function($ctx1) { return (600);
  1870. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{}, smalltalk.HLTranscript.klass)})},
  1871. args: [],
  1872. source: "tabPriority\x0a\x09^ 600",
  1873. messageSends: [],
  1874. referencedClasses: []
  1875. }),
  1876. smalltalk.HLTranscript.klass);
  1877. smalltalk.addMethod(
  1878. "_ajaxPutAt_data_",
  1879. smalltalk.method({
  1880. selector: "ajaxPutAt:data:",
  1881. category: '*Helios-Core',
  1882. fn: function (aURL,aString){
  1883. var self=this;
  1884. 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){
  1885. 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"));
  1886. }, function($ctx2) {$ctx2.fillBlock({xhr:xhr},$ctx1)})}))]));
  1887. return self}, function($ctx1) {$ctx1.fill(self,"ajaxPutAt:data:",{aURL:aURL,aString:aString},smalltalk.Package)})},
  1888. args: ["aURL", "aString"],
  1889. 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'] }",
  1890. messageSends: ["ajax:options:", "->", "alert:", ",", "responseText"],
  1891. referencedClasses: []
  1892. }),
  1893. smalltalk.Package);
  1894. smalltalk.addMethod(
  1895. "_heliosCommit",
  1896. smalltalk.method({
  1897. selector: "heliosCommit",
  1898. category: '*Helios-Core',
  1899. fn: function (){
  1900. var self=this;
  1901. 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){
  1902. var fileContents;
  1903. return smalltalk.withContext(function($ctx2) { fileContents=_st(_st(_st(commitStrategy)._key())._new())._exportPackage_(_st(self)._name());
  1904. fileContents;
  1905. return _st(self)._ajaxPutAt_data_(_st(commitStrategy)._value(),fileContents);
  1906. }, function($ctx2) {$ctx2.fillBlock({commitStrategy:commitStrategy,fileContents:fileContents},$ctx1)})}));
  1907. return self}, function($ctx1) {$ctx1.fill(self,"heliosCommit",{},smalltalk.Package)})},
  1908. args: [],
  1909. 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 ]",
  1910. messageSends: ["do:", "exportPackage:", "name", "new", "key", "ajaxPutAt:data:", "value", "->", ",", "commitPathJs", "commitPathSt"],
  1911. referencedClasses: ["Exporter", "StrippedExporter", "ChunkExporter"]
  1912. }),
  1913. smalltalk.Package);