1
0

Helios-Core.js 54 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568
  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) { _st(_st((smalltalk.HLManager || HLManager))._current())._addTab_(_st((smalltalk.HLTab || HLTab))._on_labelled_(_st(self)._new(),_st(self)._tabLabel()));
  303. return self}, function($ctx1) {$ctx1.fill(self,"openAsTab",{}, smalltalk.HLWidget.klass)})},
  304. args: [],
  305. source: "openAsTab\x0a\x09HLManager current addTab: (HLTab on: self new labelled: self tabLabel)",
  306. messageSends: ["addTab:", "on:labelled:", "new", "tabLabel", "current"],
  307. referencedClasses: ["HLTab", "HLManager"]
  308. }),
  309. smalltalk.HLWidget.klass);
  310. smalltalk.addMethod(
  311. "_tabLabel",
  312. smalltalk.method({
  313. selector: "tabLabel",
  314. category: 'accessing',
  315. fn: function (){
  316. var self=this;
  317. return smalltalk.withContext(function($ctx1) { return "Tab";
  318. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{}, smalltalk.HLWidget.klass)})},
  319. args: [],
  320. source: "tabLabel\x0a\x09^ 'Tab'",
  321. messageSends: [],
  322. referencedClasses: []
  323. }),
  324. smalltalk.HLWidget.klass);
  325. smalltalk.addMethod(
  326. "_tabPriority",
  327. smalltalk.method({
  328. selector: "tabPriority",
  329. category: 'accessing',
  330. fn: function (){
  331. var self=this;
  332. return smalltalk.withContext(function($ctx1) { return (500);
  333. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{}, smalltalk.HLWidget.klass)})},
  334. args: [],
  335. source: "tabPriority\x0a\x09^ 500",
  336. messageSends: [],
  337. referencedClasses: []
  338. }),
  339. smalltalk.HLWidget.klass);
  340. smalltalk.addClass('HLDebugger', smalltalk.HLWidget, [], 'Helios-Core');
  341. smalltalk.addClass('HLFocusableWidget', smalltalk.HLWidget, ['hiddenInput'], 'Helios-Core');
  342. smalltalk.addMethod(
  343. "_blur",
  344. smalltalk.method({
  345. selector: "blur",
  346. category: 'events',
  347. fn: function (){
  348. var self=this;
  349. return smalltalk.withContext(function($ctx1) { _st(_st(self["@hiddenInput"])._asJQuery())._blur();
  350. return self}, function($ctx1) {$ctx1.fill(self,"blur",{}, smalltalk.HLFocusableWidget)})},
  351. args: [],
  352. source: "blur\x0a\x09hiddenInput asJQuery blur",
  353. messageSends: ["blur", "asJQuery"],
  354. referencedClasses: []
  355. }),
  356. smalltalk.HLFocusableWidget);
  357. smalltalk.addMethod(
  358. "_focus",
  359. smalltalk.method({
  360. selector: "focus",
  361. category: 'events',
  362. fn: function (){
  363. var self=this;
  364. return smalltalk.withContext(function($ctx1) { _st(_st(self["@hiddenInput"])._asJQuery())._focus();
  365. return self}, function($ctx1) {$ctx1.fill(self,"focus",{}, smalltalk.HLFocusableWidget)})},
  366. args: [],
  367. source: "focus\x0a\x09hiddenInput asJQuery focus",
  368. messageSends: ["focus", "asJQuery"],
  369. referencedClasses: []
  370. }),
  371. smalltalk.HLFocusableWidget);
  372. smalltalk.addMethod(
  373. "_focusClass",
  374. smalltalk.method({
  375. selector: "focusClass",
  376. category: 'accessing',
  377. fn: function (){
  378. var self=this;
  379. return smalltalk.withContext(function($ctx1) { return "focused";
  380. }, function($ctx1) {$ctx1.fill(self,"focusClass",{}, smalltalk.HLFocusableWidget)})},
  381. args: [],
  382. source: "focusClass\x0a\x09^ 'focused'",
  383. messageSends: [],
  384. referencedClasses: []
  385. }),
  386. smalltalk.HLFocusableWidget);
  387. smalltalk.addMethod(
  388. "_hasFocus",
  389. smalltalk.method({
  390. selector: "hasFocus",
  391. category: 'events',
  392. fn: function (){
  393. var self=this;
  394. return smalltalk.withContext(function($ctx1) { var $1;
  395. $1=_st(_st(_st(self)._wrapper())._notNil())._and_((function(){
  396. return smalltalk.withContext(function($ctx2) { return _st(_st(_st(self)._wrapper())._asJQuery())._hasClass_(_st(self)._focusClass());
  397. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  398. return $1;
  399. }, function($ctx1) {$ctx1.fill(self,"hasFocus",{}, smalltalk.HLFocusableWidget)})},
  400. args: [],
  401. source: "hasFocus\x0a\x09^ self wrapper notNil and: [ self wrapper asJQuery hasClass: self focusClass ]",
  402. messageSends: ["and:", "hasClass:", "focusClass", "asJQuery", "wrapper", "notNil"],
  403. referencedClasses: []
  404. }),
  405. smalltalk.HLFocusableWidget);
  406. smalltalk.addMethod(
  407. "_renderContentOn_",
  408. smalltalk.method({
  409. selector: "renderContentOn:",
  410. category: 'rendering',
  411. fn: function (html){
  412. var self=this;
  413. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html}, smalltalk.HLFocusableWidget)})},
  414. args: ["html"],
  415. source: "renderContentOn: html",
  416. messageSends: [],
  417. referencedClasses: []
  418. }),
  419. smalltalk.HLFocusableWidget);
  420. smalltalk.addMethod(
  421. "_renderHiddenInputOn_",
  422. smalltalk.method({
  423. selector: "renderHiddenInputOn:",
  424. category: 'rendering',
  425. fn: function (html){
  426. var self=this;
  427. return smalltalk.withContext(function($ctx1) { var $1,$2;
  428. $1=_st(html)._input();
  429. _st($1)._style_("position: absolute; left: -100000px;");
  430. _st($1)._onBlur_((function(){
  431. return smalltalk.withContext(function($ctx2) { return _st(_st(_st(self)._wrapper())._asJQuery())._removeClass_(_st(self)._focusClass());
  432. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  433. $2=_st($1)._onFocus_((function(){
  434. return smalltalk.withContext(function($ctx2) { return _st(_st(_st(self)._wrapper())._asJQuery())._addClass_(_st(self)._focusClass());
  435. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  436. self["@hiddenInput"]=$2;
  437. return self}, function($ctx1) {$ctx1.fill(self,"renderHiddenInputOn:",{html:html}, smalltalk.HLFocusableWidget)})},
  438. args: ["html"],
  439. 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 ]",
  440. messageSends: ["style:", "input", "onBlur:", "removeClass:", "focusClass", "asJQuery", "wrapper", "onFocus:", "addClass:"],
  441. referencedClasses: []
  442. }),
  443. smalltalk.HLFocusableWidget);
  444. smalltalk.addMethod(
  445. "_renderOn_",
  446. smalltalk.method({
  447. selector: "renderOn:",
  448. category: 'rendering',
  449. fn: function (html){
  450. var self=this;
  451. return smalltalk.withContext(function($ctx1) { var $1,$2;
  452. _st(self)._registerBindings();
  453. _st(self)._renderHiddenInputOn_(html);
  454. $1=_st(html)._div();
  455. _st($1)._class_("hl_widget");
  456. _st($1)._onClick_((function(){
  457. return smalltalk.withContext(function($ctx2) { return _st(_st(self["@hiddenInput"])._asJQuery())._focus();
  458. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  459. $2=_st($1)._with_((function(){
  460. return smalltalk.withContext(function($ctx2) { return _st(self)._renderContentOn_(html);
  461. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  462. self["@wrapper"]=$2;
  463. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html}, smalltalk.HLFocusableWidget)})},
  464. args: ["html"],
  465. 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 ]",
  466. messageSends: ["registerBindings", "renderHiddenInputOn:", "class:", "div", "onClick:", "focus", "asJQuery", "with:", "renderContentOn:"],
  467. referencedClasses: []
  468. }),
  469. smalltalk.HLFocusableWidget);
  470. smalltalk.addClass('HLListWidget', smalltalk.HLFocusableWidget, ['items', 'selectedItem'], 'Helios-Core');
  471. smalltalk.addMethod(
  472. "_activateFirstListItem",
  473. smalltalk.method({
  474. selector: "activateFirstListItem",
  475. category: 'actions',
  476. fn: function (){
  477. var self=this;
  478. return smalltalk.withContext(function($ctx1) { _st(self)._activateListItem_(_st(window)._jQuery_(_st(_st(_st(self["@wrapper"])._asJQuery())._find_("li"))._get_((0))));
  479. return self}, function($ctx1) {$ctx1.fill(self,"activateFirstListItem",{}, smalltalk.HLListWidget)})},
  480. args: [],
  481. source: "activateFirstListItem\x0a\x09self activateListItem: (window jQuery: ((wrapper asJQuery find: 'li') get: 0))",
  482. messageSends: ["activateListItem:", "jQuery:", "get:", "find:", "asJQuery"],
  483. referencedClasses: []
  484. }),
  485. smalltalk.HLListWidget);
  486. smalltalk.addMethod(
  487. "_activateListItem_",
  488. smalltalk.method({
  489. selector: "activateListItem:",
  490. category: 'actions',
  491. fn: function (aListItem){
  492. var self=this;
  493. var parent,position;
  494. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  495. $1=_st(aListItem)._get_((0));
  496. if(($receiver = $1) == nil || $receiver == undefined){
  497. $2=self;
  498. return $2;
  499. } else {
  500. $1;
  501. };
  502. position=_st(self)._positionOf_(aListItem);
  503. parent=_st(aListItem)._parent();
  504. _st(_st(parent)._children())._removeClass_("active");
  505. _st(aListItem)._addClass_("active");
  506. $3=_st(_st(_st(aListItem)._position())._top()).__lt((0));
  507. if(smalltalk.assert($3)){
  508. _st(_st(parent)._get_((0)))._scrollTop_(_st(_st(_st(_st(parent)._get_((0)))._scrollTop()).__plus(_st(_st(aListItem)._position())._top())).__minus((10)));
  509. };
  510. $4=_st(_st(_st(_st(aListItem)._position())._top()).__plus(_st(aListItem)._height())).__gt(_st(parent)._height());
  511. if(smalltalk.assert($4)){
  512. _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)));
  513. };
  514. _st(self)._selectItem_(_st(_st(self)._items())._at_(_st(_st(aListItem)._attr_("list-data"))._asNumber()));
  515. return self}, function($ctx1) {$ctx1.fill(self,"activateListItem:",{aListItem:aListItem,parent:parent,position:position}, smalltalk.HLListWidget)})},
  516. args: ["aListItem"],
  517. 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)",
  518. messageSends: ["ifNil:", "get:", "positionOf:", "parent", "removeClass:", "children", "addClass:", "ifTrue:", "scrollTop:", "-", "+", "top", "position", "scrollTop", "<", "height", ">", "selectItem:", "at:", "asNumber", "attr:", "items"],
  519. referencedClasses: []
  520. }),
  521. smalltalk.HLListWidget);
  522. smalltalk.addMethod(
  523. "_cssClassForItem_",
  524. smalltalk.method({
  525. selector: "cssClassForItem:",
  526. category: 'accessing',
  527. fn: function (anObject){
  528. var self=this;
  529. return smalltalk.withContext(function($ctx1) { var $2,$1;
  530. $2=_st(_st(self)._selectedItem()).__eq(anObject);
  531. if(smalltalk.assert($2)){
  532. $1="active";
  533. } else {
  534. $1="inactive";
  535. };
  536. return $1;
  537. }, function($ctx1) {$ctx1.fill(self,"cssClassForItem:",{anObject:anObject}, smalltalk.HLListWidget)})},
  538. args: ["anObject"],
  539. source: "cssClassForItem: anObject\x0a\x09^ self selectedItem = anObject\x0a\x09\x09\x09ifTrue: [ 'active' ]\x0a\x09\x09\x09ifFalse: [ 'inactive' ]",
  540. messageSends: ["ifTrue:ifFalse:", "=", "selectedItem"],
  541. referencedClasses: []
  542. }),
  543. smalltalk.HLListWidget);
  544. smalltalk.addMethod(
  545. "_defaultItems",
  546. smalltalk.method({
  547. selector: "defaultItems",
  548. category: 'defaults',
  549. fn: function (){
  550. var self=this;
  551. return smalltalk.withContext(function($ctx1) { return [];
  552. }, function($ctx1) {$ctx1.fill(self,"defaultItems",{}, smalltalk.HLListWidget)})},
  553. args: [],
  554. source: "defaultItems\x0a\x09^ #()",
  555. messageSends: [],
  556. referencedClasses: []
  557. }),
  558. smalltalk.HLListWidget);
  559. smalltalk.addMethod(
  560. "_focus",
  561. smalltalk.method({
  562. selector: "focus",
  563. category: 'actions',
  564. fn: function (){
  565. var self=this;
  566. return smalltalk.withContext(function($ctx1) { var $1,$2;
  567. smalltalk.HLFocusableWidget.fn.prototype._focus.apply(_st(self), []);
  568. $1=_st(_st(self)._items())._isEmpty();
  569. if(! smalltalk.assert($1)){
  570. $2=_st(self)._selectedItem();
  571. if(($receiver = $2) == nil || $receiver == undefined){
  572. _st(self)._activateFirstListItem();
  573. } else {
  574. $2;
  575. };
  576. };
  577. return self}, function($ctx1) {$ctx1.fill(self,"focus",{}, smalltalk.HLListWidget)})},
  578. args: [],
  579. source: "focus\x0a\x09super focus.\x0a self items isEmpty ifFalse: [ \x0a\x09\x09self selectedItem ifNil: [ self activateFirstListItem ] ]",
  580. messageSends: ["focus", "ifFalse:", "ifNil:", "activateFirstListItem", "selectedItem", "isEmpty", "items"],
  581. referencedClasses: []
  582. }),
  583. smalltalk.HLListWidget);
  584. smalltalk.addMethod(
  585. "_iconForItem_",
  586. smalltalk.method({
  587. selector: "iconForItem:",
  588. category: 'accessing',
  589. fn: function (anObject){
  590. var self=this;
  591. return smalltalk.withContext(function($ctx1) { return "";
  592. }, function($ctx1) {$ctx1.fill(self,"iconForItem:",{anObject:anObject}, smalltalk.HLListWidget)})},
  593. args: ["anObject"],
  594. source: "iconForItem: anObject\x0a\x09^ ''",
  595. messageSends: [],
  596. referencedClasses: []
  597. }),
  598. smalltalk.HLListWidget);
  599. smalltalk.addMethod(
  600. "_items",
  601. smalltalk.method({
  602. selector: "items",
  603. category: 'accessing',
  604. fn: function (){
  605. var self=this;
  606. return smalltalk.withContext(function($ctx1) { var $2,$1;
  607. $2=self["@items"];
  608. if(($receiver = $2) == nil || $receiver == undefined){
  609. self["@items"]=_st(self)._defaultItems();
  610. $1=self["@items"];
  611. } else {
  612. $1=$2;
  613. };
  614. return $1;
  615. }, function($ctx1) {$ctx1.fill(self,"items",{}, smalltalk.HLListWidget)})},
  616. args: [],
  617. source: "items\x0a\x09^ items ifNil: [ items := self defaultItems ]",
  618. messageSends: ["ifNil:", "defaultItems"],
  619. referencedClasses: []
  620. }),
  621. smalltalk.HLListWidget);
  622. smalltalk.addMethod(
  623. "_items_",
  624. smalltalk.method({
  625. selector: "items:",
  626. category: 'accessing',
  627. fn: function (aCollection){
  628. var self=this;
  629. return smalltalk.withContext(function($ctx1) { self["@items"]=aCollection;
  630. return self}, function($ctx1) {$ctx1.fill(self,"items:",{aCollection:aCollection}, smalltalk.HLListWidget)})},
  631. args: ["aCollection"],
  632. source: "items: aCollection\x0a\x09items := aCollection",
  633. messageSends: [],
  634. referencedClasses: []
  635. }),
  636. smalltalk.HLListWidget);
  637. smalltalk.addMethod(
  638. "_positionOf_",
  639. smalltalk.method({
  640. selector: "positionOf:",
  641. category: 'accessing',
  642. fn: function (aListItem){
  643. var self=this;
  644. return smalltalk.withContext(function($ctx1) {
  645. return aListItem.parent().children().get().indexOf(aListItem.get(0)) + 1
  646. ;
  647. return self}, function($ctx1) {$ctx1.fill(self,"positionOf:",{aListItem:aListItem}, smalltalk.HLListWidget)})},
  648. args: ["aListItem"],
  649. source: "positionOf: aListItem\x0a\x09<\x0a \x09return aListItem.parent().children().get().indexOf(aListItem.get(0)) + 1\x0a\x09>",
  650. messageSends: [],
  651. referencedClasses: []
  652. }),
  653. smalltalk.HLListWidget);
  654. smalltalk.addMethod(
  655. "_renderButtonsOn_",
  656. smalltalk.method({
  657. selector: "renderButtonsOn:",
  658. category: 'rendering',
  659. fn: function (html){
  660. var self=this;
  661. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html}, smalltalk.HLListWidget)})},
  662. args: ["html"],
  663. source: "renderButtonsOn: html",
  664. messageSends: [],
  665. referencedClasses: []
  666. }),
  667. smalltalk.HLListWidget);
  668. smalltalk.addMethod(
  669. "_renderContentOn_",
  670. smalltalk.method({
  671. selector: "renderContentOn:",
  672. category: 'rendering',
  673. fn: function (html){
  674. var self=this;
  675. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  676. $1=_st(html)._ul();
  677. _st($1)._class_("nav nav-pills nav-stacked");
  678. $2=_st($1)._with_((function(){
  679. return smalltalk.withContext(function($ctx2) { return _st(self)._renderListOn_(html);
  680. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  681. $3=_st(html)._div();
  682. _st($3)._class_("pane_actions form-actions");
  683. $4=_st($3)._with_((function(){
  684. return smalltalk.withContext(function($ctx2) { return _st(self)._renderButtonsOn_(html);
  685. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  686. _st(self)._setupKeyBindings();
  687. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html}, smalltalk.HLListWidget)})},
  688. args: ["html"],
  689. 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",
  690. messageSends: ["class:", "ul", "with:", "renderListOn:", "div", "renderButtonsOn:", "setupKeyBindings"],
  691. referencedClasses: []
  692. }),
  693. smalltalk.HLListWidget);
  694. smalltalk.addMethod(
  695. "_renderItem_on_",
  696. smalltalk.method({
  697. selector: "renderItem:on:",
  698. category: 'rendering',
  699. fn: function (anObject,html){
  700. var self=this;
  701. var li;
  702. return smalltalk.withContext(function($ctx1) { var $1,$3,$4,$2;
  703. li=_st(html)._li();
  704. $1=li;
  705. _st($1)._class_(_st(self)._cssClassForItem_(anObject));
  706. _st($1)._at_put_("list-data",_st(_st(_st(self)._items())._indexOf_(anObject))._asString());
  707. $2=_st($1)._with_((function(){
  708. return smalltalk.withContext(function($ctx2) { $3=_st(html)._a();
  709. _st($3)._with_((function(){
  710. return smalltalk.withContext(function($ctx3) { _st(_st(html)._tag_("i"))._class_(_st(self)._iconForItem_(anObject));
  711. return _st(self)._renderItemLabel_on_(anObject,html);
  712. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  713. $4=_st($3)._onClick_((function(){
  714. return smalltalk.withContext(function($ctx3) { return _st(self)._activateListItem_(_st(li)._asJQuery());
  715. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  716. return $4;
  717. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  718. return self}, function($ctx1) {$ctx1.fill(self,"renderItem:on:",{anObject:anObject,html:html,li:li}, smalltalk.HLListWidget)})},
  719. args: ["anObject", "html"],
  720. 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 ] ]",
  721. messageSends: ["li", "class:", "cssClassForItem:", "at:put:", "asString", "indexOf:", "items", "with:", "iconForItem:", "tag:", "renderItemLabel:on:", "a", "onClick:", "activateListItem:", "asJQuery"],
  722. referencedClasses: []
  723. }),
  724. smalltalk.HLListWidget);
  725. smalltalk.addMethod(
  726. "_renderItemLabel_on_",
  727. smalltalk.method({
  728. selector: "renderItemLabel:on:",
  729. category: 'rendering',
  730. fn: function (anObject,html){
  731. var self=this;
  732. return smalltalk.withContext(function($ctx1) { _st(html)._with_(_st(anObject)._asString());
  733. return self}, function($ctx1) {$ctx1.fill(self,"renderItemLabel:on:",{anObject:anObject,html:html}, smalltalk.HLListWidget)})},
  734. args: ["anObject", "html"],
  735. source: "renderItemLabel: anObject on: html\x0a\x09html with: anObject asString",
  736. messageSends: ["with:", "asString"],
  737. referencedClasses: []
  738. }),
  739. smalltalk.HLListWidget);
  740. smalltalk.addMethod(
  741. "_renderListOn_",
  742. smalltalk.method({
  743. selector: "renderListOn:",
  744. category: 'rendering',
  745. fn: function (html){
  746. var self=this;
  747. return smalltalk.withContext(function($ctx1) { _st(_st(self)._items())._do_((function(each){
  748. return smalltalk.withContext(function($ctx2) { return _st(self)._renderItem_on_(each,html);
  749. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  750. return self}, function($ctx1) {$ctx1.fill(self,"renderListOn:",{html:html}, smalltalk.HLListWidget)})},
  751. args: ["html"],
  752. source: "renderListOn: html\x0a\x09self items do: [ :each | \x0a \x09self renderItem: each on: html ]",
  753. messageSends: ["do:", "renderItem:on:", "items"],
  754. referencedClasses: []
  755. }),
  756. smalltalk.HLListWidget);
  757. smalltalk.addMethod(
  758. "_selectItem_",
  759. smalltalk.method({
  760. selector: "selectItem:",
  761. category: 'actions',
  762. fn: function (anObject){
  763. var self=this;
  764. return smalltalk.withContext(function($ctx1) { _st(self)._selectedItem_(anObject);
  765. return self}, function($ctx1) {$ctx1.fill(self,"selectItem:",{anObject:anObject}, smalltalk.HLListWidget)})},
  766. args: ["anObject"],
  767. source: "selectItem: anObject\x0a\x09self selectedItem: anObject",
  768. messageSends: ["selectedItem:"],
  769. referencedClasses: []
  770. }),
  771. smalltalk.HLListWidget);
  772. smalltalk.addMethod(
  773. "_selectedItem",
  774. smalltalk.method({
  775. selector: "selectedItem",
  776. category: 'accessing',
  777. fn: function (){
  778. var self=this;
  779. return smalltalk.withContext(function($ctx1) { var $1;
  780. $1=self["@selectedItem"];
  781. return $1;
  782. }, function($ctx1) {$ctx1.fill(self,"selectedItem",{}, smalltalk.HLListWidget)})},
  783. args: [],
  784. source: "selectedItem\x0a\x09^ selectedItem",
  785. messageSends: [],
  786. referencedClasses: []
  787. }),
  788. smalltalk.HLListWidget);
  789. smalltalk.addMethod(
  790. "_selectedItem_",
  791. smalltalk.method({
  792. selector: "selectedItem:",
  793. category: 'accessing',
  794. fn: function (anObject){
  795. var self=this;
  796. return smalltalk.withContext(function($ctx1) { self["@selectedItem"]=anObject;
  797. return self}, function($ctx1) {$ctx1.fill(self,"selectedItem:",{anObject:anObject}, smalltalk.HLListWidget)})},
  798. args: ["anObject"],
  799. source: "selectedItem: anObject\x0a\x09selectedItem := anObject",
  800. messageSends: [],
  801. referencedClasses: []
  802. }),
  803. smalltalk.HLListWidget);
  804. smalltalk.addMethod(
  805. "_setupKeyBindings",
  806. smalltalk.method({
  807. selector: "setupKeyBindings",
  808. category: 'events',
  809. fn: function (){
  810. var self=this;
  811. var next;
  812. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  813. _st(_st(self["@hiddenInput"])._asJQuery())._unbind_("keydown");
  814. _st(_st(self["@hiddenInput"])._asJQuery())._keydown_((function(e){
  815. var selected;
  816. return smalltalk.withContext(function($ctx2) { selected=_st(window)._jQuery_(".focused .nav-pills .active");
  817. selected;
  818. $1=_st(_st(e)._which()).__eq((38));
  819. if(smalltalk.assert($1)){
  820. _st(self)._activateListItem_(_st(selected)._prev());
  821. };
  822. $2=_st(_st(e)._which()).__eq((40));
  823. if(smalltalk.assert($2)){
  824. next=_st(selected)._next();
  825. next;
  826. $3=_st(next)._get_((0));
  827. if(($receiver = $3) == nil || $receiver == undefined){
  828. next=_st(window)._jQuery_(".focused .nav-pills li:first-child");
  829. next;
  830. } else {
  831. $3;
  832. };
  833. return _st(self)._activateListItem_(next);
  834. };
  835. }, function($ctx2) {$ctx2.fillBlock({e:e,selected:selected},$ctx1)})}));
  836. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyBindings",{next:next}, smalltalk.HLListWidget)})},
  837. args: [],
  838. 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 ] ]",
  839. messageSends: ["unbind:", "asJQuery", "keydown:", "jQuery:", "ifTrue:", "activateListItem:", "prev", "=", "which", "next", "ifNil:", "get:"],
  840. referencedClasses: []
  841. }),
  842. smalltalk.HLListWidget);
  843. smalltalk.addClass('HLNavigationListWidget', smalltalk.HLListWidget, ['previous', 'next'], 'Helios-Core');
  844. smalltalk.addMethod(
  845. "_next",
  846. smalltalk.method({
  847. selector: "next",
  848. category: 'accessing',
  849. fn: function (){
  850. var self=this;
  851. return smalltalk.withContext(function($ctx1) { var $1;
  852. $1=self["@next"];
  853. return $1;
  854. }, function($ctx1) {$ctx1.fill(self,"next",{}, smalltalk.HLNavigationListWidget)})},
  855. args: [],
  856. source: "next\x0a\x09^ next",
  857. messageSends: [],
  858. referencedClasses: []
  859. }),
  860. smalltalk.HLNavigationListWidget);
  861. smalltalk.addMethod(
  862. "_next_",
  863. smalltalk.method({
  864. selector: "next:",
  865. category: 'accessing',
  866. fn: function (aWidget){
  867. var self=this;
  868. return smalltalk.withContext(function($ctx1) { var $1;
  869. self["@next"]=aWidget;
  870. $1=_st(_st(aWidget)._previous()).__eq(self);
  871. if(! smalltalk.assert($1)){
  872. _st(aWidget)._previous_(self);
  873. };
  874. return self}, function($ctx1) {$ctx1.fill(self,"next:",{aWidget:aWidget}, smalltalk.HLNavigationListWidget)})},
  875. args: ["aWidget"],
  876. source: "next: aWidget\x0a\x09next := aWidget.\x0a aWidget previous = self ifFalse: [ aWidget previous: self ]",
  877. messageSends: ["ifFalse:", "previous:", "=", "previous"],
  878. referencedClasses: []
  879. }),
  880. smalltalk.HLNavigationListWidget);
  881. smalltalk.addMethod(
  882. "_nextFocus",
  883. smalltalk.method({
  884. selector: "nextFocus",
  885. category: 'actions',
  886. fn: function (){
  887. var self=this;
  888. return smalltalk.withContext(function($ctx1) { var $1;
  889. $1=_st(self)._next();
  890. if(($receiver = $1) == nil || $receiver == undefined){
  891. $1;
  892. } else {
  893. _st(_st(self)._next())._focus();
  894. };
  895. return self}, function($ctx1) {$ctx1.fill(self,"nextFocus",{}, smalltalk.HLNavigationListWidget)})},
  896. args: [],
  897. source: "nextFocus\x0a\x09self next ifNotNil: [ self next focus ]",
  898. messageSends: ["ifNotNil:", "focus", "next"],
  899. referencedClasses: []
  900. }),
  901. smalltalk.HLNavigationListWidget);
  902. smalltalk.addMethod(
  903. "_previous",
  904. smalltalk.method({
  905. selector: "previous",
  906. category: 'accessing',
  907. fn: function (){
  908. var self=this;
  909. return smalltalk.withContext(function($ctx1) { var $1;
  910. $1=self["@previous"];
  911. return $1;
  912. }, function($ctx1) {$ctx1.fill(self,"previous",{}, smalltalk.HLNavigationListWidget)})},
  913. args: [],
  914. source: "previous\x0a\x09^ previous",
  915. messageSends: [],
  916. referencedClasses: []
  917. }),
  918. smalltalk.HLNavigationListWidget);
  919. smalltalk.addMethod(
  920. "_previous_",
  921. smalltalk.method({
  922. selector: "previous:",
  923. category: 'accessing',
  924. fn: function (aWidget){
  925. var self=this;
  926. return smalltalk.withContext(function($ctx1) { var $1;
  927. self["@previous"]=aWidget;
  928. $1=_st(_st(aWidget)._next()).__eq(self);
  929. if(! smalltalk.assert($1)){
  930. _st(aWidget)._next_(self);
  931. };
  932. return self}, function($ctx1) {$ctx1.fill(self,"previous:",{aWidget:aWidget}, smalltalk.HLNavigationListWidget)})},
  933. args: ["aWidget"],
  934. source: "previous: aWidget\x0a\x09previous := aWidget.\x0a aWidget next = self ifFalse: [ aWidget next: self ]",
  935. messageSends: ["ifFalse:", "next:", "=", "next"],
  936. referencedClasses: []
  937. }),
  938. smalltalk.HLNavigationListWidget);
  939. smalltalk.addMethod(
  940. "_previousFocus",
  941. smalltalk.method({
  942. selector: "previousFocus",
  943. category: 'actions',
  944. fn: function (){
  945. var self=this;
  946. return smalltalk.withContext(function($ctx1) { var $1;
  947. $1=_st(self)._previous();
  948. if(($receiver = $1) == nil || $receiver == undefined){
  949. $1;
  950. } else {
  951. _st(_st(self)._previous())._focus();
  952. };
  953. return self}, function($ctx1) {$ctx1.fill(self,"previousFocus",{}, smalltalk.HLNavigationListWidget)})},
  954. args: [],
  955. source: "previousFocus\x0a\x09self previous ifNotNil: [ self previous focus ]",
  956. messageSends: ["ifNotNil:", "focus", "previous"],
  957. referencedClasses: []
  958. }),
  959. smalltalk.HLNavigationListWidget);
  960. smalltalk.addMethod(
  961. "_setupKeyBindings",
  962. smalltalk.method({
  963. selector: "setupKeyBindings",
  964. category: 'events',
  965. fn: function (){
  966. var self=this;
  967. return smalltalk.withContext(function($ctx1) { var $1,$2;
  968. smalltalk.HLListWidget.fn.prototype._setupKeyBindings.apply(_st(self), []);
  969. _st(_st(self["@hiddenInput"])._asJQuery())._keydown_((function(e){
  970. return smalltalk.withContext(function($ctx2) { $1=_st(_st(e)._which()).__eq((39));
  971. if(smalltalk.assert($1)){
  972. _st(self)._nextFocus();
  973. };
  974. $2=_st(_st(e)._which()).__eq((37));
  975. if(smalltalk.assert($2)){
  976. return _st(self)._previousFocus();
  977. };
  978. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1)})}));
  979. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyBindings",{}, smalltalk.HLNavigationListWidget)})},
  980. args: [],
  981. 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 ] ]",
  982. messageSends: ["setupKeyBindings", "keydown:", "ifTrue:", "nextFocus", "=", "which", "previousFocus", "asJQuery"],
  983. referencedClasses: []
  984. }),
  985. smalltalk.HLNavigationListWidget);
  986. smalltalk.addClass('HLManager', smalltalk.HLWidget, ['tabs', 'activeTab', 'keyBinder', 'environment'], 'Helios-Core');
  987. smalltalk.addMethod(
  988. "_activate_",
  989. smalltalk.method({
  990. selector: "activate:",
  991. category: 'actions',
  992. fn: function (aTab){
  993. var self=this;
  994. return smalltalk.withContext(function($ctx1) { var $1,$2;
  995. _st(_st(self)._keyBinder())._flushBindings();
  996. self["@activeTab"]=aTab;
  997. $1=self;
  998. _st($1)._refresh();
  999. $2=_st($1)._show_(aTab);
  1000. return self}, function($ctx1) {$ctx1.fill(self,"activate:",{aTab:aTab}, smalltalk.HLManager)})},
  1001. args: ["aTab"],
  1002. source: "activate: aTab\x0a\x09self keyBinder flushBindings.\x0a\x09activeTab := aTab.\x0a \x0a\x09self \x0a\x09\x09refresh;\x0a\x09\x09show: aTab",
  1003. messageSends: ["flushBindings", "keyBinder", "refresh", "show:"],
  1004. referencedClasses: []
  1005. }),
  1006. smalltalk.HLManager);
  1007. smalltalk.addMethod(
  1008. "_activeTab",
  1009. smalltalk.method({
  1010. selector: "activeTab",
  1011. category: 'accessing',
  1012. fn: function (){
  1013. var self=this;
  1014. return smalltalk.withContext(function($ctx1) { var $1;
  1015. $1=self["@activeTab"];
  1016. return $1;
  1017. }, function($ctx1) {$ctx1.fill(self,"activeTab",{}, smalltalk.HLManager)})},
  1018. args: [],
  1019. source: "activeTab\x0a\x09^ activeTab",
  1020. messageSends: [],
  1021. referencedClasses: []
  1022. }),
  1023. smalltalk.HLManager);
  1024. smalltalk.addMethod(
  1025. "_addTab_",
  1026. smalltalk.method({
  1027. selector: "addTab:",
  1028. category: 'actions',
  1029. fn: function (aTab){
  1030. var self=this;
  1031. return smalltalk.withContext(function($ctx1) { _st(_st(self)._tabs())._add_(aTab);
  1032. _st(self)._activate_(aTab);
  1033. return self}, function($ctx1) {$ctx1.fill(self,"addTab:",{aTab:aTab}, smalltalk.HLManager)})},
  1034. args: ["aTab"],
  1035. source: "addTab: aTab\x0a\x09self tabs add: aTab.\x0a self activate: aTab",
  1036. messageSends: ["add:", "tabs", "activate:"],
  1037. referencedClasses: []
  1038. }),
  1039. smalltalk.HLManager);
  1040. smalltalk.addMethod(
  1041. "_defaultEnvironment",
  1042. smalltalk.method({
  1043. selector: "defaultEnvironment",
  1044. category: 'defaults',
  1045. fn: function (){
  1046. var self=this;
  1047. return smalltalk.withContext(function($ctx1) { var $1;
  1048. $1=_st((smalltalk.HLLocalEnvironment || HLLocalEnvironment))._new();
  1049. return $1;
  1050. }, function($ctx1) {$ctx1.fill(self,"defaultEnvironment",{}, smalltalk.HLManager)})},
  1051. args: [],
  1052. source: "defaultEnvironment\x0a\x09^ HLLocalEnvironment new",
  1053. messageSends: ["new"],
  1054. referencedClasses: ["HLLocalEnvironment"]
  1055. }),
  1056. smalltalk.HLManager);
  1057. smalltalk.addMethod(
  1058. "_environment",
  1059. smalltalk.method({
  1060. selector: "environment",
  1061. category: 'accessing',
  1062. fn: function (){
  1063. var self=this;
  1064. return smalltalk.withContext(function($ctx1) { var $2,$1;
  1065. $2=self["@environment"];
  1066. if(($receiver = $2) == nil || $receiver == undefined){
  1067. self["@environment"]=_st(self)._defaultEnvironment();
  1068. $1=self["@environment"];
  1069. } else {
  1070. $1=$2;
  1071. };
  1072. return $1;
  1073. }, function($ctx1) {$ctx1.fill(self,"environment",{}, smalltalk.HLManager)})},
  1074. args: [],
  1075. source: "environment\x0a\x09\x22The default environment used by all Helios objects\x22\x0a \x0a\x09^ environment ifNil: [ environment := self defaultEnvironment ]",
  1076. messageSends: ["ifNil:", "defaultEnvironment"],
  1077. referencedClasses: []
  1078. }),
  1079. smalltalk.HLManager);
  1080. smalltalk.addMethod(
  1081. "_environment_",
  1082. smalltalk.method({
  1083. selector: "environment:",
  1084. category: 'accessing',
  1085. fn: function (anEnvironment){
  1086. var self=this;
  1087. return smalltalk.withContext(function($ctx1) { self["@environment"]=anEnvironment;
  1088. return self}, function($ctx1) {$ctx1.fill(self,"environment:",{anEnvironment:anEnvironment}, smalltalk.HLManager)})},
  1089. args: ["anEnvironment"],
  1090. source: "environment: anEnvironment\x0a\x09environment := anEnvironment",
  1091. messageSends: [],
  1092. referencedClasses: []
  1093. }),
  1094. smalltalk.HLManager);
  1095. smalltalk.addMethod(
  1096. "_initialize",
  1097. smalltalk.method({
  1098. selector: "initialize",
  1099. category: 'initialization',
  1100. fn: function (){
  1101. var self=this;
  1102. return smalltalk.withContext(function($ctx1) { smalltalk.HLWidget.fn.prototype._initialize.apply(_st(self), []);
  1103. _st(_st(self)._keyBinder())._setupEvents();
  1104. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.HLManager)})},
  1105. args: [],
  1106. source: "initialize\x0a\x09super initialize.\x0a self keyBinder setupEvents",
  1107. messageSends: ["initialize", "setupEvents", "keyBinder"],
  1108. referencedClasses: []
  1109. }),
  1110. smalltalk.HLManager);
  1111. smalltalk.addMethod(
  1112. "_keyBinder",
  1113. smalltalk.method({
  1114. selector: "keyBinder",
  1115. category: 'accessing',
  1116. fn: function (){
  1117. var self=this;
  1118. return smalltalk.withContext(function($ctx1) { var $2,$1;
  1119. $2=self["@keyBinder"];
  1120. if(($receiver = $2) == nil || $receiver == undefined){
  1121. self["@keyBinder"]=_st((smalltalk.HLKeyBinder || HLKeyBinder))._new();
  1122. $1=self["@keyBinder"];
  1123. } else {
  1124. $1=$2;
  1125. };
  1126. return $1;
  1127. }, function($ctx1) {$ctx1.fill(self,"keyBinder",{}, smalltalk.HLManager)})},
  1128. args: [],
  1129. source: "keyBinder\x0a\x09^ keyBinder ifNil: [ keyBinder := HLKeyBinder new ]",
  1130. messageSends: ["ifNil:", "new"],
  1131. referencedClasses: ["HLKeyBinder"]
  1132. }),
  1133. smalltalk.HLManager);
  1134. smalltalk.addMethod(
  1135. "_refresh",
  1136. smalltalk.method({
  1137. selector: "refresh",
  1138. category: 'rendering',
  1139. fn: function (){
  1140. var self=this;
  1141. return smalltalk.withContext(function($ctx1) { _st(_st(window)._jQuery_(".navbar"))._remove();
  1142. _st(_st(window)._jQuery_("#container"))._remove();
  1143. _st(self)._appendToJQuery_(_st("body")._asJQuery());
  1144. return self}, function($ctx1) {$ctx1.fill(self,"refresh",{}, smalltalk.HLManager)})},
  1145. args: [],
  1146. source: "refresh\x0a\x09(window jQuery: '.navbar') remove.\x0a\x09(window jQuery: '#container') remove.\x0a\x09self appendToJQuery: 'body' asJQuery",
  1147. messageSends: ["remove", "jQuery:", "appendToJQuery:", "asJQuery"],
  1148. referencedClasses: []
  1149. }),
  1150. smalltalk.HLManager);
  1151. smalltalk.addMethod(
  1152. "_removeTab_",
  1153. smalltalk.method({
  1154. selector: "removeTab:",
  1155. category: 'actions',
  1156. fn: function (aTab){
  1157. var self=this;
  1158. return smalltalk.withContext(function($ctx1) { var $1,$2;
  1159. $1=_st(_st(self)._tabs())._includes_(aTab);
  1160. if(! smalltalk.assert($1)){
  1161. $2=self;
  1162. return $2;
  1163. };
  1164. _st(_st(self)._tabs())._remove_(aTab);
  1165. _st(self)._refresh();
  1166. return self}, function($ctx1) {$ctx1.fill(self,"removeTab:",{aTab:aTab}, smalltalk.HLManager)})},
  1167. args: ["aTab"],
  1168. source: "removeTab: aTab\x0a\x09\x22Todo: activate the previously activated tab. Keep a history of tabs selection\x22\x0a\x0a\x09(self tabs includes: aTab) ifFalse: [ ^ self ].\x0a\x0a\x09self tabs remove: aTab.\x0a\x09self refresh",
  1169. messageSends: ["ifFalse:", "includes:", "tabs", "remove:", "refresh"],
  1170. referencedClasses: []
  1171. }),
  1172. smalltalk.HLManager);
  1173. smalltalk.addMethod(
  1174. "_renderAddOn_",
  1175. smalltalk.method({
  1176. selector: "renderAddOn:",
  1177. category: 'rendering',
  1178. fn: function (html){
  1179. var self=this;
  1180. return smalltalk.withContext(function($ctx1) { var $1,$3,$4,$5,$7,$8,$6,$2;
  1181. $1=_st(html)._li();
  1182. _st($1)._class_("dropdown");
  1183. $2=_st($1)._with_((function(){
  1184. return smalltalk.withContext(function($ctx2) { $3=_st(html)._a();
  1185. _st($3)._class_("dropdown-toggle");
  1186. _st($3)._at_put_("data-toggle","dropdown");
  1187. $4=_st($3)._with_((function(){
  1188. return smalltalk.withContext(function($ctx3) { _st(html)._with_("Open...");
  1189. return _st(_st(html)._tag_("b"))._class_("caret");
  1190. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1191. $4;
  1192. $5=_st(html)._ul();
  1193. _st($5)._class_("dropdown-menu");
  1194. $6=_st($5)._with_((function(){
  1195. return smalltalk.withContext(function($ctx3) { return _st(_st(_st(_st((smalltalk.HLWidget || HLWidget))._withAllSubclasses())._select_((function(each){
  1196. return smalltalk.withContext(function($ctx4) { return _st(each)._canBeOpenAsTab();
  1197. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx1)})})))._sorted_((function(a,b){
  1198. return smalltalk.withContext(function($ctx4) { return _st(_st(a)._tabPriority()).__lt(_st(b)._tabPriority());
  1199. }, function($ctx4) {$ctx4.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(each){
  1200. return smalltalk.withContext(function($ctx4) { return _st(_st(html)._li())._with_((function(){
  1201. return smalltalk.withContext(function($ctx5) { $7=_st(html)._a();
  1202. _st($7)._with_(_st(each)._tabLabel());
  1203. $8=_st($7)._onClick_((function(){
  1204. return smalltalk.withContext(function($ctx6) { return _st(each)._openAsTab();
  1205. }, function($ctx6) {$ctx6.fillBlock({},$ctx1)})}));
  1206. return $8;
  1207. }, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
  1208. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx1)})}));
  1209. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1210. return $6;
  1211. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1212. return self}, function($ctx1) {$ctx1.fill(self,"renderAddOn:",{html:html}, smalltalk.HLManager)})},
  1213. args: ["html"],
  1214. 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 ] ] ] ] ]",
  1215. messageSends: ["class:", "li", "with:", "a", "at:put:", "tag:", "ul", "do:", "tabLabel", "onClick:", "openAsTab", "sorted:", "<", "tabPriority", "select:", "canBeOpenAsTab", "withAllSubclasses"],
  1216. referencedClasses: ["HLWidget"]
  1217. }),
  1218. smalltalk.HLManager);
  1219. smalltalk.addMethod(
  1220. "_renderContentOn_",
  1221. smalltalk.method({
  1222. selector: "renderContentOn:",
  1223. category: 'rendering',
  1224. fn: function (html){
  1225. var self=this;
  1226. return smalltalk.withContext(function($ctx1) { var $1,$3,$4,$2;
  1227. $1=_st(html)._div();
  1228. _st($1)._class_("navbar navbar-fixed-top");
  1229. $2=_st($1)._with_((function(){
  1230. return smalltalk.withContext(function($ctx2) { $3=_st(html)._div();
  1231. _st($3)._class_("navbar-inner");
  1232. $4=_st($3)._with_((function(){
  1233. return smalltalk.withContext(function($ctx3) { return _st(self)._renderTabsOn_(html);
  1234. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1235. return $4;
  1236. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1237. _st(_st(html)._div())._id_("container");
  1238. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html}, smalltalk.HLManager)})},
  1239. args: ["html"],
  1240. 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'",
  1241. messageSends: ["class:", "div", "with:", "renderTabsOn:", "id:"],
  1242. referencedClasses: []
  1243. }),
  1244. smalltalk.HLManager);
  1245. smalltalk.addMethod(
  1246. "_renderTabsOn_",
  1247. smalltalk.method({
  1248. selector: "renderTabsOn:",
  1249. category: 'rendering',
  1250. fn: function (html){
  1251. var self=this;
  1252. return smalltalk.withContext(function($ctx1) { var $1,$3,$4,$6,$5,$8,$9,$7,$2;
  1253. $1=_st(html)._ul();
  1254. _st($1)._class_("nav");
  1255. $2=_st($1)._with_((function(){
  1256. return smalltalk.withContext(function($ctx2) { _st(_st(self)._tabs())._do_((function(each){
  1257. return smalltalk.withContext(function($ctx3) { $3=_st(html)._li();
  1258. $4=$3;
  1259. $6=_st(each)._isActive();
  1260. if(smalltalk.assert($6)){
  1261. $5="active";
  1262. } else {
  1263. $5="inactive";
  1264. };
  1265. _st($4)._class_($5);
  1266. $7=_st($3)._with_((function(){
  1267. return smalltalk.withContext(function($ctx4) { $8=_st(html)._a();
  1268. _st($8)._with_((function(){
  1269. return smalltalk.withContext(function($ctx5) { _st(_st(_st(html)._tag_("i"))._class_("icon-remove-circle"))._onClick_((function(){
  1270. return smalltalk.withContext(function($ctx6) { return _st(self)._removeTab_(each);
  1271. }, function($ctx6) {$ctx6.fillBlock({},$ctx1)})}));
  1272. return _st(html)._with_(_st(each)._label());
  1273. }, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
  1274. $9=_st($8)._onClick_((function(){
  1275. return smalltalk.withContext(function($ctx5) { return _st(each)._activate();
  1276. }, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
  1277. return $9;
  1278. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
  1279. return $7;
  1280. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  1281. return _st(self)._renderAddOn_(html);
  1282. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1283. return self}, function($ctx1) {$ctx1.fill(self,"renderTabsOn:",{html:html}, smalltalk.HLManager)})},
  1284. args: ["html"],
  1285. 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 ]",
  1286. messageSends: ["class:", "ul", "with:", "do:", "ifTrue:ifFalse:", "isActive", "li", "onClick:", "removeTab:", "tag:", "label", "a", "activate", "tabs", "renderAddOn:"],
  1287. referencedClasses: []
  1288. }),
  1289. smalltalk.HLManager);
  1290. smalltalk.addMethod(
  1291. "_show_",
  1292. smalltalk.method({
  1293. selector: "show:",
  1294. category: 'rendering',
  1295. fn: function (aTab){
  1296. var self=this;
  1297. return smalltalk.withContext(function($ctx1) { _st(_st(window)._jQuery_("#container"))._empty();
  1298. _st(_st(aTab)._widget())._appendToJQuery_(_st("#container")._asJQuery());
  1299. return self}, function($ctx1) {$ctx1.fill(self,"show:",{aTab:aTab}, smalltalk.HLManager)})},
  1300. args: ["aTab"],
  1301. source: "show: aTab\x0a\x09(window jQuery: '#container') empty.\x0a\x09aTab widget appendToJQuery: '#container' asJQuery",
  1302. messageSends: ["empty", "jQuery:", "appendToJQuery:", "asJQuery", "widget"],
  1303. referencedClasses: []
  1304. }),
  1305. smalltalk.HLManager);
  1306. smalltalk.addMethod(
  1307. "_tabs",
  1308. smalltalk.method({
  1309. selector: "tabs",
  1310. category: 'accessing',
  1311. fn: function (){
  1312. var self=this;
  1313. return smalltalk.withContext(function($ctx1) { var $2,$1;
  1314. $2=self["@tabs"];
  1315. if(($receiver = $2) == nil || $receiver == undefined){
  1316. self["@tabs"]=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
  1317. $1=self["@tabs"];
  1318. } else {
  1319. $1=$2;
  1320. };
  1321. return $1;
  1322. }, function($ctx1) {$ctx1.fill(self,"tabs",{}, smalltalk.HLManager)})},
  1323. args: [],
  1324. source: "tabs\x0a\x09^ tabs ifNil: [ tabs := OrderedCollection new ]",
  1325. messageSends: ["ifNil:", "new"],
  1326. referencedClasses: ["OrderedCollection"]
  1327. }),
  1328. smalltalk.HLManager);
  1329. smalltalk.HLManager.klass.iVarNames = ['current'];
  1330. smalltalk.addMethod(
  1331. "_current",
  1332. smalltalk.method({
  1333. selector: "current",
  1334. category: 'accessing',
  1335. fn: function (){
  1336. var self=this;
  1337. return smalltalk.withContext(function($ctx1) { var $2,$1;
  1338. $2=self["@current"];
  1339. if(($receiver = $2) == nil || $receiver == undefined){
  1340. self["@current"]=_st(_st(self)._basicNew())._initialize();
  1341. $1=self["@current"];
  1342. } else {
  1343. $1=$2;
  1344. };
  1345. return $1;
  1346. }, function($ctx1) {$ctx1.fill(self,"current",{}, smalltalk.HLManager.klass)})},
  1347. args: [],
  1348. source: "current\x0a\x09^ current ifNil: [ current := self basicNew initialize ]",
  1349. messageSends: ["ifNil:", "initialize", "basicNew"],
  1350. referencedClasses: []
  1351. }),
  1352. smalltalk.HLManager.klass);
  1353. smalltalk.addMethod(
  1354. "_initialize",
  1355. smalltalk.method({
  1356. selector: "initialize",
  1357. category: 'initialization',
  1358. fn: function (){
  1359. var self=this;
  1360. return smalltalk.withContext(function($ctx1) { _st(_st(self)._current())._appendToJQuery_(_st("body")._asJQuery());
  1361. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.HLManager.klass)})},
  1362. args: [],
  1363. source: "initialize\x0a\x09self current appendToJQuery: 'body' asJQuery",
  1364. messageSends: ["appendToJQuery:", "asJQuery", "current"],
  1365. referencedClasses: []
  1366. }),
  1367. smalltalk.HLManager.klass);
  1368. smalltalk.addMethod(
  1369. "_new",
  1370. smalltalk.method({
  1371. selector: "new",
  1372. category: 'instance creation',
  1373. fn: function (){
  1374. var self=this;
  1375. return smalltalk.withContext(function($ctx1) { _st(self)._shouldNotImplement();
  1376. return self}, function($ctx1) {$ctx1.fill(self,"new",{}, smalltalk.HLManager.klass)})},
  1377. args: [],
  1378. source: "new\x0a\x09\x22Use current instead\x22\x0a\x0a\x09self shouldNotImplement",
  1379. messageSends: ["shouldNotImplement"],
  1380. referencedClasses: []
  1381. }),
  1382. smalltalk.HLManager.klass);
  1383. smalltalk.addClass('HLSUnit', smalltalk.HLWidget, [], 'Helios-Core');
  1384. smalltalk.addMethod(
  1385. "_canBeOpenAsTab",
  1386. smalltalk.method({
  1387. selector: "canBeOpenAsTab",
  1388. category: 'testing',
  1389. fn: function (){
  1390. var self=this;
  1391. return smalltalk.withContext(function($ctx1) { return true;
  1392. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{}, smalltalk.HLSUnit.klass)})},
  1393. args: [],
  1394. source: "canBeOpenAsTab\x0a\x09^ true",
  1395. messageSends: [],
  1396. referencedClasses: []
  1397. }),
  1398. smalltalk.HLSUnit.klass);
  1399. smalltalk.addMethod(
  1400. "_tabLabel",
  1401. smalltalk.method({
  1402. selector: "tabLabel",
  1403. category: 'accessing',
  1404. fn: function (){
  1405. var self=this;
  1406. return smalltalk.withContext(function($ctx1) { return "SUnit";
  1407. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{}, smalltalk.HLSUnit.klass)})},
  1408. args: [],
  1409. source: "tabLabel\x0a\x09^ 'SUnit'",
  1410. messageSends: [],
  1411. referencedClasses: []
  1412. }),
  1413. smalltalk.HLSUnit.klass);
  1414. smalltalk.addMethod(
  1415. "_tabPriority",
  1416. smalltalk.method({
  1417. selector: "tabPriority",
  1418. category: 'accessing',
  1419. fn: function (){
  1420. var self=this;
  1421. return smalltalk.withContext(function($ctx1) { return (1000);
  1422. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{}, smalltalk.HLSUnit.klass)})},
  1423. args: [],
  1424. source: "tabPriority\x0a\x09^ 1000",
  1425. messageSends: [],
  1426. referencedClasses: []
  1427. }),
  1428. smalltalk.HLSUnit.klass);
  1429. smalltalk.addClass('HLTranscript', smalltalk.HLWidget, [], 'Helios-Core');
  1430. smalltalk.addMethod(
  1431. "_canBeOpenAsTab",
  1432. smalltalk.method({
  1433. selector: "canBeOpenAsTab",
  1434. category: 'testing',
  1435. fn: function (){
  1436. var self=this;
  1437. return smalltalk.withContext(function($ctx1) { return true;
  1438. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{}, smalltalk.HLTranscript.klass)})},
  1439. args: [],
  1440. source: "canBeOpenAsTab\x0a\x09^ true",
  1441. messageSends: [],
  1442. referencedClasses: []
  1443. }),
  1444. smalltalk.HLTranscript.klass);
  1445. smalltalk.addMethod(
  1446. "_tabLabel",
  1447. smalltalk.method({
  1448. selector: "tabLabel",
  1449. category: 'accessing',
  1450. fn: function (){
  1451. var self=this;
  1452. return smalltalk.withContext(function($ctx1) { return "Transcript";
  1453. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{}, smalltalk.HLTranscript.klass)})},
  1454. args: [],
  1455. source: "tabLabel\x0a\x09^ 'Transcript'",
  1456. messageSends: [],
  1457. referencedClasses: []
  1458. }),
  1459. smalltalk.HLTranscript.klass);
  1460. smalltalk.addMethod(
  1461. "_tabPriority",
  1462. smalltalk.method({
  1463. selector: "tabPriority",
  1464. category: 'accessing',
  1465. fn: function (){
  1466. var self=this;
  1467. return smalltalk.withContext(function($ctx1) { return (600);
  1468. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{}, smalltalk.HLTranscript.klass)})},
  1469. args: [],
  1470. source: "tabPriority\x0a\x09^ 600",
  1471. messageSends: [],
  1472. referencedClasses: []
  1473. }),
  1474. smalltalk.HLTranscript.klass);