Helios-Core.js 57 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670
  1. smalltalk.addPackage('Helios-Core');
  2. smalltalk.addClass('HLTab', smalltalk.Object, ['widget', 'label'], 'Helios-Core');
  3. smalltalk.addMethod(
  4. "_activate",
  5. smalltalk.method({
  6. selector: "activate",
  7. category: 'accessing',
  8. fn: function (){
  9. var self=this;
  10. return smalltalk.withContext(function($ctx1) { _st(_st(self)._manager())._activate_(self);
  11. return self}, function($ctx1) {$ctx1.fill(self,"activate",{}, smalltalk.HLTab)})},
  12. args: [],
  13. source: "activate\x0a\x09self manager activate: self",
  14. messageSends: ["activate:", "manager"],
  15. referencedClasses: []
  16. }),
  17. smalltalk.HLTab);
  18. smalltalk.addMethod(
  19. "_add",
  20. smalltalk.method({
  21. selector: "add",
  22. category: 'accessing',
  23. fn: function (){
  24. var self=this;
  25. return smalltalk.withContext(function($ctx1) { _st(_st(self)._manager())._addTab_(self);
  26. return self}, function($ctx1) {$ctx1.fill(self,"add",{}, smalltalk.HLTab)})},
  27. args: [],
  28. source: "add\x0a\x09self manager addTab: self",
  29. messageSends: ["addTab:", "manager"],
  30. referencedClasses: []
  31. }),
  32. smalltalk.HLTab);
  33. smalltalk.addMethod(
  34. "_isActive",
  35. smalltalk.method({
  36. selector: "isActive",
  37. category: 'testing',
  38. fn: function (){
  39. var self=this;
  40. return smalltalk.withContext(function($ctx1) { var $1;
  41. $1=_st(_st(_st(self)._manager())._activeTab()).__eq(self);
  42. return $1;
  43. }, function($ctx1) {$ctx1.fill(self,"isActive",{}, smalltalk.HLTab)})},
  44. args: [],
  45. source: "isActive\x0a\x09^ self manager activeTab = self",
  46. messageSends: ["=", "activeTab", "manager"],
  47. referencedClasses: []
  48. }),
  49. smalltalk.HLTab);
  50. smalltalk.addMethod(
  51. "_label",
  52. smalltalk.method({
  53. selector: "label",
  54. category: 'accessing',
  55. fn: function (){
  56. var self=this;
  57. return smalltalk.withContext(function($ctx1) { var $2,$1;
  58. $2=self["@label"];
  59. if(($receiver = $2) == nil || $receiver == undefined){
  60. $1="";
  61. } else {
  62. $1=$2;
  63. };
  64. return $1;
  65. }, function($ctx1) {$ctx1.fill(self,"label",{}, smalltalk.HLTab)})},
  66. args: [],
  67. source: "label\x0a\x09^ label ifNil: [ '' ]",
  68. messageSends: ["ifNil:"],
  69. referencedClasses: []
  70. }),
  71. smalltalk.HLTab);
  72. smalltalk.addMethod(
  73. "_label_",
  74. smalltalk.method({
  75. selector: "label:",
  76. category: 'accessing',
  77. fn: function (aString){
  78. var self=this;
  79. return smalltalk.withContext(function($ctx1) { self["@label"]=aString;
  80. return self}, function($ctx1) {$ctx1.fill(self,"label:",{aString:aString}, smalltalk.HLTab)})},
  81. args: ["aString"],
  82. source: "label: aString\x0a\x09label := aString",
  83. messageSends: [],
  84. referencedClasses: []
  85. }),
  86. smalltalk.HLTab);
  87. smalltalk.addMethod(
  88. "_manager",
  89. smalltalk.method({
  90. selector: "manager",
  91. category: 'accessing',
  92. fn: function (){
  93. var self=this;
  94. return smalltalk.withContext(function($ctx1) { var $1;
  95. $1=_st((smalltalk.HLManager || HLManager))._current();
  96. return $1;
  97. }, function($ctx1) {$ctx1.fill(self,"manager",{}, smalltalk.HLTab)})},
  98. args: [],
  99. source: "manager\x0a\x09^ HLManager current",
  100. messageSends: ["current"],
  101. referencedClasses: ["HLManager"]
  102. }),
  103. smalltalk.HLTab);
  104. smalltalk.addMethod(
  105. "_widget",
  106. smalltalk.method({
  107. selector: "widget",
  108. category: 'accessing',
  109. fn: function (){
  110. var self=this;
  111. return smalltalk.withContext(function($ctx1) { var $1;
  112. $1=self["@widget"];
  113. return $1;
  114. }, function($ctx1) {$ctx1.fill(self,"widget",{}, smalltalk.HLTab)})},
  115. args: [],
  116. source: "widget\x0a\x09^ widget",
  117. messageSends: [],
  118. referencedClasses: []
  119. }),
  120. smalltalk.HLTab);
  121. smalltalk.addMethod(
  122. "_widget_",
  123. smalltalk.method({
  124. selector: "widget:",
  125. category: 'accessing',
  126. fn: function (aWidget){
  127. var self=this;
  128. return smalltalk.withContext(function($ctx1) { self["@widget"]=aWidget;
  129. return self}, function($ctx1) {$ctx1.fill(self,"widget:",{aWidget:aWidget}, smalltalk.HLTab)})},
  130. args: ["aWidget"],
  131. source: "widget: aWidget\x0a\x09widget := aWidget",
  132. messageSends: [],
  133. referencedClasses: []
  134. }),
  135. smalltalk.HLTab);
  136. smalltalk.addMethod(
  137. "_on_labelled_",
  138. smalltalk.method({
  139. selector: "on:labelled:",
  140. category: 'instance creation',
  141. fn: function (aWidget,aString){
  142. var self=this;
  143. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  144. $2=_st(self)._new();
  145. _st($2)._widget_(aWidget);
  146. _st($2)._label_(aString);
  147. $3=_st($2)._yourself();
  148. $1=$3;
  149. return $1;
  150. }, function($ctx1) {$ctx1.fill(self,"on:labelled:",{aWidget:aWidget,aString:aString}, smalltalk.HLTab.klass)})},
  151. args: ["aWidget", "aString"],
  152. source: "on: aWidget labelled: aString\x0a\x09^ self new\x0a\x09\x09widget: aWidget;\x0a\x09\x09label: aString;\x0a\x09\x09yourself",
  153. messageSends: ["widget:", "new", "label:", "yourself"],
  154. referencedClasses: []
  155. }),
  156. smalltalk.HLTab.klass);
  157. smalltalk.addClass('HLWidget', smalltalk.Widget, ['wrapper'], 'Helios-Core');
  158. smalltalk.addMethod(
  159. "_manager",
  160. smalltalk.method({
  161. selector: "manager",
  162. category: 'accessing',
  163. fn: function (){
  164. var self=this;
  165. return smalltalk.withContext(function($ctx1) { var $1;
  166. $1=_st((smalltalk.HLManager || HLManager))._current();
  167. return $1;
  168. }, function($ctx1) {$ctx1.fill(self,"manager",{}, smalltalk.HLWidget)})},
  169. args: [],
  170. source: "manager\x0a\x09^ HLManager current",
  171. messageSends: ["current"],
  172. referencedClasses: ["HLManager"]
  173. }),
  174. smalltalk.HLWidget);
  175. smalltalk.addMethod(
  176. "_refresh",
  177. smalltalk.method({
  178. selector: "refresh",
  179. category: 'updating',
  180. fn: function (){
  181. var self=this;
  182. return smalltalk.withContext(function($ctx1) { var $1,$2;
  183. $1=_st(self)._wrapper();
  184. if(($receiver = $1) == nil || $receiver == undefined){
  185. $2=self;
  186. return $2;
  187. } else {
  188. $1;
  189. };
  190. _st(_st(_st(self)._wrapper())._asJQuery())._empty();
  191. _st((function(html){
  192. return smalltalk.withContext(function($ctx2) { return _st(self)._renderContentOn_(html);
  193. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}))._appendToJQuery_(_st(_st(self)._wrapper())._asJQuery());
  194. return self}, function($ctx1) {$ctx1.fill(self,"refresh",{}, smalltalk.HLWidget)})},
  195. args: [],
  196. source: "refresh\x0a\x09self wrapper ifNil: [ ^ self ].\x0a \x0a\x09self wrapper asJQuery empty.\x0a [ :html | self renderContentOn: html ] appendToJQuery: self wrapper asJQuery",
  197. messageSends: ["ifNil:", "wrapper", "empty", "asJQuery", "appendToJQuery:", "renderContentOn:"],
  198. referencedClasses: []
  199. }),
  200. smalltalk.HLWidget);
  201. smalltalk.addMethod(
  202. "_registerBindings",
  203. smalltalk.method({
  204. selector: "registerBindings",
  205. category: 'keybindings',
  206. fn: function (){
  207. var self=this;
  208. return smalltalk.withContext(function($ctx1) { _st(self)._registerBindingsOn_(_st(_st(_st(self)._manager())._keyBinder())._bindings());
  209. return self}, function($ctx1) {$ctx1.fill(self,"registerBindings",{}, smalltalk.HLWidget)})},
  210. args: [],
  211. source: "registerBindings\x0a\x09self registerBindingsOn: self manager keyBinder bindings",
  212. messageSends: ["registerBindingsOn:", "bindings", "keyBinder", "manager"],
  213. referencedClasses: []
  214. }),
  215. smalltalk.HLWidget);
  216. smalltalk.addMethod(
  217. "_registerBindingsOn_",
  218. smalltalk.method({
  219. selector: "registerBindingsOn:",
  220. category: 'keybindings',
  221. fn: function (aBindingGroup){
  222. var self=this;
  223. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"registerBindingsOn:",{aBindingGroup:aBindingGroup}, smalltalk.HLWidget)})},
  224. args: ["aBindingGroup"],
  225. source: "registerBindingsOn: aBindingGroup",
  226. messageSends: [],
  227. referencedClasses: []
  228. }),
  229. smalltalk.HLWidget);
  230. smalltalk.addMethod(
  231. "_renderContentOn_",
  232. smalltalk.method({
  233. selector: "renderContentOn:",
  234. category: 'rendering',
  235. fn: function (html){
  236. var self=this;
  237. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html}, smalltalk.HLWidget)})},
  238. args: ["html"],
  239. source: "renderContentOn: html\x0a",
  240. messageSends: [],
  241. referencedClasses: []
  242. }),
  243. smalltalk.HLWidget);
  244. smalltalk.addMethod(
  245. "_renderOn_",
  246. smalltalk.method({
  247. selector: "renderOn:",
  248. category: 'rendering',
  249. fn: function (html){
  250. var self=this;
  251. return smalltalk.withContext(function($ctx1) { _st(self)._registerBindings();
  252. self["@wrapper"]=_st(html)._div();
  253. _st((function(renderer){
  254. return smalltalk.withContext(function($ctx2) { return _st(self)._renderContentOn_(renderer);
  255. }, function($ctx2) {$ctx2.fillBlock({renderer:renderer},$ctx1)})}))._appendToJQuery_(_st(self["@wrapper"])._asJQuery());
  256. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html}, smalltalk.HLWidget)})},
  257. args: ["html"],
  258. source: "renderOn: html\x0a self registerBindings.\x0a\x0a\x09wrapper := html div.\x0a [ :renderer | self renderContentOn: renderer ] appendToJQuery: wrapper asJQuery",
  259. messageSends: ["registerBindings", "div", "appendToJQuery:", "asJQuery", "renderContentOn:"],
  260. referencedClasses: []
  261. }),
  262. smalltalk.HLWidget);
  263. smalltalk.addMethod(
  264. "_wrapper",
  265. smalltalk.method({
  266. selector: "wrapper",
  267. category: 'accessing',
  268. fn: function (){
  269. var self=this;
  270. return smalltalk.withContext(function($ctx1) { var $1;
  271. $1=self["@wrapper"];
  272. return $1;
  273. }, function($ctx1) {$ctx1.fill(self,"wrapper",{}, smalltalk.HLWidget)})},
  274. args: [],
  275. source: "wrapper\x0a\x09^ wrapper",
  276. messageSends: [],
  277. referencedClasses: []
  278. }),
  279. smalltalk.HLWidget);
  280. smalltalk.addMethod(
  281. "_canBeOpenAsTab",
  282. smalltalk.method({
  283. selector: "canBeOpenAsTab",
  284. category: 'testing',
  285. fn: function (){
  286. var self=this;
  287. return smalltalk.withContext(function($ctx1) { return false;
  288. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{}, smalltalk.HLWidget.klass)})},
  289. args: [],
  290. source: "canBeOpenAsTab\x0a\x09^ false",
  291. messageSends: [],
  292. referencedClasses: []
  293. }),
  294. smalltalk.HLWidget.klass);
  295. smalltalk.addMethod(
  296. "_openAsTab",
  297. smalltalk.method({
  298. selector: "openAsTab",
  299. category: 'accessing',
  300. fn: function (){
  301. var self=this;
  302. return smalltalk.withContext(function($ctx1) { var $1,$2;
  303. $1=_st(self)._canBeOpenAsTab();
  304. if(! smalltalk.assert($1)){
  305. $2=self;
  306. return $2;
  307. };
  308. _st(_st((smalltalk.HLManager || HLManager))._current())._addTab_(_st((smalltalk.HLTab || HLTab))._on_labelled_(_st(self)._new(),_st(self)._tabLabel()));
  309. return self}, function($ctx1) {$ctx1.fill(self,"openAsTab",{}, smalltalk.HLWidget.klass)})},
  310. args: [],
  311. source: "openAsTab\x0a\x09self canBeOpenAsTab ifFalse: [ ^ self ].\x0a\x09HLManager current addTab: (HLTab on: self new labelled: self tabLabel)",
  312. messageSends: ["ifFalse:", "canBeOpenAsTab", "addTab:", "on:labelled:", "new", "tabLabel", "current"],
  313. referencedClasses: ["HLTab", "HLManager"]
  314. }),
  315. smalltalk.HLWidget.klass);
  316. smalltalk.addMethod(
  317. "_tabLabel",
  318. smalltalk.method({
  319. selector: "tabLabel",
  320. category: 'accessing',
  321. fn: function (){
  322. var self=this;
  323. return smalltalk.withContext(function($ctx1) { return "Tab";
  324. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{}, smalltalk.HLWidget.klass)})},
  325. args: [],
  326. source: "tabLabel\x0a\x09^ 'Tab'",
  327. messageSends: [],
  328. referencedClasses: []
  329. }),
  330. smalltalk.HLWidget.klass);
  331. smalltalk.addMethod(
  332. "_tabPriority",
  333. smalltalk.method({
  334. selector: "tabPriority",
  335. category: 'accessing',
  336. fn: function (){
  337. var self=this;
  338. return smalltalk.withContext(function($ctx1) { return (500);
  339. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{}, smalltalk.HLWidget.klass)})},
  340. args: [],
  341. source: "tabPriority\x0a\x09^ 500",
  342. messageSends: [],
  343. referencedClasses: []
  344. }),
  345. smalltalk.HLWidget.klass);
  346. smalltalk.addClass('HLDebugger', smalltalk.HLWidget, [], 'Helios-Core');
  347. smalltalk.addClass('HLFocusableWidget', smalltalk.HLWidget, ['hiddenInput'], 'Helios-Core');
  348. smalltalk.addMethod(
  349. "_blur",
  350. smalltalk.method({
  351. selector: "blur",
  352. category: 'events',
  353. fn: function (){
  354. var self=this;
  355. return smalltalk.withContext(function($ctx1) { _st(_st(self["@hiddenInput"])._asJQuery())._blur();
  356. return self}, function($ctx1) {$ctx1.fill(self,"blur",{}, smalltalk.HLFocusableWidget)})},
  357. args: [],
  358. source: "blur\x0a\x09hiddenInput asJQuery blur",
  359. messageSends: ["blur", "asJQuery"],
  360. referencedClasses: []
  361. }),
  362. smalltalk.HLFocusableWidget);
  363. smalltalk.addMethod(
  364. "_focus",
  365. smalltalk.method({
  366. selector: "focus",
  367. category: 'events',
  368. fn: function (){
  369. var self=this;
  370. return smalltalk.withContext(function($ctx1) { _st(_st(self["@hiddenInput"])._asJQuery())._focus();
  371. return self}, function($ctx1) {$ctx1.fill(self,"focus",{}, smalltalk.HLFocusableWidget)})},
  372. args: [],
  373. source: "focus\x0a\x09hiddenInput asJQuery focus",
  374. messageSends: ["focus", "asJQuery"],
  375. referencedClasses: []
  376. }),
  377. smalltalk.HLFocusableWidget);
  378. smalltalk.addMethod(
  379. "_focusClass",
  380. smalltalk.method({
  381. selector: "focusClass",
  382. category: 'accessing',
  383. fn: function (){
  384. var self=this;
  385. return smalltalk.withContext(function($ctx1) { return "focused";
  386. }, function($ctx1) {$ctx1.fill(self,"focusClass",{}, smalltalk.HLFocusableWidget)})},
  387. args: [],
  388. source: "focusClass\x0a\x09^ 'focused'",
  389. messageSends: [],
  390. referencedClasses: []
  391. }),
  392. smalltalk.HLFocusableWidget);
  393. smalltalk.addMethod(
  394. "_hasFocus",
  395. smalltalk.method({
  396. selector: "hasFocus",
  397. category: 'events',
  398. fn: function (){
  399. var self=this;
  400. return smalltalk.withContext(function($ctx1) { var $1;
  401. $1=_st(_st(_st(self)._wrapper())._notNil())._and_((function(){
  402. return smalltalk.withContext(function($ctx2) { return _st(_st(_st(self)._wrapper())._asJQuery())._hasClass_(_st(self)._focusClass());
  403. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  404. return $1;
  405. }, function($ctx1) {$ctx1.fill(self,"hasFocus",{}, smalltalk.HLFocusableWidget)})},
  406. args: [],
  407. source: "hasFocus\x0a\x09^ self wrapper notNil and: [ self wrapper asJQuery hasClass: self focusClass ]",
  408. messageSends: ["and:", "hasClass:", "focusClass", "asJQuery", "wrapper", "notNil"],
  409. referencedClasses: []
  410. }),
  411. smalltalk.HLFocusableWidget);
  412. smalltalk.addMethod(
  413. "_renderContentOn_",
  414. smalltalk.method({
  415. selector: "renderContentOn:",
  416. category: 'rendering',
  417. fn: function (html){
  418. var self=this;
  419. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html}, smalltalk.HLFocusableWidget)})},
  420. args: ["html"],
  421. source: "renderContentOn: html",
  422. messageSends: [],
  423. referencedClasses: []
  424. }),
  425. smalltalk.HLFocusableWidget);
  426. smalltalk.addMethod(
  427. "_renderHiddenInputOn_",
  428. smalltalk.method({
  429. selector: "renderHiddenInputOn:",
  430. category: 'rendering',
  431. fn: function (html){
  432. var self=this;
  433. return smalltalk.withContext(function($ctx1) { var $1,$2;
  434. $1=_st(html)._input();
  435. _st($1)._style_("position: absolute; left: -100000px;");
  436. _st($1)._onBlur_((function(){
  437. return smalltalk.withContext(function($ctx2) { return _st(_st(_st(self)._wrapper())._asJQuery())._removeClass_(_st(self)._focusClass());
  438. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  439. $2=_st($1)._onFocus_((function(){
  440. return smalltalk.withContext(function($ctx2) { return _st(_st(_st(self)._wrapper())._asJQuery())._addClass_(_st(self)._focusClass());
  441. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  442. self["@hiddenInput"]=$2;
  443. return self}, function($ctx1) {$ctx1.fill(self,"renderHiddenInputOn:",{html:html}, smalltalk.HLFocusableWidget)})},
  444. args: ["html"],
  445. source: "renderHiddenInputOn: html\x0a\x09hiddenInput := html input\x0a \x09style: 'position: absolute; left: -100000px;';\x0a \x09onBlur: [ self wrapper asJQuery removeClass: self focusClass ];\x0a onFocus: [ self wrapper asJQuery addClass: self focusClass ]",
  446. messageSends: ["style:", "input", "onBlur:", "removeClass:", "focusClass", "asJQuery", "wrapper", "onFocus:", "addClass:"],
  447. referencedClasses: []
  448. }),
  449. smalltalk.HLFocusableWidget);
  450. smalltalk.addMethod(
  451. "_renderOn_",
  452. smalltalk.method({
  453. selector: "renderOn:",
  454. category: 'rendering',
  455. fn: function (html){
  456. var self=this;
  457. return smalltalk.withContext(function($ctx1) { var $1,$2;
  458. _st(self)._registerBindings();
  459. _st(self)._renderHiddenInputOn_(html);
  460. $1=_st(html)._div();
  461. _st($1)._class_("hl_widget");
  462. _st($1)._onClick_((function(){
  463. return smalltalk.withContext(function($ctx2) { return _st(_st(self["@hiddenInput"])._asJQuery())._focus();
  464. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  465. $2=_st($1)._with_((function(){
  466. return smalltalk.withContext(function($ctx2) { return _st(self)._renderContentOn_(html);
  467. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  468. self["@wrapper"]=$2;
  469. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html}, smalltalk.HLFocusableWidget)})},
  470. args: ["html"],
  471. source: "renderOn: html\x0a\x09self registerBindings.\x0a\x09self renderHiddenInputOn: html.\x0a \x0a wrapper := html div \x0a \x09class: 'hl_widget'; \x0a onClick: [ hiddenInput asJQuery focus ];\x0a with: [\x0a\x09\x09\x09self renderContentOn: html ]",
  472. messageSends: ["registerBindings", "renderHiddenInputOn:", "class:", "div", "onClick:", "focus", "asJQuery", "with:", "renderContentOn:"],
  473. referencedClasses: []
  474. }),
  475. smalltalk.HLFocusableWidget);
  476. smalltalk.addClass('HLListWidget', smalltalk.HLFocusableWidget, ['items', 'selectedItem'], 'Helios-Core');
  477. smalltalk.addMethod(
  478. "_activateFirstListItem",
  479. smalltalk.method({
  480. selector: "activateFirstListItem",
  481. category: 'actions',
  482. fn: function (){
  483. var self=this;
  484. return smalltalk.withContext(function($ctx1) { _st(self)._activateListItem_(_st(window)._jQuery_(_st(_st(_st(self["@wrapper"])._asJQuery())._find_("li"))._get_((0))));
  485. return self}, function($ctx1) {$ctx1.fill(self,"activateFirstListItem",{}, smalltalk.HLListWidget)})},
  486. args: [],
  487. source: "activateFirstListItem\x0a\x09self activateListItem: (window jQuery: ((wrapper asJQuery find: 'li') get: 0))",
  488. messageSends: ["activateListItem:", "jQuery:", "get:", "find:", "asJQuery"],
  489. referencedClasses: []
  490. }),
  491. smalltalk.HLListWidget);
  492. smalltalk.addMethod(
  493. "_activateListItem_",
  494. smalltalk.method({
  495. selector: "activateListItem:",
  496. category: 'actions',
  497. fn: function (aListItem){
  498. var self=this;
  499. var parent,position;
  500. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  501. $1=_st(aListItem)._get_((0));
  502. if(($receiver = $1) == nil || $receiver == undefined){
  503. $2=self;
  504. return $2;
  505. } else {
  506. $1;
  507. };
  508. position=_st(self)._positionOf_(aListItem);
  509. parent=_st(aListItem)._parent();
  510. _st(_st(parent)._children())._removeClass_("active");
  511. _st(aListItem)._addClass_("active");
  512. $3=_st(_st(_st(aListItem)._position())._top()).__lt((0));
  513. if(smalltalk.assert($3)){
  514. _st(_st(parent)._get_((0)))._scrollTop_(_st(_st(_st(_st(parent)._get_((0)))._scrollTop()).__plus(_st(_st(aListItem)._position())._top())).__minus((10)));
  515. };
  516. $4=_st(_st(_st(_st(aListItem)._position())._top()).__plus(_st(aListItem)._height())).__gt(_st(parent)._height());
  517. if(smalltalk.assert($4)){
  518. _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)));
  519. };
  520. _st(self)._selectItem_(_st(_st(self)._items())._at_(_st(_st(aListItem)._attr_("list-data"))._asNumber()));
  521. return self}, function($ctx1) {$ctx1.fill(self,"activateListItem:",{aListItem:aListItem,parent:parent,position:position}, smalltalk.HLListWidget)})},
  522. args: ["aListItem"],
  523. source: "activateListItem: aListItem\x0a\x09| parent position |\x0a \x0a\x09(aListItem get: 0) ifNil: [ ^self ].\x0a\x0a\x09position := self positionOf: aListItem.\x0a\x0a parent := aListItem parent.\x0a\x09parent children removeClass: 'active'.\x0a\x09aListItem addClass: 'active'.\x0a \x0a \x22Move the scrollbar to show the active element\x22\x0a aListItem position top < 0 ifTrue: [\x0a\x09\x09(parent get: 0) scrollTop: ((parent get: 0) scrollTop + aListItem position top - 10) ].\x0a aListItem position top + aListItem height > parent height ifTrue: [ \x0a\x09\x09(parent get: 0) scrollTop: ((parent get: 0) scrollTop + aListItem height - (parent height - aListItem position top)) +10 ].\x0a \x0a \x22Activate the corresponding item\x22\x0a self selectItem: (self items at: (aListItem attr: 'list-data') asNumber)",
  524. messageSends: ["ifNil:", "get:", "positionOf:", "parent", "removeClass:", "children", "addClass:", "ifTrue:", "scrollTop:", "-", "+", "top", "position", "scrollTop", "<", "height", ">", "selectItem:", "at:", "asNumber", "attr:", "items"],
  525. referencedClasses: []
  526. }),
  527. smalltalk.HLListWidget);
  528. smalltalk.addMethod(
  529. "_cssClassForItem_",
  530. smalltalk.method({
  531. selector: "cssClassForItem:",
  532. category: 'accessing',
  533. fn: function (anObject){
  534. var self=this;
  535. return smalltalk.withContext(function($ctx1) { var $2,$1;
  536. $2=_st(_st(self)._selectedItem()).__eq(anObject);
  537. if(smalltalk.assert($2)){
  538. $1="active";
  539. } else {
  540. $1="inactive";
  541. };
  542. return $1;
  543. }, function($ctx1) {$ctx1.fill(self,"cssClassForItem:",{anObject:anObject}, smalltalk.HLListWidget)})},
  544. args: ["anObject"],
  545. source: "cssClassForItem: anObject\x0a\x09^ self selectedItem = anObject\x0a\x09\x09\x09ifTrue: [ 'active' ]\x0a\x09\x09\x09ifFalse: [ 'inactive' ]",
  546. messageSends: ["ifTrue:ifFalse:", "=", "selectedItem"],
  547. referencedClasses: []
  548. }),
  549. smalltalk.HLListWidget);
  550. smalltalk.addMethod(
  551. "_defaultItems",
  552. smalltalk.method({
  553. selector: "defaultItems",
  554. category: 'defaults',
  555. fn: function (){
  556. var self=this;
  557. return smalltalk.withContext(function($ctx1) { return [];
  558. }, function($ctx1) {$ctx1.fill(self,"defaultItems",{}, smalltalk.HLListWidget)})},
  559. args: [],
  560. source: "defaultItems\x0a\x09^ #()",
  561. messageSends: [],
  562. referencedClasses: []
  563. }),
  564. smalltalk.HLListWidget);
  565. smalltalk.addMethod(
  566. "_focus",
  567. smalltalk.method({
  568. selector: "focus",
  569. category: 'actions',
  570. fn: function (){
  571. var self=this;
  572. return smalltalk.withContext(function($ctx1) { var $1,$2;
  573. smalltalk.HLFocusableWidget.fn.prototype._focus.apply(_st(self), []);
  574. $1=_st(_st(self)._items())._isEmpty();
  575. if(! smalltalk.assert($1)){
  576. $2=_st(self)._selectedItem();
  577. if(($receiver = $2) == nil || $receiver == undefined){
  578. _st(self)._activateFirstListItem();
  579. } else {
  580. $2;
  581. };
  582. };
  583. return self}, function($ctx1) {$ctx1.fill(self,"focus",{}, smalltalk.HLListWidget)})},
  584. args: [],
  585. source: "focus\x0a\x09super focus.\x0a self items isEmpty ifFalse: [ \x0a\x09\x09self selectedItem ifNil: [ self activateFirstListItem ] ]",
  586. messageSends: ["focus", "ifFalse:", "ifNil:", "activateFirstListItem", "selectedItem", "isEmpty", "items"],
  587. referencedClasses: []
  588. }),
  589. smalltalk.HLListWidget);
  590. smalltalk.addMethod(
  591. "_iconForItem_",
  592. smalltalk.method({
  593. selector: "iconForItem:",
  594. category: 'accessing',
  595. fn: function (anObject){
  596. var self=this;
  597. return smalltalk.withContext(function($ctx1) { return "";
  598. }, function($ctx1) {$ctx1.fill(self,"iconForItem:",{anObject:anObject}, smalltalk.HLListWidget)})},
  599. args: ["anObject"],
  600. source: "iconForItem: anObject\x0a\x09^ ''",
  601. messageSends: [],
  602. referencedClasses: []
  603. }),
  604. smalltalk.HLListWidget);
  605. smalltalk.addMethod(
  606. "_items",
  607. smalltalk.method({
  608. selector: "items",
  609. category: 'accessing',
  610. fn: function (){
  611. var self=this;
  612. return smalltalk.withContext(function($ctx1) { var $2,$1;
  613. $2=self["@items"];
  614. if(($receiver = $2) == nil || $receiver == undefined){
  615. self["@items"]=_st(self)._defaultItems();
  616. $1=self["@items"];
  617. } else {
  618. $1=$2;
  619. };
  620. return $1;
  621. }, function($ctx1) {$ctx1.fill(self,"items",{}, smalltalk.HLListWidget)})},
  622. args: [],
  623. source: "items\x0a\x09^ items ifNil: [ items := self defaultItems ]",
  624. messageSends: ["ifNil:", "defaultItems"],
  625. referencedClasses: []
  626. }),
  627. smalltalk.HLListWidget);
  628. smalltalk.addMethod(
  629. "_items_",
  630. smalltalk.method({
  631. selector: "items:",
  632. category: 'accessing',
  633. fn: function (aCollection){
  634. var self=this;
  635. return smalltalk.withContext(function($ctx1) { self["@items"]=aCollection;
  636. return self}, function($ctx1) {$ctx1.fill(self,"items:",{aCollection:aCollection}, smalltalk.HLListWidget)})},
  637. args: ["aCollection"],
  638. source: "items: aCollection\x0a\x09items := aCollection",
  639. messageSends: [],
  640. referencedClasses: []
  641. }),
  642. smalltalk.HLListWidget);
  643. smalltalk.addMethod(
  644. "_positionOf_",
  645. smalltalk.method({
  646. selector: "positionOf:",
  647. category: 'accessing',
  648. fn: function (aListItem){
  649. var self=this;
  650. return smalltalk.withContext(function($ctx1) {
  651. return aListItem.parent().children().get().indexOf(aListItem.get(0)) + 1
  652. ;
  653. return self}, function($ctx1) {$ctx1.fill(self,"positionOf:",{aListItem:aListItem}, smalltalk.HLListWidget)})},
  654. args: ["aListItem"],
  655. source: "positionOf: aListItem\x0a\x09<\x0a \x09return aListItem.parent().children().get().indexOf(aListItem.get(0)) + 1\x0a\x09>",
  656. messageSends: [],
  657. referencedClasses: []
  658. }),
  659. smalltalk.HLListWidget);
  660. smalltalk.addMethod(
  661. "_renderButtonsOn_",
  662. smalltalk.method({
  663. selector: "renderButtonsOn:",
  664. category: 'rendering',
  665. fn: function (html){
  666. var self=this;
  667. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html}, smalltalk.HLListWidget)})},
  668. args: ["html"],
  669. source: "renderButtonsOn: html",
  670. messageSends: [],
  671. referencedClasses: []
  672. }),
  673. smalltalk.HLListWidget);
  674. smalltalk.addMethod(
  675. "_renderContentOn_",
  676. smalltalk.method({
  677. selector: "renderContentOn:",
  678. category: 'rendering',
  679. fn: function (html){
  680. var self=this;
  681. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  682. $1=_st(html)._ul();
  683. _st($1)._class_("nav nav-pills nav-stacked");
  684. $2=_st($1)._with_((function(){
  685. return smalltalk.withContext(function($ctx2) { return _st(self)._renderListOn_(html);
  686. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  687. $3=_st(html)._div();
  688. _st($3)._class_("pane_actions form-actions");
  689. $4=_st($3)._with_((function(){
  690. return smalltalk.withContext(function($ctx2) { return _st(self)._renderButtonsOn_(html);
  691. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  692. _st(self)._setupKeyBindings();
  693. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html}, smalltalk.HLListWidget)})},
  694. args: ["html"],
  695. 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",
  696. messageSends: ["class:", "ul", "with:", "renderListOn:", "div", "renderButtonsOn:", "setupKeyBindings"],
  697. referencedClasses: []
  698. }),
  699. smalltalk.HLListWidget);
  700. smalltalk.addMethod(
  701. "_renderItem_on_",
  702. smalltalk.method({
  703. selector: "renderItem:on:",
  704. category: 'rendering',
  705. fn: function (anObject,html){
  706. var self=this;
  707. var li;
  708. return smalltalk.withContext(function($ctx1) { var $1,$3,$4,$2;
  709. li=_st(html)._li();
  710. $1=li;
  711. _st($1)._class_(_st(self)._cssClassForItem_(anObject));
  712. _st($1)._at_put_("list-data",_st(_st(_st(self)._items())._indexOf_(anObject))._asString());
  713. $2=_st($1)._with_((function(){
  714. return smalltalk.withContext(function($ctx2) { $3=_st(html)._a();
  715. _st($3)._with_((function(){
  716. return smalltalk.withContext(function($ctx3) { _st(_st(html)._tag_("i"))._class_(_st(self)._iconForItem_(anObject));
  717. return _st(self)._renderItemLabel_on_(anObject,html);
  718. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  719. $4=_st($3)._onClick_((function(){
  720. return smalltalk.withContext(function($ctx3) { return _st(self)._activateListItem_(_st(li)._asJQuery());
  721. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  722. return $4;
  723. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  724. return self}, function($ctx1) {$ctx1.fill(self,"renderItem:on:",{anObject:anObject,html:html,li:li}, smalltalk.HLListWidget)})},
  725. args: ["anObject", "html"],
  726. source: "renderItem: anObject on: html\x0a\x09| li |\x0a \x0a\x09li := html li.\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 ] ]",
  727. messageSends: ["li", "class:", "cssClassForItem:", "at:put:", "asString", "indexOf:", "items", "with:", "iconForItem:", "tag:", "renderItemLabel:on:", "a", "onClick:", "activateListItem:", "asJQuery"],
  728. referencedClasses: []
  729. }),
  730. smalltalk.HLListWidget);
  731. smalltalk.addMethod(
  732. "_renderItemLabel_on_",
  733. smalltalk.method({
  734. selector: "renderItemLabel:on:",
  735. category: 'rendering',
  736. fn: function (anObject,html){
  737. var self=this;
  738. return smalltalk.withContext(function($ctx1) { _st(html)._with_(_st(anObject)._asString());
  739. return self}, function($ctx1) {$ctx1.fill(self,"renderItemLabel:on:",{anObject:anObject,html:html}, smalltalk.HLListWidget)})},
  740. args: ["anObject", "html"],
  741. source: "renderItemLabel: anObject on: html\x0a\x09html with: anObject asString",
  742. messageSends: ["with:", "asString"],
  743. referencedClasses: []
  744. }),
  745. smalltalk.HLListWidget);
  746. smalltalk.addMethod(
  747. "_renderListOn_",
  748. smalltalk.method({
  749. selector: "renderListOn:",
  750. category: 'rendering',
  751. fn: function (html){
  752. var self=this;
  753. return smalltalk.withContext(function($ctx1) { _st(_st(self)._items())._do_((function(each){
  754. return smalltalk.withContext(function($ctx2) { return _st(self)._renderItem_on_(each,html);
  755. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  756. return self}, function($ctx1) {$ctx1.fill(self,"renderListOn:",{html:html}, smalltalk.HLListWidget)})},
  757. args: ["html"],
  758. source: "renderListOn: html\x0a\x09self items do: [ :each | \x0a \x09self renderItem: each on: html ]",
  759. messageSends: ["do:", "renderItem:on:", "items"],
  760. referencedClasses: []
  761. }),
  762. smalltalk.HLListWidget);
  763. smalltalk.addMethod(
  764. "_selectItem_",
  765. smalltalk.method({
  766. selector: "selectItem:",
  767. category: 'actions',
  768. fn: function (anObject){
  769. var self=this;
  770. return smalltalk.withContext(function($ctx1) { _st(self)._selectedItem_(anObject);
  771. return self}, function($ctx1) {$ctx1.fill(self,"selectItem:",{anObject:anObject}, smalltalk.HLListWidget)})},
  772. args: ["anObject"],
  773. source: "selectItem: anObject\x0a\x09self selectedItem: anObject",
  774. messageSends: ["selectedItem:"],
  775. referencedClasses: []
  776. }),
  777. smalltalk.HLListWidget);
  778. smalltalk.addMethod(
  779. "_selectedItem",
  780. smalltalk.method({
  781. selector: "selectedItem",
  782. category: 'accessing',
  783. fn: function (){
  784. var self=this;
  785. return smalltalk.withContext(function($ctx1) { var $1;
  786. $1=self["@selectedItem"];
  787. return $1;
  788. }, function($ctx1) {$ctx1.fill(self,"selectedItem",{}, smalltalk.HLListWidget)})},
  789. args: [],
  790. source: "selectedItem\x0a\x09^ selectedItem",
  791. messageSends: [],
  792. referencedClasses: []
  793. }),
  794. smalltalk.HLListWidget);
  795. smalltalk.addMethod(
  796. "_selectedItem_",
  797. smalltalk.method({
  798. selector: "selectedItem:",
  799. category: 'accessing',
  800. fn: function (anObject){
  801. var self=this;
  802. return smalltalk.withContext(function($ctx1) { self["@selectedItem"]=anObject;
  803. return self}, function($ctx1) {$ctx1.fill(self,"selectedItem:",{anObject:anObject}, smalltalk.HLListWidget)})},
  804. args: ["anObject"],
  805. source: "selectedItem: anObject\x0a\x09selectedItem := anObject",
  806. messageSends: [],
  807. referencedClasses: []
  808. }),
  809. smalltalk.HLListWidget);
  810. smalltalk.addMethod(
  811. "_setupKeyBindings",
  812. smalltalk.method({
  813. selector: "setupKeyBindings",
  814. category: 'events',
  815. fn: function (){
  816. var self=this;
  817. var next;
  818. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  819. _st(_st(self["@hiddenInput"])._asJQuery())._unbind_("keydown");
  820. _st(_st(self["@hiddenInput"])._asJQuery())._keydown_((function(e){
  821. var selected;
  822. return smalltalk.withContext(function($ctx2) { selected=_st(window)._jQuery_(".focused .nav-pills .active");
  823. selected;
  824. $1=_st(_st(e)._which()).__eq((38));
  825. if(smalltalk.assert($1)){
  826. _st(self)._activateListItem_(_st(selected)._prev());
  827. };
  828. $2=_st(_st(e)._which()).__eq((40));
  829. if(smalltalk.assert($2)){
  830. next=_st(selected)._next();
  831. next;
  832. $3=_st(next)._get_((0));
  833. if(($receiver = $3) == nil || $receiver == undefined){
  834. next=_st(window)._jQuery_(".focused .nav-pills li:first-child");
  835. next;
  836. } else {
  837. $3;
  838. };
  839. return _st(self)._activateListItem_(next);
  840. };
  841. }, function($ctx2) {$ctx2.fillBlock({e:e,selected:selected},$ctx1)})}));
  842. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyBindings",{next:next}, smalltalk.HLListWidget)})},
  843. args: [],
  844. source: "setupKeyBindings\x0a\x09| next |\x0a\x09hiddenInput asJQuery unbind: 'keydown'.\x0a\x0a\x09hiddenInput asJQuery keydown: [ :e | | selected |\x0a \x09selected := window jQuery: '.focused .nav-pills .active'.\x0a e which = 38 ifTrue: [ \x0a \x09self activateListItem: selected prev ].\x0a \x09e which = 40 ifTrue: [\x0a \x09next := selected next.\x0a (next get: 0) ifNil: [ next := window jQuery: '.focused .nav-pills li:first-child' ].\x0a\x09\x09\x09self activateListItem: next ] ]",
  845. messageSends: ["unbind:", "asJQuery", "keydown:", "jQuery:", "ifTrue:", "activateListItem:", "prev", "=", "which", "next", "ifNil:", "get:"],
  846. referencedClasses: []
  847. }),
  848. smalltalk.HLListWidget);
  849. smalltalk.addClass('HLNavigationListWidget', smalltalk.HLListWidget, ['previous', 'next'], 'Helios-Core');
  850. smalltalk.addMethod(
  851. "_next",
  852. smalltalk.method({
  853. selector: "next",
  854. category: 'accessing',
  855. fn: function (){
  856. var self=this;
  857. return smalltalk.withContext(function($ctx1) { var $1;
  858. $1=self["@next"];
  859. return $1;
  860. }, function($ctx1) {$ctx1.fill(self,"next",{}, smalltalk.HLNavigationListWidget)})},
  861. args: [],
  862. source: "next\x0a\x09^ next",
  863. messageSends: [],
  864. referencedClasses: []
  865. }),
  866. smalltalk.HLNavigationListWidget);
  867. smalltalk.addMethod(
  868. "_next_",
  869. smalltalk.method({
  870. selector: "next:",
  871. category: 'accessing',
  872. fn: function (aWidget){
  873. var self=this;
  874. return smalltalk.withContext(function($ctx1) { var $1;
  875. self["@next"]=aWidget;
  876. $1=_st(_st(aWidget)._previous()).__eq(self);
  877. if(! smalltalk.assert($1)){
  878. _st(aWidget)._previous_(self);
  879. };
  880. return self}, function($ctx1) {$ctx1.fill(self,"next:",{aWidget:aWidget}, smalltalk.HLNavigationListWidget)})},
  881. args: ["aWidget"],
  882. source: "next: aWidget\x0a\x09next := aWidget.\x0a aWidget previous = self ifFalse: [ aWidget previous: self ]",
  883. messageSends: ["ifFalse:", "previous:", "=", "previous"],
  884. referencedClasses: []
  885. }),
  886. smalltalk.HLNavigationListWidget);
  887. smalltalk.addMethod(
  888. "_nextFocus",
  889. smalltalk.method({
  890. selector: "nextFocus",
  891. category: 'actions',
  892. fn: function (){
  893. var self=this;
  894. return smalltalk.withContext(function($ctx1) { var $1;
  895. $1=_st(self)._next();
  896. if(($receiver = $1) == nil || $receiver == undefined){
  897. $1;
  898. } else {
  899. _st(_st(self)._next())._focus();
  900. };
  901. return self}, function($ctx1) {$ctx1.fill(self,"nextFocus",{}, smalltalk.HLNavigationListWidget)})},
  902. args: [],
  903. source: "nextFocus\x0a\x09self next ifNotNil: [ self next focus ]",
  904. messageSends: ["ifNotNil:", "focus", "next"],
  905. referencedClasses: []
  906. }),
  907. smalltalk.HLNavigationListWidget);
  908. smalltalk.addMethod(
  909. "_previous",
  910. smalltalk.method({
  911. selector: "previous",
  912. category: 'accessing',
  913. fn: function (){
  914. var self=this;
  915. return smalltalk.withContext(function($ctx1) { var $1;
  916. $1=self["@previous"];
  917. return $1;
  918. }, function($ctx1) {$ctx1.fill(self,"previous",{}, smalltalk.HLNavigationListWidget)})},
  919. args: [],
  920. source: "previous\x0a\x09^ previous",
  921. messageSends: [],
  922. referencedClasses: []
  923. }),
  924. smalltalk.HLNavigationListWidget);
  925. smalltalk.addMethod(
  926. "_previous_",
  927. smalltalk.method({
  928. selector: "previous:",
  929. category: 'accessing',
  930. fn: function (aWidget){
  931. var self=this;
  932. return smalltalk.withContext(function($ctx1) { var $1;
  933. self["@previous"]=aWidget;
  934. $1=_st(_st(aWidget)._next()).__eq(self);
  935. if(! smalltalk.assert($1)){
  936. _st(aWidget)._next_(self);
  937. };
  938. return self}, function($ctx1) {$ctx1.fill(self,"previous:",{aWidget:aWidget}, smalltalk.HLNavigationListWidget)})},
  939. args: ["aWidget"],
  940. source: "previous: aWidget\x0a\x09previous := aWidget.\x0a aWidget next = self ifFalse: [ aWidget next: self ]",
  941. messageSends: ["ifFalse:", "next:", "=", "next"],
  942. referencedClasses: []
  943. }),
  944. smalltalk.HLNavigationListWidget);
  945. smalltalk.addMethod(
  946. "_previousFocus",
  947. smalltalk.method({
  948. selector: "previousFocus",
  949. category: 'actions',
  950. fn: function (){
  951. var self=this;
  952. return smalltalk.withContext(function($ctx1) { var $1;
  953. $1=_st(self)._previous();
  954. if(($receiver = $1) == nil || $receiver == undefined){
  955. $1;
  956. } else {
  957. _st(_st(self)._previous())._focus();
  958. };
  959. return self}, function($ctx1) {$ctx1.fill(self,"previousFocus",{}, smalltalk.HLNavigationListWidget)})},
  960. args: [],
  961. source: "previousFocus\x0a\x09self previous ifNotNil: [ self previous focus ]",
  962. messageSends: ["ifNotNil:", "focus", "previous"],
  963. referencedClasses: []
  964. }),
  965. smalltalk.HLNavigationListWidget);
  966. smalltalk.addMethod(
  967. "_setupKeyBindings",
  968. smalltalk.method({
  969. selector: "setupKeyBindings",
  970. category: 'events',
  971. fn: function (){
  972. var self=this;
  973. return smalltalk.withContext(function($ctx1) { var $1,$2;
  974. smalltalk.HLListWidget.fn.prototype._setupKeyBindings.apply(_st(self), []);
  975. _st(_st(self["@hiddenInput"])._asJQuery())._keydown_((function(e){
  976. return smalltalk.withContext(function($ctx2) { $1=_st(_st(e)._which()).__eq((39));
  977. if(smalltalk.assert($1)){
  978. _st(self)._nextFocus();
  979. };
  980. $2=_st(_st(e)._which()).__eq((37));
  981. if(smalltalk.assert($2)){
  982. return _st(self)._previousFocus();
  983. };
  984. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1)})}));
  985. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyBindings",{}, smalltalk.HLNavigationListWidget)})},
  986. args: [],
  987. source: "setupKeyBindings\x0a\x09super setupKeyBindings.\x0a\x0a\x09hiddenInput asJQuery keydown: [ :e |\x0a e which = 39 ifTrue: [ \x0a \x09self nextFocus ].\x0a\x09\x09e which = 37 ifTrue: [ \x0a \x09self previousFocus ] ]",
  988. messageSends: ["setupKeyBindings", "keydown:", "ifTrue:", "nextFocus", "=", "which", "previousFocus", "asJQuery"],
  989. referencedClasses: []
  990. }),
  991. smalltalk.HLNavigationListWidget);
  992. smalltalk.addClass('HLManager', smalltalk.HLWidget, ['tabs', 'activeTab', 'keyBinder', 'environment', 'history'], 'Helios-Core');
  993. smalltalk.addMethod(
  994. "_activate_",
  995. smalltalk.method({
  996. selector: "activate:",
  997. category: 'actions',
  998. fn: function (aTab){
  999. var self=this;
  1000. return smalltalk.withContext(function($ctx1) { var $1,$2;
  1001. _st(_st(self)._keyBinder())._flushBindings();
  1002. self["@activeTab"]=aTab;
  1003. $1=self;
  1004. _st($1)._refresh();
  1005. _st($1)._addToHistory_(aTab);
  1006. $2=_st($1)._show_(aTab);
  1007. return self}, function($ctx1) {$ctx1.fill(self,"activate:",{aTab:aTab}, smalltalk.HLManager)})},
  1008. args: ["aTab"],
  1009. source: "activate: aTab\x0a\x09self keyBinder flushBindings.\x0a\x09activeTab := aTab.\x0a\x09\x0a\x09self \x0a\x09\x09refresh;\x0a\x09\x09addToHistory: aTab;\x0a\x09\x09show: aTab",
  1010. messageSends: ["flushBindings", "keyBinder", "refresh", "addToHistory:", "show:"],
  1011. referencedClasses: []
  1012. }),
  1013. smalltalk.HLManager);
  1014. smalltalk.addMethod(
  1015. "_activeTab",
  1016. smalltalk.method({
  1017. selector: "activeTab",
  1018. category: 'accessing',
  1019. fn: function (){
  1020. var self=this;
  1021. return smalltalk.withContext(function($ctx1) { var $1;
  1022. $1=self["@activeTab"];
  1023. return $1;
  1024. }, function($ctx1) {$ctx1.fill(self,"activeTab",{}, smalltalk.HLManager)})},
  1025. args: [],
  1026. source: "activeTab\x0a\x09^ activeTab",
  1027. messageSends: [],
  1028. referencedClasses: []
  1029. }),
  1030. smalltalk.HLManager);
  1031. smalltalk.addMethod(
  1032. "_addTab_",
  1033. smalltalk.method({
  1034. selector: "addTab:",
  1035. category: 'actions',
  1036. fn: function (aTab){
  1037. var self=this;
  1038. return smalltalk.withContext(function($ctx1) { _st(_st(self)._tabs())._add_(aTab);
  1039. _st(self)._activate_(aTab);
  1040. return self}, function($ctx1) {$ctx1.fill(self,"addTab:",{aTab:aTab}, smalltalk.HLManager)})},
  1041. args: ["aTab"],
  1042. source: "addTab: aTab\x0a\x09self tabs add: aTab.\x0a self activate: aTab",
  1043. messageSends: ["add:", "tabs", "activate:"],
  1044. referencedClasses: []
  1045. }),
  1046. smalltalk.HLManager);
  1047. smalltalk.addMethod(
  1048. "_addToHistory_",
  1049. smalltalk.method({
  1050. selector: "addToHistory:",
  1051. category: 'actions',
  1052. fn: function (aTab){
  1053. var self=this;
  1054. return smalltalk.withContext(function($ctx1) { _st(self)._removeFromHistory_(aTab);
  1055. _st(_st(self)._history())._add_(aTab);
  1056. return self}, function($ctx1) {$ctx1.fill(self,"addToHistory:",{aTab:aTab}, smalltalk.HLManager)})},
  1057. args: ["aTab"],
  1058. source: "addToHistory: aTab\x0a\x09self removeFromHistory: aTab.\x0a\x09self history add: aTab",
  1059. messageSends: ["removeFromHistory:", "add:", "history"],
  1060. referencedClasses: []
  1061. }),
  1062. smalltalk.HLManager);
  1063. smalltalk.addMethod(
  1064. "_defaultEnvironment",
  1065. smalltalk.method({
  1066. selector: "defaultEnvironment",
  1067. category: 'defaults',
  1068. fn: function (){
  1069. var self=this;
  1070. return smalltalk.withContext(function($ctx1) { var $1;
  1071. $1=_st((smalltalk.HLLocalEnvironment || HLLocalEnvironment))._new();
  1072. return $1;
  1073. }, function($ctx1) {$ctx1.fill(self,"defaultEnvironment",{}, smalltalk.HLManager)})},
  1074. args: [],
  1075. source: "defaultEnvironment\x0a\x09^ HLLocalEnvironment new",
  1076. messageSends: ["new"],
  1077. referencedClasses: ["HLLocalEnvironment"]
  1078. }),
  1079. smalltalk.HLManager);
  1080. smalltalk.addMethod(
  1081. "_environment",
  1082. smalltalk.method({
  1083. selector: "environment",
  1084. category: 'accessing',
  1085. fn: function (){
  1086. var self=this;
  1087. return smalltalk.withContext(function($ctx1) { var $2,$1;
  1088. $2=self["@environment"];
  1089. if(($receiver = $2) == nil || $receiver == undefined){
  1090. self["@environment"]=_st(self)._defaultEnvironment();
  1091. $1=self["@environment"];
  1092. } else {
  1093. $1=$2;
  1094. };
  1095. return $1;
  1096. }, function($ctx1) {$ctx1.fill(self,"environment",{}, smalltalk.HLManager)})},
  1097. args: [],
  1098. source: "environment\x0a\x09\x22The default environment used by all Helios objects\x22\x0a \x0a\x09^ environment ifNil: [ environment := self defaultEnvironment ]",
  1099. messageSends: ["ifNil:", "defaultEnvironment"],
  1100. referencedClasses: []
  1101. }),
  1102. smalltalk.HLManager);
  1103. smalltalk.addMethod(
  1104. "_environment_",
  1105. smalltalk.method({
  1106. selector: "environment:",
  1107. category: 'accessing',
  1108. fn: function (anEnvironment){
  1109. var self=this;
  1110. return smalltalk.withContext(function($ctx1) { self["@environment"]=anEnvironment;
  1111. return self}, function($ctx1) {$ctx1.fill(self,"environment:",{anEnvironment:anEnvironment}, smalltalk.HLManager)})},
  1112. args: ["anEnvironment"],
  1113. source: "environment: anEnvironment\x0a\x09environment := anEnvironment",
  1114. messageSends: [],
  1115. referencedClasses: []
  1116. }),
  1117. smalltalk.HLManager);
  1118. smalltalk.addMethod(
  1119. "_history",
  1120. smalltalk.method({
  1121. selector: "history",
  1122. category: 'accessing',
  1123. fn: function (){
  1124. var self=this;
  1125. return smalltalk.withContext(function($ctx1) { var $2,$1;
  1126. $2=self["@history"];
  1127. if(($receiver = $2) == nil || $receiver == undefined){
  1128. self["@history"]=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
  1129. $1=self["@history"];
  1130. } else {
  1131. $1=$2;
  1132. };
  1133. return $1;
  1134. }, function($ctx1) {$ctx1.fill(self,"history",{}, smalltalk.HLManager)})},
  1135. args: [],
  1136. source: "history\x0a\x09^ history ifNil: [ history := OrderedCollection new ]",
  1137. messageSends: ["ifNil:", "new"],
  1138. referencedClasses: ["OrderedCollection"]
  1139. }),
  1140. smalltalk.HLManager);
  1141. smalltalk.addMethod(
  1142. "_history_",
  1143. smalltalk.method({
  1144. selector: "history:",
  1145. category: 'accessing',
  1146. fn: function (aCollection){
  1147. var self=this;
  1148. return smalltalk.withContext(function($ctx1) { self["@history"]=aCollection;
  1149. return self}, function($ctx1) {$ctx1.fill(self,"history:",{aCollection:aCollection}, smalltalk.HLManager)})},
  1150. args: ["aCollection"],
  1151. source: "history: aCollection\x0a\x09history := aCollection",
  1152. messageSends: [],
  1153. referencedClasses: []
  1154. }),
  1155. smalltalk.HLManager);
  1156. smalltalk.addMethod(
  1157. "_initialize",
  1158. smalltalk.method({
  1159. selector: "initialize",
  1160. category: 'initialization',
  1161. fn: function (){
  1162. var self=this;
  1163. return smalltalk.withContext(function($ctx1) { smalltalk.HLWidget.fn.prototype._initialize.apply(_st(self), []);
  1164. _st(_st(self)._keyBinder())._setupEvents();
  1165. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.HLManager)})},
  1166. args: [],
  1167. source: "initialize\x0a\x09super initialize.\x0a self keyBinder setupEvents",
  1168. messageSends: ["initialize", "setupEvents", "keyBinder"],
  1169. referencedClasses: []
  1170. }),
  1171. smalltalk.HLManager);
  1172. smalltalk.addMethod(
  1173. "_keyBinder",
  1174. smalltalk.method({
  1175. selector: "keyBinder",
  1176. category: 'accessing',
  1177. fn: function (){
  1178. var self=this;
  1179. return smalltalk.withContext(function($ctx1) { var $2,$1;
  1180. $2=self["@keyBinder"];
  1181. if(($receiver = $2) == nil || $receiver == undefined){
  1182. self["@keyBinder"]=_st((smalltalk.HLKeyBinder || HLKeyBinder))._new();
  1183. $1=self["@keyBinder"];
  1184. } else {
  1185. $1=$2;
  1186. };
  1187. return $1;
  1188. }, function($ctx1) {$ctx1.fill(self,"keyBinder",{}, smalltalk.HLManager)})},
  1189. args: [],
  1190. source: "keyBinder\x0a\x09^ keyBinder ifNil: [ keyBinder := HLKeyBinder new ]",
  1191. messageSends: ["ifNil:", "new"],
  1192. referencedClasses: ["HLKeyBinder"]
  1193. }),
  1194. smalltalk.HLManager);
  1195. smalltalk.addMethod(
  1196. "_refresh",
  1197. smalltalk.method({
  1198. selector: "refresh",
  1199. category: 'rendering',
  1200. fn: function (){
  1201. var self=this;
  1202. return smalltalk.withContext(function($ctx1) { _st(_st(window)._jQuery_(".navbar"))._remove();
  1203. _st(_st(window)._jQuery_("#container"))._remove();
  1204. _st(self)._appendToJQuery_(_st("body")._asJQuery());
  1205. return self}, function($ctx1) {$ctx1.fill(self,"refresh",{}, smalltalk.HLManager)})},
  1206. args: [],
  1207. source: "refresh\x0a\x09(window jQuery: '.navbar') remove.\x0a\x09(window jQuery: '#container') remove.\x0a\x09self appendToJQuery: 'body' asJQuery",
  1208. messageSends: ["remove", "jQuery:", "appendToJQuery:", "asJQuery"],
  1209. referencedClasses: []
  1210. }),
  1211. smalltalk.HLManager);
  1212. smalltalk.addMethod(
  1213. "_removeActiveTab",
  1214. smalltalk.method({
  1215. selector: "removeActiveTab",
  1216. category: 'actions',
  1217. fn: function (){
  1218. var self=this;
  1219. return smalltalk.withContext(function($ctx1) { _st(self)._removeTab_(_st(self)._activeTab());
  1220. return self}, function($ctx1) {$ctx1.fill(self,"removeActiveTab",{}, smalltalk.HLManager)})},
  1221. args: [],
  1222. source: "removeActiveTab\x0a\x09self removeTab: self activeTab",
  1223. messageSends: ["removeTab:", "activeTab"],
  1224. referencedClasses: []
  1225. }),
  1226. smalltalk.HLManager);
  1227. smalltalk.addMethod(
  1228. "_removeFromHistory_",
  1229. smalltalk.method({
  1230. selector: "removeFromHistory:",
  1231. category: 'actions',
  1232. fn: function (aTab){
  1233. var self=this;
  1234. return smalltalk.withContext(function($ctx1) { _st(self)._history_(_st(_st(self)._history())._reject_((function(each){
  1235. return smalltalk.withContext(function($ctx2) { return _st(each).__eq_eq(aTab);
  1236. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})));
  1237. return self}, function($ctx1) {$ctx1.fill(self,"removeFromHistory:",{aTab:aTab}, smalltalk.HLManager)})},
  1238. args: ["aTab"],
  1239. source: "removeFromHistory: aTab\x0a\x09self history: (self history reject: [ :each | each == aTab ])",
  1240. messageSends: ["history:", "reject:", "==", "history"],
  1241. referencedClasses: []
  1242. }),
  1243. smalltalk.HLManager);
  1244. smalltalk.addMethod(
  1245. "_removeTab_",
  1246. smalltalk.method({
  1247. selector: "removeTab:",
  1248. category: 'actions',
  1249. fn: function (aTab){
  1250. var self=this;
  1251. return smalltalk.withContext(function($ctx1) { var $1,$2;
  1252. $1=_st(_st(self)._tabs())._includes_(aTab);
  1253. if(! smalltalk.assert($1)){
  1254. $2=self;
  1255. return $2;
  1256. };
  1257. _st(self)._removeFromHistory_(aTab);
  1258. _st(_st(self)._tabs())._remove_(aTab);
  1259. _st(self)._refresh();
  1260. _st(_st(self)._history())._ifNotEmpty_((function(){
  1261. return smalltalk.withContext(function($ctx2) { return _st(_st(_st(self)._history())._last())._activate();
  1262. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1263. return self}, function($ctx1) {$ctx1.fill(self,"removeTab:",{aTab:aTab}, smalltalk.HLManager)})},
  1264. args: ["aTab"],
  1265. source: "removeTab: aTab\x0a\x09(self tabs includes: aTab) ifFalse: [ ^ self ].\x0a\x0a\x09self removeFromHistory: aTab.\x0a\x09self tabs remove: aTab.\x0a\x09self refresh.\x0a\x09self history ifNotEmpty: [\x0a\x09\x09self history last activate ]",
  1266. messageSends: ["ifFalse:", "includes:", "tabs", "removeFromHistory:", "remove:", "refresh", "ifNotEmpty:", "activate", "last", "history"],
  1267. referencedClasses: []
  1268. }),
  1269. smalltalk.HLManager);
  1270. smalltalk.addMethod(
  1271. "_renderAddOn_",
  1272. smalltalk.method({
  1273. selector: "renderAddOn:",
  1274. category: 'rendering',
  1275. fn: function (html){
  1276. var self=this;
  1277. return smalltalk.withContext(function($ctx1) { var $1,$3,$4,$5,$7,$8,$6,$2;
  1278. $1=_st(html)._li();
  1279. _st($1)._class_("dropdown");
  1280. $2=_st($1)._with_((function(){
  1281. return smalltalk.withContext(function($ctx2) { $3=_st(html)._a();
  1282. _st($3)._class_("dropdown-toggle");
  1283. _st($3)._at_put_("data-toggle","dropdown");
  1284. $4=_st($3)._with_((function(){
  1285. return smalltalk.withContext(function($ctx3) { _st(html)._with_("Open...");
  1286. return _st(_st(html)._tag_("b"))._class_("caret");
  1287. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1288. $4;
  1289. $5=_st(html)._ul();
  1290. _st($5)._class_("dropdown-menu");
  1291. $6=_st($5)._with_((function(){
  1292. return smalltalk.withContext(function($ctx3) { return _st(_st(_st(_st((smalltalk.HLWidget || HLWidget))._withAllSubclasses())._select_((function(each){
  1293. return smalltalk.withContext(function($ctx4) { return _st(each)._canBeOpenAsTab();
  1294. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx1)})})))._sorted_((function(a,b){
  1295. return smalltalk.withContext(function($ctx4) { return _st(_st(a)._tabPriority()).__lt(_st(b)._tabPriority());
  1296. }, function($ctx4) {$ctx4.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(each){
  1297. return smalltalk.withContext(function($ctx4) { return _st(_st(html)._li())._with_((function(){
  1298. return smalltalk.withContext(function($ctx5) { $7=_st(html)._a();
  1299. _st($7)._with_(_st(each)._tabLabel());
  1300. $8=_st($7)._onClick_((function(){
  1301. return smalltalk.withContext(function($ctx6) { return _st(each)._openAsTab();
  1302. }, function($ctx6) {$ctx6.fillBlock({},$ctx1)})}));
  1303. return $8;
  1304. }, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
  1305. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx1)})}));
  1306. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1307. return $6;
  1308. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1309. return self}, function($ctx1) {$ctx1.fill(self,"renderAddOn:",{html:html}, smalltalk.HLManager)})},
  1310. args: ["html"],
  1311. 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 ] ] ] ] ]",
  1312. messageSends: ["class:", "li", "with:", "a", "at:put:", "tag:", "ul", "do:", "tabLabel", "onClick:", "openAsTab", "sorted:", "<", "tabPriority", "select:", "canBeOpenAsTab", "withAllSubclasses"],
  1313. referencedClasses: ["HLWidget"]
  1314. }),
  1315. smalltalk.HLManager);
  1316. smalltalk.addMethod(
  1317. "_renderContentOn_",
  1318. smalltalk.method({
  1319. selector: "renderContentOn:",
  1320. category: 'rendering',
  1321. fn: function (html){
  1322. var self=this;
  1323. return smalltalk.withContext(function($ctx1) { var $1,$3,$4,$2;
  1324. $1=_st(html)._div();
  1325. _st($1)._class_("navbar navbar-fixed-top");
  1326. $2=_st($1)._with_((function(){
  1327. return smalltalk.withContext(function($ctx2) { $3=_st(html)._div();
  1328. _st($3)._class_("navbar-inner");
  1329. $4=_st($3)._with_((function(){
  1330. return smalltalk.withContext(function($ctx3) { return _st(self)._renderTabsOn_(html);
  1331. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1332. return $4;
  1333. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1334. _st(_st(html)._div())._id_("container");
  1335. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html}, smalltalk.HLManager)})},
  1336. args: ["html"],
  1337. 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 ] ].\x0a\x09html div id: 'container'",
  1338. messageSends: ["class:", "div", "with:", "renderTabsOn:", "id:"],
  1339. referencedClasses: []
  1340. }),
  1341. smalltalk.HLManager);
  1342. smalltalk.addMethod(
  1343. "_renderTabsOn_",
  1344. smalltalk.method({
  1345. selector: "renderTabsOn:",
  1346. category: 'rendering',
  1347. fn: function (html){
  1348. var self=this;
  1349. return smalltalk.withContext(function($ctx1) { var $1,$3,$4,$6,$5,$8,$9,$7,$2;
  1350. $1=_st(html)._ul();
  1351. _st($1)._class_("nav");
  1352. $2=_st($1)._with_((function(){
  1353. return smalltalk.withContext(function($ctx2) { _st(_st(self)._tabs())._do_((function(each){
  1354. return smalltalk.withContext(function($ctx3) { $3=_st(html)._li();
  1355. $4=$3;
  1356. $6=_st(each)._isActive();
  1357. if(smalltalk.assert($6)){
  1358. $5="active";
  1359. } else {
  1360. $5="inactive";
  1361. };
  1362. _st($4)._class_($5);
  1363. $7=_st($3)._with_((function(){
  1364. return smalltalk.withContext(function($ctx4) { $8=_st(html)._a();
  1365. _st($8)._with_((function(){
  1366. return smalltalk.withContext(function($ctx5) { _st(_st(_st(html)._tag_("i"))._class_("icon-remove-circle"))._onClick_((function(){
  1367. return smalltalk.withContext(function($ctx6) { return _st(self)._removeTab_(each);
  1368. }, function($ctx6) {$ctx6.fillBlock({},$ctx1)})}));
  1369. return _st(html)._with_(_st(each)._label());
  1370. }, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
  1371. $9=_st($8)._onClick_((function(){
  1372. return smalltalk.withContext(function($ctx5) { return _st(each)._activate();
  1373. }, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
  1374. return $9;
  1375. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
  1376. return $7;
  1377. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  1378. return _st(self)._renderAddOn_(html);
  1379. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1380. return self}, function($ctx1) {$ctx1.fill(self,"renderTabsOn:",{html:html}, smalltalk.HLManager)})},
  1381. args: ["html"],
  1382. 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-circle')\x0a \x09\x09\x09\x09\x09\x09\x09\x09\x09onClick: [ self removeTab: each ].\x0a \x09html with: each label ];\x0a\x09\x09\x09\x09\x09\x09\x09onClick: [ each activate ] ] ].\x0a\x09\x09\x09self renderAddOn: html ]",
  1383. messageSends: ["class:", "ul", "with:", "do:", "ifTrue:ifFalse:", "isActive", "li", "onClick:", "removeTab:", "tag:", "label", "a", "activate", "tabs", "renderAddOn:"],
  1384. referencedClasses: []
  1385. }),
  1386. smalltalk.HLManager);
  1387. smalltalk.addMethod(
  1388. "_show_",
  1389. smalltalk.method({
  1390. selector: "show:",
  1391. category: 'rendering',
  1392. fn: function (aTab){
  1393. var self=this;
  1394. return smalltalk.withContext(function($ctx1) { _st(_st(window)._jQuery_("#container"))._empty();
  1395. _st(_st(aTab)._widget())._appendToJQuery_(_st("#container")._asJQuery());
  1396. return self}, function($ctx1) {$ctx1.fill(self,"show:",{aTab:aTab}, smalltalk.HLManager)})},
  1397. args: ["aTab"],
  1398. source: "show: aTab\x0a\x09(window jQuery: '#container') empty.\x0a\x09aTab widget appendToJQuery: '#container' asJQuery",
  1399. messageSends: ["empty", "jQuery:", "appendToJQuery:", "asJQuery", "widget"],
  1400. referencedClasses: []
  1401. }),
  1402. smalltalk.HLManager);
  1403. smalltalk.addMethod(
  1404. "_tabs",
  1405. smalltalk.method({
  1406. selector: "tabs",
  1407. category: 'accessing',
  1408. fn: function (){
  1409. var self=this;
  1410. return smalltalk.withContext(function($ctx1) { var $2,$1;
  1411. $2=self["@tabs"];
  1412. if(($receiver = $2) == nil || $receiver == undefined){
  1413. self["@tabs"]=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
  1414. $1=self["@tabs"];
  1415. } else {
  1416. $1=$2;
  1417. };
  1418. return $1;
  1419. }, function($ctx1) {$ctx1.fill(self,"tabs",{}, smalltalk.HLManager)})},
  1420. args: [],
  1421. source: "tabs\x0a\x09^ tabs ifNil: [ tabs := OrderedCollection new ]",
  1422. messageSends: ["ifNil:", "new"],
  1423. referencedClasses: ["OrderedCollection"]
  1424. }),
  1425. smalltalk.HLManager);
  1426. smalltalk.HLManager.klass.iVarNames = ['current'];
  1427. smalltalk.addMethod(
  1428. "_current",
  1429. smalltalk.method({
  1430. selector: "current",
  1431. category: 'accessing',
  1432. fn: function (){
  1433. var self=this;
  1434. return smalltalk.withContext(function($ctx1) { var $2,$1;
  1435. $2=self["@current"];
  1436. if(($receiver = $2) == nil || $receiver == undefined){
  1437. self["@current"]=_st(_st(self)._basicNew())._initialize();
  1438. $1=self["@current"];
  1439. } else {
  1440. $1=$2;
  1441. };
  1442. return $1;
  1443. }, function($ctx1) {$ctx1.fill(self,"current",{}, smalltalk.HLManager.klass)})},
  1444. args: [],
  1445. source: "current\x0a\x09^ current ifNil: [ current := self basicNew initialize ]",
  1446. messageSends: ["ifNil:", "initialize", "basicNew"],
  1447. referencedClasses: []
  1448. }),
  1449. smalltalk.HLManager.klass);
  1450. smalltalk.addMethod(
  1451. "_initialize",
  1452. smalltalk.method({
  1453. selector: "initialize",
  1454. category: 'initialization',
  1455. fn: function (){
  1456. var self=this;
  1457. return smalltalk.withContext(function($ctx1) { _st(_st(self)._current())._appendToJQuery_(_st("body")._asJQuery());
  1458. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.HLManager.klass)})},
  1459. args: [],
  1460. source: "initialize\x0a\x09self current appendToJQuery: 'body' asJQuery",
  1461. messageSends: ["appendToJQuery:", "asJQuery", "current"],
  1462. referencedClasses: []
  1463. }),
  1464. smalltalk.HLManager.klass);
  1465. smalltalk.addMethod(
  1466. "_new",
  1467. smalltalk.method({
  1468. selector: "new",
  1469. category: 'instance creation',
  1470. fn: function (){
  1471. var self=this;
  1472. return smalltalk.withContext(function($ctx1) { _st(self)._shouldNotImplement();
  1473. return self}, function($ctx1) {$ctx1.fill(self,"new",{}, smalltalk.HLManager.klass)})},
  1474. args: [],
  1475. source: "new\x0a\x09\x22Use current instead\x22\x0a\x0a\x09self shouldNotImplement",
  1476. messageSends: ["shouldNotImplement"],
  1477. referencedClasses: []
  1478. }),
  1479. smalltalk.HLManager.klass);
  1480. smalltalk.addClass('HLSUnit', smalltalk.HLWidget, [], 'Helios-Core');
  1481. smalltalk.addMethod(
  1482. "_canBeOpenAsTab",
  1483. smalltalk.method({
  1484. selector: "canBeOpenAsTab",
  1485. category: 'testing',
  1486. fn: function (){
  1487. var self=this;
  1488. return smalltalk.withContext(function($ctx1) { return true;
  1489. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{}, smalltalk.HLSUnit.klass)})},
  1490. args: [],
  1491. source: "canBeOpenAsTab\x0a\x09^ true",
  1492. messageSends: [],
  1493. referencedClasses: []
  1494. }),
  1495. smalltalk.HLSUnit.klass);
  1496. smalltalk.addMethod(
  1497. "_tabLabel",
  1498. smalltalk.method({
  1499. selector: "tabLabel",
  1500. category: 'accessing',
  1501. fn: function (){
  1502. var self=this;
  1503. return smalltalk.withContext(function($ctx1) { return "SUnit";
  1504. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{}, smalltalk.HLSUnit.klass)})},
  1505. args: [],
  1506. source: "tabLabel\x0a\x09^ 'SUnit'",
  1507. messageSends: [],
  1508. referencedClasses: []
  1509. }),
  1510. smalltalk.HLSUnit.klass);
  1511. smalltalk.addMethod(
  1512. "_tabPriority",
  1513. smalltalk.method({
  1514. selector: "tabPriority",
  1515. category: 'accessing',
  1516. fn: function (){
  1517. var self=this;
  1518. return smalltalk.withContext(function($ctx1) { return (1000);
  1519. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{}, smalltalk.HLSUnit.klass)})},
  1520. args: [],
  1521. source: "tabPriority\x0a\x09^ 1000",
  1522. messageSends: [],
  1523. referencedClasses: []
  1524. }),
  1525. smalltalk.HLSUnit.klass);
  1526. smalltalk.addClass('HLTranscript', smalltalk.HLWidget, [], 'Helios-Core');
  1527. smalltalk.addMethod(
  1528. "_canBeOpenAsTab",
  1529. smalltalk.method({
  1530. selector: "canBeOpenAsTab",
  1531. category: 'testing',
  1532. fn: function (){
  1533. var self=this;
  1534. return smalltalk.withContext(function($ctx1) { return true;
  1535. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{}, smalltalk.HLTranscript.klass)})},
  1536. args: [],
  1537. source: "canBeOpenAsTab\x0a\x09^ true",
  1538. messageSends: [],
  1539. referencedClasses: []
  1540. }),
  1541. smalltalk.HLTranscript.klass);
  1542. smalltalk.addMethod(
  1543. "_tabLabel",
  1544. smalltalk.method({
  1545. selector: "tabLabel",
  1546. category: 'accessing',
  1547. fn: function (){
  1548. var self=this;
  1549. return smalltalk.withContext(function($ctx1) { return "Transcript";
  1550. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{}, smalltalk.HLTranscript.klass)})},
  1551. args: [],
  1552. source: "tabLabel\x0a\x09^ 'Transcript'",
  1553. messageSends: [],
  1554. referencedClasses: []
  1555. }),
  1556. smalltalk.HLTranscript.klass);
  1557. smalltalk.addMethod(
  1558. "_tabPriority",
  1559. smalltalk.method({
  1560. selector: "tabPriority",
  1561. category: 'accessing',
  1562. fn: function (){
  1563. var self=this;
  1564. return smalltalk.withContext(function($ctx1) { return (600);
  1565. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{}, smalltalk.HLTranscript.klass)})},
  1566. args: [],
  1567. source: "tabPriority\x0a\x09^ 600",
  1568. messageSends: [],
  1569. referencedClasses: []
  1570. }),
  1571. smalltalk.HLTranscript.klass);