Helios-Core.js 73 KB

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