Helios-Core.js 60 KB

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