Helios-Core.js 70 KB

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