Helios-Core.js 72 KB

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