Helios-Core.js 88 KB

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