Helios-Core.js 85 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552
  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. _st(_st(_st(window)._jQuery_(".focused .nav-pills .active"))._get())._ifEmpty_((function(){
  1127. return smalltalk.withContext(function($ctx2) {
  1128. return _st(self)._activateFirstListItem();
  1129. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1130. return self}, function($ctx1) {$ctx1.fill(self,"activateNextListItem",{},smalltalk.HLListWidget)})},
  1131. args: [],
  1132. source: "activateNextListItem\x0a\x09self activateListItem: (window jQuery: '.focused .nav-pills .active') next.\x0a\x09\x0a\x09\x22select the first item if none is selected\x22\x0a\x09(window jQuery: '.focused .nav-pills .active') get ifEmpty: [\x0a\x09\x09self activateFirstListItem ]",
  1133. messageSends: ["activateListItem:", "next", "jQuery:", "ifEmpty:", "activateFirstListItem", "get"],
  1134. referencedClasses: []
  1135. }),
  1136. smalltalk.HLListWidget);
  1137. smalltalk.addMethod(
  1138. smalltalk.method({
  1139. selector: "activatePreviousListItem",
  1140. category: 'actions',
  1141. fn: function (){
  1142. var self=this;
  1143. return smalltalk.withContext(function($ctx1) {
  1144. _st(self)._activateListItem_(_st(_st(window)._jQuery_(".focused .nav-pills .active"))._prev());
  1145. return self}, function($ctx1) {$ctx1.fill(self,"activatePreviousListItem",{},smalltalk.HLListWidget)})},
  1146. args: [],
  1147. source: "activatePreviousListItem\x0a\x09self activateListItem: (window jQuery: '.focused .nav-pills .active') prev",
  1148. messageSends: ["activateListItem:", "prev", "jQuery:"],
  1149. referencedClasses: []
  1150. }),
  1151. smalltalk.HLListWidget);
  1152. smalltalk.addMethod(
  1153. smalltalk.method({
  1154. selector: "cssClassForItem:",
  1155. category: 'accessing',
  1156. fn: function (anObject){
  1157. var self=this;
  1158. return smalltalk.withContext(function($ctx1) {
  1159. var $2,$1;
  1160. $2=_st(_st(self)._selectedItem()).__eq(anObject);
  1161. if(smalltalk.assert($2)){
  1162. $1="active";
  1163. } else {
  1164. $1="inactive";
  1165. };
  1166. return $1;
  1167. }, function($ctx1) {$ctx1.fill(self,"cssClassForItem:",{anObject:anObject},smalltalk.HLListWidget)})},
  1168. args: ["anObject"],
  1169. source: "cssClassForItem: anObject\x0a\x09^ self selectedItem = anObject\x0a\x09\x09\x09ifTrue: [ 'active' ]\x0a\x09\x09\x09ifFalse: [ 'inactive' ]",
  1170. messageSends: ["ifTrue:ifFalse:", "=", "selectedItem"],
  1171. referencedClasses: []
  1172. }),
  1173. smalltalk.HLListWidget);
  1174. smalltalk.addMethod(
  1175. smalltalk.method({
  1176. selector: "defaultItems",
  1177. category: 'defaults',
  1178. fn: function (){
  1179. var self=this;
  1180. return smalltalk.withContext(function($ctx1) {
  1181. var $1;
  1182. $1=[];
  1183. return $1;
  1184. }, function($ctx1) {$ctx1.fill(self,"defaultItems",{},smalltalk.HLListWidget)})},
  1185. args: [],
  1186. source: "defaultItems\x0a\x09^ #()",
  1187. messageSends: [],
  1188. referencedClasses: []
  1189. }),
  1190. smalltalk.HLListWidget);
  1191. smalltalk.addMethod(
  1192. smalltalk.method({
  1193. selector: "ensureVisible:",
  1194. category: 'actions',
  1195. fn: function (aListItem){
  1196. var self=this;
  1197. var perent,position;
  1198. return smalltalk.withContext(function($ctx1) {
  1199. var $1,$2;
  1200. position=_st(self)._positionOf_(aListItem);
  1201. parent=_st(aListItem)._parent();
  1202. $1=_st(_st(_st(aListItem)._position())._top()).__lt((0));
  1203. if(smalltalk.assert($1)){
  1204. _st(_st(parent)._get_((0)))._scrollTop_(_st(_st(_st(_st(parent)._get_((0)))._scrollTop()).__plus(_st(_st(aListItem)._position())._top())).__minus((10)));
  1205. };
  1206. $2=_st(_st(_st(_st(aListItem)._position())._top()).__plus(_st(aListItem)._height())).__gt(_st(parent)._height());
  1207. if(smalltalk.assert($2)){
  1208. _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)));
  1209. };
  1210. return self}, function($ctx1) {$ctx1.fill(self,"ensureVisible:",{aListItem:aListItem,perent:perent,position:position},smalltalk.HLListWidget)})},
  1211. args: ["aListItem"],
  1212. 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 ]",
  1213. messageSends: ["positionOf:", "parent", "ifTrue:", "scrollTop:", "-", "+", "top", "position", "scrollTop", "get:", "<", "height", ">"],
  1214. referencedClasses: []
  1215. }),
  1216. smalltalk.HLListWidget);
  1217. smalltalk.addMethod(
  1218. smalltalk.method({
  1219. selector: "focus",
  1220. category: 'actions',
  1221. fn: function (){
  1222. var self=this;
  1223. return smalltalk.withContext(function($ctx1) {
  1224. var $1,$2;
  1225. smalltalk.HLFocusableWidget.fn.prototype._focus.apply(_st(self), []);
  1226. $1=_st(_st(self)._items())._isEmpty();
  1227. if(! smalltalk.assert($1)){
  1228. $2=_st(self)._selectedItem();
  1229. if(($receiver = $2) == nil || $receiver == undefined){
  1230. _st(self)._activateFirstListItem();
  1231. } else {
  1232. $2;
  1233. };
  1234. };
  1235. return self}, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLListWidget)})},
  1236. args: [],
  1237. source: "focus\x0a\x09super focus.\x0a self items isEmpty ifFalse: [ \x0a\x09\x09self selectedItem ifNil: [ self activateFirstListItem ] ]",
  1238. messageSends: ["focus", "ifFalse:", "ifNil:", "activateFirstListItem", "selectedItem", "isEmpty", "items"],
  1239. referencedClasses: []
  1240. }),
  1241. smalltalk.HLListWidget);
  1242. smalltalk.addMethod(
  1243. smalltalk.method({
  1244. selector: "iconForItem:",
  1245. category: 'accessing',
  1246. fn: function (anObject){
  1247. var self=this;
  1248. return smalltalk.withContext(function($ctx1) {
  1249. return "";
  1250. }, function($ctx1) {$ctx1.fill(self,"iconForItem:",{anObject:anObject},smalltalk.HLListWidget)})},
  1251. args: ["anObject"],
  1252. source: "iconForItem: anObject\x0a\x09^ ''",
  1253. messageSends: [],
  1254. referencedClasses: []
  1255. }),
  1256. smalltalk.HLListWidget);
  1257. smalltalk.addMethod(
  1258. smalltalk.method({
  1259. selector: "initialize",
  1260. category: 'initialization',
  1261. fn: function (){
  1262. var self=this;
  1263. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  1264. return smalltalk.withContext(function($ctx1) {
  1265. smalltalk.HLFocusableWidget.fn.prototype._initialize.apply(_st(self), []);
  1266. self["@mapping"]=_st($Dictionary())._new();
  1267. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.HLListWidget)})},
  1268. args: [],
  1269. source: "initialize\x0a\x09super initialize.\x0a\x09\x0a\x09mapping := Dictionary new.",
  1270. messageSends: ["initialize", "new"],
  1271. referencedClasses: ["Dictionary"]
  1272. }),
  1273. smalltalk.HLListWidget);
  1274. smalltalk.addMethod(
  1275. smalltalk.method({
  1276. selector: "items",
  1277. category: 'accessing',
  1278. fn: function (){
  1279. var self=this;
  1280. return smalltalk.withContext(function($ctx1) {
  1281. var $2,$1;
  1282. $2=self["@items"];
  1283. if(($receiver = $2) == nil || $receiver == undefined){
  1284. self["@items"]=_st(self)._defaultItems();
  1285. $1=self["@items"];
  1286. } else {
  1287. $1=$2;
  1288. };
  1289. return $1;
  1290. }, function($ctx1) {$ctx1.fill(self,"items",{},smalltalk.HLListWidget)})},
  1291. args: [],
  1292. source: "items\x0a\x09^ items ifNil: [ items := self defaultItems ]",
  1293. messageSends: ["ifNil:", "defaultItems"],
  1294. referencedClasses: []
  1295. }),
  1296. smalltalk.HLListWidget);
  1297. smalltalk.addMethod(
  1298. smalltalk.method({
  1299. selector: "items:",
  1300. category: 'accessing',
  1301. fn: function (aCollection){
  1302. var self=this;
  1303. return smalltalk.withContext(function($ctx1) {
  1304. self["@items"]=aCollection;
  1305. return self}, function($ctx1) {$ctx1.fill(self,"items:",{aCollection:aCollection},smalltalk.HLListWidget)})},
  1306. args: ["aCollection"],
  1307. source: "items: aCollection\x0a\x09items := aCollection",
  1308. messageSends: [],
  1309. referencedClasses: []
  1310. }),
  1311. smalltalk.HLListWidget);
  1312. smalltalk.addMethod(
  1313. smalltalk.method({
  1314. selector: "positionOf:",
  1315. category: 'accessing',
  1316. fn: function (aListItem){
  1317. var self=this;
  1318. return smalltalk.withContext(function($ctx1) {
  1319. return aListItem.parent().children().get().indexOf(aListItem.get(0)) + 1
  1320. ;
  1321. return self}, function($ctx1) {$ctx1.fill(self,"positionOf:",{aListItem:aListItem},smalltalk.HLListWidget)})},
  1322. args: ["aListItem"],
  1323. source: "positionOf: aListItem\x0a\x09<\x0a \x09return aListItem.parent().children().get().indexOf(aListItem.get(0)) + 1\x0a\x09>",
  1324. messageSends: [],
  1325. referencedClasses: []
  1326. }),
  1327. smalltalk.HLListWidget);
  1328. smalltalk.addMethod(
  1329. smalltalk.method({
  1330. selector: "refresh",
  1331. category: 'actions',
  1332. fn: function (){
  1333. var self=this;
  1334. return smalltalk.withContext(function($ctx1) {
  1335. var $1;
  1336. var $early={};
  1337. try {
  1338. smalltalk.HLFocusableWidget.fn.prototype._refresh.apply(_st(self), []);
  1339. _st(self)._ensureVisible_(_st(_st(self["@mapping"])._at_ifAbsent_(_st(self)._selectedItem(),(function(){
  1340. return smalltalk.withContext(function($ctx2) {
  1341. $1=self;
  1342. throw $early=[$1];
  1343. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._asJQuery());
  1344. return self}
  1345. catch(e) {if(e===$early)return e[0]; throw e}
  1346. }, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.HLListWidget)})},
  1347. args: [],
  1348. source: "refresh\x0a\x09super refresh.\x0a\x09\x0a\x09self ensureVisible: (mapping \x0a\x09\x09at: self selectedItem\x0a\x09\x09ifAbsent: [ ^ self ]) asJQuery",
  1349. messageSends: ["refresh", "ensureVisible:", "asJQuery", "at:ifAbsent:", "selectedItem"],
  1350. referencedClasses: []
  1351. }),
  1352. smalltalk.HLListWidget);
  1353. smalltalk.addMethod(
  1354. smalltalk.method({
  1355. selector: "registerMappingFrom:to:",
  1356. category: 'private',
  1357. fn: function (anObject,aTag){
  1358. var self=this;
  1359. return smalltalk.withContext(function($ctx1) {
  1360. _st(self["@mapping"])._at_put_(anObject,aTag);
  1361. return self}, function($ctx1) {$ctx1.fill(self,"registerMappingFrom:to:",{anObject:anObject,aTag:aTag},smalltalk.HLListWidget)})},
  1362. args: ["anObject", "aTag"],
  1363. source: "registerMappingFrom: anObject to: aTag\x0a\x09mapping at: anObject put: aTag",
  1364. messageSends: ["at:put:"],
  1365. referencedClasses: []
  1366. }),
  1367. smalltalk.HLListWidget);
  1368. smalltalk.addMethod(
  1369. smalltalk.method({
  1370. selector: "renderButtonsOn:",
  1371. category: 'rendering',
  1372. fn: function (html){
  1373. var self=this;
  1374. return smalltalk.withContext(function($ctx1) {
  1375. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},smalltalk.HLListWidget)})},
  1376. args: ["html"],
  1377. source: "renderButtonsOn: html",
  1378. messageSends: [],
  1379. referencedClasses: []
  1380. }),
  1381. smalltalk.HLListWidget);
  1382. smalltalk.addMethod(
  1383. smalltalk.method({
  1384. selector: "renderContentOn:",
  1385. category: 'rendering',
  1386. fn: function (html){
  1387. var self=this;
  1388. return smalltalk.withContext(function($ctx1) {
  1389. var $1,$2,$3,$4;
  1390. $1=_st(html)._ul();
  1391. _st($1)._class_("nav nav-pills nav-stacked");
  1392. $2=_st($1)._with_((function(){
  1393. return smalltalk.withContext(function($ctx2) {
  1394. return _st(self)._renderListOn_(html);
  1395. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1396. $3=_st(html)._div();
  1397. _st($3)._class_("pane_actions form-actions");
  1398. $4=_st($3)._with_((function(){
  1399. return smalltalk.withContext(function($ctx2) {
  1400. return _st(self)._renderButtonsOn_(html);
  1401. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1402. _st(self)._setupKeyBindings();
  1403. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLListWidget)})},
  1404. args: ["html"],
  1405. 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",
  1406. messageSends: ["class:", "ul", "with:", "renderListOn:", "div", "renderButtonsOn:", "setupKeyBindings"],
  1407. referencedClasses: []
  1408. }),
  1409. smalltalk.HLListWidget);
  1410. smalltalk.addMethod(
  1411. smalltalk.method({
  1412. selector: "renderItem:on:",
  1413. category: 'rendering',
  1414. fn: function (anObject,html){
  1415. var self=this;
  1416. var li;
  1417. return smalltalk.withContext(function($ctx1) {
  1418. var $1,$3,$4,$2;
  1419. li=_st(html)._li();
  1420. _st(self)._registerMappingFrom_to_(anObject,li);
  1421. $1=li;
  1422. _st($1)._class_(_st(self)._cssClassForItem_(anObject));
  1423. _st($1)._at_put_("list-data",_st(_st(_st(self)._items())._indexOf_(anObject))._asString());
  1424. $2=_st($1)._with_((function(){
  1425. return smalltalk.withContext(function($ctx2) {
  1426. $3=_st(html)._a();
  1427. _st($3)._with_((function(){
  1428. return smalltalk.withContext(function($ctx3) {
  1429. _st(_st(html)._tag_("i"))._class_(_st(self)._iconForItem_(anObject));
  1430. return _st(self)._renderItemLabel_on_(anObject,html);
  1431. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1432. $4=_st($3)._onClick_((function(){
  1433. return smalltalk.withContext(function($ctx3) {
  1434. return _st(self)._activateListItem_(_st(li)._asJQuery());
  1435. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1436. return $4;
  1437. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1438. return self}, function($ctx1) {$ctx1.fill(self,"renderItem:on:",{anObject:anObject,html:html,li:li},smalltalk.HLListWidget)})},
  1439. args: ["anObject", "html"],
  1440. 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 ] ]",
  1441. messageSends: ["li", "registerMappingFrom:to:", "class:", "cssClassForItem:", "at:put:", "asString", "indexOf:", "items", "with:", "iconForItem:", "tag:", "renderItemLabel:on:", "a", "onClick:", "activateListItem:", "asJQuery"],
  1442. referencedClasses: []
  1443. }),
  1444. smalltalk.HLListWidget);
  1445. smalltalk.addMethod(
  1446. smalltalk.method({
  1447. selector: "renderItemLabel:on:",
  1448. category: 'rendering',
  1449. fn: function (anObject,html){
  1450. var self=this;
  1451. return smalltalk.withContext(function($ctx1) {
  1452. _st(html)._with_(_st(anObject)._asString());
  1453. return self}, function($ctx1) {$ctx1.fill(self,"renderItemLabel:on:",{anObject:anObject,html:html},smalltalk.HLListWidget)})},
  1454. args: ["anObject", "html"],
  1455. source: "renderItemLabel: anObject on: html\x0a\x09html with: anObject asString",
  1456. messageSends: ["with:", "asString"],
  1457. referencedClasses: []
  1458. }),
  1459. smalltalk.HLListWidget);
  1460. smalltalk.addMethod(
  1461. smalltalk.method({
  1462. selector: "renderListOn:",
  1463. category: 'rendering',
  1464. fn: function (html){
  1465. var self=this;
  1466. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  1467. return smalltalk.withContext(function($ctx1) {
  1468. self["@mapping"]=_st($Dictionary())._new();
  1469. _st(_st(self)._items())._do_((function(each){
  1470. return smalltalk.withContext(function($ctx2) {
  1471. return _st(self)._renderItem_on_(each,html);
  1472. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1473. return self}, function($ctx1) {$ctx1.fill(self,"renderListOn:",{html:html},smalltalk.HLListWidget)})},
  1474. args: ["html"],
  1475. source: "renderListOn: html\x0a\x09mapping := Dictionary new.\x0a\x09\x0a\x09self items do: [ :each | \x0a \x09self renderItem: each on: html ]",
  1476. messageSends: ["new", "do:", "renderItem:on:", "items"],
  1477. referencedClasses: ["Dictionary"]
  1478. }),
  1479. smalltalk.HLListWidget);
  1480. smalltalk.addMethod(
  1481. smalltalk.method({
  1482. selector: "selectItem:",
  1483. category: 'actions',
  1484. fn: function (anObject){
  1485. var self=this;
  1486. return smalltalk.withContext(function($ctx1) {
  1487. _st(self)._selectedItem_(anObject);
  1488. return self}, function($ctx1) {$ctx1.fill(self,"selectItem:",{anObject:anObject},smalltalk.HLListWidget)})},
  1489. args: ["anObject"],
  1490. source: "selectItem: anObject\x0a\x09self selectedItem: anObject",
  1491. messageSends: ["selectedItem:"],
  1492. referencedClasses: []
  1493. }),
  1494. smalltalk.HLListWidget);
  1495. smalltalk.addMethod(
  1496. smalltalk.method({
  1497. selector: "selectedItem",
  1498. category: 'accessing',
  1499. fn: function (){
  1500. var self=this;
  1501. return smalltalk.withContext(function($ctx1) {
  1502. var $1;
  1503. $1=self["@selectedItem"];
  1504. return $1;
  1505. }, function($ctx1) {$ctx1.fill(self,"selectedItem",{},smalltalk.HLListWidget)})},
  1506. args: [],
  1507. source: "selectedItem\x0a\x09^ selectedItem",
  1508. messageSends: [],
  1509. referencedClasses: []
  1510. }),
  1511. smalltalk.HLListWidget);
  1512. smalltalk.addMethod(
  1513. smalltalk.method({
  1514. selector: "selectedItem:",
  1515. category: 'accessing',
  1516. fn: function (anObject){
  1517. var self=this;
  1518. return smalltalk.withContext(function($ctx1) {
  1519. self["@selectedItem"]=anObject;
  1520. return self}, function($ctx1) {$ctx1.fill(self,"selectedItem:",{anObject:anObject},smalltalk.HLListWidget)})},
  1521. args: ["anObject"],
  1522. source: "selectedItem: anObject\x0a\x09selectedItem := anObject",
  1523. messageSends: [],
  1524. referencedClasses: []
  1525. }),
  1526. smalltalk.HLListWidget);
  1527. smalltalk.addMethod(
  1528. smalltalk.method({
  1529. selector: "setupKeyBindings",
  1530. category: 'events',
  1531. fn: function (){
  1532. var self=this;
  1533. var active,interval,delay,repeatInterval;
  1534. return smalltalk.withContext(function($ctx1) {
  1535. var $1,$2,$3,$4,$5;
  1536. active=false;
  1537. repeatInterval=(70);
  1538. _st(_st(_st(self)._wrapper())._asJQuery())._unbind_("keydown");
  1539. _st(_st(_st(self)._wrapper())._asJQuery())._keydown_((function(e){
  1540. return smalltalk.withContext(function($ctx2) {
  1541. $1=_st(_st(_st(e)._which()).__eq((38)))._and_((function(){
  1542. return smalltalk.withContext(function($ctx3) {
  1543. return _st(active).__eq(false);
  1544. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1545. if(smalltalk.assert($1)){
  1546. active=true;
  1547. active;
  1548. _st(self)._activatePreviousListItem();
  1549. delay=_st((function(){
  1550. return smalltalk.withContext(function($ctx3) {
  1551. interval=_st((function(){
  1552. return smalltalk.withContext(function($ctx4) {
  1553. return _st(self)._activatePreviousListItem();
  1554. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}))._valueWithInterval_(repeatInterval);
  1555. return interval;
  1556. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}))._valueWithTimeout_((300));
  1557. delay;
  1558. };
  1559. $2=_st(_st(_st(e)._which()).__eq((40)))._and_((function(){
  1560. return smalltalk.withContext(function($ctx3) {
  1561. return _st(active).__eq(false);
  1562. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1563. if(smalltalk.assert($2)){
  1564. active=true;
  1565. active;
  1566. _st(self)._activateNextListItem();
  1567. delay=_st((function(){
  1568. return smalltalk.withContext(function($ctx3) {
  1569. interval=_st((function(){
  1570. return smalltalk.withContext(function($ctx4) {
  1571. return _st(self)._activateNextListItem();
  1572. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}))._valueWithInterval_(repeatInterval);
  1573. return interval;
  1574. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}))._valueWithTimeout_((300));
  1575. return delay;
  1576. };
  1577. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1)})}));
  1578. _st(_st(_st(self)._wrapper())._asJQuery())._keyup_((function(e){
  1579. return smalltalk.withContext(function($ctx2) {
  1580. $3=active;
  1581. if(smalltalk.assert($3)){
  1582. active=false;
  1583. active;
  1584. $4=interval;
  1585. if(($receiver = $4) == nil || $receiver == undefined){
  1586. $4;
  1587. } else {
  1588. _st(interval)._clearInterval();
  1589. };
  1590. $5=delay;
  1591. if(($receiver = $5) == nil || $receiver == undefined){
  1592. return $5;
  1593. } else {
  1594. return _st(delay)._clearTimeout();
  1595. };
  1596. };
  1597. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1)})}));
  1598. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyBindings",{active:active,interval:interval,delay:delay,repeatInterval:repeatInterval},smalltalk.HLListWidget)})},
  1599. args: [],
  1600. 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 := [ self activatePreviousListItem ]\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 := [ self activateNextListItem ]\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] ] ]",
  1601. messageSends: ["unbind:", "asJQuery", "wrapper", "keydown:", "ifTrue:", "activatePreviousListItem", "valueWithTimeout:", "valueWithInterval:", "and:", "=", "which", "activateNextListItem", "keyup:", "ifNotNil:", "clearInterval", "clearTimeout"],
  1602. referencedClasses: []
  1603. }),
  1604. smalltalk.HLListWidget);
  1605. smalltalk.addClass('HLNavigationListWidget', smalltalk.HLListWidget, ['previous', 'next'], 'Helios-Core');
  1606. smalltalk.addMethod(
  1607. smalltalk.method({
  1608. selector: "next",
  1609. category: 'accessing',
  1610. fn: function (){
  1611. var self=this;
  1612. return smalltalk.withContext(function($ctx1) {
  1613. var $1;
  1614. $1=self["@next"];
  1615. return $1;
  1616. }, function($ctx1) {$ctx1.fill(self,"next",{},smalltalk.HLNavigationListWidget)})},
  1617. args: [],
  1618. source: "next\x0a\x09^ next",
  1619. messageSends: [],
  1620. referencedClasses: []
  1621. }),
  1622. smalltalk.HLNavigationListWidget);
  1623. smalltalk.addMethod(
  1624. smalltalk.method({
  1625. selector: "next:",
  1626. category: 'accessing',
  1627. fn: function (aWidget){
  1628. var self=this;
  1629. return smalltalk.withContext(function($ctx1) {
  1630. var $1;
  1631. self["@next"]=aWidget;
  1632. $1=_st(_st(aWidget)._previous()).__eq(self);
  1633. if(! smalltalk.assert($1)){
  1634. _st(aWidget)._previous_(self);
  1635. };
  1636. return self}, function($ctx1) {$ctx1.fill(self,"next:",{aWidget:aWidget},smalltalk.HLNavigationListWidget)})},
  1637. args: ["aWidget"],
  1638. source: "next: aWidget\x0a\x09next := aWidget.\x0a aWidget previous = self ifFalse: [ aWidget previous: self ]",
  1639. messageSends: ["ifFalse:", "previous:", "=", "previous"],
  1640. referencedClasses: []
  1641. }),
  1642. smalltalk.HLNavigationListWidget);
  1643. smalltalk.addMethod(
  1644. smalltalk.method({
  1645. selector: "nextFocus",
  1646. category: 'actions',
  1647. fn: function (){
  1648. var self=this;
  1649. return smalltalk.withContext(function($ctx1) {
  1650. var $1;
  1651. $1=_st(self)._next();
  1652. if(($receiver = $1) == nil || $receiver == undefined){
  1653. $1;
  1654. } else {
  1655. _st(_st(self)._next())._focus();
  1656. };
  1657. return self}, function($ctx1) {$ctx1.fill(self,"nextFocus",{},smalltalk.HLNavigationListWidget)})},
  1658. args: [],
  1659. source: "nextFocus\x0a\x09self next ifNotNil: [ self next focus ]",
  1660. messageSends: ["ifNotNil:", "focus", "next"],
  1661. referencedClasses: []
  1662. }),
  1663. smalltalk.HLNavigationListWidget);
  1664. smalltalk.addMethod(
  1665. smalltalk.method({
  1666. selector: "previous",
  1667. category: 'accessing',
  1668. fn: function (){
  1669. var self=this;
  1670. return smalltalk.withContext(function($ctx1) {
  1671. var $1;
  1672. $1=self["@previous"];
  1673. return $1;
  1674. }, function($ctx1) {$ctx1.fill(self,"previous",{},smalltalk.HLNavigationListWidget)})},
  1675. args: [],
  1676. source: "previous\x0a\x09^ previous",
  1677. messageSends: [],
  1678. referencedClasses: []
  1679. }),
  1680. smalltalk.HLNavigationListWidget);
  1681. smalltalk.addMethod(
  1682. smalltalk.method({
  1683. selector: "previous:",
  1684. category: 'accessing',
  1685. fn: function (aWidget){
  1686. var self=this;
  1687. return smalltalk.withContext(function($ctx1) {
  1688. var $1;
  1689. self["@previous"]=aWidget;
  1690. $1=_st(_st(aWidget)._next()).__eq(self);
  1691. if(! smalltalk.assert($1)){
  1692. _st(aWidget)._next_(self);
  1693. };
  1694. return self}, function($ctx1) {$ctx1.fill(self,"previous:",{aWidget:aWidget},smalltalk.HLNavigationListWidget)})},
  1695. args: ["aWidget"],
  1696. source: "previous: aWidget\x0a\x09previous := aWidget.\x0a aWidget next = self ifFalse: [ aWidget next: self ]",
  1697. messageSends: ["ifFalse:", "next:", "=", "next"],
  1698. referencedClasses: []
  1699. }),
  1700. smalltalk.HLNavigationListWidget);
  1701. smalltalk.addMethod(
  1702. smalltalk.method({
  1703. selector: "previousFocus",
  1704. category: 'actions',
  1705. fn: function (){
  1706. var self=this;
  1707. return smalltalk.withContext(function($ctx1) {
  1708. var $1;
  1709. $1=_st(self)._previous();
  1710. if(($receiver = $1) == nil || $receiver == undefined){
  1711. $1;
  1712. } else {
  1713. _st(_st(self)._previous())._focus();
  1714. };
  1715. return self}, function($ctx1) {$ctx1.fill(self,"previousFocus",{},smalltalk.HLNavigationListWidget)})},
  1716. args: [],
  1717. source: "previousFocus\x0a\x09self previous ifNotNil: [ self previous focus ]",
  1718. messageSends: ["ifNotNil:", "focus", "previous"],
  1719. referencedClasses: []
  1720. }),
  1721. smalltalk.HLNavigationListWidget);
  1722. smalltalk.addMethod(
  1723. smalltalk.method({
  1724. selector: "setupKeyBindings",
  1725. category: 'events',
  1726. fn: function (){
  1727. var self=this;
  1728. return smalltalk.withContext(function($ctx1) {
  1729. var $1,$2;
  1730. smalltalk.HLListWidget.fn.prototype._setupKeyBindings.apply(_st(self), []);
  1731. _st(_st(_st(self)._wrapper())._asJQuery())._keydown_((function(e){
  1732. return smalltalk.withContext(function($ctx2) {
  1733. $1=_st(_st(e)._which()).__eq((39));
  1734. if(smalltalk.assert($1)){
  1735. _st(self)._nextFocus();
  1736. };
  1737. $2=_st(_st(e)._which()).__eq((37));
  1738. if(smalltalk.assert($2)){
  1739. return _st(self)._previousFocus();
  1740. };
  1741. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1)})}));
  1742. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyBindings",{},smalltalk.HLNavigationListWidget)})},
  1743. args: [],
  1744. 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 ] ]",
  1745. messageSends: ["setupKeyBindings", "keydown:", "ifTrue:", "nextFocus", "=", "which", "previousFocus", "asJQuery", "wrapper"],
  1746. referencedClasses: []
  1747. }),
  1748. smalltalk.HLNavigationListWidget);
  1749. smalltalk.addClass('HLManager', smalltalk.HLWidget, ['tabs', 'activeTab', 'keyBinder', 'environment', 'history'], 'Helios-Core');
  1750. smalltalk.addMethod(
  1751. smalltalk.method({
  1752. selector: "activate:",
  1753. category: 'actions',
  1754. fn: function (aTab){
  1755. var self=this;
  1756. return smalltalk.withContext(function($ctx1) {
  1757. var $1,$2;
  1758. _st(_st(self)._keyBinder())._flushBindings();
  1759. _st(aTab)._registerBindings();
  1760. self["@activeTab"]=aTab;
  1761. $1=self;
  1762. _st($1)._refresh();
  1763. _st($1)._addToHistory_(aTab);
  1764. $2=_st($1)._show_(aTab);
  1765. return self}, function($ctx1) {$ctx1.fill(self,"activate:",{aTab:aTab},smalltalk.HLManager)})},
  1766. args: ["aTab"],
  1767. 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",
  1768. messageSends: ["flushBindings", "keyBinder", "registerBindings", "refresh", "addToHistory:", "show:"],
  1769. referencedClasses: []
  1770. }),
  1771. smalltalk.HLManager);
  1772. smalltalk.addMethod(
  1773. smalltalk.method({
  1774. selector: "activeTab",
  1775. category: 'accessing',
  1776. fn: function (){
  1777. var self=this;
  1778. return smalltalk.withContext(function($ctx1) {
  1779. var $1;
  1780. $1=self["@activeTab"];
  1781. return $1;
  1782. }, function($ctx1) {$ctx1.fill(self,"activeTab",{},smalltalk.HLManager)})},
  1783. args: [],
  1784. source: "activeTab\x0a\x09^ activeTab",
  1785. messageSends: [],
  1786. referencedClasses: []
  1787. }),
  1788. smalltalk.HLManager);
  1789. smalltalk.addMethod(
  1790. smalltalk.method({
  1791. selector: "addTab:",
  1792. category: 'actions',
  1793. fn: function (aTab){
  1794. var self=this;
  1795. return smalltalk.withContext(function($ctx1) {
  1796. _st(_st(self)._tabs())._add_(aTab);
  1797. _st(self)._activate_(aTab);
  1798. return self}, function($ctx1) {$ctx1.fill(self,"addTab:",{aTab:aTab},smalltalk.HLManager)})},
  1799. args: ["aTab"],
  1800. source: "addTab: aTab\x0a\x09self tabs add: aTab.\x0a self activate: aTab",
  1801. messageSends: ["add:", "tabs", "activate:"],
  1802. referencedClasses: []
  1803. }),
  1804. smalltalk.HLManager);
  1805. smalltalk.addMethod(
  1806. smalltalk.method({
  1807. selector: "addToHistory:",
  1808. category: 'actions',
  1809. fn: function (aTab){
  1810. var self=this;
  1811. return smalltalk.withContext(function($ctx1) {
  1812. _st(self)._removeFromHistory_(aTab);
  1813. _st(_st(self)._history())._add_(aTab);
  1814. return self}, function($ctx1) {$ctx1.fill(self,"addToHistory:",{aTab:aTab},smalltalk.HLManager)})},
  1815. args: ["aTab"],
  1816. source: "addToHistory: aTab\x0a\x09self removeFromHistory: aTab.\x0a\x09self history add: aTab",
  1817. messageSends: ["removeFromHistory:", "add:", "history"],
  1818. referencedClasses: []
  1819. }),
  1820. smalltalk.HLManager);
  1821. smalltalk.addMethod(
  1822. smalltalk.method({
  1823. selector: "confirm:ifFalse:",
  1824. category: 'actions',
  1825. fn: function (aString,aBlock){
  1826. var self=this;
  1827. function $HLConfirmation(){return smalltalk.HLConfirmation||(typeof HLConfirmation=="undefined"?nil:HLConfirmation)}
  1828. return smalltalk.withContext(function($ctx1) {
  1829. var $1,$2;
  1830. $1=_st($HLConfirmation())._new();
  1831. _st($1)._confirmationString_(aString);
  1832. _st($1)._cancelBlock_(aBlock);
  1833. $2=_st($1)._yourself();
  1834. _st($2)._appendToJQuery_(_st("body")._asJQuery());
  1835. return self}, function($ctx1) {$ctx1.fill(self,"confirm:ifFalse:",{aString:aString,aBlock:aBlock},smalltalk.HLManager)})},
  1836. args: ["aString", "aBlock"],
  1837. 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",
  1838. messageSends: ["appendToJQuery:", "asJQuery", "confirmationString:", "new", "cancelBlock:", "yourself"],
  1839. referencedClasses: ["HLConfirmation"]
  1840. }),
  1841. smalltalk.HLManager);
  1842. smalltalk.addMethod(
  1843. smalltalk.method({
  1844. selector: "confirm:ifTrue:",
  1845. category: 'actions',
  1846. fn: function (aString,aBlock){
  1847. var self=this;
  1848. function $HLConfirmation(){return smalltalk.HLConfirmation||(typeof HLConfirmation=="undefined"?nil:HLConfirmation)}
  1849. return smalltalk.withContext(function($ctx1) {
  1850. var $1,$2;
  1851. $1=_st($HLConfirmation())._new();
  1852. _st($1)._confirmationString_(aString);
  1853. _st($1)._actionBlock_(aBlock);
  1854. $2=_st($1)._yourself();
  1855. _st($2)._appendToJQuery_(_st("body")._asJQuery());
  1856. return self}, function($ctx1) {$ctx1.fill(self,"confirm:ifTrue:",{aString:aString,aBlock:aBlock},smalltalk.HLManager)})},
  1857. args: ["aString", "aBlock"],
  1858. 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",
  1859. messageSends: ["appendToJQuery:", "asJQuery", "confirmationString:", "new", "actionBlock:", "yourself"],
  1860. referencedClasses: ["HLConfirmation"]
  1861. }),
  1862. smalltalk.HLManager);
  1863. smalltalk.addMethod(
  1864. smalltalk.method({
  1865. selector: "defaultEnvironment",
  1866. category: 'defaults',
  1867. fn: function (){
  1868. var self=this;
  1869. function $Environment(){return smalltalk.Environment||(typeof Environment=="undefined"?nil:Environment)}
  1870. return smalltalk.withContext(function($ctx1) {
  1871. var $1,$2,$3;
  1872. $1=_st(window)._parent();
  1873. if(($receiver = $1) == nil || $receiver == undefined){
  1874. $2=_st($Environment())._new();
  1875. return $2;
  1876. } else {
  1877. $1;
  1878. };
  1879. $3=_st(_st(_st(_st(window)._parent())._at_("smalltalk"))._at_("Environment"))._new();
  1880. return $3;
  1881. }, function($ctx1) {$ctx1.fill(self,"defaultEnvironment",{},smalltalk.HLManager)})},
  1882. args: [],
  1883. 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",
  1884. messageSends: ["ifNil:", "new", "parent", "at:"],
  1885. referencedClasses: ["Environment"]
  1886. }),
  1887. smalltalk.HLManager);
  1888. smalltalk.addMethod(
  1889. smalltalk.method({
  1890. selector: "environment",
  1891. category: 'accessing',
  1892. fn: function (){
  1893. var self=this;
  1894. return smalltalk.withContext(function($ctx1) {
  1895. var $2,$1;
  1896. $2=self["@environment"];
  1897. if(($receiver = $2) == nil || $receiver == undefined){
  1898. self["@environment"]=_st(self)._defaultEnvironment();
  1899. $1=self["@environment"];
  1900. } else {
  1901. $1=$2;
  1902. };
  1903. return $1;
  1904. }, function($ctx1) {$ctx1.fill(self,"environment",{},smalltalk.HLManager)})},
  1905. args: [],
  1906. source: "environment\x0a\x09\x22The default environment used by all Helios objects\x22\x0a \x0a\x09^ environment ifNil: [ environment := self defaultEnvironment ]",
  1907. messageSends: ["ifNil:", "defaultEnvironment"],
  1908. referencedClasses: []
  1909. }),
  1910. smalltalk.HLManager);
  1911. smalltalk.addMethod(
  1912. smalltalk.method({
  1913. selector: "environment:",
  1914. category: 'accessing',
  1915. fn: function (anEnvironment){
  1916. var self=this;
  1917. return smalltalk.withContext(function($ctx1) {
  1918. self["@environment"]=anEnvironment;
  1919. return self}, function($ctx1) {$ctx1.fill(self,"environment:",{anEnvironment:anEnvironment},smalltalk.HLManager)})},
  1920. args: ["anEnvironment"],
  1921. source: "environment: anEnvironment\x0a\x09environment := anEnvironment",
  1922. messageSends: [],
  1923. referencedClasses: []
  1924. }),
  1925. smalltalk.HLManager);
  1926. smalltalk.addMethod(
  1927. smalltalk.method({
  1928. selector: "history",
  1929. category: 'accessing',
  1930. fn: function (){
  1931. var self=this;
  1932. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  1933. return smalltalk.withContext(function($ctx1) {
  1934. var $2,$1;
  1935. $2=self["@history"];
  1936. if(($receiver = $2) == nil || $receiver == undefined){
  1937. self["@history"]=_st($OrderedCollection())._new();
  1938. $1=self["@history"];
  1939. } else {
  1940. $1=$2;
  1941. };
  1942. return $1;
  1943. }, function($ctx1) {$ctx1.fill(self,"history",{},smalltalk.HLManager)})},
  1944. args: [],
  1945. source: "history\x0a\x09^ history ifNil: [ history := OrderedCollection new ]",
  1946. messageSends: ["ifNil:", "new"],
  1947. referencedClasses: ["OrderedCollection"]
  1948. }),
  1949. smalltalk.HLManager);
  1950. smalltalk.addMethod(
  1951. smalltalk.method({
  1952. selector: "history:",
  1953. category: 'accessing',
  1954. fn: function (aCollection){
  1955. var self=this;
  1956. return smalltalk.withContext(function($ctx1) {
  1957. self["@history"]=aCollection;
  1958. return self}, function($ctx1) {$ctx1.fill(self,"history:",{aCollection:aCollection},smalltalk.HLManager)})},
  1959. args: ["aCollection"],
  1960. source: "history: aCollection\x0a\x09history := aCollection",
  1961. messageSends: [],
  1962. referencedClasses: []
  1963. }),
  1964. smalltalk.HLManager);
  1965. smalltalk.addMethod(
  1966. smalltalk.method({
  1967. selector: "initialize",
  1968. category: 'initialization',
  1969. fn: function (){
  1970. var self=this;
  1971. return smalltalk.withContext(function($ctx1) {
  1972. smalltalk.HLWidget.fn.prototype._initialize.apply(_st(self), []);
  1973. _st(_st(self)._keyBinder())._setupEvents();
  1974. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.HLManager)})},
  1975. args: [],
  1976. source: "initialize\x0a\x09super initialize.\x0a self keyBinder setupEvents",
  1977. messageSends: ["initialize", "setupEvents", "keyBinder"],
  1978. referencedClasses: []
  1979. }),
  1980. smalltalk.HLManager);
  1981. smalltalk.addMethod(
  1982. smalltalk.method({
  1983. selector: "keyBinder",
  1984. category: 'accessing',
  1985. fn: function (){
  1986. var self=this;
  1987. function $HLKeyBinder(){return smalltalk.HLKeyBinder||(typeof HLKeyBinder=="undefined"?nil:HLKeyBinder)}
  1988. return smalltalk.withContext(function($ctx1) {
  1989. var $2,$1;
  1990. $2=self["@keyBinder"];
  1991. if(($receiver = $2) == nil || $receiver == undefined){
  1992. self["@keyBinder"]=_st($HLKeyBinder())._new();
  1993. $1=self["@keyBinder"];
  1994. } else {
  1995. $1=$2;
  1996. };
  1997. return $1;
  1998. }, function($ctx1) {$ctx1.fill(self,"keyBinder",{},smalltalk.HLManager)})},
  1999. args: [],
  2000. source: "keyBinder\x0a\x09^ keyBinder ifNil: [ keyBinder := HLKeyBinder new ]",
  2001. messageSends: ["ifNil:", "new"],
  2002. referencedClasses: ["HLKeyBinder"]
  2003. }),
  2004. smalltalk.HLManager);
  2005. smalltalk.addMethod(
  2006. smalltalk.method({
  2007. selector: "refresh",
  2008. category: 'rendering',
  2009. fn: function (){
  2010. var self=this;
  2011. return smalltalk.withContext(function($ctx1) {
  2012. _st(_st(window)._jQuery_(".navbar"))._remove();
  2013. _st(self)._appendToJQuery_(_st("body")._asJQuery());
  2014. return self}, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.HLManager)})},
  2015. args: [],
  2016. source: "refresh\x0a\x09(window jQuery: '.navbar') remove.\x0a\x09self appendToJQuery: 'body' asJQuery",
  2017. messageSends: ["remove", "jQuery:", "appendToJQuery:", "asJQuery"],
  2018. referencedClasses: []
  2019. }),
  2020. smalltalk.HLManager);
  2021. smalltalk.addMethod(
  2022. smalltalk.method({
  2023. selector: "removeActiveTab",
  2024. category: 'actions',
  2025. fn: function (){
  2026. var self=this;
  2027. return smalltalk.withContext(function($ctx1) {
  2028. _st(self)._removeTab_(_st(self)._activeTab());
  2029. return self}, function($ctx1) {$ctx1.fill(self,"removeActiveTab",{},smalltalk.HLManager)})},
  2030. args: [],
  2031. source: "removeActiveTab\x0a\x09self removeTab: self activeTab",
  2032. messageSends: ["removeTab:", "activeTab"],
  2033. referencedClasses: []
  2034. }),
  2035. smalltalk.HLManager);
  2036. smalltalk.addMethod(
  2037. smalltalk.method({
  2038. selector: "removeFromHistory:",
  2039. category: 'actions',
  2040. fn: function (aTab){
  2041. var self=this;
  2042. return smalltalk.withContext(function($ctx1) {
  2043. _st(self)._history_(_st(_st(self)._history())._reject_((function(each){
  2044. return smalltalk.withContext(function($ctx2) {
  2045. return _st(each).__eq_eq(aTab);
  2046. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})));
  2047. return self}, function($ctx1) {$ctx1.fill(self,"removeFromHistory:",{aTab:aTab},smalltalk.HLManager)})},
  2048. args: ["aTab"],
  2049. source: "removeFromHistory: aTab\x0a\x09self history: (self history reject: [ :each | each == aTab ])",
  2050. messageSends: ["history:", "reject:", "==", "history"],
  2051. referencedClasses: []
  2052. }),
  2053. smalltalk.HLManager);
  2054. smalltalk.addMethod(
  2055. smalltalk.method({
  2056. selector: "removeTab:",
  2057. category: 'actions',
  2058. fn: function (aTab){
  2059. var self=this;
  2060. return smalltalk.withContext(function($ctx1) {
  2061. var $1,$2;
  2062. $1=_st(_st(self)._tabs())._includes_(aTab);
  2063. if(! smalltalk.assert($1)){
  2064. $2=self;
  2065. return $2;
  2066. };
  2067. _st(self)._removeFromHistory_(aTab);
  2068. _st(_st(self)._tabs())._remove_(aTab);
  2069. _st(_st(self)._keyBinder())._flushBindings();
  2070. _st(aTab)._remove();
  2071. _st(self)._refresh();
  2072. _st(_st(self)._history())._ifNotEmpty_((function(){
  2073. return smalltalk.withContext(function($ctx2) {
  2074. return _st(_st(_st(self)._history())._last())._activate();
  2075. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2076. return self}, function($ctx1) {$ctx1.fill(self,"removeTab:",{aTab:aTab},smalltalk.HLManager)})},
  2077. args: ["aTab"],
  2078. 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 ]",
  2079. messageSends: ["ifFalse:", "includes:", "tabs", "removeFromHistory:", "remove:", "flushBindings", "keyBinder", "remove", "refresh", "ifNotEmpty:", "activate", "last", "history"],
  2080. referencedClasses: []
  2081. }),
  2082. smalltalk.HLManager);
  2083. smalltalk.addMethod(
  2084. smalltalk.method({
  2085. selector: "renderAddOn:",
  2086. category: 'rendering',
  2087. fn: function (html){
  2088. var self=this;
  2089. function $HLWidget(){return smalltalk.HLWidget||(typeof HLWidget=="undefined"?nil:HLWidget)}
  2090. return smalltalk.withContext(function($ctx1) {
  2091. var $1,$3,$4,$5,$7,$8,$6,$2;
  2092. $1=_st(html)._li();
  2093. _st($1)._class_("dropdown");
  2094. $2=_st($1)._with_((function(){
  2095. return smalltalk.withContext(function($ctx2) {
  2096. $3=_st(html)._a();
  2097. _st($3)._class_("dropdown-toggle");
  2098. _st($3)._at_put_("data-toggle","dropdown");
  2099. $4=_st($3)._with_((function(){
  2100. return smalltalk.withContext(function($ctx3) {
  2101. _st(html)._with_("Open...");
  2102. return _st(_st(html)._tag_("b"))._class_("caret");
  2103. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  2104. $4;
  2105. $5=_st(html)._ul();
  2106. _st($5)._class_("dropdown-menu");
  2107. $6=_st($5)._with_((function(){
  2108. return smalltalk.withContext(function($ctx3) {
  2109. return _st(_st(_st(_st($HLWidget())._withAllSubclasses())._select_((function(each){
  2110. return smalltalk.withContext(function($ctx4) {
  2111. return _st(each)._canBeOpenAsTab();
  2112. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx1)})})))._sorted_((function(a,b){
  2113. return smalltalk.withContext(function($ctx4) {
  2114. return _st(_st(a)._tabPriority()).__lt(_st(b)._tabPriority());
  2115. }, function($ctx4) {$ctx4.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(each){
  2116. return smalltalk.withContext(function($ctx4) {
  2117. return _st(_st(html)._li())._with_((function(){
  2118. return smalltalk.withContext(function($ctx5) {
  2119. $7=_st(html)._a();
  2120. _st($7)._with_(_st(each)._tabLabel());
  2121. $8=_st($7)._onClick_((function(){
  2122. return smalltalk.withContext(function($ctx6) {
  2123. return _st(each)._openAsTab();
  2124. }, function($ctx6) {$ctx6.fillBlock({},$ctx1)})}));
  2125. return $8;
  2126. }, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
  2127. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx1)})}));
  2128. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  2129. return $6;
  2130. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2131. return self}, function($ctx1) {$ctx1.fill(self,"renderAddOn:",{html:html},smalltalk.HLManager)})},
  2132. args: ["html"],
  2133. 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 ] ] ] ] ]",
  2134. messageSends: ["class:", "li", "with:", "a", "at:put:", "tag:", "ul", "do:", "tabLabel", "onClick:", "openAsTab", "sorted:", "<", "tabPriority", "select:", "canBeOpenAsTab", "withAllSubclasses"],
  2135. referencedClasses: ["HLWidget"]
  2136. }),
  2137. smalltalk.HLManager);
  2138. smalltalk.addMethod(
  2139. smalltalk.method({
  2140. selector: "renderContentOn:",
  2141. category: 'rendering',
  2142. fn: function (html){
  2143. var self=this;
  2144. return smalltalk.withContext(function($ctx1) {
  2145. var $1,$3,$4,$2;
  2146. $1=_st(html)._div();
  2147. _st($1)._class_("navbar navbar-fixed-top");
  2148. $2=_st($1)._with_((function(){
  2149. return smalltalk.withContext(function($ctx2) {
  2150. $3=_st(html)._div();
  2151. _st($3)._class_("navbar-inner");
  2152. $4=_st($3)._with_((function(){
  2153. return smalltalk.withContext(function($ctx3) {
  2154. return _st(self)._renderTabsOn_(html);
  2155. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  2156. return $4;
  2157. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2158. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLManager)})},
  2159. args: ["html"],
  2160. 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 ] ]",
  2161. messageSends: ["class:", "div", "with:", "renderTabsOn:"],
  2162. referencedClasses: []
  2163. }),
  2164. smalltalk.HLManager);
  2165. smalltalk.addMethod(
  2166. smalltalk.method({
  2167. selector: "renderTabsOn:",
  2168. category: 'rendering',
  2169. fn: function (html){
  2170. var self=this;
  2171. return smalltalk.withContext(function($ctx1) {
  2172. var $1,$3,$4,$6,$5,$8,$9,$7,$2;
  2173. $1=_st(html)._ul();
  2174. _st($1)._class_("nav");
  2175. $2=_st($1)._with_((function(){
  2176. return smalltalk.withContext(function($ctx2) {
  2177. _st(_st(self)._tabs())._do_((function(each){
  2178. return smalltalk.withContext(function($ctx3) {
  2179. $3=_st(html)._li();
  2180. $4=$3;
  2181. $6=_st(each)._isActive();
  2182. if(smalltalk.assert($6)){
  2183. $5="active";
  2184. } else {
  2185. $5="inactive";
  2186. };
  2187. _st($4)._class_($5);
  2188. $7=_st($3)._with_((function(){
  2189. return smalltalk.withContext(function($ctx4) {
  2190. $8=_st(html)._a();
  2191. _st($8)._with_((function(){
  2192. return smalltalk.withContext(function($ctx5) {
  2193. _st(_st(_st(html)._tag_("i"))._class_("icon-remove"))._onClick_((function(){
  2194. return smalltalk.withContext(function($ctx6) {
  2195. return _st(self)._removeTab_(each);
  2196. }, function($ctx6) {$ctx6.fillBlock({},$ctx1)})}));
  2197. return _st(html)._with_(_st(each)._displayLabel());
  2198. }, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
  2199. $9=_st($8)._onClick_((function(){
  2200. return smalltalk.withContext(function($ctx5) {
  2201. return _st(each)._activate();
  2202. }, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
  2203. return $9;
  2204. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
  2205. return $7;
  2206. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  2207. return _st(self)._renderAddOn_(html);
  2208. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2209. return self}, function($ctx1) {$ctx1.fill(self,"renderTabsOn:",{html:html},smalltalk.HLManager)})},
  2210. args: ["html"],
  2211. 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 ]",
  2212. messageSends: ["class:", "ul", "with:", "do:", "ifTrue:ifFalse:", "isActive", "li", "onClick:", "removeTab:", "tag:", "displayLabel", "a", "activate", "tabs", "renderAddOn:"],
  2213. referencedClasses: []
  2214. }),
  2215. smalltalk.HLManager);
  2216. smalltalk.addMethod(
  2217. smalltalk.method({
  2218. selector: "show:",
  2219. category: 'rendering',
  2220. fn: function (aTab){
  2221. var self=this;
  2222. return smalltalk.withContext(function($ctx1) {
  2223. var $1,$2;
  2224. _st(_st(self)._tabs())._do_((function(each){
  2225. return smalltalk.withContext(function($ctx2) {
  2226. return _st(each)._hide();
  2227. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  2228. $1=aTab;
  2229. _st($1)._show();
  2230. $2=_st($1)._focus();
  2231. return self}, function($ctx1) {$ctx1.fill(self,"show:",{aTab:aTab},smalltalk.HLManager)})},
  2232. args: ["aTab"],
  2233. source: "show: aTab\x0a\x09self tabs do: [ :each | each hide ].\x0a\x09aTab show; focus",
  2234. messageSends: ["do:", "hide", "tabs", "show", "focus"],
  2235. referencedClasses: []
  2236. }),
  2237. smalltalk.HLManager);
  2238. smalltalk.addMethod(
  2239. smalltalk.method({
  2240. selector: "tabs",
  2241. category: 'accessing',
  2242. fn: function (){
  2243. var self=this;
  2244. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  2245. return smalltalk.withContext(function($ctx1) {
  2246. var $2,$1;
  2247. $2=self["@tabs"];
  2248. if(($receiver = $2) == nil || $receiver == undefined){
  2249. self["@tabs"]=_st($OrderedCollection())._new();
  2250. $1=self["@tabs"];
  2251. } else {
  2252. $1=$2;
  2253. };
  2254. return $1;
  2255. }, function($ctx1) {$ctx1.fill(self,"tabs",{},smalltalk.HLManager)})},
  2256. args: [],
  2257. source: "tabs\x0a\x09^ tabs ifNil: [ tabs := OrderedCollection new ]",
  2258. messageSends: ["ifNil:", "new"],
  2259. referencedClasses: ["OrderedCollection"]
  2260. }),
  2261. smalltalk.HLManager);
  2262. smalltalk.HLManager.klass.iVarNames = ['current'];
  2263. smalltalk.addMethod(
  2264. smalltalk.method({
  2265. selector: "current",
  2266. category: 'accessing',
  2267. fn: function (){
  2268. var self=this;
  2269. return smalltalk.withContext(function($ctx1) {
  2270. var $2,$1;
  2271. $2=self["@current"];
  2272. if(($receiver = $2) == nil || $receiver == undefined){
  2273. self["@current"]=_st(_st(self)._basicNew())._initialize();
  2274. $1=self["@current"];
  2275. } else {
  2276. $1=$2;
  2277. };
  2278. return $1;
  2279. }, function($ctx1) {$ctx1.fill(self,"current",{},smalltalk.HLManager.klass)})},
  2280. args: [],
  2281. source: "current\x0a\x09^ current ifNil: [ current := self basicNew initialize ]",
  2282. messageSends: ["ifNil:", "initialize", "basicNew"],
  2283. referencedClasses: []
  2284. }),
  2285. smalltalk.HLManager.klass);
  2286. smalltalk.addMethod(
  2287. smalltalk.method({
  2288. selector: "initialize",
  2289. category: 'initialization',
  2290. fn: function (){
  2291. var self=this;
  2292. return smalltalk.withContext(function($ctx1) {
  2293. _st(_st(self)._current())._appendToJQuery_(_st("body")._asJQuery());
  2294. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.HLManager.klass)})},
  2295. args: [],
  2296. source: "initialize\x0a\x09self current appendToJQuery: 'body' asJQuery",
  2297. messageSends: ["appendToJQuery:", "asJQuery", "current"],
  2298. referencedClasses: []
  2299. }),
  2300. smalltalk.HLManager.klass);
  2301. smalltalk.addMethod(
  2302. smalltalk.method({
  2303. selector: "new",
  2304. category: 'instance creation',
  2305. fn: function (){
  2306. var self=this;
  2307. return smalltalk.withContext(function($ctx1) {
  2308. _st(self)._shouldNotImplement();
  2309. return self}, function($ctx1) {$ctx1.fill(self,"new",{},smalltalk.HLManager.klass)})},
  2310. args: [],
  2311. source: "new\x0a\x09\x22Use current instead\x22\x0a\x0a\x09self shouldNotImplement",
  2312. messageSends: ["shouldNotImplement"],
  2313. referencedClasses: []
  2314. }),
  2315. smalltalk.HLManager.klass);
  2316. smalltalk.addClass('HLSUnit', smalltalk.HLWidget, [], 'Helios-Core');
  2317. smalltalk.addMethod(
  2318. smalltalk.method({
  2319. selector: "canBeOpenAsTab",
  2320. category: 'testing',
  2321. fn: function (){
  2322. var self=this;
  2323. return smalltalk.withContext(function($ctx1) {
  2324. return true;
  2325. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLSUnit.klass)})},
  2326. args: [],
  2327. source: "canBeOpenAsTab\x0a\x09^ true",
  2328. messageSends: [],
  2329. referencedClasses: []
  2330. }),
  2331. smalltalk.HLSUnit.klass);
  2332. smalltalk.addMethod(
  2333. smalltalk.method({
  2334. selector: "tabLabel",
  2335. category: 'accessing',
  2336. fn: function (){
  2337. var self=this;
  2338. return smalltalk.withContext(function($ctx1) {
  2339. return "SUnit";
  2340. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{},smalltalk.HLSUnit.klass)})},
  2341. args: [],
  2342. source: "tabLabel\x0a\x09^ 'SUnit'",
  2343. messageSends: [],
  2344. referencedClasses: []
  2345. }),
  2346. smalltalk.HLSUnit.klass);
  2347. smalltalk.addMethod(
  2348. smalltalk.method({
  2349. selector: "tabPriority",
  2350. category: 'accessing',
  2351. fn: function (){
  2352. var self=this;
  2353. return smalltalk.withContext(function($ctx1) {
  2354. var $1;
  2355. $1=(1000);
  2356. return $1;
  2357. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{},smalltalk.HLSUnit.klass)})},
  2358. args: [],
  2359. source: "tabPriority\x0a\x09^ 1000",
  2360. messageSends: [],
  2361. referencedClasses: []
  2362. }),
  2363. smalltalk.HLSUnit.klass);
  2364. smalltalk.addClass('HLTranscript', smalltalk.HLWidget, [], 'Helios-Core');
  2365. smalltalk.addMethod(
  2366. smalltalk.method({
  2367. selector: "canBeOpenAsTab",
  2368. category: 'testing',
  2369. fn: function (){
  2370. var self=this;
  2371. return smalltalk.withContext(function($ctx1) {
  2372. return true;
  2373. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLTranscript.klass)})},
  2374. args: [],
  2375. source: "canBeOpenAsTab\x0a\x09^ true",
  2376. messageSends: [],
  2377. referencedClasses: []
  2378. }),
  2379. smalltalk.HLTranscript.klass);
  2380. smalltalk.addMethod(
  2381. smalltalk.method({
  2382. selector: "tabLabel",
  2383. category: 'accessing',
  2384. fn: function (){
  2385. var self=this;
  2386. return smalltalk.withContext(function($ctx1) {
  2387. return "Transcript";
  2388. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{},smalltalk.HLTranscript.klass)})},
  2389. args: [],
  2390. source: "tabLabel\x0a\x09^ 'Transcript'",
  2391. messageSends: [],
  2392. referencedClasses: []
  2393. }),
  2394. smalltalk.HLTranscript.klass);
  2395. smalltalk.addMethod(
  2396. smalltalk.method({
  2397. selector: "tabPriority",
  2398. category: 'accessing',
  2399. fn: function (){
  2400. var self=this;
  2401. return smalltalk.withContext(function($ctx1) {
  2402. var $1;
  2403. $1=(600);
  2404. return $1;
  2405. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{},smalltalk.HLTranscript.klass)})},
  2406. args: [],
  2407. source: "tabPriority\x0a\x09^ 600",
  2408. messageSends: [],
  2409. referencedClasses: []
  2410. }),
  2411. smalltalk.HLTranscript.klass);