Helios-Core.js 70 KB

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