Helios-Core.js 86 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584
  1. smalltalk.addPackage('Helios-Core');
  2. smalltalk.addClass('HLModel', smalltalk.Object, ['announcer', 'environment'], 'Helios-Core');
  3. smalltalk.addMethod(
  4. smalltalk.method({
  5. selector: "announcer",
  6. category: 'accessing',
  7. fn: function (){
  8. var self=this;
  9. function $Announcer(){return smalltalk.Announcer||(typeof Announcer=="undefined"?nil:Announcer)}
  10. return smalltalk.withContext(function($ctx1) {
  11. var $2,$1;
  12. $2=self["@announcer"];
  13. if(($receiver = $2) == nil || $receiver == undefined){
  14. self["@announcer"]=_st($Announcer())._new();
  15. $1=self["@announcer"];
  16. } else {
  17. $1=$2;
  18. };
  19. return $1;
  20. }, function($ctx1) {$ctx1.fill(self,"announcer",{},smalltalk.HLModel)})},
  21. args: [],
  22. source: "announcer\x0a\x09^ announcer ifNil: [ announcer := Announcer new ]",
  23. messageSends: ["ifNil:", "new"],
  24. referencedClasses: ["Announcer"]
  25. }),
  26. smalltalk.HLModel);
  27. smalltalk.addMethod(
  28. smalltalk.method({
  29. selector: "environment",
  30. category: 'accessing',
  31. fn: function (){
  32. var self=this;
  33. return smalltalk.withContext(function($ctx1) {
  34. var $2,$1;
  35. $2=self["@environment"];
  36. if(($receiver = $2) == nil || $receiver == undefined){
  37. $1=_st(_st(self)._manager())._environment();
  38. } else {
  39. $1=$2;
  40. };
  41. return $1;
  42. }, function($ctx1) {$ctx1.fill(self,"environment",{},smalltalk.HLModel)})},
  43. args: [],
  44. source: "environment\x0a\x09^ environment ifNil: [ self manager environment ]",
  45. messageSends: ["ifNil:", "environment", "manager"],
  46. referencedClasses: []
  47. }),
  48. smalltalk.HLModel);
  49. smalltalk.addMethod(
  50. smalltalk.method({
  51. selector: "environment:",
  52. category: 'accessing',
  53. fn: function (anEnvironment){
  54. var self=this;
  55. return smalltalk.withContext(function($ctx1) {
  56. self["@environment"]=anEnvironment;
  57. return self}, function($ctx1) {$ctx1.fill(self,"environment:",{anEnvironment:anEnvironment},smalltalk.HLModel)})},
  58. args: ["anEnvironment"],
  59. source: "environment: anEnvironment\x0a\x09environment := anEnvironment",
  60. messageSends: [],
  61. referencedClasses: []
  62. }),
  63. smalltalk.HLModel);
  64. smalltalk.addMethod(
  65. smalltalk.method({
  66. selector: "manager",
  67. category: 'accessing',
  68. fn: function (){
  69. var self=this;
  70. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  71. return smalltalk.withContext(function($ctx1) {
  72. var $1;
  73. $1=_st($HLManager())._current();
  74. return $1;
  75. }, function($ctx1) {$ctx1.fill(self,"manager",{},smalltalk.HLModel)})},
  76. args: [],
  77. source: "manager\x0a\x09^ HLManager current",
  78. messageSends: ["current"],
  79. referencedClasses: ["HLManager"]
  80. }),
  81. smalltalk.HLModel);
  82. smalltalk.addMethod(
  83. smalltalk.method({
  84. selector: "systemAnnouncer",
  85. category: 'accessing',
  86. fn: function (){
  87. var self=this;
  88. return smalltalk.withContext(function($ctx1) {
  89. var $1;
  90. $1=_st(_st(self)._environment())._systemAnnouncer();
  91. return $1;
  92. }, function($ctx1) {$ctx1.fill(self,"systemAnnouncer",{},smalltalk.HLModel)})},
  93. args: [],
  94. source: "systemAnnouncer\x0a\x09^ self environment systemAnnouncer",
  95. messageSends: ["systemAnnouncer", "environment"],
  96. referencedClasses: []
  97. }),
  98. smalltalk.HLModel);
  99. smalltalk.addClass('HLTab', smalltalk.Widget, ['widget', 'label', 'root'], 'Helios-Core');
  100. smalltalk.addMethod(
  101. smalltalk.method({
  102. selector: "activate",
  103. category: 'accessing',
  104. fn: function (){
  105. var self=this;
  106. return smalltalk.withContext(function($ctx1) {
  107. _st(_st(self)._manager())._activate_(self);
  108. return self}, function($ctx1) {$ctx1.fill(self,"activate",{},smalltalk.HLTab)})},
  109. args: [],
  110. source: "activate\x0a\x09self manager activate: self",
  111. messageSends: ["activate:", "manager"],
  112. referencedClasses: []
  113. }),
  114. smalltalk.HLTab);
  115. smalltalk.addMethod(
  116. smalltalk.method({
  117. selector: "add",
  118. category: 'accessing',
  119. fn: function (){
  120. var self=this;
  121. return smalltalk.withContext(function($ctx1) {
  122. _st(_st(self)._manager())._addTab_(self);
  123. return self}, function($ctx1) {$ctx1.fill(self,"add",{},smalltalk.HLTab)})},
  124. args: [],
  125. source: "add\x0a\x09self manager addTab: self",
  126. messageSends: ["addTab:", "manager"],
  127. referencedClasses: []
  128. }),
  129. smalltalk.HLTab);
  130. smalltalk.addMethod(
  131. smalltalk.method({
  132. selector: "displayLabel",
  133. category: 'accessing',
  134. fn: function (){
  135. var self=this;
  136. return smalltalk.withContext(function($ctx1) {
  137. var $2,$1;
  138. $2=_st(_st(_st(self)._label())._size()).__gt((20));
  139. if(smalltalk.assert($2)){
  140. $1=_st(_st(_st(self)._label())._first_((20))).__comma("...");
  141. } else {
  142. $1=_st(self)._label();
  143. };
  144. return $1;
  145. }, function($ctx1) {$ctx1.fill(self,"displayLabel",{},smalltalk.HLTab)})},
  146. args: [],
  147. source: "displayLabel\x0a\x09^ self label size > 20 \x0a\x09\x09ifTrue: [ (self label first: 20), '...' ]\x0a\x09\x09ifFalse: [ self label ]",
  148. messageSends: ["ifTrue:ifFalse:", ",", "first:", "label", ">", "size"],
  149. referencedClasses: []
  150. }),
  151. smalltalk.HLTab);
  152. smalltalk.addMethod(
  153. smalltalk.method({
  154. selector: "focus",
  155. category: 'accessing',
  156. fn: function (){
  157. var self=this;
  158. return smalltalk.withContext(function($ctx1) {
  159. var $1;
  160. $1=_st(_st(self)._widget())._canHaveFocus();
  161. if(smalltalk.assert($1)){
  162. _st(_st(self)._widget())._focus();
  163. };
  164. return self}, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLTab)})},
  165. args: [],
  166. source: "focus\x0a\x09self widget canHaveFocus ifTrue: [\x0a\x09\x09self widget focus ]",
  167. messageSends: ["ifTrue:", "focus", "widget", "canHaveFocus"],
  168. referencedClasses: []
  169. }),
  170. smalltalk.HLTab);
  171. smalltalk.addMethod(
  172. smalltalk.method({
  173. selector: "hide",
  174. category: 'actions',
  175. fn: function (){
  176. var self=this;
  177. return smalltalk.withContext(function($ctx1) {
  178. var $1;
  179. $1=self["@root"];
  180. if(($receiver = $1) == nil || $receiver == undefined){
  181. $1;
  182. } else {
  183. _st(_st(self["@root"])._asJQuery())._css_put_("visibility","hidden");
  184. };
  185. return self}, function($ctx1) {$ctx1.fill(self,"hide",{},smalltalk.HLTab)})},
  186. args: [],
  187. source: "hide\x0a\x09root ifNotNil: [ root asJQuery css: 'visibility' put: 'hidden' ]",
  188. messageSends: ["ifNotNil:", "css:put:", "asJQuery"],
  189. referencedClasses: []
  190. }),
  191. smalltalk.HLTab);
  192. smalltalk.addMethod(
  193. smalltalk.method({
  194. selector: "isActive",
  195. category: 'testing',
  196. fn: function (){
  197. var self=this;
  198. return smalltalk.withContext(function($ctx1) {
  199. var $1;
  200. $1=_st(_st(_st(self)._manager())._activeTab()).__eq(self);
  201. return $1;
  202. }, function($ctx1) {$ctx1.fill(self,"isActive",{},smalltalk.HLTab)})},
  203. args: [],
  204. source: "isActive\x0a\x09^ self manager activeTab = self",
  205. messageSends: ["=", "activeTab", "manager"],
  206. referencedClasses: []
  207. }),
  208. smalltalk.HLTab);
  209. smalltalk.addMethod(
  210. smalltalk.method({
  211. selector: "label",
  212. category: 'accessing',
  213. fn: function (){
  214. var self=this;
  215. return smalltalk.withContext(function($ctx1) {
  216. var $2,$1;
  217. $2=self["@label"];
  218. if(($receiver = $2) == nil || $receiver == undefined){
  219. $1="";
  220. } else {
  221. $1=$2;
  222. };
  223. return $1;
  224. }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLTab)})},
  225. args: [],
  226. source: "label\x0a\x09^ label ifNil: [ '' ]",
  227. messageSends: ["ifNil:"],
  228. referencedClasses: []
  229. }),
  230. smalltalk.HLTab);
  231. smalltalk.addMethod(
  232. smalltalk.method({
  233. selector: "label:",
  234. category: 'accessing',
  235. fn: function (aString){
  236. var self=this;
  237. return smalltalk.withContext(function($ctx1) {
  238. self["@label"]=aString;
  239. return self}, function($ctx1) {$ctx1.fill(self,"label:",{aString:aString},smalltalk.HLTab)})},
  240. args: ["aString"],
  241. source: "label: aString\x0a\x09label := aString",
  242. messageSends: [],
  243. referencedClasses: []
  244. }),
  245. smalltalk.HLTab);
  246. smalltalk.addMethod(
  247. smalltalk.method({
  248. selector: "manager",
  249. category: 'accessing',
  250. fn: function (){
  251. var self=this;
  252. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  253. return smalltalk.withContext(function($ctx1) {
  254. var $1;
  255. $1=_st($HLManager())._current();
  256. return $1;
  257. }, function($ctx1) {$ctx1.fill(self,"manager",{},smalltalk.HLTab)})},
  258. args: [],
  259. source: "manager\x0a\x09^ HLManager current",
  260. messageSends: ["current"],
  261. referencedClasses: ["HLManager"]
  262. }),
  263. smalltalk.HLTab);
  264. smalltalk.addMethod(
  265. smalltalk.method({
  266. selector: "registerBindings",
  267. category: 'actions',
  268. fn: function (){
  269. var self=this;
  270. return smalltalk.withContext(function($ctx1) {
  271. _st(_st(self)._widget())._registerBindings();
  272. return self}, function($ctx1) {$ctx1.fill(self,"registerBindings",{},smalltalk.HLTab)})},
  273. args: [],
  274. source: "registerBindings\x0a\x09self widget registerBindings",
  275. messageSends: ["registerBindings", "widget"],
  276. referencedClasses: []
  277. }),
  278. smalltalk.HLTab);
  279. smalltalk.addMethod(
  280. smalltalk.method({
  281. selector: "remove",
  282. category: 'actions',
  283. fn: function (){
  284. var self=this;
  285. return smalltalk.withContext(function($ctx1) {
  286. var $1;
  287. $1=self["@root"];
  288. if(($receiver = $1) == nil || $receiver == undefined){
  289. $1;
  290. } else {
  291. _st(_st(self["@root"])._asJQuery())._remove();
  292. };
  293. return self}, function($ctx1) {$ctx1.fill(self,"remove",{},smalltalk.HLTab)})},
  294. args: [],
  295. source: "remove\x0a\x09root ifNotNil: [ root asJQuery remove ]",
  296. messageSends: ["ifNotNil:", "remove", "asJQuery"],
  297. referencedClasses: []
  298. }),
  299. smalltalk.HLTab);
  300. smalltalk.addMethod(
  301. smalltalk.method({
  302. selector: "renderOn:",
  303. category: 'rendering',
  304. fn: function (html){
  305. var self=this;
  306. return smalltalk.withContext(function($ctx1) {
  307. var $1,$2;
  308. $1=_st(html)._div();
  309. _st($1)._class_("tab");
  310. $2=_st($1)._yourself();
  311. self["@root"]=$2;
  312. _st(self)._renderTab();
  313. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.HLTab)})},
  314. args: ["html"],
  315. source: "renderOn: html\x0a\x09root := html div\x0a\x09\x09class: 'tab';\x0a\x09\x09yourself.\x0a\x09self renderTab",
  316. messageSends: ["class:", "div", "yourself", "renderTab"],
  317. referencedClasses: []
  318. }),
  319. smalltalk.HLTab);
  320. smalltalk.addMethod(
  321. smalltalk.method({
  322. selector: "renderTab",
  323. category: 'rendering',
  324. fn: function (){
  325. var self=this;
  326. return smalltalk.withContext(function($ctx1) {
  327. var $1,$2;
  328. _st(self["@root"])._contents_((function(html){
  329. return smalltalk.withContext(function($ctx2) {
  330. $1=_st(html)._div();
  331. _st($1)._class_("amber_box");
  332. $2=_st($1)._with_((function(){
  333. return smalltalk.withContext(function($ctx3) {
  334. return _st(_st(self)._widget())._renderOn_(html);
  335. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  336. return $2;
  337. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}));
  338. return self}, function($ctx1) {$ctx1.fill(self,"renderTab",{},smalltalk.HLTab)})},
  339. args: [],
  340. source: "renderTab\x0a\x09root contents: [ :html |\x0a\x09\x09html div\x0a\x09\x09\x09class: 'amber_box';\x0a\x09\x09\x09with: [ self widget renderOn: html ] ]",
  341. messageSends: ["contents:", "class:", "div", "with:", "renderOn:", "widget"],
  342. referencedClasses: []
  343. }),
  344. smalltalk.HLTab);
  345. smalltalk.addMethod(
  346. smalltalk.method({
  347. selector: "show",
  348. category: 'actions',
  349. fn: function (){
  350. var self=this;
  351. return smalltalk.withContext(function($ctx1) {
  352. var $1;
  353. $1=self["@root"];
  354. if(($receiver = $1) == nil || $receiver == undefined){
  355. _st(self)._appendToJQuery_(_st("body")._asJQuery());
  356. } else {
  357. _st(_st(self["@root"])._asJQuery())._css_put_("visibility","visible");
  358. };
  359. return self}, function($ctx1) {$ctx1.fill(self,"show",{},smalltalk.HLTab)})},
  360. args: [],
  361. source: "show\x0a\x09root\x0a\x09\x09ifNil: [ self appendToJQuery: 'body' asJQuery ]\x0a\x09\x09ifNotNil: [ root asJQuery css: 'visibility' put: 'visible' ]",
  362. messageSends: ["ifNil:ifNotNil:", "appendToJQuery:", "asJQuery", "css:put:"],
  363. referencedClasses: []
  364. }),
  365. smalltalk.HLTab);
  366. smalltalk.addMethod(
  367. smalltalk.method({
  368. selector: "widget",
  369. category: 'accessing',
  370. fn: function (){
  371. var self=this;
  372. return smalltalk.withContext(function($ctx1) {
  373. var $1;
  374. $1=self["@widget"];
  375. return $1;
  376. }, function($ctx1) {$ctx1.fill(self,"widget",{},smalltalk.HLTab)})},
  377. args: [],
  378. source: "widget\x0a\x09^ widget",
  379. messageSends: [],
  380. referencedClasses: []
  381. }),
  382. smalltalk.HLTab);
  383. smalltalk.addMethod(
  384. smalltalk.method({
  385. selector: "widget:",
  386. category: 'accessing',
  387. fn: function (aWidget){
  388. var self=this;
  389. return smalltalk.withContext(function($ctx1) {
  390. self["@widget"]=aWidget;
  391. return self}, function($ctx1) {$ctx1.fill(self,"widget:",{aWidget:aWidget},smalltalk.HLTab)})},
  392. args: ["aWidget"],
  393. source: "widget: aWidget\x0a\x09widget := aWidget",
  394. messageSends: [],
  395. referencedClasses: []
  396. }),
  397. smalltalk.HLTab);
  398. smalltalk.addMethod(
  399. smalltalk.method({
  400. selector: "on:labelled:",
  401. category: 'instance creation',
  402. fn: function (aWidget,aString){
  403. var self=this;
  404. return smalltalk.withContext(function($ctx1) {
  405. var $2,$3,$1;
  406. $2=_st(self)._new();
  407. _st($2)._widget_(aWidget);
  408. _st($2)._label_(aString);
  409. $3=_st($2)._yourself();
  410. $1=$3;
  411. return $1;
  412. }, function($ctx1) {$ctx1.fill(self,"on:labelled:",{aWidget:aWidget,aString:aString},smalltalk.HLTab.klass)})},
  413. args: ["aWidget", "aString"],
  414. source: "on: aWidget labelled: aString\x0a\x09^ self new\x0a\x09\x09widget: aWidget;\x0a\x09\x09label: aString;\x0a\x09\x09yourself",
  415. messageSends: ["widget:", "new", "label:", "yourself"],
  416. referencedClasses: []
  417. }),
  418. smalltalk.HLTab.klass);
  419. smalltalk.addClass('HLWidget', smalltalk.Widget, ['wrapper'], 'Helios-Core');
  420. smalltalk.addMethod(
  421. smalltalk.method({
  422. selector: "alert:",
  423. category: 'actions',
  424. fn: function (aString){
  425. var self=this;
  426. return smalltalk.withContext(function($ctx1) {
  427. _st(window)._alert_(aString);
  428. return self}, function($ctx1) {$ctx1.fill(self,"alert:",{aString:aString},smalltalk.HLWidget)})},
  429. args: ["aString"],
  430. source: "alert: aString\x0a\x09window alert: aString",
  431. messageSends: ["alert:"],
  432. referencedClasses: []
  433. }),
  434. smalltalk.HLWidget);
  435. smalltalk.addMethod(
  436. smalltalk.method({
  437. selector: "canHaveFocus",
  438. category: 'testing',
  439. fn: function (){
  440. var self=this;
  441. return smalltalk.withContext(function($ctx1) {
  442. return false;
  443. }, function($ctx1) {$ctx1.fill(self,"canHaveFocus",{},smalltalk.HLWidget)})},
  444. args: [],
  445. source: "canHaveFocus\x0a\x09^ false",
  446. messageSends: [],
  447. referencedClasses: []
  448. }),
  449. smalltalk.HLWidget);
  450. smalltalk.addMethod(
  451. smalltalk.method({
  452. selector: "confirm:ifTrue:",
  453. category: 'actions',
  454. fn: function (aString,aBlock){
  455. var self=this;
  456. return smalltalk.withContext(function($ctx1) {
  457. _st(_st(self)._manager())._confirm_ifTrue_(aString,aBlock);
  458. return self}, function($ctx1) {$ctx1.fill(self,"confirm:ifTrue:",{aString:aString,aBlock:aBlock},smalltalk.HLWidget)})},
  459. args: ["aString", "aBlock"],
  460. source: "confirm: aString ifTrue: aBlock\x0a\x09self manager confirm: aString ifTrue: aBlock",
  461. messageSends: ["confirm:ifTrue:", "manager"],
  462. referencedClasses: []
  463. }),
  464. smalltalk.HLWidget);
  465. smalltalk.addMethod(
  466. smalltalk.method({
  467. selector: "execute:",
  468. category: 'actions',
  469. fn: function (aCommand){
  470. var self=this;
  471. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  472. return smalltalk.withContext(function($ctx1) {
  473. var $1,$2;
  474. $1=_st(_st($HLManager())._current())._keyBinder();
  475. _st($1)._activate();
  476. $2=_st($1)._applyBinding_(_st(aCommand)._asBinding());
  477. return self}, function($ctx1) {$ctx1.fill(self,"execute:",{aCommand:aCommand},smalltalk.HLWidget)})},
  478. args: ["aCommand"],
  479. source: "execute: aCommand\x0a\x09HLManager current keyBinder\x0a\x09\x09activate;\x0a\x09\x09applyBinding: aCommand asBinding",
  480. messageSends: ["activate", "keyBinder", "current", "applyBinding:", "asBinding"],
  481. referencedClasses: ["HLManager"]
  482. }),
  483. smalltalk.HLWidget);
  484. smalltalk.addMethod(
  485. smalltalk.method({
  486. selector: "manager",
  487. category: 'accessing',
  488. fn: function (){
  489. var self=this;
  490. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  491. return smalltalk.withContext(function($ctx1) {
  492. var $1;
  493. $1=_st($HLManager())._current();
  494. return $1;
  495. }, function($ctx1) {$ctx1.fill(self,"manager",{},smalltalk.HLWidget)})},
  496. args: [],
  497. source: "manager\x0a\x09^ HLManager current",
  498. messageSends: ["current"],
  499. referencedClasses: ["HLManager"]
  500. }),
  501. smalltalk.HLWidget);
  502. smalltalk.addMethod(
  503. smalltalk.method({
  504. selector: "refresh",
  505. category: 'updating',
  506. fn: function (){
  507. var self=this;
  508. return smalltalk.withContext(function($ctx1) {
  509. var $1,$2;
  510. $1=_st(self)._wrapper();
  511. if(($receiver = $1) == nil || $receiver == undefined){
  512. $2=self;
  513. return $2;
  514. } else {
  515. $1;
  516. };
  517. _st(_st(_st(self)._wrapper())._asJQuery())._empty();
  518. _st((function(html){
  519. return smalltalk.withContext(function($ctx2) {
  520. return _st(self)._renderContentOn_(html);
  521. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}))._appendToJQuery_(_st(_st(self)._wrapper())._asJQuery());
  522. return self}, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.HLWidget)})},
  523. args: [],
  524. source: "refresh\x0a\x09self wrapper ifNil: [ ^ self ].\x0a \x0a\x09self wrapper asJQuery empty.\x0a [ :html | self renderContentOn: html ] appendToJQuery: self wrapper asJQuery",
  525. messageSends: ["ifNil:", "wrapper", "empty", "asJQuery", "appendToJQuery:", "renderContentOn:"],
  526. referencedClasses: []
  527. }),
  528. smalltalk.HLWidget);
  529. smalltalk.addMethod(
  530. smalltalk.method({
  531. selector: "registerBindings",
  532. category: 'keybindings',
  533. fn: function (){
  534. var self=this;
  535. return smalltalk.withContext(function($ctx1) {
  536. _st(self)._registerBindingsOn_(_st(_st(_st(self)._manager())._keyBinder())._bindings());
  537. return self}, function($ctx1) {$ctx1.fill(self,"registerBindings",{},smalltalk.HLWidget)})},
  538. args: [],
  539. source: "registerBindings\x0a\x09self registerBindingsOn: self manager keyBinder bindings",
  540. messageSends: ["registerBindingsOn:", "bindings", "keyBinder", "manager"],
  541. referencedClasses: []
  542. }),
  543. smalltalk.HLWidget);
  544. smalltalk.addMethod(
  545. smalltalk.method({
  546. selector: "registerBindingsOn:",
  547. category: 'keybindings',
  548. fn: function (aBindingGroup){
  549. var self=this;
  550. return smalltalk.withContext(function($ctx1) {
  551. return self}, function($ctx1) {$ctx1.fill(self,"registerBindingsOn:",{aBindingGroup:aBindingGroup},smalltalk.HLWidget)})},
  552. args: ["aBindingGroup"],
  553. source: "registerBindingsOn: aBindingGroup",
  554. messageSends: [],
  555. referencedClasses: []
  556. }),
  557. smalltalk.HLWidget);
  558. smalltalk.addMethod(
  559. smalltalk.method({
  560. selector: "renderContentOn:",
  561. category: 'rendering',
  562. fn: function (html){
  563. var self=this;
  564. return smalltalk.withContext(function($ctx1) {
  565. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLWidget)})},
  566. args: ["html"],
  567. source: "renderContentOn: html",
  568. messageSends: [],
  569. referencedClasses: []
  570. }),
  571. smalltalk.HLWidget);
  572. smalltalk.addMethod(
  573. smalltalk.method({
  574. selector: "renderOn:",
  575. category: 'rendering',
  576. fn: function (html){
  577. var self=this;
  578. return smalltalk.withContext(function($ctx1) {
  579. self["@wrapper"]=_st(html)._div();
  580. _st((function(renderer){
  581. return smalltalk.withContext(function($ctx2) {
  582. return _st(self)._renderContentOn_(renderer);
  583. }, function($ctx2) {$ctx2.fillBlock({renderer:renderer},$ctx1)})}))._appendToJQuery_(_st(self["@wrapper"])._asJQuery());
  584. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.HLWidget)})},
  585. args: ["html"],
  586. source: "renderOn: html\x0a\x09wrapper := html div.\x0a [ :renderer | self renderContentOn: renderer ] appendToJQuery: wrapper asJQuery",
  587. messageSends: ["div", "appendToJQuery:", "asJQuery", "renderContentOn:"],
  588. referencedClasses: []
  589. }),
  590. smalltalk.HLWidget);
  591. smalltalk.addMethod(
  592. smalltalk.method({
  593. selector: "wrapper",
  594. category: 'accessing',
  595. fn: function (){
  596. var self=this;
  597. return smalltalk.withContext(function($ctx1) {
  598. var $1;
  599. $1=self["@wrapper"];
  600. return $1;
  601. }, function($ctx1) {$ctx1.fill(self,"wrapper",{},smalltalk.HLWidget)})},
  602. args: [],
  603. source: "wrapper\x0a\x09^ wrapper",
  604. messageSends: [],
  605. referencedClasses: []
  606. }),
  607. smalltalk.HLWidget);
  608. smalltalk.addMethod(
  609. smalltalk.method({
  610. selector: "canBeOpenAsTab",
  611. category: 'testing',
  612. fn: function (){
  613. var self=this;
  614. return smalltalk.withContext(function($ctx1) {
  615. return false;
  616. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLWidget.klass)})},
  617. args: [],
  618. source: "canBeOpenAsTab\x0a\x09^ false",
  619. messageSends: [],
  620. referencedClasses: []
  621. }),
  622. smalltalk.HLWidget.klass);
  623. smalltalk.addMethod(
  624. smalltalk.method({
  625. selector: "openAsTab",
  626. category: 'accessing',
  627. fn: function (){
  628. var self=this;
  629. function $HLTab(){return smalltalk.HLTab||(typeof HLTab=="undefined"?nil:HLTab)}
  630. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  631. return smalltalk.withContext(function($ctx1) {
  632. var $1,$2;
  633. $1=_st(self)._canBeOpenAsTab();
  634. if(! smalltalk.assert($1)){
  635. $2=self;
  636. return $2;
  637. };
  638. _st(_st($HLManager())._current())._addTab_(_st($HLTab())._on_labelled_(_st(self)._new(),_st(self)._tabLabel()));
  639. return self}, function($ctx1) {$ctx1.fill(self,"openAsTab",{},smalltalk.HLWidget.klass)})},
  640. args: [],
  641. source: "openAsTab\x0a\x09self canBeOpenAsTab ifFalse: [ ^ self ].\x0a\x09HLManager current addTab: (HLTab on: self new labelled: self tabLabel)",
  642. messageSends: ["ifFalse:", "canBeOpenAsTab", "addTab:", "on:labelled:", "new", "tabLabel", "current"],
  643. referencedClasses: ["HLTab", "HLManager"]
  644. }),
  645. smalltalk.HLWidget.klass);
  646. smalltalk.addMethod(
  647. smalltalk.method({
  648. selector: "tabLabel",
  649. category: 'accessing',
  650. fn: function (){
  651. var self=this;
  652. return smalltalk.withContext(function($ctx1) {
  653. return "Tab";
  654. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{},smalltalk.HLWidget.klass)})},
  655. args: [],
  656. source: "tabLabel\x0a\x09^ 'Tab'",
  657. messageSends: [],
  658. referencedClasses: []
  659. }),
  660. smalltalk.HLWidget.klass);
  661. smalltalk.addMethod(
  662. smalltalk.method({
  663. selector: "tabPriority",
  664. category: 'accessing',
  665. fn: function (){
  666. var self=this;
  667. return smalltalk.withContext(function($ctx1) {
  668. var $1;
  669. $1=(500);
  670. return $1;
  671. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{},smalltalk.HLWidget.klass)})},
  672. args: [],
  673. source: "tabPriority\x0a\x09^ 500",
  674. messageSends: [],
  675. referencedClasses: []
  676. }),
  677. smalltalk.HLWidget.klass);
  678. smalltalk.addClass('HLConfirmation', smalltalk.HLWidget, ['confirmationString', 'actionBlock', 'cancelBlock'], 'Helios-Core');
  679. smalltalk.addMethod(
  680. smalltalk.method({
  681. selector: "actionBlock",
  682. category: 'accessing',
  683. fn: function (){
  684. var self=this;
  685. return smalltalk.withContext(function($ctx1) {
  686. var $2,$1;
  687. $2=self["@actionBlock"];
  688. if(($receiver = $2) == nil || $receiver == undefined){
  689. $1=(function(){
  690. return smalltalk.withContext(function($ctx2) {
  691. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
  692. } else {
  693. $1=$2;
  694. };
  695. return $1;
  696. }, function($ctx1) {$ctx1.fill(self,"actionBlock",{},smalltalk.HLConfirmation)})},
  697. args: [],
  698. source: "actionBlock\x0a\x09^ actionBlock ifNil: [ [] ]",
  699. messageSends: ["ifNil:"],
  700. referencedClasses: []
  701. }),
  702. smalltalk.HLConfirmation);
  703. smalltalk.addMethod(
  704. smalltalk.method({
  705. selector: "actionBlock:",
  706. category: 'accessing',
  707. fn: function (aBlock){
  708. var self=this;
  709. return smalltalk.withContext(function($ctx1) {
  710. self["@actionBlock"]=aBlock;
  711. return self}, function($ctx1) {$ctx1.fill(self,"actionBlock:",{aBlock:aBlock},smalltalk.HLConfirmation)})},
  712. args: ["aBlock"],
  713. source: "actionBlock: aBlock\x0a\x09actionBlock := aBlock",
  714. messageSends: [],
  715. referencedClasses: []
  716. }),
  717. smalltalk.HLConfirmation);
  718. smalltalk.addMethod(
  719. smalltalk.method({
  720. selector: "cancel",
  721. category: 'actions',
  722. fn: function (){
  723. var self=this;
  724. return smalltalk.withContext(function($ctx1) {
  725. _st(_st(self)._cancelBlock())._value();
  726. _st(self)._remove();
  727. return self}, function($ctx1) {$ctx1.fill(self,"cancel",{},smalltalk.HLConfirmation)})},
  728. args: [],
  729. source: "cancel\x0a\x09self cancelBlock value.\x0a\x09self remove",
  730. messageSends: ["value", "cancelBlock", "remove"],
  731. referencedClasses: []
  732. }),
  733. smalltalk.HLConfirmation);
  734. smalltalk.addMethod(
  735. smalltalk.method({
  736. selector: "cancelBlock",
  737. category: 'accessing',
  738. fn: function (){
  739. var self=this;
  740. return smalltalk.withContext(function($ctx1) {
  741. var $2,$1;
  742. $2=self["@cancelBlock"];
  743. if(($receiver = $2) == nil || $receiver == undefined){
  744. $1=(function(){
  745. return smalltalk.withContext(function($ctx2) {
  746. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
  747. } else {
  748. $1=$2;
  749. };
  750. return $1;
  751. }, function($ctx1) {$ctx1.fill(self,"cancelBlock",{},smalltalk.HLConfirmation)})},
  752. args: [],
  753. source: "cancelBlock\x0a\x09^ cancelBlock ifNil: [ [] ]",
  754. messageSends: ["ifNil:"],
  755. referencedClasses: []
  756. }),
  757. smalltalk.HLConfirmation);
  758. smalltalk.addMethod(
  759. smalltalk.method({
  760. selector: "cancelBlock:",
  761. category: 'accessing',
  762. fn: function (aBlock){
  763. var self=this;
  764. return smalltalk.withContext(function($ctx1) {
  765. self["@cancelBlock"]=aBlock;
  766. return self}, function($ctx1) {$ctx1.fill(self,"cancelBlock:",{aBlock:aBlock},smalltalk.HLConfirmation)})},
  767. args: ["aBlock"],
  768. source: "cancelBlock: aBlock\x0a\x09cancelBlock := aBlock",
  769. messageSends: [],
  770. referencedClasses: []
  771. }),
  772. smalltalk.HLConfirmation);
  773. smalltalk.addMethod(
  774. smalltalk.method({
  775. selector: "confirm",
  776. category: 'actions',
  777. fn: function (){
  778. var self=this;
  779. return smalltalk.withContext(function($ctx1) {
  780. _st(_st(self)._actionBlock())._value();
  781. _st(self)._remove();
  782. return self}, function($ctx1) {$ctx1.fill(self,"confirm",{},smalltalk.HLConfirmation)})},
  783. args: [],
  784. source: "confirm\x0a\x09self actionBlock value.\x0a\x09self remove",
  785. messageSends: ["value", "actionBlock", "remove"],
  786. referencedClasses: []
  787. }),
  788. smalltalk.HLConfirmation);
  789. smalltalk.addMethod(
  790. smalltalk.method({
  791. selector: "confirmationString",
  792. category: 'accessing',
  793. fn: function (){
  794. var self=this;
  795. return smalltalk.withContext(function($ctx1) {
  796. var $2,$1;
  797. $2=self["@confirmationString"];
  798. if(($receiver = $2) == nil || $receiver == undefined){
  799. $1="Confirm";
  800. } else {
  801. $1=$2;
  802. };
  803. return $1;
  804. }, function($ctx1) {$ctx1.fill(self,"confirmationString",{},smalltalk.HLConfirmation)})},
  805. args: [],
  806. source: "confirmationString\x0a\x09^ confirmationString ifNil: [ 'Confirm' ]",
  807. messageSends: ["ifNil:"],
  808. referencedClasses: []
  809. }),
  810. smalltalk.HLConfirmation);
  811. smalltalk.addMethod(
  812. smalltalk.method({
  813. selector: "confirmationString:",
  814. category: 'accessing',
  815. fn: function (aString){
  816. var self=this;
  817. return smalltalk.withContext(function($ctx1) {
  818. self["@confirmationString"]=aString;
  819. return self}, function($ctx1) {$ctx1.fill(self,"confirmationString:",{aString:aString},smalltalk.HLConfirmation)})},
  820. args: ["aString"],
  821. source: "confirmationString: aString\x0a\x09confirmationString := aString",
  822. messageSends: [],
  823. referencedClasses: []
  824. }),
  825. smalltalk.HLConfirmation);
  826. smalltalk.addMethod(
  827. smalltalk.method({
  828. selector: "remove",
  829. category: 'actions',
  830. fn: function (){
  831. var self=this;
  832. return smalltalk.withContext(function($ctx1) {
  833. _st(_st(window)._jQuery_(".confirmation"))._removeClass_("active");
  834. _st((function(){
  835. return smalltalk.withContext(function($ctx2) {
  836. _st(_st(window)._jQuery_("#overlay"))._remove();
  837. return _st(_st(window)._jQuery_(".confirmation"))._remove();
  838. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._valueWithTimeout_((300));
  839. return self}, function($ctx1) {$ctx1.fill(self,"remove",{},smalltalk.HLConfirmation)})},
  840. args: [],
  841. source: "remove\x0a\x09(window jQuery: '.confirmation') removeClass: 'active'.\x0a\x09[ \x0a\x09\x09(window jQuery: '#overlay') remove.\x0a\x09\x09(window jQuery: '.confirmation') remove\x0a\x09] valueWithTimeout: 300",
  842. messageSends: ["removeClass:", "jQuery:", "valueWithTimeout:", "remove"],
  843. referencedClasses: []
  844. }),
  845. smalltalk.HLConfirmation);
  846. smalltalk.addMethod(
  847. smalltalk.method({
  848. selector: "renderContentOn:",
  849. category: 'rendering',
  850. fn: function (html){
  851. var self=this;
  852. var confirmButton;
  853. return smalltalk.withContext(function($ctx1) {
  854. var $1,$3,$5,$6,$7,$8,$4,$2;
  855. _st(_st(html)._div())._id_("overlay");
  856. $1=_st(html)._div();
  857. _st($1)._class_("confirmation");
  858. $2=_st($1)._with_((function(){
  859. return smalltalk.withContext(function($ctx2) {
  860. _st(_st(html)._span())._with_(_st(self)._confirmationString());
  861. $3=_st(html)._div();
  862. _st($3)._class_("buttons");
  863. $4=_st($3)._with_((function(){
  864. return smalltalk.withContext(function($ctx3) {
  865. $5=_st(html)._button();
  866. _st($5)._class_("button");
  867. _st($5)._with_("Cancel");
  868. $6=_st($5)._onClick_((function(){
  869. return smalltalk.withContext(function($ctx4) {
  870. return _st(self)._cancel();
  871. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
  872. $6;
  873. $7=_st(html)._button();
  874. _st($7)._class_("button default");
  875. _st($7)._with_("Confirm");
  876. $8=_st($7)._onClick_((function(){
  877. return smalltalk.withContext(function($ctx4) {
  878. return _st(self)._confirm();
  879. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
  880. confirmButton=$8;
  881. return confirmButton;
  882. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  883. return $4;
  884. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  885. _st(_st(confirmButton)._asJQuery())._focus();
  886. _st(_st(window)._jQuery_(".confirmation"))._addClass_("active");
  887. _st(self)._setupKeyBindings();
  888. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html,confirmButton:confirmButton},smalltalk.HLConfirmation)})},
  889. args: ["html"],
  890. source: "renderContentOn: html\x0a\x09| confirmButton |\x0a\x09\x0a\x09html div id: 'overlay'.\x0a\x09html div \x0a\x09\x09class: 'confirmation';\x0a\x09\x09with: [\x0a\x09\x09\x09html span with: self confirmationString.\x0a\x09\x09\x09html div \x0a\x09\x09\x09\x09class: 'buttons';\x0a\x09\x09\x09\x09with: [\x0a\x09\x09\x09\x09\x09html button\x0a\x09\x09\x09\x09\x09\x09class: 'button';\x0a\x09\x09\x09\x09\x09\x09with: 'Cancel';\x0a\x09\x09\x09\x09\x09\x09onClick: [ self cancel ].\x0a\x09\x09\x09\x09\x09confirmButton := html button\x0a\x09\x09\x09\x09\x09\x09class: 'button default';\x0a\x09\x09\x09\x09\x09\x09with: 'Confirm';\x0a\x09\x09\x09\x09\x09\x09onClick: [ self confirm ] ] ].\x0a\x0a\x09confirmButton asJQuery focus.\x0a\x09(window jQuery: '.confirmation') addClass: 'active'.\x0a\x09self setupKeyBindings",
  891. messageSends: ["id:", "div", "class:", "with:", "confirmationString", "span", "button", "onClick:", "cancel", "confirm", "focus", "asJQuery", "addClass:", "jQuery:", "setupKeyBindings"],
  892. referencedClasses: []
  893. }),
  894. smalltalk.HLConfirmation);
  895. smalltalk.addMethod(
  896. smalltalk.method({
  897. selector: "setupKeyBindings",
  898. category: 'rendering',
  899. fn: function (){
  900. var self=this;
  901. return smalltalk.withContext(function($ctx1) {
  902. var $1;
  903. _st(_st(window)._jQuery_(".confirmation"))._keyup_((function(e){
  904. return smalltalk.withContext(function($ctx2) {
  905. $1=_st(_st(e)._keyCode()).__eq((27));
  906. if(smalltalk.assert($1)){
  907. return _st(self)._cancel();
  908. };
  909. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1)})}));
  910. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyBindings",{},smalltalk.HLConfirmation)})},
  911. args: [],
  912. source: "setupKeyBindings\x0a\x09(window jQuery: '.confirmation') keyup: [ :e |\x0a\x09\x09e keyCode = 27 ifTrue: [ self cancel ] ]",
  913. messageSends: ["keyup:", "ifTrue:", "cancel", "=", "keyCode", "jQuery:"],
  914. referencedClasses: []
  915. }),
  916. smalltalk.HLConfirmation);
  917. smalltalk.addClass('HLDebugger', smalltalk.HLWidget, [], 'Helios-Core');
  918. smalltalk.addClass('HLFocusableWidget', smalltalk.HLWidget, [], 'Helios-Core');
  919. smalltalk.addMethod(
  920. smalltalk.method({
  921. selector: "blur",
  922. category: 'events',
  923. fn: function (){
  924. var self=this;
  925. return smalltalk.withContext(function($ctx1) {
  926. _st(_st(_st(self)._wrapper())._asJQuery())._blur();
  927. return self}, function($ctx1) {$ctx1.fill(self,"blur",{},smalltalk.HLFocusableWidget)})},
  928. args: [],
  929. source: "blur\x0a\x09self wrapper asJQuery blur",
  930. messageSends: ["blur", "asJQuery", "wrapper"],
  931. referencedClasses: []
  932. }),
  933. smalltalk.HLFocusableWidget);
  934. smalltalk.addMethod(
  935. smalltalk.method({
  936. selector: "canHaveFocus",
  937. category: 'testing',
  938. fn: function (){
  939. var self=this;
  940. return smalltalk.withContext(function($ctx1) {
  941. return true;
  942. }, function($ctx1) {$ctx1.fill(self,"canHaveFocus",{},smalltalk.HLFocusableWidget)})},
  943. args: [],
  944. source: "canHaveFocus\x0a\x09^ true",
  945. messageSends: [],
  946. referencedClasses: []
  947. }),
  948. smalltalk.HLFocusableWidget);
  949. smalltalk.addMethod(
  950. smalltalk.method({
  951. selector: "focus",
  952. category: 'events',
  953. fn: function (){
  954. var self=this;
  955. return smalltalk.withContext(function($ctx1) {
  956. _st(_st(_st(self)._wrapper())._asJQuery())._focus();
  957. return self}, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLFocusableWidget)})},
  958. args: [],
  959. source: "focus\x0a\x09self wrapper asJQuery focus",
  960. messageSends: ["focus", "asJQuery", "wrapper"],
  961. referencedClasses: []
  962. }),
  963. smalltalk.HLFocusableWidget);
  964. smalltalk.addMethod(
  965. smalltalk.method({
  966. selector: "focusClass",
  967. category: 'accessing',
  968. fn: function (){
  969. var self=this;
  970. return smalltalk.withContext(function($ctx1) {
  971. return "focused";
  972. }, function($ctx1) {$ctx1.fill(self,"focusClass",{},smalltalk.HLFocusableWidget)})},
  973. args: [],
  974. source: "focusClass\x0a\x09^ 'focused'",
  975. messageSends: [],
  976. referencedClasses: []
  977. }),
  978. smalltalk.HLFocusableWidget);
  979. smalltalk.addMethod(
  980. smalltalk.method({
  981. selector: "hasFocus",
  982. category: 'events',
  983. fn: function (){
  984. var self=this;
  985. return smalltalk.withContext(function($ctx1) {
  986. var $1;
  987. $1=_st(_st(_st(self)._wrapper())._notNil())._and_((function(){
  988. return smalltalk.withContext(function($ctx2) {
  989. return _st(_st(_st(self)._wrapper())._asJQuery())._is_(":focus");
  990. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  991. return $1;
  992. }, function($ctx1) {$ctx1.fill(self,"hasFocus",{},smalltalk.HLFocusableWidget)})},
  993. args: [],
  994. source: "hasFocus\x0a\x09^ self wrapper notNil and: [ self wrapper asJQuery is: ':focus' ]",
  995. messageSends: ["and:", "is:", "asJQuery", "wrapper", "notNil"],
  996. referencedClasses: []
  997. }),
  998. smalltalk.HLFocusableWidget);
  999. smalltalk.addMethod(
  1000. smalltalk.method({
  1001. selector: "renderContentOn:",
  1002. category: 'rendering',
  1003. fn: function (html){
  1004. var self=this;
  1005. return smalltalk.withContext(function($ctx1) {
  1006. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLFocusableWidget)})},
  1007. args: ["html"],
  1008. source: "renderContentOn: html",
  1009. messageSends: [],
  1010. referencedClasses: []
  1011. }),
  1012. smalltalk.HLFocusableWidget);
  1013. smalltalk.addMethod(
  1014. smalltalk.method({
  1015. selector: "renderOn:",
  1016. category: 'rendering',
  1017. fn: function (html){
  1018. var self=this;
  1019. return smalltalk.withContext(function($ctx1) {
  1020. var $1,$2,$3,$4;
  1021. _st(self)._registerBindings();
  1022. $1=_st(html)._div();
  1023. _st($1)._class_("hl_widget");
  1024. $2=_st($1)._yourself();
  1025. self["@wrapper"]=$2;
  1026. _st(self["@wrapper"])._with_((function(){
  1027. return smalltalk.withContext(function($ctx2) {
  1028. return _st(self)._renderContentOn_(html);
  1029. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1030. $3=self["@wrapper"];
  1031. _st($3)._at_put_("tabindex","0");
  1032. _st($3)._onBlur_((function(){
  1033. return smalltalk.withContext(function($ctx2) {
  1034. return _st(_st(_st(self)._wrapper())._asJQuery())._removeClass_(_st(self)._focusClass());
  1035. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1036. $4=_st($3)._onFocus_((function(){
  1037. return smalltalk.withContext(function($ctx2) {
  1038. return _st(_st(_st(self)._wrapper())._asJQuery())._addClass_(_st(self)._focusClass());
  1039. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1040. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.HLFocusableWidget)})},
  1041. args: ["html"],
  1042. source: "renderOn: html\x0a\x09self registerBindings.\x0a \x0a wrapper := html div \x0a \x09class: 'hl_widget';\x0a\x09\x09yourself.\x0a\x09\x09\x0a wrapper with: [ self renderContentOn: html ].\x0a\x09\x0a\x09wrapper\x0a\x09\x09at: 'tabindex' put: '0';\x0a\x09\x09onBlur: [ self wrapper asJQuery removeClass: self focusClass ];\x0a onFocus: [ self wrapper asJQuery addClass: self focusClass ]",
  1043. messageSends: ["registerBindings", "class:", "div", "yourself", "with:", "renderContentOn:", "at:put:", "onBlur:", "removeClass:", "focusClass", "asJQuery", "wrapper", "onFocus:", "addClass:"],
  1044. referencedClasses: []
  1045. }),
  1046. smalltalk.HLFocusableWidget);
  1047. smalltalk.addClass('HLListWidget', smalltalk.HLFocusableWidget, ['items', 'selectedItem', 'mapping'], 'Helios-Core');
  1048. smalltalk.addMethod(
  1049. smalltalk.method({
  1050. selector: "activateFirstListItem",
  1051. category: 'actions',
  1052. fn: function (){
  1053. var self=this;
  1054. return smalltalk.withContext(function($ctx1) {
  1055. _st(self)._activateListItem_(_st(window)._jQuery_(_st(_st(_st(self["@wrapper"])._asJQuery())._find_("li.inactive"))._get_((0))));
  1056. return self}, function($ctx1) {$ctx1.fill(self,"activateFirstListItem",{},smalltalk.HLListWidget)})},
  1057. args: [],
  1058. source: "activateFirstListItem\x0a\x09self activateListItem: (window jQuery: ((wrapper asJQuery find: 'li.inactive') get: 0))",
  1059. messageSends: ["activateListItem:", "jQuery:", "get:", "find:", "asJQuery"],
  1060. referencedClasses: []
  1061. }),
  1062. smalltalk.HLListWidget);
  1063. smalltalk.addMethod(
  1064. smalltalk.method({
  1065. selector: "activateItem:",
  1066. category: 'actions',
  1067. fn: function (anObject){
  1068. var self=this;
  1069. return smalltalk.withContext(function($ctx1) {
  1070. var $1;
  1071. var $early={};
  1072. try {
  1073. _st(self)._activateListItem_(_st(_st(self["@mapping"])._at_ifAbsent_(anObject,(function(){
  1074. return smalltalk.withContext(function($ctx2) {
  1075. $1=self;
  1076. throw $early=[$1];
  1077. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._asJQuery());
  1078. return self}
  1079. catch(e) {if(e===$early)return e[0]; throw e}
  1080. }, function($ctx1) {$ctx1.fill(self,"activateItem:",{anObject:anObject},smalltalk.HLListWidget)})},
  1081. args: ["anObject"],
  1082. source: "activateItem: anObject\x0a\x09self activateListItem: (mapping \x0a\x09\x09at: anObject\x0a\x09\x09ifAbsent: [ ^ self ]) asJQuery",
  1083. messageSends: ["activateListItem:", "asJQuery", "at:ifAbsent:"],
  1084. referencedClasses: []
  1085. }),
  1086. smalltalk.HLListWidget);
  1087. smalltalk.addMethod(
  1088. smalltalk.method({
  1089. selector: "activateListItem:",
  1090. category: 'actions',
  1091. fn: function (aListItem){
  1092. var self=this;
  1093. var item;
  1094. return smalltalk.withContext(function($ctx1) {
  1095. var $1,$2,$3;
  1096. $1=_st(aListItem)._get_((0));
  1097. if(($receiver = $1) == nil || $receiver == undefined){
  1098. $2=self;
  1099. return $2;
  1100. } else {
  1101. $1;
  1102. };
  1103. _st(_st(_st(aListItem)._parent())._children())._removeClass_("active");
  1104. _st(aListItem)._addClass_("active");
  1105. _st(self)._ensureVisible_(aListItem);
  1106. item=_st(_st(self)._items())._at_(_st(_st(aListItem)._attr_("list-data"))._asNumber());
  1107. $3=_st(_st(self)._selectedItem()).__eq_eq(item);
  1108. if(! smalltalk.assert($3)){
  1109. _st(self)._selectItem_(item);
  1110. };
  1111. return self}, function($ctx1) {$ctx1.fill(self,"activateListItem:",{aListItem:aListItem,item:item},smalltalk.HLListWidget)})},
  1112. args: ["aListItem"],
  1113. source: "activateListItem: aListItem\x0a\x09| item |\x0a \x0a\x09(aListItem get: 0) ifNil: [ ^self ].\x0a\x09aListItem parent children removeClass: 'active'.\x0a\x09aListItem addClass: 'active'.\x0a \x0a\x09self ensureVisible: aListItem.\x0a \x0a \x22Activate the corresponding item\x22\x0a item := (self items at: (aListItem attr: 'list-data') asNumber).\x0a self selectedItem == item ifFalse: [\x0a\x09 self selectItem: item ]",
  1114. messageSends: ["ifNil:", "get:", "removeClass:", "children", "parent", "addClass:", "ensureVisible:", "at:", "asNumber", "attr:", "items", "ifFalse:", "selectItem:", "==", "selectedItem"],
  1115. referencedClasses: []
  1116. }),
  1117. smalltalk.HLListWidget);
  1118. smalltalk.addMethod(
  1119. smalltalk.method({
  1120. selector: "activateNextListItem",
  1121. category: 'actions',
  1122. fn: function (){
  1123. var self=this;
  1124. return smalltalk.withContext(function($ctx1) {
  1125. _st(self)._activateListItem_(_st(_st(window)._jQuery_(".focused .nav-pills .active"))._next());
  1126. return self}, function($ctx1) {$ctx1.fill(self,"activateNextListItem",{},smalltalk.HLListWidget)})},
  1127. args: [],
  1128. source: "activateNextListItem\x0a\x09self activateListItem: (window jQuery: '.focused .nav-pills .active') next",
  1129. messageSends: ["activateListItem:", "next", "jQuery:"],
  1130. referencedClasses: []
  1131. }),
  1132. smalltalk.HLListWidget);
  1133. smalltalk.addMethod(
  1134. smalltalk.method({
  1135. selector: "activatePreviousListItem",
  1136. category: 'actions',
  1137. fn: function (){
  1138. var self=this;
  1139. return smalltalk.withContext(function($ctx1) {
  1140. _st(self)._activateListItem_(_st(_st(window)._jQuery_(".focused .nav-pills .active"))._prev());
  1141. return self}, function($ctx1) {$ctx1.fill(self,"activatePreviousListItem",{},smalltalk.HLListWidget)})},
  1142. args: [],
  1143. source: "activatePreviousListItem\x0a\x09self activateListItem: (window jQuery: '.focused .nav-pills .active') prev",
  1144. messageSends: ["activateListItem:", "prev", "jQuery:"],
  1145. referencedClasses: []
  1146. }),
  1147. smalltalk.HLListWidget);
  1148. smalltalk.addMethod(
  1149. smalltalk.method({
  1150. selector: "cssClassForItem:",
  1151. category: 'accessing',
  1152. fn: function (anObject){
  1153. var self=this;
  1154. return smalltalk.withContext(function($ctx1) {
  1155. var $2,$1;
  1156. $2=_st(_st(self)._selectedItem()).__eq(anObject);
  1157. if(smalltalk.assert($2)){
  1158. $1="active";
  1159. } else {
  1160. $1="inactive";
  1161. };
  1162. return $1;
  1163. }, function($ctx1) {$ctx1.fill(self,"cssClassForItem:",{anObject:anObject},smalltalk.HLListWidget)})},
  1164. args: ["anObject"],
  1165. source: "cssClassForItem: anObject\x0a\x09^ self selectedItem = anObject\x0a\x09\x09\x09ifTrue: [ 'active' ]\x0a\x09\x09\x09ifFalse: [ 'inactive' ]",
  1166. messageSends: ["ifTrue:ifFalse:", "=", "selectedItem"],
  1167. referencedClasses: []
  1168. }),
  1169. smalltalk.HLListWidget);
  1170. smalltalk.addMethod(
  1171. smalltalk.method({
  1172. selector: "defaultItems",
  1173. category: 'defaults',
  1174. fn: function (){
  1175. var self=this;
  1176. return smalltalk.withContext(function($ctx1) {
  1177. var $1;
  1178. $1=[];
  1179. return $1;
  1180. }, function($ctx1) {$ctx1.fill(self,"defaultItems",{},smalltalk.HLListWidget)})},
  1181. args: [],
  1182. source: "defaultItems\x0a\x09^ #()",
  1183. messageSends: [],
  1184. referencedClasses: []
  1185. }),
  1186. smalltalk.HLListWidget);
  1187. smalltalk.addMethod(
  1188. smalltalk.method({
  1189. selector: "ensureVisible:",
  1190. category: 'actions',
  1191. fn: function (aListItem){
  1192. var self=this;
  1193. var perent,position;
  1194. return smalltalk.withContext(function($ctx1) {
  1195. var $1,$2;
  1196. position=_st(self)._positionOf_(aListItem);
  1197. parent=_st(aListItem)._parent();
  1198. $1=_st(_st(_st(aListItem)._position())._top()).__lt((0));
  1199. if(smalltalk.assert($1)){
  1200. _st(_st(parent)._get_((0)))._scrollTop_(_st(_st(_st(_st(parent)._get_((0)))._scrollTop()).__plus(_st(_st(aListItem)._position())._top())).__minus((10)));
  1201. };
  1202. $2=_st(_st(_st(_st(aListItem)._position())._top()).__plus(_st(aListItem)._height())).__gt(_st(parent)._height());
  1203. if(smalltalk.assert($2)){
  1204. _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)));
  1205. };
  1206. return self}, function($ctx1) {$ctx1.fill(self,"ensureVisible:",{aListItem:aListItem,perent:perent,position:position},smalltalk.HLListWidget)})},
  1207. args: ["aListItem"],
  1208. source: "ensureVisible: aListItem\x09\x0a\x09\x22Move the scrollbar to show the active element\x22\x0a\x09\x0a\x09| perent position |\x0a\x09\x0a\x09position := self positionOf: aListItem.\x0a\x09parent := aListItem parent.\x0a\x09\x0a aListItem position top < 0 ifTrue: [\x0a\x09\x09(parent get: 0) scrollTop: ((parent get: 0) scrollTop + aListItem position top - 10) ].\x0a aListItem position top + aListItem height > parent height ifTrue: [ \x0a\x09\x09(parent get: 0) scrollTop: ((parent get: 0) scrollTop + aListItem height - (parent height - aListItem position top)) +10 ]",
  1209. messageSends: ["positionOf:", "parent", "ifTrue:", "scrollTop:", "-", "+", "top", "position", "scrollTop", "get:", "<", "height", ">"],
  1210. referencedClasses: []
  1211. }),
  1212. smalltalk.HLListWidget);
  1213. smalltalk.addMethod(
  1214. smalltalk.method({
  1215. selector: "focus",
  1216. category: 'actions',
  1217. fn: function (){
  1218. var self=this;
  1219. return smalltalk.withContext(function($ctx1) {
  1220. var $1,$2;
  1221. smalltalk.HLFocusableWidget.fn.prototype._focus.apply(_st(self), []);
  1222. $1=_st(_st(self)._items())._isEmpty();
  1223. if(! smalltalk.assert($1)){
  1224. $2=_st(self)._selectedItem();
  1225. if(($receiver = $2) == nil || $receiver == undefined){
  1226. _st(self)._activateFirstListItem();
  1227. } else {
  1228. $2;
  1229. };
  1230. };
  1231. return self}, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLListWidget)})},
  1232. args: [],
  1233. source: "focus\x0a\x09super focus.\x0a self items isEmpty ifFalse: [ \x0a\x09\x09self selectedItem ifNil: [ self activateFirstListItem ] ]",
  1234. messageSends: ["focus", "ifFalse:", "ifNil:", "activateFirstListItem", "selectedItem", "isEmpty", "items"],
  1235. referencedClasses: []
  1236. }),
  1237. smalltalk.HLListWidget);
  1238. smalltalk.addMethod(
  1239. smalltalk.method({
  1240. selector: "iconForItem:",
  1241. category: 'accessing',
  1242. fn: function (anObject){
  1243. var self=this;
  1244. return smalltalk.withContext(function($ctx1) {
  1245. return "";
  1246. }, function($ctx1) {$ctx1.fill(self,"iconForItem:",{anObject:anObject},smalltalk.HLListWidget)})},
  1247. args: ["anObject"],
  1248. source: "iconForItem: anObject\x0a\x09^ ''",
  1249. messageSends: [],
  1250. referencedClasses: []
  1251. }),
  1252. smalltalk.HLListWidget);
  1253. smalltalk.addMethod(
  1254. smalltalk.method({
  1255. selector: "initialize",
  1256. category: 'initialization',
  1257. fn: function (){
  1258. var self=this;
  1259. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  1260. return smalltalk.withContext(function($ctx1) {
  1261. smalltalk.HLFocusableWidget.fn.prototype._initialize.apply(_st(self), []);
  1262. self["@mapping"]=_st($Dictionary())._new();
  1263. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.HLListWidget)})},
  1264. args: [],
  1265. source: "initialize\x0a\x09super initialize.\x0a\x09\x0a\x09mapping := Dictionary new.",
  1266. messageSends: ["initialize", "new"],
  1267. referencedClasses: ["Dictionary"]
  1268. }),
  1269. smalltalk.HLListWidget);
  1270. smalltalk.addMethod(
  1271. smalltalk.method({
  1272. selector: "items",
  1273. category: 'accessing',
  1274. fn: function (){
  1275. var self=this;
  1276. return smalltalk.withContext(function($ctx1) {
  1277. var $2,$1;
  1278. $2=self["@items"];
  1279. if(($receiver = $2) == nil || $receiver == undefined){
  1280. self["@items"]=_st(self)._defaultItems();
  1281. $1=self["@items"];
  1282. } else {
  1283. $1=$2;
  1284. };
  1285. return $1;
  1286. }, function($ctx1) {$ctx1.fill(self,"items",{},smalltalk.HLListWidget)})},
  1287. args: [],
  1288. source: "items\x0a\x09^ items ifNil: [ items := self defaultItems ]",
  1289. messageSends: ["ifNil:", "defaultItems"],
  1290. referencedClasses: []
  1291. }),
  1292. smalltalk.HLListWidget);
  1293. smalltalk.addMethod(
  1294. smalltalk.method({
  1295. selector: "items:",
  1296. category: 'accessing',
  1297. fn: function (aCollection){
  1298. var self=this;
  1299. return smalltalk.withContext(function($ctx1) {
  1300. self["@items"]=aCollection;
  1301. return self}, function($ctx1) {$ctx1.fill(self,"items:",{aCollection:aCollection},smalltalk.HLListWidget)})},
  1302. args: ["aCollection"],
  1303. source: "items: aCollection\x0a\x09items := aCollection",
  1304. messageSends: [],
  1305. referencedClasses: []
  1306. }),
  1307. smalltalk.HLListWidget);
  1308. smalltalk.addMethod(
  1309. smalltalk.method({
  1310. selector: "positionOf:",
  1311. category: 'accessing',
  1312. fn: function (aListItem){
  1313. var self=this;
  1314. return smalltalk.withContext(function($ctx1) {
  1315. return aListItem.parent().children().get().indexOf(aListItem.get(0)) + 1
  1316. ;
  1317. return self}, function($ctx1) {$ctx1.fill(self,"positionOf:",{aListItem:aListItem},smalltalk.HLListWidget)})},
  1318. args: ["aListItem"],
  1319. source: "positionOf: aListItem\x0a\x09<\x0a \x09return aListItem.parent().children().get().indexOf(aListItem.get(0)) + 1\x0a\x09>",
  1320. messageSends: [],
  1321. referencedClasses: []
  1322. }),
  1323. smalltalk.HLListWidget);
  1324. smalltalk.addMethod(
  1325. smalltalk.method({
  1326. selector: "refresh",
  1327. category: 'actions',
  1328. fn: function (){
  1329. var self=this;
  1330. return smalltalk.withContext(function($ctx1) {
  1331. var $1;
  1332. var $early={};
  1333. try {
  1334. smalltalk.HLFocusableWidget.fn.prototype._refresh.apply(_st(self), []);
  1335. _st(self)._ensureVisible_(_st(_st(self["@mapping"])._at_ifAbsent_(_st(self)._selectedItem(),(function(){
  1336. return smalltalk.withContext(function($ctx2) {
  1337. $1=self;
  1338. throw $early=[$1];
  1339. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._asJQuery());
  1340. return self}
  1341. catch(e) {if(e===$early)return e[0]; throw e}
  1342. }, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.HLListWidget)})},
  1343. args: [],
  1344. source: "refresh\x0a\x09super refresh.\x0a\x09\x0a\x09self ensureVisible: (mapping \x0a\x09\x09at: self selectedItem\x0a\x09\x09ifAbsent: [ ^ self ]) asJQuery",
  1345. messageSends: ["refresh", "ensureVisible:", "asJQuery", "at:ifAbsent:", "selectedItem"],
  1346. referencedClasses: []
  1347. }),
  1348. smalltalk.HLListWidget);
  1349. smalltalk.addMethod(
  1350. smalltalk.method({
  1351. selector: "registerMappingFrom:to:",
  1352. category: 'private',
  1353. fn: function (anObject,aTag){
  1354. var self=this;
  1355. return smalltalk.withContext(function($ctx1) {
  1356. _st(self["@mapping"])._at_put_(anObject,aTag);
  1357. return self}, function($ctx1) {$ctx1.fill(self,"registerMappingFrom:to:",{anObject:anObject,aTag:aTag},smalltalk.HLListWidget)})},
  1358. args: ["anObject", "aTag"],
  1359. source: "registerMappingFrom: anObject to: aTag\x0a\x09mapping at: anObject put: aTag",
  1360. messageSends: ["at:put:"],
  1361. referencedClasses: []
  1362. }),
  1363. smalltalk.HLListWidget);
  1364. smalltalk.addMethod(
  1365. smalltalk.method({
  1366. selector: "renderButtonsOn:",
  1367. category: 'rendering',
  1368. fn: function (html){
  1369. var self=this;
  1370. return smalltalk.withContext(function($ctx1) {
  1371. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},smalltalk.HLListWidget)})},
  1372. args: ["html"],
  1373. source: "renderButtonsOn: html",
  1374. messageSends: [],
  1375. referencedClasses: []
  1376. }),
  1377. smalltalk.HLListWidget);
  1378. smalltalk.addMethod(
  1379. smalltalk.method({
  1380. selector: "renderContentOn:",
  1381. category: 'rendering',
  1382. fn: function (html){
  1383. var self=this;
  1384. return smalltalk.withContext(function($ctx1) {
  1385. var $1,$2,$3,$4;
  1386. $1=_st(html)._ul();
  1387. _st($1)._class_("nav nav-pills nav-stacked");
  1388. $2=_st($1)._with_((function(){
  1389. return smalltalk.withContext(function($ctx2) {
  1390. return _st(self)._renderListOn_(html);
  1391. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1392. $3=_st(html)._div();
  1393. _st($3)._class_("pane_actions form-actions");
  1394. $4=_st($3)._with_((function(){
  1395. return smalltalk.withContext(function($ctx2) {
  1396. return _st(self)._renderButtonsOn_(html);
  1397. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1398. _st(self)._setupKeyBindings();
  1399. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLListWidget)})},
  1400. args: ["html"],
  1401. 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",
  1402. messageSends: ["class:", "ul", "with:", "renderListOn:", "div", "renderButtonsOn:", "setupKeyBindings"],
  1403. referencedClasses: []
  1404. }),
  1405. smalltalk.HLListWidget);
  1406. smalltalk.addMethod(
  1407. smalltalk.method({
  1408. selector: "renderItem:on:",
  1409. category: 'rendering',
  1410. fn: function (anObject,html){
  1411. var self=this;
  1412. var li;
  1413. return smalltalk.withContext(function($ctx1) {
  1414. var $1,$3,$4,$2;
  1415. li=_st(html)._li();
  1416. _st(self)._registerMappingFrom_to_(anObject,li);
  1417. $1=li;
  1418. _st($1)._class_(_st(self)._cssClassForItem_(anObject));
  1419. _st($1)._at_put_("list-data",_st(_st(_st(self)._items())._indexOf_(anObject))._asString());
  1420. $2=_st($1)._with_((function(){
  1421. return smalltalk.withContext(function($ctx2) {
  1422. $3=_st(html)._a();
  1423. _st($3)._with_((function(){
  1424. return smalltalk.withContext(function($ctx3) {
  1425. _st(_st(html)._tag_("i"))._class_(_st(self)._iconForItem_(anObject));
  1426. return _st(self)._renderItemLabel_on_(anObject,html);
  1427. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1428. $4=_st($3)._onClick_((function(){
  1429. return smalltalk.withContext(function($ctx3) {
  1430. return _st(self)._activateListItem_(_st(li)._asJQuery());
  1431. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1432. return $4;
  1433. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1434. return self}, function($ctx1) {$ctx1.fill(self,"renderItem:on:",{anObject:anObject,html:html,li:li},smalltalk.HLListWidget)})},
  1435. args: ["anObject", "html"],
  1436. 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 ] ]",
  1437. messageSends: ["li", "registerMappingFrom:to:", "class:", "cssClassForItem:", "at:put:", "asString", "indexOf:", "items", "with:", "iconForItem:", "tag:", "renderItemLabel:on:", "a", "onClick:", "activateListItem:", "asJQuery"],
  1438. referencedClasses: []
  1439. }),
  1440. smalltalk.HLListWidget);
  1441. smalltalk.addMethod(
  1442. smalltalk.method({
  1443. selector: "renderItemLabel:on:",
  1444. category: 'rendering',
  1445. fn: function (anObject,html){
  1446. var self=this;
  1447. return smalltalk.withContext(function($ctx1) {
  1448. _st(html)._with_(_st(anObject)._asString());
  1449. return self}, function($ctx1) {$ctx1.fill(self,"renderItemLabel:on:",{anObject:anObject,html:html},smalltalk.HLListWidget)})},
  1450. args: ["anObject", "html"],
  1451. source: "renderItemLabel: anObject on: html\x0a\x09html with: anObject asString",
  1452. messageSends: ["with:", "asString"],
  1453. referencedClasses: []
  1454. }),
  1455. smalltalk.HLListWidget);
  1456. smalltalk.addMethod(
  1457. smalltalk.method({
  1458. selector: "renderListOn:",
  1459. category: 'rendering',
  1460. fn: function (html){
  1461. var self=this;
  1462. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  1463. return smalltalk.withContext(function($ctx1) {
  1464. self["@mapping"]=_st($Dictionary())._new();
  1465. _st(_st(self)._items())._do_((function(each){
  1466. return smalltalk.withContext(function($ctx2) {
  1467. return _st(self)._renderItem_on_(each,html);
  1468. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1469. return self}, function($ctx1) {$ctx1.fill(self,"renderListOn:",{html:html},smalltalk.HLListWidget)})},
  1470. args: ["html"],
  1471. source: "renderListOn: html\x0a\x09mapping := Dictionary new.\x0a\x09\x0a\x09self items do: [ :each | \x0a \x09self renderItem: each on: html ]",
  1472. messageSends: ["new", "do:", "renderItem:on:", "items"],
  1473. referencedClasses: ["Dictionary"]
  1474. }),
  1475. smalltalk.HLListWidget);
  1476. smalltalk.addMethod(
  1477. smalltalk.method({
  1478. selector: "selectItem:",
  1479. category: 'actions',
  1480. fn: function (anObject){
  1481. var self=this;
  1482. return smalltalk.withContext(function($ctx1) {
  1483. _st(self)._selectedItem_(anObject);
  1484. return self}, function($ctx1) {$ctx1.fill(self,"selectItem:",{anObject:anObject},smalltalk.HLListWidget)})},
  1485. args: ["anObject"],
  1486. source: "selectItem: anObject\x0a\x09self selectedItem: anObject",
  1487. messageSends: ["selectedItem:"],
  1488. referencedClasses: []
  1489. }),
  1490. smalltalk.HLListWidget);
  1491. smalltalk.addMethod(
  1492. smalltalk.method({
  1493. selector: "selectedItem",
  1494. category: 'accessing',
  1495. fn: function (){
  1496. var self=this;
  1497. return smalltalk.withContext(function($ctx1) {
  1498. var $1;
  1499. $1=self["@selectedItem"];
  1500. return $1;
  1501. }, function($ctx1) {$ctx1.fill(self,"selectedItem",{},smalltalk.HLListWidget)})},
  1502. args: [],
  1503. source: "selectedItem\x0a\x09^ selectedItem",
  1504. messageSends: [],
  1505. referencedClasses: []
  1506. }),
  1507. smalltalk.HLListWidget);
  1508. smalltalk.addMethod(
  1509. smalltalk.method({
  1510. selector: "selectedItem:",
  1511. category: 'accessing',
  1512. fn: function (anObject){
  1513. var self=this;
  1514. return smalltalk.withContext(function($ctx1) {
  1515. self["@selectedItem"]=anObject;
  1516. return self}, function($ctx1) {$ctx1.fill(self,"selectedItem:",{anObject:anObject},smalltalk.HLListWidget)})},
  1517. args: ["anObject"],
  1518. source: "selectedItem: anObject\x0a\x09selectedItem := anObject",
  1519. messageSends: [],
  1520. referencedClasses: []
  1521. }),
  1522. smalltalk.HLListWidget);
  1523. smalltalk.addMethod(
  1524. smalltalk.method({
  1525. selector: "setupKeyBindings",
  1526. category: 'events',
  1527. fn: function (){
  1528. var self=this;
  1529. var active,interval,delay,repeatInterval;
  1530. return smalltalk.withContext(function($ctx1) {
  1531. var $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11;
  1532. active=false;
  1533. repeatInterval=(70);
  1534. _st(_st(_st(self)._wrapper())._asJQuery())._unbind_("keydown");
  1535. _st(_st(_st(self)._wrapper())._asJQuery())._keydown_((function(e){
  1536. return smalltalk.withContext(function($ctx2) {
  1537. $1=_st(_st(_st(e)._which()).__eq((38)))._and_((function(){
  1538. return smalltalk.withContext(function($ctx3) {
  1539. return _st(active).__eq(false);
  1540. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1541. if(smalltalk.assert($1)){
  1542. active=true;
  1543. active;
  1544. _st(self)._activatePreviousListItem();
  1545. delay=_st((function(){
  1546. return smalltalk.withContext(function($ctx3) {
  1547. interval=_st((function(){
  1548. return smalltalk.withContext(function($ctx4) {
  1549. $2=_st(_st(_st(self)._wrapper())._asJQuery())._hasClass_(_st(self)._focusClass());
  1550. if(smalltalk.assert($2)){
  1551. return _st(self)._activatePreviousListItem();
  1552. } else {
  1553. active=false;
  1554. active;
  1555. $3=interval;
  1556. if(($receiver = $3) == nil || $receiver == undefined){
  1557. $3;
  1558. } else {
  1559. _st(interval)._clearInterval();
  1560. };
  1561. $4=delay;
  1562. if(($receiver = $4) == nil || $receiver == undefined){
  1563. return $4;
  1564. } else {
  1565. return _st(delay)._clearTimeout();
  1566. };
  1567. };
  1568. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}))._valueWithInterval_(repeatInterval);
  1569. return interval;
  1570. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}))._valueWithTimeout_((300));
  1571. delay;
  1572. };
  1573. $5=_st(_st(_st(e)._which()).__eq((40)))._and_((function(){
  1574. return smalltalk.withContext(function($ctx3) {
  1575. return _st(active).__eq(false);
  1576. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1577. if(smalltalk.assert($5)){
  1578. active=true;
  1579. active;
  1580. _st(self)._activateNextListItem();
  1581. delay=_st((function(){
  1582. return smalltalk.withContext(function($ctx3) {
  1583. interval=_st((function(){
  1584. return smalltalk.withContext(function($ctx4) {
  1585. $6=_st(_st(_st(self)._wrapper())._asJQuery())._hasClass_(_st(self)._focusClass());
  1586. if(smalltalk.assert($6)){
  1587. return _st(self)._activateNextListItem();
  1588. } else {
  1589. active=false;
  1590. active;
  1591. $7=interval;
  1592. if(($receiver = $7) == nil || $receiver == undefined){
  1593. $7;
  1594. } else {
  1595. _st(interval)._clearInterval();
  1596. };
  1597. $8=delay;
  1598. if(($receiver = $8) == nil || $receiver == undefined){
  1599. return $8;
  1600. } else {
  1601. return _st(delay)._clearTimeout();
  1602. };
  1603. };
  1604. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}))._valueWithInterval_(repeatInterval);
  1605. return interval;
  1606. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}))._valueWithTimeout_((300));
  1607. return delay;
  1608. };
  1609. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1)})}));
  1610. _st(_st(_st(self)._wrapper())._asJQuery())._keyup_((function(e){
  1611. return smalltalk.withContext(function($ctx2) {
  1612. $9=active;
  1613. if(smalltalk.assert($9)){
  1614. active=false;
  1615. active;
  1616. $10=interval;
  1617. if(($receiver = $10) == nil || $receiver == undefined){
  1618. $10;
  1619. } else {
  1620. _st(interval)._clearInterval();
  1621. };
  1622. $11=delay;
  1623. if(($receiver = $11) == nil || $receiver == undefined){
  1624. return $11;
  1625. } else {
  1626. return _st(delay)._clearTimeout();
  1627. };
  1628. };
  1629. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1)})}));
  1630. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyBindings",{active:active,interval:interval,delay:delay,repeatInterval:repeatInterval},smalltalk.HLListWidget)})},
  1631. args: [],
  1632. source: "setupKeyBindings\x0a\x09\x22TODO: refactor this!\x22\x0a\x09\x0a\x09| active interval delay repeatInterval |\x0a\x09\x0a\x09active := false.\x0a\x09repeatInterval := 70.\x0a\x09self wrapper asJQuery unbind: 'keydown'.\x0a\x0a\x09self wrapper asJQuery keydown: [ :e |\x0a\x09\x09\x0a (e which = 38 and: [ active = false ]) ifTrue: [ \x0a\x09\x09\x09active := true.\x0a\x09\x09\x09self activatePreviousListItem.\x0a \x09delay := [\x0a\x09\x09\x09\x09interval := [\x0a\x09\x09\x09\x09\x09(self wrapper asJQuery hasClass: self focusClass)\x0a\x09\x09\x09\x09\x09\x09ifTrue: [\x0a\x09\x09\x09\x09\x09\x09\x09self activatePreviousListItem ]\x0a\x09\x09\x09\x09\x09\x09ifFalse: [\x0a\x09\x09\x09\x09\x09\x09\x09active := false.\x0a\x09\x09\x09\x09\x09\x09\x09interval ifNotNil: [ interval clearInterval ].\x0a\x09\x09\x09\x09\x09\x09\x09delay ifNotNil: [ delay clearTimeout] ] ]\x0a\x09\x09\x09\x09\x09valueWithInterval: repeatInterval ]\x0a\x09\x09\x09\x09\x09\x09valueWithTimeout: 300 ].\x0a\x09\x09\x09\x0a \x09(e which = 40 and: [ active = false ]) ifTrue: [\x0a active := true.\x0a\x09\x09\x09self activateNextListItem.\x0a \x09delay := [\x0a\x09\x09\x09\x09interval := [ \x0a\x09\x09\x09\x09\x09(self wrapper asJQuery hasClass: self focusClass)\x0a\x09\x09\x09\x09\x09\x09ifTrue: [\x0a\x09\x09\x09\x09\x09\x09\x09self activateNextListItem ]\x0a\x09\x09\x09\x09\x09\x09ifFalse: [\x0a\x09\x09\x09\x09\x09\x09\x09active := false.\x0a\x09\x09\x09\x09\x09\x09\x09interval ifNotNil: [ interval clearInterval ].\x0a\x09\x09\x09\x09\x09\x09\x09delay ifNotNil: [ delay clearTimeout] ] ]\x0a\x09\x09\x09\x09\x09valueWithInterval: repeatInterval ]\x0a\x09\x09\x09\x09\x09\x09valueWithTimeout: 300 ] ].\x0a\x09\x0a\x09self wrapper asJQuery keyup: [ :e |\x0a\x09\x09active ifTrue: [\x0a\x09\x09\x09active := false.\x0a\x09\x09\x09interval ifNotNil: [ interval clearInterval ].\x0a\x09\x09\x09delay ifNotNil: [ delay clearTimeout] ] ]",
  1633. messageSends: ["unbind:", "asJQuery", "wrapper", "keydown:", "ifTrue:", "activatePreviousListItem", "valueWithTimeout:", "valueWithInterval:", "ifTrue:ifFalse:", "ifNotNil:", "clearInterval", "clearTimeout", "hasClass:", "focusClass", "and:", "=", "which", "activateNextListItem", "keyup:"],
  1634. referencedClasses: []
  1635. }),
  1636. smalltalk.HLListWidget);
  1637. smalltalk.addClass('HLNavigationListWidget', smalltalk.HLListWidget, ['previous', 'next'], 'Helios-Core');
  1638. smalltalk.addMethod(
  1639. smalltalk.method({
  1640. selector: "next",
  1641. category: 'accessing',
  1642. fn: function (){
  1643. var self=this;
  1644. return smalltalk.withContext(function($ctx1) {
  1645. var $1;
  1646. $1=self["@next"];
  1647. return $1;
  1648. }, function($ctx1) {$ctx1.fill(self,"next",{},smalltalk.HLNavigationListWidget)})},
  1649. args: [],
  1650. source: "next\x0a\x09^ next",
  1651. messageSends: [],
  1652. referencedClasses: []
  1653. }),
  1654. smalltalk.HLNavigationListWidget);
  1655. smalltalk.addMethod(
  1656. smalltalk.method({
  1657. selector: "next:",
  1658. category: 'accessing',
  1659. fn: function (aWidget){
  1660. var self=this;
  1661. return smalltalk.withContext(function($ctx1) {
  1662. var $1;
  1663. self["@next"]=aWidget;
  1664. $1=_st(_st(aWidget)._previous()).__eq(self);
  1665. if(! smalltalk.assert($1)){
  1666. _st(aWidget)._previous_(self);
  1667. };
  1668. return self}, function($ctx1) {$ctx1.fill(self,"next:",{aWidget:aWidget},smalltalk.HLNavigationListWidget)})},
  1669. args: ["aWidget"],
  1670. source: "next: aWidget\x0a\x09next := aWidget.\x0a aWidget previous = self ifFalse: [ aWidget previous: self ]",
  1671. messageSends: ["ifFalse:", "previous:", "=", "previous"],
  1672. referencedClasses: []
  1673. }),
  1674. smalltalk.HLNavigationListWidget);
  1675. smalltalk.addMethod(
  1676. smalltalk.method({
  1677. selector: "nextFocus",
  1678. category: 'actions',
  1679. fn: function (){
  1680. var self=this;
  1681. return smalltalk.withContext(function($ctx1) {
  1682. var $1;
  1683. $1=_st(self)._next();
  1684. if(($receiver = $1) == nil || $receiver == undefined){
  1685. $1;
  1686. } else {
  1687. _st(_st(self)._next())._focus();
  1688. };
  1689. return self}, function($ctx1) {$ctx1.fill(self,"nextFocus",{},smalltalk.HLNavigationListWidget)})},
  1690. args: [],
  1691. source: "nextFocus\x0a\x09self next ifNotNil: [ self next focus ]",
  1692. messageSends: ["ifNotNil:", "focus", "next"],
  1693. referencedClasses: []
  1694. }),
  1695. smalltalk.HLNavigationListWidget);
  1696. smalltalk.addMethod(
  1697. smalltalk.method({
  1698. selector: "previous",
  1699. category: 'accessing',
  1700. fn: function (){
  1701. var self=this;
  1702. return smalltalk.withContext(function($ctx1) {
  1703. var $1;
  1704. $1=self["@previous"];
  1705. return $1;
  1706. }, function($ctx1) {$ctx1.fill(self,"previous",{},smalltalk.HLNavigationListWidget)})},
  1707. args: [],
  1708. source: "previous\x0a\x09^ previous",
  1709. messageSends: [],
  1710. referencedClasses: []
  1711. }),
  1712. smalltalk.HLNavigationListWidget);
  1713. smalltalk.addMethod(
  1714. smalltalk.method({
  1715. selector: "previous:",
  1716. category: 'accessing',
  1717. fn: function (aWidget){
  1718. var self=this;
  1719. return smalltalk.withContext(function($ctx1) {
  1720. var $1;
  1721. self["@previous"]=aWidget;
  1722. $1=_st(_st(aWidget)._next()).__eq(self);
  1723. if(! smalltalk.assert($1)){
  1724. _st(aWidget)._next_(self);
  1725. };
  1726. return self}, function($ctx1) {$ctx1.fill(self,"previous:",{aWidget:aWidget},smalltalk.HLNavigationListWidget)})},
  1727. args: ["aWidget"],
  1728. source: "previous: aWidget\x0a\x09previous := aWidget.\x0a aWidget next = self ifFalse: [ aWidget next: self ]",
  1729. messageSends: ["ifFalse:", "next:", "=", "next"],
  1730. referencedClasses: []
  1731. }),
  1732. smalltalk.HLNavigationListWidget);
  1733. smalltalk.addMethod(
  1734. smalltalk.method({
  1735. selector: "previousFocus",
  1736. category: 'actions',
  1737. fn: function (){
  1738. var self=this;
  1739. return smalltalk.withContext(function($ctx1) {
  1740. var $1;
  1741. $1=_st(self)._previous();
  1742. if(($receiver = $1) == nil || $receiver == undefined){
  1743. $1;
  1744. } else {
  1745. _st(_st(self)._previous())._focus();
  1746. };
  1747. return self}, function($ctx1) {$ctx1.fill(self,"previousFocus",{},smalltalk.HLNavigationListWidget)})},
  1748. args: [],
  1749. source: "previousFocus\x0a\x09self previous ifNotNil: [ self previous focus ]",
  1750. messageSends: ["ifNotNil:", "focus", "previous"],
  1751. referencedClasses: []
  1752. }),
  1753. smalltalk.HLNavigationListWidget);
  1754. smalltalk.addMethod(
  1755. smalltalk.method({
  1756. selector: "setupKeyBindings",
  1757. category: 'events',
  1758. fn: function (){
  1759. var self=this;
  1760. return smalltalk.withContext(function($ctx1) {
  1761. var $1,$2;
  1762. smalltalk.HLListWidget.fn.prototype._setupKeyBindings.apply(_st(self), []);
  1763. _st(_st(_st(self)._wrapper())._asJQuery())._keydown_((function(e){
  1764. return smalltalk.withContext(function($ctx2) {
  1765. $1=_st(_st(e)._which()).__eq((39));
  1766. if(smalltalk.assert($1)){
  1767. _st(self)._nextFocus();
  1768. };
  1769. $2=_st(_st(e)._which()).__eq((37));
  1770. if(smalltalk.assert($2)){
  1771. return _st(self)._previousFocus();
  1772. };
  1773. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1)})}));
  1774. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyBindings",{},smalltalk.HLNavigationListWidget)})},
  1775. args: [],
  1776. source: "setupKeyBindings\x0a\x09super setupKeyBindings.\x0a\x0a\x09self wrapper asJQuery keydown: [ :e |\x0a e which = 39 ifTrue: [ \x0a \x09self nextFocus ].\x0a\x09\x09e which = 37 ifTrue: [ \x0a \x09self previousFocus ] ]",
  1777. messageSends: ["setupKeyBindings", "keydown:", "ifTrue:", "nextFocus", "=", "which", "previousFocus", "asJQuery", "wrapper"],
  1778. referencedClasses: []
  1779. }),
  1780. smalltalk.HLNavigationListWidget);
  1781. smalltalk.addClass('HLManager', smalltalk.HLWidget, ['tabs', 'activeTab', 'keyBinder', 'environment', 'history'], 'Helios-Core');
  1782. smalltalk.addMethod(
  1783. smalltalk.method({
  1784. selector: "activate:",
  1785. category: 'actions',
  1786. fn: function (aTab){
  1787. var self=this;
  1788. return smalltalk.withContext(function($ctx1) {
  1789. var $1,$2;
  1790. _st(_st(self)._keyBinder())._flushBindings();
  1791. _st(aTab)._registerBindings();
  1792. self["@activeTab"]=aTab;
  1793. $1=self;
  1794. _st($1)._refresh();
  1795. _st($1)._addToHistory_(aTab);
  1796. $2=_st($1)._show_(aTab);
  1797. return self}, function($ctx1) {$ctx1.fill(self,"activate:",{aTab:aTab},smalltalk.HLManager)})},
  1798. args: ["aTab"],
  1799. 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",
  1800. messageSends: ["flushBindings", "keyBinder", "registerBindings", "refresh", "addToHistory:", "show:"],
  1801. referencedClasses: []
  1802. }),
  1803. smalltalk.HLManager);
  1804. smalltalk.addMethod(
  1805. smalltalk.method({
  1806. selector: "activeTab",
  1807. category: 'accessing',
  1808. fn: function (){
  1809. var self=this;
  1810. return smalltalk.withContext(function($ctx1) {
  1811. var $1;
  1812. $1=self["@activeTab"];
  1813. return $1;
  1814. }, function($ctx1) {$ctx1.fill(self,"activeTab",{},smalltalk.HLManager)})},
  1815. args: [],
  1816. source: "activeTab\x0a\x09^ activeTab",
  1817. messageSends: [],
  1818. referencedClasses: []
  1819. }),
  1820. smalltalk.HLManager);
  1821. smalltalk.addMethod(
  1822. smalltalk.method({
  1823. selector: "addTab:",
  1824. category: 'actions',
  1825. fn: function (aTab){
  1826. var self=this;
  1827. return smalltalk.withContext(function($ctx1) {
  1828. _st(_st(self)._tabs())._add_(aTab);
  1829. _st(self)._activate_(aTab);
  1830. return self}, function($ctx1) {$ctx1.fill(self,"addTab:",{aTab:aTab},smalltalk.HLManager)})},
  1831. args: ["aTab"],
  1832. source: "addTab: aTab\x0a\x09self tabs add: aTab.\x0a self activate: aTab",
  1833. messageSends: ["add:", "tabs", "activate:"],
  1834. referencedClasses: []
  1835. }),
  1836. smalltalk.HLManager);
  1837. smalltalk.addMethod(
  1838. smalltalk.method({
  1839. selector: "addToHistory:",
  1840. category: 'actions',
  1841. fn: function (aTab){
  1842. var self=this;
  1843. return smalltalk.withContext(function($ctx1) {
  1844. _st(self)._removeFromHistory_(aTab);
  1845. _st(_st(self)._history())._add_(aTab);
  1846. return self}, function($ctx1) {$ctx1.fill(self,"addToHistory:",{aTab:aTab},smalltalk.HLManager)})},
  1847. args: ["aTab"],
  1848. source: "addToHistory: aTab\x0a\x09self removeFromHistory: aTab.\x0a\x09self history add: aTab",
  1849. messageSends: ["removeFromHistory:", "add:", "history"],
  1850. referencedClasses: []
  1851. }),
  1852. smalltalk.HLManager);
  1853. smalltalk.addMethod(
  1854. smalltalk.method({
  1855. selector: "confirm:ifFalse:",
  1856. category: 'actions',
  1857. fn: function (aString,aBlock){
  1858. var self=this;
  1859. function $HLConfirmation(){return smalltalk.HLConfirmation||(typeof HLConfirmation=="undefined"?nil:HLConfirmation)}
  1860. return smalltalk.withContext(function($ctx1) {
  1861. var $1,$2;
  1862. $1=_st($HLConfirmation())._new();
  1863. _st($1)._confirmationString_(aString);
  1864. _st($1)._cancelBlock_(aBlock);
  1865. $2=_st($1)._yourself();
  1866. _st($2)._appendToJQuery_(_st("body")._asJQuery());
  1867. return self}, function($ctx1) {$ctx1.fill(self,"confirm:ifFalse:",{aString:aString,aBlock:aBlock},smalltalk.HLManager)})},
  1868. args: ["aString", "aBlock"],
  1869. source: "confirm: aString ifFalse: aBlock\x0a\x09(HLConfirmation new\x0a\x09\x09confirmationString: aString;\x0a\x09\x09cancelBlock: aBlock;\x0a\x09\x09yourself)\x0a\x09\x09\x09appendToJQuery: 'body' asJQuery",
  1870. messageSends: ["appendToJQuery:", "asJQuery", "confirmationString:", "new", "cancelBlock:", "yourself"],
  1871. referencedClasses: ["HLConfirmation"]
  1872. }),
  1873. smalltalk.HLManager);
  1874. smalltalk.addMethod(
  1875. smalltalk.method({
  1876. selector: "confirm:ifTrue:",
  1877. category: 'actions',
  1878. fn: function (aString,aBlock){
  1879. var self=this;
  1880. function $HLConfirmation(){return smalltalk.HLConfirmation||(typeof HLConfirmation=="undefined"?nil:HLConfirmation)}
  1881. return smalltalk.withContext(function($ctx1) {
  1882. var $1,$2;
  1883. $1=_st($HLConfirmation())._new();
  1884. _st($1)._confirmationString_(aString);
  1885. _st($1)._actionBlock_(aBlock);
  1886. $2=_st($1)._yourself();
  1887. _st($2)._appendToJQuery_(_st("body")._asJQuery());
  1888. return self}, function($ctx1) {$ctx1.fill(self,"confirm:ifTrue:",{aString:aString,aBlock:aBlock},smalltalk.HLManager)})},
  1889. args: ["aString", "aBlock"],
  1890. source: "confirm: aString ifTrue: aBlock\x0a\x09(HLConfirmation new\x0a\x09\x09confirmationString: aString;\x0a\x09\x09actionBlock: aBlock;\x0a\x09\x09yourself)\x0a\x09\x09\x09appendToJQuery: 'body' asJQuery",
  1891. messageSends: ["appendToJQuery:", "asJQuery", "confirmationString:", "new", "actionBlock:", "yourself"],
  1892. referencedClasses: ["HLConfirmation"]
  1893. }),
  1894. smalltalk.HLManager);
  1895. smalltalk.addMethod(
  1896. smalltalk.method({
  1897. selector: "defaultEnvironment",
  1898. category: 'defaults',
  1899. fn: function (){
  1900. var self=this;
  1901. function $Environment(){return smalltalk.Environment||(typeof Environment=="undefined"?nil:Environment)}
  1902. return smalltalk.withContext(function($ctx1) {
  1903. var $1,$2,$3;
  1904. $1=_st(window)._parent();
  1905. if(($receiver = $1) == nil || $receiver == undefined){
  1906. $2=_st($Environment())._new();
  1907. return $2;
  1908. } else {
  1909. $1;
  1910. };
  1911. $3=_st(_st(_st(_st(window)._parent())._at_("smalltalk"))._at_("Environment"))._new();
  1912. return $3;
  1913. }, function($ctx1) {$ctx1.fill(self,"defaultEnvironment",{},smalltalk.HLManager)})},
  1914. args: [],
  1915. source: "defaultEnvironment\x0a\x09\x22If helios is loaded from within a frame, answer the parent window environment\x22\x0a\x09\x0a\x09window parent ifNil: [ ^ Environment new ].\x0a\x09\x0a\x09^ ((window parent at: 'smalltalk')\x0a\x09\x09at: 'Environment') new",
  1916. messageSends: ["ifNil:", "new", "parent", "at:"],
  1917. referencedClasses: ["Environment"]
  1918. }),
  1919. smalltalk.HLManager);
  1920. smalltalk.addMethod(
  1921. smalltalk.method({
  1922. selector: "environment",
  1923. category: 'accessing',
  1924. fn: function (){
  1925. var self=this;
  1926. return smalltalk.withContext(function($ctx1) {
  1927. var $2,$1;
  1928. $2=self["@environment"];
  1929. if(($receiver = $2) == nil || $receiver == undefined){
  1930. self["@environment"]=_st(self)._defaultEnvironment();
  1931. $1=self["@environment"];
  1932. } else {
  1933. $1=$2;
  1934. };
  1935. return $1;
  1936. }, function($ctx1) {$ctx1.fill(self,"environment",{},smalltalk.HLManager)})},
  1937. args: [],
  1938. source: "environment\x0a\x09\x22The default environment used by all Helios objects\x22\x0a \x0a\x09^ environment ifNil: [ environment := self defaultEnvironment ]",
  1939. messageSends: ["ifNil:", "defaultEnvironment"],
  1940. referencedClasses: []
  1941. }),
  1942. smalltalk.HLManager);
  1943. smalltalk.addMethod(
  1944. smalltalk.method({
  1945. selector: "environment:",
  1946. category: 'accessing',
  1947. fn: function (anEnvironment){
  1948. var self=this;
  1949. return smalltalk.withContext(function($ctx1) {
  1950. self["@environment"]=anEnvironment;
  1951. return self}, function($ctx1) {$ctx1.fill(self,"environment:",{anEnvironment:anEnvironment},smalltalk.HLManager)})},
  1952. args: ["anEnvironment"],
  1953. source: "environment: anEnvironment\x0a\x09environment := anEnvironment",
  1954. messageSends: [],
  1955. referencedClasses: []
  1956. }),
  1957. smalltalk.HLManager);
  1958. smalltalk.addMethod(
  1959. smalltalk.method({
  1960. selector: "history",
  1961. category: 'accessing',
  1962. fn: function (){
  1963. var self=this;
  1964. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  1965. return smalltalk.withContext(function($ctx1) {
  1966. var $2,$1;
  1967. $2=self["@history"];
  1968. if(($receiver = $2) == nil || $receiver == undefined){
  1969. self["@history"]=_st($OrderedCollection())._new();
  1970. $1=self["@history"];
  1971. } else {
  1972. $1=$2;
  1973. };
  1974. return $1;
  1975. }, function($ctx1) {$ctx1.fill(self,"history",{},smalltalk.HLManager)})},
  1976. args: [],
  1977. source: "history\x0a\x09^ history ifNil: [ history := OrderedCollection new ]",
  1978. messageSends: ["ifNil:", "new"],
  1979. referencedClasses: ["OrderedCollection"]
  1980. }),
  1981. smalltalk.HLManager);
  1982. smalltalk.addMethod(
  1983. smalltalk.method({
  1984. selector: "history:",
  1985. category: 'accessing',
  1986. fn: function (aCollection){
  1987. var self=this;
  1988. return smalltalk.withContext(function($ctx1) {
  1989. self["@history"]=aCollection;
  1990. return self}, function($ctx1) {$ctx1.fill(self,"history:",{aCollection:aCollection},smalltalk.HLManager)})},
  1991. args: ["aCollection"],
  1992. source: "history: aCollection\x0a\x09history := aCollection",
  1993. messageSends: [],
  1994. referencedClasses: []
  1995. }),
  1996. smalltalk.HLManager);
  1997. smalltalk.addMethod(
  1998. smalltalk.method({
  1999. selector: "initialize",
  2000. category: 'initialization',
  2001. fn: function (){
  2002. var self=this;
  2003. return smalltalk.withContext(function($ctx1) {
  2004. smalltalk.HLWidget.fn.prototype._initialize.apply(_st(self), []);
  2005. _st(_st(self)._keyBinder())._setupEvents();
  2006. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.HLManager)})},
  2007. args: [],
  2008. source: "initialize\x0a\x09super initialize.\x0a self keyBinder setupEvents",
  2009. messageSends: ["initialize", "setupEvents", "keyBinder"],
  2010. referencedClasses: []
  2011. }),
  2012. smalltalk.HLManager);
  2013. smalltalk.addMethod(
  2014. smalltalk.method({
  2015. selector: "keyBinder",
  2016. category: 'accessing',
  2017. fn: function (){
  2018. var self=this;
  2019. function $HLKeyBinder(){return smalltalk.HLKeyBinder||(typeof HLKeyBinder=="undefined"?nil:HLKeyBinder)}
  2020. return smalltalk.withContext(function($ctx1) {
  2021. var $2,$1;
  2022. $2=self["@keyBinder"];
  2023. if(($receiver = $2) == nil || $receiver == undefined){
  2024. self["@keyBinder"]=_st($HLKeyBinder())._new();
  2025. $1=self["@keyBinder"];
  2026. } else {
  2027. $1=$2;
  2028. };
  2029. return $1;
  2030. }, function($ctx1) {$ctx1.fill(self,"keyBinder",{},smalltalk.HLManager)})},
  2031. args: [],
  2032. source: "keyBinder\x0a\x09^ keyBinder ifNil: [ keyBinder := HLKeyBinder new ]",
  2033. messageSends: ["ifNil:", "new"],
  2034. referencedClasses: ["HLKeyBinder"]
  2035. }),
  2036. smalltalk.HLManager);
  2037. smalltalk.addMethod(
  2038. smalltalk.method({
  2039. selector: "refresh",
  2040. category: 'rendering',
  2041. fn: function (){
  2042. var self=this;
  2043. return smalltalk.withContext(function($ctx1) {
  2044. _st(_st(window)._jQuery_(".navbar"))._remove();
  2045. _st(self)._appendToJQuery_(_st("body")._asJQuery());
  2046. return self}, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.HLManager)})},
  2047. args: [],
  2048. source: "refresh\x0a\x09(window jQuery: '.navbar') remove.\x0a\x09self appendToJQuery: 'body' asJQuery",
  2049. messageSends: ["remove", "jQuery:", "appendToJQuery:", "asJQuery"],
  2050. referencedClasses: []
  2051. }),
  2052. smalltalk.HLManager);
  2053. smalltalk.addMethod(
  2054. smalltalk.method({
  2055. selector: "removeActiveTab",
  2056. category: 'actions',
  2057. fn: function (){
  2058. var self=this;
  2059. return smalltalk.withContext(function($ctx1) {
  2060. _st(self)._removeTab_(_st(self)._activeTab());
  2061. return self}, function($ctx1) {$ctx1.fill(self,"removeActiveTab",{},smalltalk.HLManager)})},
  2062. args: [],
  2063. source: "removeActiveTab\x0a\x09self removeTab: self activeTab",
  2064. messageSends: ["removeTab:", "activeTab"],
  2065. referencedClasses: []
  2066. }),
  2067. smalltalk.HLManager);
  2068. smalltalk.addMethod(
  2069. smalltalk.method({
  2070. selector: "removeFromHistory:",
  2071. category: 'actions',
  2072. fn: function (aTab){
  2073. var self=this;
  2074. return smalltalk.withContext(function($ctx1) {
  2075. _st(self)._history_(_st(_st(self)._history())._reject_((function(each){
  2076. return smalltalk.withContext(function($ctx2) {
  2077. return _st(each).__eq_eq(aTab);
  2078. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})));
  2079. return self}, function($ctx1) {$ctx1.fill(self,"removeFromHistory:",{aTab:aTab},smalltalk.HLManager)})},
  2080. args: ["aTab"],
  2081. source: "removeFromHistory: aTab\x0a\x09self history: (self history reject: [ :each | each == aTab ])",
  2082. messageSends: ["history:", "reject:", "==", "history"],
  2083. referencedClasses: []
  2084. }),
  2085. smalltalk.HLManager);
  2086. smalltalk.addMethod(
  2087. smalltalk.method({
  2088. selector: "removeTab:",
  2089. category: 'actions',
  2090. fn: function (aTab){
  2091. var self=this;
  2092. return smalltalk.withContext(function($ctx1) {
  2093. var $1,$2;
  2094. $1=_st(_st(self)._tabs())._includes_(aTab);
  2095. if(! smalltalk.assert($1)){
  2096. $2=self;
  2097. return $2;
  2098. };
  2099. _st(self)._removeFromHistory_(aTab);
  2100. _st(_st(self)._tabs())._remove_(aTab);
  2101. _st(_st(self)._keyBinder())._flushBindings();
  2102. _st(aTab)._remove();
  2103. _st(self)._refresh();
  2104. _st(_st(self)._history())._ifNotEmpty_((function(){
  2105. return smalltalk.withContext(function($ctx2) {
  2106. return _st(_st(_st(self)._history())._last())._activate();
  2107. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2108. return self}, function($ctx1) {$ctx1.fill(self,"removeTab:",{aTab:aTab},smalltalk.HLManager)})},
  2109. args: ["aTab"],
  2110. 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 ]",
  2111. messageSends: ["ifFalse:", "includes:", "tabs", "removeFromHistory:", "remove:", "flushBindings", "keyBinder", "remove", "refresh", "ifNotEmpty:", "activate", "last", "history"],
  2112. referencedClasses: []
  2113. }),
  2114. smalltalk.HLManager);
  2115. smalltalk.addMethod(
  2116. smalltalk.method({
  2117. selector: "renderAddOn:",
  2118. category: 'rendering',
  2119. fn: function (html){
  2120. var self=this;
  2121. function $HLWidget(){return smalltalk.HLWidget||(typeof HLWidget=="undefined"?nil:HLWidget)}
  2122. return smalltalk.withContext(function($ctx1) {
  2123. var $1,$3,$4,$5,$7,$8,$6,$2;
  2124. $1=_st(html)._li();
  2125. _st($1)._class_("dropdown");
  2126. $2=_st($1)._with_((function(){
  2127. return smalltalk.withContext(function($ctx2) {
  2128. $3=_st(html)._a();
  2129. _st($3)._class_("dropdown-toggle");
  2130. _st($3)._at_put_("data-toggle","dropdown");
  2131. $4=_st($3)._with_((function(){
  2132. return smalltalk.withContext(function($ctx3) {
  2133. _st(html)._with_("Open...");
  2134. return _st(_st(html)._tag_("b"))._class_("caret");
  2135. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  2136. $4;
  2137. $5=_st(html)._ul();
  2138. _st($5)._class_("dropdown-menu");
  2139. $6=_st($5)._with_((function(){
  2140. return smalltalk.withContext(function($ctx3) {
  2141. return _st(_st(_st(_st($HLWidget())._withAllSubclasses())._select_((function(each){
  2142. return smalltalk.withContext(function($ctx4) {
  2143. return _st(each)._canBeOpenAsTab();
  2144. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx1)})})))._sorted_((function(a,b){
  2145. return smalltalk.withContext(function($ctx4) {
  2146. return _st(_st(a)._tabPriority()).__lt(_st(b)._tabPriority());
  2147. }, function($ctx4) {$ctx4.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(each){
  2148. return smalltalk.withContext(function($ctx4) {
  2149. return _st(_st(html)._li())._with_((function(){
  2150. return smalltalk.withContext(function($ctx5) {
  2151. $7=_st(html)._a();
  2152. _st($7)._with_(_st(each)._tabLabel());
  2153. $8=_st($7)._onClick_((function(){
  2154. return smalltalk.withContext(function($ctx6) {
  2155. return _st(each)._openAsTab();
  2156. }, function($ctx6) {$ctx6.fillBlock({},$ctx1)})}));
  2157. return $8;
  2158. }, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
  2159. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx1)})}));
  2160. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  2161. return $6;
  2162. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2163. return self}, function($ctx1) {$ctx1.fill(self,"renderAddOn:",{html:html},smalltalk.HLManager)})},
  2164. args: ["html"],
  2165. 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 ] ] ] ] ]",
  2166. messageSends: ["class:", "li", "with:", "a", "at:put:", "tag:", "ul", "do:", "tabLabel", "onClick:", "openAsTab", "sorted:", "<", "tabPriority", "select:", "canBeOpenAsTab", "withAllSubclasses"],
  2167. referencedClasses: ["HLWidget"]
  2168. }),
  2169. smalltalk.HLManager);
  2170. smalltalk.addMethod(
  2171. smalltalk.method({
  2172. selector: "renderContentOn:",
  2173. category: 'rendering',
  2174. fn: function (html){
  2175. var self=this;
  2176. return smalltalk.withContext(function($ctx1) {
  2177. var $1,$3,$4,$2;
  2178. $1=_st(html)._div();
  2179. _st($1)._class_("navbar navbar-fixed-top");
  2180. $2=_st($1)._with_((function(){
  2181. return smalltalk.withContext(function($ctx2) {
  2182. $3=_st(html)._div();
  2183. _st($3)._class_("navbar-inner");
  2184. $4=_st($3)._with_((function(){
  2185. return smalltalk.withContext(function($ctx3) {
  2186. return _st(self)._renderTabsOn_(html);
  2187. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  2188. return $4;
  2189. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2190. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLManager)})},
  2191. args: ["html"],
  2192. 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 ] ]",
  2193. messageSends: ["class:", "div", "with:", "renderTabsOn:"],
  2194. referencedClasses: []
  2195. }),
  2196. smalltalk.HLManager);
  2197. smalltalk.addMethod(
  2198. smalltalk.method({
  2199. selector: "renderTabsOn:",
  2200. category: 'rendering',
  2201. fn: function (html){
  2202. var self=this;
  2203. return smalltalk.withContext(function($ctx1) {
  2204. var $1,$3,$4,$6,$5,$8,$9,$7,$2;
  2205. $1=_st(html)._ul();
  2206. _st($1)._class_("nav");
  2207. $2=_st($1)._with_((function(){
  2208. return smalltalk.withContext(function($ctx2) {
  2209. _st(_st(self)._tabs())._do_((function(each){
  2210. return smalltalk.withContext(function($ctx3) {
  2211. $3=_st(html)._li();
  2212. $4=$3;
  2213. $6=_st(each)._isActive();
  2214. if(smalltalk.assert($6)){
  2215. $5="active";
  2216. } else {
  2217. $5="inactive";
  2218. };
  2219. _st($4)._class_($5);
  2220. $7=_st($3)._with_((function(){
  2221. return smalltalk.withContext(function($ctx4) {
  2222. $8=_st(html)._a();
  2223. _st($8)._with_((function(){
  2224. return smalltalk.withContext(function($ctx5) {
  2225. _st(_st(_st(html)._tag_("i"))._class_("icon-remove"))._onClick_((function(){
  2226. return smalltalk.withContext(function($ctx6) {
  2227. return _st(self)._removeTab_(each);
  2228. }, function($ctx6) {$ctx6.fillBlock({},$ctx1)})}));
  2229. return _st(html)._with_(_st(each)._displayLabel());
  2230. }, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
  2231. $9=_st($8)._onClick_((function(){
  2232. return smalltalk.withContext(function($ctx5) {
  2233. return _st(each)._activate();
  2234. }, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
  2235. return $9;
  2236. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
  2237. return $7;
  2238. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  2239. return _st(self)._renderAddOn_(html);
  2240. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2241. return self}, function($ctx1) {$ctx1.fill(self,"renderTabsOn:",{html:html},smalltalk.HLManager)})},
  2242. args: ["html"],
  2243. 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 ]",
  2244. messageSends: ["class:", "ul", "with:", "do:", "ifTrue:ifFalse:", "isActive", "li", "onClick:", "removeTab:", "tag:", "displayLabel", "a", "activate", "tabs", "renderAddOn:"],
  2245. referencedClasses: []
  2246. }),
  2247. smalltalk.HLManager);
  2248. smalltalk.addMethod(
  2249. smalltalk.method({
  2250. selector: "show:",
  2251. category: 'rendering',
  2252. fn: function (aTab){
  2253. var self=this;
  2254. return smalltalk.withContext(function($ctx1) {
  2255. var $1,$2;
  2256. _st(_st(self)._tabs())._do_((function(each){
  2257. return smalltalk.withContext(function($ctx2) {
  2258. return _st(each)._hide();
  2259. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  2260. $1=aTab;
  2261. _st($1)._show();
  2262. $2=_st($1)._focus();
  2263. return self}, function($ctx1) {$ctx1.fill(self,"show:",{aTab:aTab},smalltalk.HLManager)})},
  2264. args: ["aTab"],
  2265. source: "show: aTab\x0a\x09self tabs do: [ :each | each hide ].\x0a\x09aTab show; focus",
  2266. messageSends: ["do:", "hide", "tabs", "show", "focus"],
  2267. referencedClasses: []
  2268. }),
  2269. smalltalk.HLManager);
  2270. smalltalk.addMethod(
  2271. smalltalk.method({
  2272. selector: "tabs",
  2273. category: 'accessing',
  2274. fn: function (){
  2275. var self=this;
  2276. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  2277. return smalltalk.withContext(function($ctx1) {
  2278. var $2,$1;
  2279. $2=self["@tabs"];
  2280. if(($receiver = $2) == nil || $receiver == undefined){
  2281. self["@tabs"]=_st($OrderedCollection())._new();
  2282. $1=self["@tabs"];
  2283. } else {
  2284. $1=$2;
  2285. };
  2286. return $1;
  2287. }, function($ctx1) {$ctx1.fill(self,"tabs",{},smalltalk.HLManager)})},
  2288. args: [],
  2289. source: "tabs\x0a\x09^ tabs ifNil: [ tabs := OrderedCollection new ]",
  2290. messageSends: ["ifNil:", "new"],
  2291. referencedClasses: ["OrderedCollection"]
  2292. }),
  2293. smalltalk.HLManager);
  2294. smalltalk.HLManager.klass.iVarNames = ['current'];
  2295. smalltalk.addMethod(
  2296. smalltalk.method({
  2297. selector: "current",
  2298. category: 'accessing',
  2299. fn: function (){
  2300. var self=this;
  2301. return smalltalk.withContext(function($ctx1) {
  2302. var $2,$1;
  2303. $2=self["@current"];
  2304. if(($receiver = $2) == nil || $receiver == undefined){
  2305. self["@current"]=_st(_st(self)._basicNew())._initialize();
  2306. $1=self["@current"];
  2307. } else {
  2308. $1=$2;
  2309. };
  2310. return $1;
  2311. }, function($ctx1) {$ctx1.fill(self,"current",{},smalltalk.HLManager.klass)})},
  2312. args: [],
  2313. source: "current\x0a\x09^ current ifNil: [ current := self basicNew initialize ]",
  2314. messageSends: ["ifNil:", "initialize", "basicNew"],
  2315. referencedClasses: []
  2316. }),
  2317. smalltalk.HLManager.klass);
  2318. smalltalk.addMethod(
  2319. smalltalk.method({
  2320. selector: "initialize",
  2321. category: 'initialization',
  2322. fn: function (){
  2323. var self=this;
  2324. return smalltalk.withContext(function($ctx1) {
  2325. _st(_st(self)._current())._appendToJQuery_(_st("body")._asJQuery());
  2326. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.HLManager.klass)})},
  2327. args: [],
  2328. source: "initialize\x0a\x09self current appendToJQuery: 'body' asJQuery",
  2329. messageSends: ["appendToJQuery:", "asJQuery", "current"],
  2330. referencedClasses: []
  2331. }),
  2332. smalltalk.HLManager.klass);
  2333. smalltalk.addMethod(
  2334. smalltalk.method({
  2335. selector: "new",
  2336. category: 'instance creation',
  2337. fn: function (){
  2338. var self=this;
  2339. return smalltalk.withContext(function($ctx1) {
  2340. _st(self)._shouldNotImplement();
  2341. return self}, function($ctx1) {$ctx1.fill(self,"new",{},smalltalk.HLManager.klass)})},
  2342. args: [],
  2343. source: "new\x0a\x09\x22Use current instead\x22\x0a\x0a\x09self shouldNotImplement",
  2344. messageSends: ["shouldNotImplement"],
  2345. referencedClasses: []
  2346. }),
  2347. smalltalk.HLManager.klass);
  2348. smalltalk.addClass('HLSUnit', smalltalk.HLWidget, [], 'Helios-Core');
  2349. smalltalk.addMethod(
  2350. smalltalk.method({
  2351. selector: "canBeOpenAsTab",
  2352. category: 'testing',
  2353. fn: function (){
  2354. var self=this;
  2355. return smalltalk.withContext(function($ctx1) {
  2356. return true;
  2357. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLSUnit.klass)})},
  2358. args: [],
  2359. source: "canBeOpenAsTab\x0a\x09^ true",
  2360. messageSends: [],
  2361. referencedClasses: []
  2362. }),
  2363. smalltalk.HLSUnit.klass);
  2364. smalltalk.addMethod(
  2365. smalltalk.method({
  2366. selector: "tabLabel",
  2367. category: 'accessing',
  2368. fn: function (){
  2369. var self=this;
  2370. return smalltalk.withContext(function($ctx1) {
  2371. return "SUnit";
  2372. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{},smalltalk.HLSUnit.klass)})},
  2373. args: [],
  2374. source: "tabLabel\x0a\x09^ 'SUnit'",
  2375. messageSends: [],
  2376. referencedClasses: []
  2377. }),
  2378. smalltalk.HLSUnit.klass);
  2379. smalltalk.addMethod(
  2380. smalltalk.method({
  2381. selector: "tabPriority",
  2382. category: 'accessing',
  2383. fn: function (){
  2384. var self=this;
  2385. return smalltalk.withContext(function($ctx1) {
  2386. var $1;
  2387. $1=(1000);
  2388. return $1;
  2389. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{},smalltalk.HLSUnit.klass)})},
  2390. args: [],
  2391. source: "tabPriority\x0a\x09^ 1000",
  2392. messageSends: [],
  2393. referencedClasses: []
  2394. }),
  2395. smalltalk.HLSUnit.klass);
  2396. smalltalk.addClass('HLTranscript', smalltalk.HLWidget, [], 'Helios-Core');
  2397. smalltalk.addMethod(
  2398. smalltalk.method({
  2399. selector: "canBeOpenAsTab",
  2400. category: 'testing',
  2401. fn: function (){
  2402. var self=this;
  2403. return smalltalk.withContext(function($ctx1) {
  2404. return true;
  2405. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLTranscript.klass)})},
  2406. args: [],
  2407. source: "canBeOpenAsTab\x0a\x09^ true",
  2408. messageSends: [],
  2409. referencedClasses: []
  2410. }),
  2411. smalltalk.HLTranscript.klass);
  2412. smalltalk.addMethod(
  2413. smalltalk.method({
  2414. selector: "tabLabel",
  2415. category: 'accessing',
  2416. fn: function (){
  2417. var self=this;
  2418. return smalltalk.withContext(function($ctx1) {
  2419. return "Transcript";
  2420. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{},smalltalk.HLTranscript.klass)})},
  2421. args: [],
  2422. source: "tabLabel\x0a\x09^ 'Transcript'",
  2423. messageSends: [],
  2424. referencedClasses: []
  2425. }),
  2426. smalltalk.HLTranscript.klass);
  2427. smalltalk.addMethod(
  2428. smalltalk.method({
  2429. selector: "tabPriority",
  2430. category: 'accessing',
  2431. fn: function (){
  2432. var self=this;
  2433. return smalltalk.withContext(function($ctx1) {
  2434. var $1;
  2435. $1=(600);
  2436. return $1;
  2437. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{},smalltalk.HLTranscript.klass)})},
  2438. args: [],
  2439. source: "tabPriority\x0a\x09^ 600",
  2440. messageSends: [],
  2441. referencedClasses: []
  2442. }),
  2443. smalltalk.HLTranscript.klass);