Helios-Core.js 75 KB

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