2
0

IDE.deploy.js 189 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541
  1. define("amber_core/IDE", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_core/Canvas", "amber_core/Kernel-Exceptions", "amber_core/Kernel-Objects", "amber_core/Kernel-Collections", "amber_core/Kernel-Methods"], function(smalltalk,nil,_st){
  2. smalltalk.addPackage('IDE');
  3. smalltalk.packages["IDE"].transport = {"type":"amd","amdNamespace":"amber_core"};
  4. smalltalk.addClass('ClassesList', smalltalk.Widget, ['browser', 'ul', 'nodes'], 'IDE');
  5. smalltalk.addMethod(
  6. smalltalk.method({
  7. selector: "browser",
  8. fn: function (){
  9. var self=this;
  10. return smalltalk.withContext(function($ctx1) {
  11. var $1;
  12. $1=self["@browser"];
  13. return $1;
  14. }, function($ctx1) {$ctx1.fill(self,"browser",{},smalltalk.ClassesList)})},
  15. messageSends: []}),
  16. smalltalk.ClassesList);
  17. smalltalk.addMethod(
  18. smalltalk.method({
  19. selector: "browser:",
  20. fn: function (aBrowser){
  21. var self=this;
  22. return smalltalk.withContext(function($ctx1) {
  23. self["@browser"]=aBrowser;
  24. return self}, function($ctx1) {$ctx1.fill(self,"browser:",{aBrowser:aBrowser},smalltalk.ClassesList)})},
  25. messageSends: []}),
  26. smalltalk.ClassesList);
  27. smalltalk.addMethod(
  28. smalltalk.method({
  29. selector: "category",
  30. fn: function (){
  31. var self=this;
  32. return smalltalk.withContext(function($ctx1) {
  33. var $1;
  34. $1=_st(self._browser())._selectedPackage();
  35. return $1;
  36. }, function($ctx1) {$ctx1.fill(self,"category",{},smalltalk.ClassesList)})},
  37. messageSends: ["selectedPackage", "browser"]}),
  38. smalltalk.ClassesList);
  39. smalltalk.addMethod(
  40. smalltalk.method({
  41. selector: "getNodes",
  42. fn: function (){
  43. var self=this;
  44. var classes,children,others;
  45. function $ClassesListNode(){return smalltalk.ClassesListNode||(typeof ClassesListNode=="undefined"?nil:ClassesListNode)}
  46. return smalltalk.withContext(function($ctx1) {
  47. var $1,$2;
  48. classes=_st(self._browser())._classes();
  49. children=[];
  50. others=[];
  51. _st(classes)._do_((function(each){
  52. return smalltalk.withContext(function($ctx2) {
  53. $1=_st(classes)._includes_(_st(each)._superclass());
  54. if(smalltalk.assert($1)){
  55. return _st(others)._add_(each);
  56. } else {
  57. return _st(children)._add_(each);
  58. };
  59. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  60. $2=_st(children)._collect_((function(each){
  61. return smalltalk.withContext(function($ctx2) {
  62. return _st($ClassesListNode())._on_browser_classes_level_(each,self._browser(),others,(0));
  63. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  64. return $2;
  65. }, function($ctx1) {$ctx1.fill(self,"getNodes",{classes:classes,children:children,others:others},smalltalk.ClassesList)})},
  66. messageSends: ["classes", "browser", "do:", "ifFalse:ifTrue:", "add:", "includes:", "superclass", "collect:", "on:browser:classes:level:"]}),
  67. smalltalk.ClassesList);
  68. smalltalk.addMethod(
  69. smalltalk.method({
  70. selector: "nodes",
  71. fn: function (){
  72. var self=this;
  73. return smalltalk.withContext(function($ctx1) {
  74. var $1,$2;
  75. $1=self["@nodes"];
  76. if(($receiver = $1) == nil || $receiver == undefined){
  77. self["@nodes"]=self._getNodes();
  78. self["@nodes"];
  79. } else {
  80. $1;
  81. };
  82. $2=self["@nodes"];
  83. return $2;
  84. }, function($ctx1) {$ctx1.fill(self,"nodes",{},smalltalk.ClassesList)})},
  85. messageSends: ["ifNil:", "getNodes"]}),
  86. smalltalk.ClassesList);
  87. smalltalk.addMethod(
  88. smalltalk.method({
  89. selector: "renderOn:",
  90. fn: function (html){
  91. var self=this;
  92. return smalltalk.withContext(function($ctx1) {
  93. var $1,$2;
  94. $1=_st(html)._ul();
  95. _st($1)._class_("amber_column browser classes");
  96. $2=_st($1)._yourself();
  97. self["@ul"]=$2;
  98. self._updateNodes();
  99. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.ClassesList)})},
  100. messageSends: ["class:", "ul", "yourself", "updateNodes"]}),
  101. smalltalk.ClassesList);
  102. smalltalk.addMethod(
  103. smalltalk.method({
  104. selector: "resetNodes",
  105. fn: function (){
  106. var self=this;
  107. return smalltalk.withContext(function($ctx1) {
  108. self["@nodes"]=nil;
  109. return self}, function($ctx1) {$ctx1.fill(self,"resetNodes",{},smalltalk.ClassesList)})},
  110. messageSends: []}),
  111. smalltalk.ClassesList);
  112. smalltalk.addMethod(
  113. smalltalk.method({
  114. selector: "updateNodes",
  115. fn: function (){
  116. var self=this;
  117. return smalltalk.withContext(function($ctx1) {
  118. _st(self["@ul"])._contents_((function(html){
  119. return smalltalk.withContext(function($ctx2) {
  120. return _st(self._nodes())._do_((function(each){
  121. return smalltalk.withContext(function($ctx3) {
  122. return _st(each)._renderOn_(html);
  123. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2)})}));
  124. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}));
  125. return self}, function($ctx1) {$ctx1.fill(self,"updateNodes",{},smalltalk.ClassesList)})},
  126. messageSends: ["contents:", "do:", "renderOn:", "nodes"]}),
  127. smalltalk.ClassesList);
  128. smalltalk.addMethod(
  129. smalltalk.method({
  130. selector: "on:",
  131. fn: function (aBrowser){
  132. var self=this;
  133. return smalltalk.withContext(function($ctx1) {
  134. var $2,$3,$1;
  135. $2=self._new();
  136. _st($2)._browser_(aBrowser);
  137. $3=_st($2)._yourself();
  138. $1=$3;
  139. return $1;
  140. }, function($ctx1) {$ctx1.fill(self,"on:",{aBrowser:aBrowser},smalltalk.ClassesList.klass)})},
  141. messageSends: ["browser:", "new", "yourself"]}),
  142. smalltalk.ClassesList.klass);
  143. smalltalk.addClass('ClassesListNode', smalltalk.Widget, ['browser', 'theClass', 'level', 'nodes'], 'IDE');
  144. smalltalk.addMethod(
  145. smalltalk.method({
  146. selector: "browser",
  147. fn: function (){
  148. var self=this;
  149. return smalltalk.withContext(function($ctx1) {
  150. var $1;
  151. $1=self["@browser"];
  152. return $1;
  153. }, function($ctx1) {$ctx1.fill(self,"browser",{},smalltalk.ClassesListNode)})},
  154. messageSends: []}),
  155. smalltalk.ClassesListNode);
  156. smalltalk.addMethod(
  157. smalltalk.method({
  158. selector: "browser:",
  159. fn: function (aBrowser){
  160. var self=this;
  161. return smalltalk.withContext(function($ctx1) {
  162. self["@browser"]=aBrowser;
  163. return self}, function($ctx1) {$ctx1.fill(self,"browser:",{aBrowser:aBrowser},smalltalk.ClassesListNode)})},
  164. messageSends: []}),
  165. smalltalk.ClassesListNode);
  166. smalltalk.addMethod(
  167. smalltalk.method({
  168. selector: "getNodesFrom:",
  169. fn: function (aCollection){
  170. var self=this;
  171. var children,others;
  172. function $ClassesListNode(){return smalltalk.ClassesListNode||(typeof ClassesListNode=="undefined"?nil:ClassesListNode)}
  173. return smalltalk.withContext(function($ctx1) {
  174. var $1;
  175. children=[];
  176. others=[];
  177. _st(aCollection)._do_((function(each){
  178. return smalltalk.withContext(function($ctx2) {
  179. $1=_st(_st(each)._superclass()).__eq(self._theClass());
  180. if(smalltalk.assert($1)){
  181. return _st(children)._add_(each);
  182. } else {
  183. return _st(others)._add_(each);
  184. };
  185. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  186. self["@nodes"]=_st(children)._collect_((function(each){
  187. return smalltalk.withContext(function($ctx2) {
  188. return _st($ClassesListNode())._on_browser_classes_level_(each,self._browser(),others,_st(self._level()).__plus((1)));
  189. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  190. return self}, function($ctx1) {$ctx1.fill(self,"getNodesFrom:",{aCollection:aCollection,children:children,others:others},smalltalk.ClassesListNode)})},
  191. messageSends: ["do:", "ifTrue:ifFalse:", "add:", "=", "theClass", "superclass", "collect:", "on:browser:classes:level:", "browser", "+", "level"]}),
  192. smalltalk.ClassesListNode);
  193. smalltalk.addMethod(
  194. smalltalk.method({
  195. selector: "label",
  196. fn: function (){
  197. var self=this;
  198. var str;
  199. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  200. return smalltalk.withContext(function($ctx1) {
  201. var $1;
  202. str=_st(_st($String())._new())._writeStream();
  203. _st(self._level())._timesRepeat_((function(){
  204. return smalltalk.withContext(function($ctx2) {
  205. return _st(str)._nextPutAll_("    ");
  206. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  207. _st(str)._nextPutAll_(_st(self._theClass())._name());
  208. $1=_st(str)._contents();
  209. return $1;
  210. }, function($ctx1) {$ctx1.fill(self,"label",{str:str},smalltalk.ClassesListNode)})},
  211. messageSends: ["writeStream", "new", "timesRepeat:", "nextPutAll:", "level", "name", "theClass", "contents"]}),
  212. smalltalk.ClassesListNode);
  213. smalltalk.addMethod(
  214. smalltalk.method({
  215. selector: "level",
  216. fn: function (){
  217. var self=this;
  218. return smalltalk.withContext(function($ctx1) {
  219. var $1;
  220. $1=self["@level"];
  221. return $1;
  222. }, function($ctx1) {$ctx1.fill(self,"level",{},smalltalk.ClassesListNode)})},
  223. messageSends: []}),
  224. smalltalk.ClassesListNode);
  225. smalltalk.addMethod(
  226. smalltalk.method({
  227. selector: "level:",
  228. fn: function (anInteger){
  229. var self=this;
  230. return smalltalk.withContext(function($ctx1) {
  231. self["@level"]=anInteger;
  232. return self}, function($ctx1) {$ctx1.fill(self,"level:",{anInteger:anInteger},smalltalk.ClassesListNode)})},
  233. messageSends: []}),
  234. smalltalk.ClassesListNode);
  235. smalltalk.addMethod(
  236. smalltalk.method({
  237. selector: "nodes",
  238. fn: function (){
  239. var self=this;
  240. return smalltalk.withContext(function($ctx1) {
  241. var $1;
  242. $1=self["@nodes"];
  243. return $1;
  244. }, function($ctx1) {$ctx1.fill(self,"nodes",{},smalltalk.ClassesListNode)})},
  245. messageSends: []}),
  246. smalltalk.ClassesListNode);
  247. smalltalk.addMethod(
  248. smalltalk.method({
  249. selector: "renderOn:",
  250. fn: function (html){
  251. var self=this;
  252. var li,cssClass;
  253. return smalltalk.withContext(function($ctx1) {
  254. var $1,$2;
  255. cssClass="";
  256. li=_st(_st(html)._li())._onClick_((function(){
  257. return smalltalk.withContext(function($ctx2) {
  258. return _st(self._browser())._selectClass_(self._theClass());
  259. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  260. _st(_st(li)._asJQuery())._html_(self._label());
  261. $1=_st(_st(self._browser())._selectedClass()).__eq(self._theClass());
  262. if(smalltalk.assert($1)){
  263. cssClass=_st(cssClass).__comma(" selected");
  264. cssClass;
  265. };
  266. $2=_st(_st(self._theClass())._comment())._isEmpty();
  267. if(! smalltalk.assert($2)){
  268. cssClass=_st(cssClass).__comma(" commented");
  269. cssClass;
  270. };
  271. _st(li)._class_(cssClass);
  272. _st(self._nodes())._do_((function(each){
  273. return smalltalk.withContext(function($ctx2) {
  274. return _st(each)._renderOn_(html);
  275. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  276. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html,li:li,cssClass:cssClass},smalltalk.ClassesListNode)})},
  277. messageSends: ["onClick:", "selectClass:", "theClass", "browser", "li", "html:", "label", "asJQuery", "ifTrue:", ",", "=", "selectedClass", "ifFalse:", "isEmpty", "comment", "class:", "do:", "renderOn:", "nodes"]}),
  278. smalltalk.ClassesListNode);
  279. smalltalk.addMethod(
  280. smalltalk.method({
  281. selector: "theClass",
  282. fn: function (){
  283. var self=this;
  284. return smalltalk.withContext(function($ctx1) {
  285. var $1;
  286. $1=self["@theClass"];
  287. return $1;
  288. }, function($ctx1) {$ctx1.fill(self,"theClass",{},smalltalk.ClassesListNode)})},
  289. messageSends: []}),
  290. smalltalk.ClassesListNode);
  291. smalltalk.addMethod(
  292. smalltalk.method({
  293. selector: "theClass:",
  294. fn: function (aClass){
  295. var self=this;
  296. return smalltalk.withContext(function($ctx1) {
  297. self["@theClass"]=aClass;
  298. return self}, function($ctx1) {$ctx1.fill(self,"theClass:",{aClass:aClass},smalltalk.ClassesListNode)})},
  299. messageSends: []}),
  300. smalltalk.ClassesListNode);
  301. smalltalk.addMethod(
  302. smalltalk.method({
  303. selector: "on:browser:classes:level:",
  304. fn: function (aClass,aBrowser,aCollection,anInteger){
  305. var self=this;
  306. return smalltalk.withContext(function($ctx1) {
  307. var $2,$3,$1;
  308. $2=self._new();
  309. _st($2)._theClass_(aClass);
  310. _st($2)._browser_(aBrowser);
  311. _st($2)._level_(anInteger);
  312. _st($2)._getNodesFrom_(aCollection);
  313. $3=_st($2)._yourself();
  314. $1=$3;
  315. return $1;
  316. }, function($ctx1) {$ctx1.fill(self,"on:browser:classes:level:",{aClass:aClass,aBrowser:aBrowser,aCollection:aCollection,anInteger:anInteger},smalltalk.ClassesListNode.klass)})},
  317. messageSends: ["theClass:", "new", "browser:", "level:", "getNodesFrom:", "yourself"]}),
  318. smalltalk.ClassesListNode.klass);
  319. smalltalk.addClass('DebugErrorHandler', smalltalk.ErrorHandler, [], 'IDE');
  320. smalltalk.addMethod(
  321. smalltalk.method({
  322. selector: "handleError:",
  323. fn: function (anError){
  324. var self=this;
  325. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  326. function $ErrorHandler(){return smalltalk.ErrorHandler||(typeof ErrorHandler=="undefined"?nil:ErrorHandler)}
  327. function $Debugger(){return smalltalk.Debugger||(typeof Debugger=="undefined"?nil:Debugger)}
  328. return smalltalk.withContext(function($ctx1) {
  329. var $1,$2;
  330. _st((function(){
  331. return smalltalk.withContext(function($ctx2) {
  332. $1=_st($Debugger())._new();
  333. _st($1)._error_(anError);
  334. $2=_st($1)._open();
  335. return $2;
  336. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_($Error(),(function(error){
  337. return smalltalk.withContext(function($ctx2) {
  338. return _st(_st($ErrorHandler())._new())._handleError_(error);
  339. }, function($ctx2) {$ctx2.fillBlock({error:error},$ctx1)})}));
  340. return self}, function($ctx1) {$ctx1.fill(self,"handleError:",{anError:anError},smalltalk.DebugErrorHandler)})},
  341. messageSends: ["on:do:", "handleError:", "new", "error:", "open"]}),
  342. smalltalk.DebugErrorHandler);
  343. smalltalk.addMethod(
  344. smalltalk.method({
  345. selector: "initialize",
  346. fn: function (){
  347. var self=this;
  348. return smalltalk.withContext(function($ctx1) {
  349. self._register();
  350. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.DebugErrorHandler.klass)})},
  351. messageSends: ["register"]}),
  352. smalltalk.DebugErrorHandler.klass);
  353. smalltalk.addClass('SourceArea', smalltalk.Widget, ['editor', 'div', 'receiver', 'onDoIt'], 'IDE');
  354. smalltalk.addMethod(
  355. smalltalk.method({
  356. selector: "clear",
  357. fn: function (){
  358. var self=this;
  359. return smalltalk.withContext(function($ctx1) {
  360. self._val_("");
  361. return self}, function($ctx1) {$ctx1.fill(self,"clear",{},smalltalk.SourceArea)})},
  362. messageSends: ["val:"]}),
  363. smalltalk.SourceArea);
  364. smalltalk.addMethod(
  365. smalltalk.method({
  366. selector: "currentLine",
  367. fn: function (){
  368. var self=this;
  369. return smalltalk.withContext(function($ctx1) {
  370. var $1;
  371. $1=_st(self["@editor"])._getLine_(_st(_st(self["@editor"])._getCursor())._line());
  372. return $1;
  373. }, function($ctx1) {$ctx1.fill(self,"currentLine",{},smalltalk.SourceArea)})},
  374. messageSends: ["getLine:", "line", "getCursor"]}),
  375. smalltalk.SourceArea);
  376. smalltalk.addMethod(
  377. smalltalk.method({
  378. selector: "currentLineOrSelection",
  379. fn: function (){
  380. var self=this;
  381. return smalltalk.withContext(function($ctx1) {
  382. var $2,$1;
  383. $2=_st(self["@editor"])._somethingSelected();
  384. if(smalltalk.assert($2)){
  385. $1=self._selection();
  386. } else {
  387. $1=self._currentLine();
  388. };
  389. return $1;
  390. }, function($ctx1) {$ctx1.fill(self,"currentLineOrSelection",{},smalltalk.SourceArea)})},
  391. messageSends: ["ifFalse:ifTrue:", "currentLine", "selection", "somethingSelected"]}),
  392. smalltalk.SourceArea);
  393. smalltalk.addMethod(
  394. smalltalk.method({
  395. selector: "doIt",
  396. fn: function (){
  397. var self=this;
  398. var result;
  399. return smalltalk.withContext(function($ctx1) {
  400. var $1,$2;
  401. result=self._eval_(self._currentLineOrSelection());
  402. $1=self._onDoIt();
  403. if(($receiver = $1) == nil || $receiver == undefined){
  404. $1;
  405. } else {
  406. _st(self._onDoIt())._value();
  407. };
  408. $2=result;
  409. return $2;
  410. }, function($ctx1) {$ctx1.fill(self,"doIt",{result:result},smalltalk.SourceArea)})},
  411. messageSends: ["eval:", "currentLineOrSelection", "ifNotNil:", "value", "onDoIt"]}),
  412. smalltalk.SourceArea);
  413. smalltalk.addMethod(
  414. smalltalk.method({
  415. selector: "editor",
  416. fn: function (){
  417. var self=this;
  418. return smalltalk.withContext(function($ctx1) {
  419. var $1;
  420. $1=self["@editor"];
  421. return $1;
  422. }, function($ctx1) {$ctx1.fill(self,"editor",{},smalltalk.SourceArea)})},
  423. messageSends: []}),
  424. smalltalk.SourceArea);
  425. smalltalk.addMethod(
  426. smalltalk.method({
  427. selector: "eval:",
  428. fn: function (aString){
  429. var self=this;
  430. var compiler;
  431. function $Compiler(){return smalltalk.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
  432. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  433. return smalltalk.withContext(function($ctx1) {
  434. var $1,$2;
  435. var $early={};
  436. try {
  437. compiler=_st($Compiler())._new();
  438. _st((function(){
  439. return smalltalk.withContext(function($ctx2) {
  440. return _st(compiler)._parseExpression_(aString);
  441. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_($Error(),(function(ex){
  442. return smalltalk.withContext(function($ctx2) {
  443. $1=self._alert_(_st(ex)._messageText());
  444. throw $early=[$1];
  445. }, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1)})}));
  446. $2=_st(compiler)._evaluateExpression_on_(aString,self._receiver());
  447. return $2;
  448. }
  449. catch(e) {if(e===$early)return e[0]; throw e}
  450. }, function($ctx1) {$ctx1.fill(self,"eval:",{aString:aString,compiler:compiler},smalltalk.SourceArea)})},
  451. messageSends: ["new", "on:do:", "alert:", "messageText", "parseExpression:", "evaluateExpression:on:", "receiver"]}),
  452. smalltalk.SourceArea);
  453. smalltalk.addMethod(
  454. smalltalk.method({
  455. selector: "fileIn",
  456. fn: function (){
  457. var self=this;
  458. function $Importer(){return smalltalk.Importer||(typeof Importer=="undefined"?nil:Importer)}
  459. return smalltalk.withContext(function($ctx1) {
  460. _st(_st($Importer())._new())._import_(_st(self._currentLineOrSelection())._readStream());
  461. return self}, function($ctx1) {$ctx1.fill(self,"fileIn",{},smalltalk.SourceArea)})},
  462. messageSends: ["import:", "readStream", "currentLineOrSelection", "new"]}),
  463. smalltalk.SourceArea);
  464. smalltalk.addMethod(
  465. smalltalk.method({
  466. selector: "focus",
  467. fn: function (){
  468. var self=this;
  469. return smalltalk.withContext(function($ctx1) {
  470. _st(self._editor())._focus();
  471. return self}, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.SourceArea)})},
  472. messageSends: ["focus", "editor"]}),
  473. smalltalk.SourceArea);
  474. smalltalk.addMethod(
  475. smalltalk.method({
  476. selector: "handleKeyDown:",
  477. fn: function (anEvent){
  478. var self=this;
  479. return smalltalk.withContext(function($ctx1) {
  480. if(anEvent.ctrlKey) {
  481. if(anEvent.keyCode === 80) { //ctrl+p
  482. self._printIt();
  483. anEvent.preventDefault();
  484. return false;
  485. }
  486. if(anEvent.keyCode === 68) { //ctrl+d
  487. self._doIt();
  488. anEvent.preventDefault();
  489. return false;
  490. }
  491. if(anEvent.keyCode === 73) { //ctrl+i
  492. self._inspectIt();
  493. anEvent.preventDefault();
  494. return false;
  495. }
  496. };
  497. return self}, function($ctx1) {$ctx1.fill(self,"handleKeyDown:",{anEvent:anEvent},smalltalk.SourceArea)})},
  498. messageSends: []}),
  499. smalltalk.SourceArea);
  500. smalltalk.addMethod(
  501. smalltalk.method({
  502. selector: "inspectIt",
  503. fn: function (){
  504. var self=this;
  505. return smalltalk.withContext(function($ctx1) {
  506. _st(self._doIt())._inspect();
  507. return self}, function($ctx1) {$ctx1.fill(self,"inspectIt",{},smalltalk.SourceArea)})},
  508. messageSends: ["inspect", "doIt"]}),
  509. smalltalk.SourceArea);
  510. smalltalk.addMethod(
  511. smalltalk.method({
  512. selector: "onDoIt",
  513. fn: function (){
  514. var self=this;
  515. return smalltalk.withContext(function($ctx1) {
  516. var $1;
  517. $1=self["@onDoIt"];
  518. return $1;
  519. }, function($ctx1) {$ctx1.fill(self,"onDoIt",{},smalltalk.SourceArea)})},
  520. messageSends: []}),
  521. smalltalk.SourceArea);
  522. smalltalk.addMethod(
  523. smalltalk.method({
  524. selector: "onDoIt:",
  525. fn: function (aBlock){
  526. var self=this;
  527. return smalltalk.withContext(function($ctx1) {
  528. self["@onDoIt"]=aBlock;
  529. return self}, function($ctx1) {$ctx1.fill(self,"onDoIt:",{aBlock:aBlock},smalltalk.SourceArea)})},
  530. messageSends: []}),
  531. smalltalk.SourceArea);
  532. smalltalk.addMethod(
  533. smalltalk.method({
  534. selector: "onKeyDown:",
  535. fn: function (aBlock){
  536. var self=this;
  537. return smalltalk.withContext(function($ctx1) {
  538. _st(self["@div"])._onKeyDown_(aBlock);
  539. return self}, function($ctx1) {$ctx1.fill(self,"onKeyDown:",{aBlock:aBlock},smalltalk.SourceArea)})},
  540. messageSends: ["onKeyDown:"]}),
  541. smalltalk.SourceArea);
  542. smalltalk.addMethod(
  543. smalltalk.method({
  544. selector: "onKeyUp:",
  545. fn: function (aBlock){
  546. var self=this;
  547. return smalltalk.withContext(function($ctx1) {
  548. _st(self["@div"])._onKeyUp_(aBlock);
  549. return self}, function($ctx1) {$ctx1.fill(self,"onKeyUp:",{aBlock:aBlock},smalltalk.SourceArea)})},
  550. messageSends: ["onKeyUp:"]}),
  551. smalltalk.SourceArea);
  552. smalltalk.addMethod(
  553. smalltalk.method({
  554. selector: "print:",
  555. fn: function (aString){
  556. var self=this;
  557. var start,stop,currentLine;
  558. function $HashedCollection(){return smalltalk.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
  559. return smalltalk.withContext(function($ctx1) {
  560. currentLine=_st(_st(self["@editor"])._getCursor_(false))._line();
  561. start=_st($HashedCollection())._new();
  562. _st(start)._at_put_("line",currentLine);
  563. _st(start)._at_put_("ch",_st(_st(self["@editor"])._getCursor_(false))._ch());
  564. _st(_st(self["@editor"])._getSelection())._ifEmpty_((function(){
  565. return smalltalk.withContext(function($ctx2) {
  566. _st(start)._at_put_("ch",_st(_st(self["@editor"])._getLine_(currentLine))._size());
  567. return _st(self["@editor"])._setSelection_end_(smalltalk.HashedCollection._from_(["line".__minus_gt(currentLine),"ch".__minus_gt((0))]),start);
  568. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  569. stop=_st($HashedCollection())._new();
  570. _st(stop)._at_put_("line",currentLine);
  571. _st(stop)._at_put_("ch",_st(_st(_st(start)._at_("ch")).__plus(_st(aString)._size())).__plus((2)));
  572. _st(self["@editor"])._replaceSelection_(_st(_st(_st(_st(self["@editor"])._getSelection()).__comma(" ")).__comma(aString)).__comma(" "));
  573. _st(self["@editor"])._setCursor_(_st(self["@editor"])._getCursor_(true));
  574. _st(self["@editor"])._setSelection_end_(stop,start);
  575. return self}, function($ctx1) {$ctx1.fill(self,"print:",{aString:aString,start:start,stop:stop,currentLine:currentLine},smalltalk.SourceArea)})},
  576. messageSends: ["line", "getCursor:", "new", "at:put:", "ch", "ifEmpty:", "size", "getLine:", "setSelection:end:", "->", "getSelection", "+", "at:", "replaceSelection:", ",", "setCursor:"]}),
  577. smalltalk.SourceArea);
  578. smalltalk.addMethod(
  579. smalltalk.method({
  580. selector: "printIt",
  581. fn: function (){
  582. var self=this;
  583. return smalltalk.withContext(function($ctx1) {
  584. self._print_(_st(self._doIt())._printString());
  585. self._focus();
  586. return self}, function($ctx1) {$ctx1.fill(self,"printIt",{},smalltalk.SourceArea)})},
  587. messageSends: ["print:", "printString", "doIt", "focus"]}),
  588. smalltalk.SourceArea);
  589. smalltalk.addMethod(
  590. smalltalk.method({
  591. selector: "receiver",
  592. fn: function (){
  593. var self=this;
  594. function $DoIt(){return smalltalk.DoIt||(typeof DoIt=="undefined"?nil:DoIt)}
  595. return smalltalk.withContext(function($ctx1) {
  596. var $2,$1;
  597. $2=self["@receiver"];
  598. if(($receiver = $2) == nil || $receiver == undefined){
  599. $1=_st($DoIt())._new();
  600. } else {
  601. $1=$2;
  602. };
  603. return $1;
  604. }, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.SourceArea)})},
  605. messageSends: ["ifNil:", "new"]}),
  606. smalltalk.SourceArea);
  607. smalltalk.addMethod(
  608. smalltalk.method({
  609. selector: "receiver:",
  610. fn: function (anObject){
  611. var self=this;
  612. return smalltalk.withContext(function($ctx1) {
  613. self["@receiver"]=anObject;
  614. return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{anObject:anObject},smalltalk.SourceArea)})},
  615. messageSends: []}),
  616. smalltalk.SourceArea);
  617. smalltalk.addMethod(
  618. smalltalk.method({
  619. selector: "renderOn:",
  620. fn: function (html){
  621. var self=this;
  622. var textarea;
  623. return smalltalk.withContext(function($ctx1) {
  624. self["@div"]=_st(_st(html)._div())._class_("source");
  625. _st(self["@div"])._with_((function(){
  626. return smalltalk.withContext(function($ctx2) {
  627. textarea=_st(html)._textarea();
  628. return textarea;
  629. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  630. self._setEditorOn_(_st(textarea)._element());
  631. _st(self["@div"])._onKeyDown_((function(e){
  632. return smalltalk.withContext(function($ctx2) {
  633. return self._handleKeyDown_(e);
  634. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1)})}));
  635. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html,textarea:textarea},smalltalk.SourceArea)})},
  636. messageSends: ["class:", "div", "with:", "textarea", "setEditorOn:", "element", "onKeyDown:", "handleKeyDown:"]}),
  637. smalltalk.SourceArea);
  638. smalltalk.addMethod(
  639. smalltalk.method({
  640. selector: "selection",
  641. fn: function (){
  642. var self=this;
  643. return smalltalk.withContext(function($ctx1) {
  644. var $1;
  645. $1=_st(self["@editor"])._getSelection();
  646. return $1;
  647. }, function($ctx1) {$ctx1.fill(self,"selection",{},smalltalk.SourceArea)})},
  648. messageSends: ["getSelection"]}),
  649. smalltalk.SourceArea);
  650. smalltalk.addMethod(
  651. smalltalk.method({
  652. selector: "setEditorOn:",
  653. fn: function (aTextarea){
  654. var self=this;
  655. return smalltalk.withContext(function($ctx1) {
  656. self['@editor'] = CodeMirror.fromTextArea(aTextarea, {
  657. theme: 'amber',
  658. lineNumbers: true,
  659. enterMode: 'flat',
  660. indentWithTabs: true,
  661. indentUnit: 4,
  662. matchBrackets: true,
  663. electricChars: false
  664. });
  665. return self}, function($ctx1) {$ctx1.fill(self,"setEditorOn:",{aTextarea:aTextarea},smalltalk.SourceArea)})},
  666. messageSends: []}),
  667. smalltalk.SourceArea);
  668. smalltalk.addMethod(
  669. smalltalk.method({
  670. selector: "val",
  671. fn: function (){
  672. var self=this;
  673. return smalltalk.withContext(function($ctx1) {
  674. var $1;
  675. $1=_st(self["@editor"])._getValue();
  676. return $1;
  677. }, function($ctx1) {$ctx1.fill(self,"val",{},smalltalk.SourceArea)})},
  678. messageSends: ["getValue"]}),
  679. smalltalk.SourceArea);
  680. smalltalk.addMethod(
  681. smalltalk.method({
  682. selector: "val:",
  683. fn: function (aString){
  684. var self=this;
  685. return smalltalk.withContext(function($ctx1) {
  686. _st(self["@editor"])._setValue_(aString);
  687. return self}, function($ctx1) {$ctx1.fill(self,"val:",{aString:aString},smalltalk.SourceArea)})},
  688. messageSends: ["setValue:"]}),
  689. smalltalk.SourceArea);
  690. smalltalk.addMethod(
  691. smalltalk.method({
  692. selector: "initialize",
  693. fn: function (){
  694. var self=this;
  695. return smalltalk.withContext(function($ctx1) {
  696. smalltalk.SourceArea.klass.superclass.fn.prototype._initialize.apply(_st(self), []);
  697. self._setupCodeMirror();
  698. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.SourceArea.klass)})},
  699. messageSends: ["initialize", "setupCodeMirror"]}),
  700. smalltalk.SourceArea.klass);
  701. smalltalk.addMethod(
  702. smalltalk.method({
  703. selector: "setupCodeMirror",
  704. fn: function (){
  705. var self=this;
  706. return smalltalk.withContext(function($ctx1) {
  707. CodeMirror.keyMap["default"].fallthrough = ["basic"] ;
  708. return self}, function($ctx1) {$ctx1.fill(self,"setupCodeMirror",{},smalltalk.SourceArea.klass)})},
  709. messageSends: []}),
  710. smalltalk.SourceArea.klass);
  711. smalltalk.addClass('TabManager', smalltalk.Widget, ['selectedTab', 'tabs', 'opened', 'ul', 'input'], 'IDE');
  712. smalltalk.addMethod(
  713. smalltalk.method({
  714. selector: "addTab:",
  715. fn: function (aWidget){
  716. var self=this;
  717. return smalltalk.withContext(function($ctx1) {
  718. _st(self._tabs())._add_(aWidget);
  719. _st(aWidget)._appendToJQuery_("#amber"._asJQuery());
  720. _st(aWidget)._hide();
  721. return self}, function($ctx1) {$ctx1.fill(self,"addTab:",{aWidget:aWidget},smalltalk.TabManager)})},
  722. messageSends: ["add:", "tabs", "appendToJQuery:", "asJQuery", "hide"]}),
  723. smalltalk.TabManager);
  724. smalltalk.addMethod(
  725. smalltalk.method({
  726. selector: "close",
  727. fn: function (){
  728. var self=this;
  729. return smalltalk.withContext(function($ctx1) {
  730. var $1;
  731. $1=self["@opened"];
  732. if(smalltalk.assert($1)){
  733. _st("#amber"._asJQuery())._hide();
  734. _st(_st(self["@ul"])._asJQuery())._hide();
  735. _st(self["@selectedTab"])._hide();
  736. self._removeBodyMargin();
  737. _st("body"._asJQuery())._removeClass_("amberBody");
  738. self["@opened"]=false;
  739. self["@opened"];
  740. };
  741. return self}, function($ctx1) {$ctx1.fill(self,"close",{},smalltalk.TabManager)})},
  742. messageSends: ["ifTrue:", "hide", "asJQuery", "removeBodyMargin", "removeClass:"]}),
  743. smalltalk.TabManager);
  744. smalltalk.addMethod(
  745. smalltalk.method({
  746. selector: "closeTab:",
  747. fn: function (aWidget){
  748. var self=this;
  749. return smalltalk.withContext(function($ctx1) {
  750. self._removeTab_(aWidget);
  751. self._selectTab_(_st(self._tabs())._last());
  752. _st(aWidget)._remove();
  753. self._update();
  754. return self}, function($ctx1) {$ctx1.fill(self,"closeTab:",{aWidget:aWidget},smalltalk.TabManager)})},
  755. messageSends: ["removeTab:", "selectTab:", "last", "tabs", "remove", "update"]}),
  756. smalltalk.TabManager);
  757. smalltalk.addMethod(
  758. smalltalk.method({
  759. selector: "initialize",
  760. fn: function (){
  761. var self=this;
  762. function $IDETranscript(){return smalltalk.IDETranscript||(typeof IDETranscript=="undefined"?nil:IDETranscript)}
  763. function $Workspace(){return smalltalk.Workspace||(typeof Workspace=="undefined"?nil:Workspace)}
  764. function $TestRunner(){return smalltalk.TestRunner||(typeof TestRunner=="undefined"?nil:TestRunner)}
  765. return smalltalk.withContext(function($ctx1) {
  766. var $1,$2,$3,$4,$5,$6;
  767. smalltalk.TabManager.superclass.fn.prototype._initialize.apply(_st(self), []);
  768. self["@opened"]=true;
  769. _st((function(html){
  770. return smalltalk.withContext(function($ctx2) {
  771. return _st(_st(html)._div())._id_("amber");
  772. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}))._appendToJQuery_("body"._asJQuery());
  773. _st("body"._asJQuery())._addClass_("amberBody");
  774. self._appendToJQuery_("#amber"._asJQuery());
  775. $1=self;
  776. _st($1)._addTab_(_st($IDETranscript())._current());
  777. _st($1)._addTab_(_st($Workspace())._new());
  778. $2=_st($1)._addTab_(_st($TestRunner())._new());
  779. self._selectTab_(_st(self._tabs())._last());
  780. $3=self;
  781. _st($3)._onResize_((function(){
  782. return smalltalk.withContext(function($ctx2) {
  783. $4=self;
  784. _st($4)._updateBodyMargin();
  785. $5=_st($4)._updatePosition();
  786. return $5;
  787. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  788. $6=_st($3)._onWindowResize_((function(){
  789. return smalltalk.withContext(function($ctx2) {
  790. return self._updatePosition();
  791. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  792. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.TabManager)})},
  793. messageSends: ["initialize", "appendToJQuery:", "asJQuery", "id:", "div", "addClass:", "addTab:", "current", "new", "selectTab:", "last", "tabs", "onResize:", "updateBodyMargin", "updatePosition", "onWindowResize:"]}),
  794. smalltalk.TabManager);
  795. smalltalk.addMethod(
  796. smalltalk.method({
  797. selector: "labelFor:",
  798. fn: function (aWidget){
  799. var self=this;
  800. var label,maxSize;
  801. return smalltalk.withContext(function($ctx1) {
  802. var $1,$2;
  803. maxSize=(15);
  804. label=_st(_st(aWidget)._label())._copyFrom_to_((0),_st(_st(_st(aWidget)._label())._size())._min_(maxSize));
  805. $1=_st(_st(_st(aWidget)._label())._size()).__gt(maxSize);
  806. if(smalltalk.assert($1)){
  807. label=_st(label).__comma("...");
  808. label;
  809. };
  810. $2=label;
  811. return $2;
  812. }, function($ctx1) {$ctx1.fill(self,"labelFor:",{aWidget:aWidget,label:label,maxSize:maxSize},smalltalk.TabManager)})},
  813. messageSends: ["copyFrom:to:", "min:", "size", "label", "ifTrue:", ",", ">"]}),
  814. smalltalk.TabManager);
  815. smalltalk.addMethod(
  816. smalltalk.method({
  817. selector: "newBrowserTab",
  818. fn: function (){
  819. var self=this;
  820. function $Browser(){return smalltalk.Browser||(typeof Browser=="undefined"?nil:Browser)}
  821. return smalltalk.withContext(function($ctx1) {
  822. _st($Browser())._open();
  823. return self}, function($ctx1) {$ctx1.fill(self,"newBrowserTab",{},smalltalk.TabManager)})},
  824. messageSends: ["open"]}),
  825. smalltalk.TabManager);
  826. smalltalk.addMethod(
  827. smalltalk.method({
  828. selector: "onResize:",
  829. fn: function (aBlock){
  830. var self=this;
  831. return smalltalk.withContext(function($ctx1) {
  832. _st("#amber"._asJQuery())._resizable_(smalltalk.HashedCollection._from_(["handles".__minus_gt("n"),"resize".__minus_gt(aBlock),"minHeight".__minus_gt((230))]));
  833. return self}, function($ctx1) {$ctx1.fill(self,"onResize:",{aBlock:aBlock},smalltalk.TabManager)})},
  834. messageSends: ["resizable:", "->", "asJQuery"]}),
  835. smalltalk.TabManager);
  836. smalltalk.addMethod(
  837. smalltalk.method({
  838. selector: "onWindowResize:",
  839. fn: function (aBlock){
  840. var self=this;
  841. return smalltalk.withContext(function($ctx1) {
  842. _st(_st(window)._asJQuery())._resize_(aBlock);
  843. return self}, function($ctx1) {$ctx1.fill(self,"onWindowResize:",{aBlock:aBlock},smalltalk.TabManager)})},
  844. messageSends: ["resize:", "asJQuery"]}),
  845. smalltalk.TabManager);
  846. smalltalk.addMethod(
  847. smalltalk.method({
  848. selector: "open",
  849. fn: function (){
  850. var self=this;
  851. return smalltalk.withContext(function($ctx1) {
  852. var $1;
  853. $1=self["@opened"];
  854. if(! smalltalk.assert($1)){
  855. _st("body"._asJQuery())._addClass_("amberBody");
  856. _st("#amber"._asJQuery())._show();
  857. _st(_st(self["@ul"])._asJQuery())._show();
  858. self._updateBodyMargin();
  859. _st(self["@selectedTab"])._show();
  860. self["@opened"]=true;
  861. self["@opened"];
  862. };
  863. return self}, function($ctx1) {$ctx1.fill(self,"open",{},smalltalk.TabManager)})},
  864. messageSends: ["ifFalse:", "addClass:", "asJQuery", "show", "updateBodyMargin"]}),
  865. smalltalk.TabManager);
  866. smalltalk.addMethod(
  867. smalltalk.method({
  868. selector: "removeBodyMargin",
  869. fn: function (){
  870. var self=this;
  871. return smalltalk.withContext(function($ctx1) {
  872. self._setBodyMargin_((0));
  873. return self}, function($ctx1) {$ctx1.fill(self,"removeBodyMargin",{},smalltalk.TabManager)})},
  874. messageSends: ["setBodyMargin:"]}),
  875. smalltalk.TabManager);
  876. smalltalk.addMethod(
  877. smalltalk.method({
  878. selector: "removeTab:",
  879. fn: function (aWidget){
  880. var self=this;
  881. return smalltalk.withContext(function($ctx1) {
  882. _st(self._tabs())._remove_(aWidget);
  883. self._update();
  884. return self}, function($ctx1) {$ctx1.fill(self,"removeTab:",{aWidget:aWidget},smalltalk.TabManager)})},
  885. messageSends: ["remove:", "tabs", "update"]}),
  886. smalltalk.TabManager);
  887. smalltalk.addMethod(
  888. smalltalk.method({
  889. selector: "renderOn:",
  890. fn: function (html){
  891. var self=this;
  892. return smalltalk.withContext(function($ctx1) {
  893. var $1,$2;
  894. _st(_st(html)._div())._id_("logo");
  895. self._renderToolbarOn_(html);
  896. $1=_st(html)._ul();
  897. _st($1)._id_("amberTabs");
  898. $2=_st($1)._yourself();
  899. self["@ul"]=$2;
  900. self._renderTabs();
  901. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.TabManager)})},
  902. messageSends: ["id:", "div", "renderToolbarOn:", "ul", "yourself", "renderTabs"]}),
  903. smalltalk.TabManager);
  904. smalltalk.addMethod(
  905. smalltalk.method({
  906. selector: "renderTabFor:on:",
  907. fn: function (aWidget,html){
  908. var self=this;
  909. var li;
  910. return smalltalk.withContext(function($ctx1) {
  911. var $1,$2,$3,$5,$6,$7,$4,$8;
  912. li=_st(html)._li();
  913. $1=_st(self["@selectedTab"]).__eq(aWidget);
  914. if(smalltalk.assert($1)){
  915. _st(li)._class_("selected");
  916. };
  917. $2=li;
  918. _st($2)._with_((function(){
  919. return smalltalk.withContext(function($ctx2) {
  920. _st(_st(html)._span())._class_("ltab");
  921. $3=_st(html)._span();
  922. _st($3)._class_("mtab");
  923. $4=_st($3)._with_((function(){
  924. return smalltalk.withContext(function($ctx3) {
  925. $5=_st(aWidget)._canBeClosed();
  926. if(smalltalk.assert($5)){
  927. $6=_st(html)._span();
  928. _st($6)._class_("close");
  929. _st($6)._with_("x");
  930. $7=_st($6)._onClick_((function(){
  931. return smalltalk.withContext(function($ctx4) {
  932. return self._closeTab_(aWidget);
  933. }, function($ctx4) {$ctx4.fillBlock({},$ctx3)})}));
  934. $7;
  935. };
  936. return _st(_st(html)._span())._with_(self._labelFor_(aWidget));
  937. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  938. $4;
  939. return _st(_st(html)._span())._class_("rtab");
  940. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  941. $8=_st($2)._onClick_((function(){
  942. return smalltalk.withContext(function($ctx2) {
  943. return self._selectTab_(aWidget);
  944. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  945. return self}, function($ctx1) {$ctx1.fill(self,"renderTabFor:on:",{aWidget:aWidget,html:html,li:li},smalltalk.TabManager)})},
  946. messageSends: ["li", "ifTrue:", "class:", "=", "with:", "span", "onClick:", "closeTab:", "canBeClosed", "labelFor:", "selectTab:"]}),
  947. smalltalk.TabManager);
  948. smalltalk.addMethod(
  949. smalltalk.method({
  950. selector: "renderTabs",
  951. fn: function (){
  952. var self=this;
  953. return smalltalk.withContext(function($ctx1) {
  954. var $1,$2,$3,$4;
  955. _st(self["@ul"])._contents_((function(html){
  956. return smalltalk.withContext(function($ctx2) {
  957. _st(self._tabs())._do_((function(each){
  958. return smalltalk.withContext(function($ctx3) {
  959. return self._renderTabFor_on_(each,html);
  960. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2)})}));
  961. $1=_st(html)._li();
  962. _st($1)._class_("newtab");
  963. _st($1)._with_((function(){
  964. return smalltalk.withContext(function($ctx3) {
  965. _st(_st(html)._span())._class_("ltab");
  966. $2=_st(html)._span();
  967. _st($2)._class_("mtab");
  968. $3=_st($2)._with_(" + ");
  969. $3;
  970. return _st(_st(html)._span())._class_("rtab");
  971. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  972. $4=_st($1)._onClick_((function(){
  973. return smalltalk.withContext(function($ctx3) {
  974. return self._newBrowserTab();
  975. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  976. return $4;
  977. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}));
  978. return self}, function($ctx1) {$ctx1.fill(self,"renderTabs",{},smalltalk.TabManager)})},
  979. messageSends: ["contents:", "do:", "renderTabFor:on:", "tabs", "class:", "li", "with:", "span", "onClick:", "newBrowserTab"]}),
  980. smalltalk.TabManager);
  981. smalltalk.addMethod(
  982. smalltalk.method({
  983. selector: "renderToolbarOn:",
  984. fn: function (html){
  985. var self=this;
  986. return smalltalk.withContext(function($ctx1) {
  987. var $1,$3,$4,$5,$6,$7,$2;
  988. $1=_st(html)._div();
  989. _st($1)._id_("amber_toolbar");
  990. $2=_st($1)._with_((function(){
  991. return smalltalk.withContext(function($ctx2) {
  992. $3=_st(html)._input();
  993. _st($3)._class_("implementors");
  994. $4=_st($3)._yourself();
  995. self["@input"]=$4;
  996. self["@input"];
  997. _st(self["@input"])._onKeyPress_((function(event){
  998. return smalltalk.withContext(function($ctx3) {
  999. $5=_st(_st(event)._keyCode()).__eq((13));
  1000. if(smalltalk.assert($5)){
  1001. return self._search_(_st(_st(self["@input"])._asJQuery())._val());
  1002. };
  1003. }, function($ctx3) {$ctx3.fillBlock({event:event},$ctx2)})}));
  1004. $6=_st(html)._div();
  1005. _st($6)._id_("amber_close");
  1006. $7=_st($6)._onClick_((function(){
  1007. return smalltalk.withContext(function($ctx3) {
  1008. return self._close();
  1009. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  1010. return $7;
  1011. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1012. return self}, function($ctx1) {$ctx1.fill(self,"renderToolbarOn:",{html:html},smalltalk.TabManager)})},
  1013. messageSends: ["id:", "div", "with:", "class:", "input", "yourself", "onKeyPress:", "ifTrue:", "search:", "val", "asJQuery", "=", "keyCode", "onClick:", "close"]}),
  1014. smalltalk.TabManager);
  1015. smalltalk.addMethod(
  1016. smalltalk.method({
  1017. selector: "search:",
  1018. fn: function (aString){
  1019. var self=this;
  1020. var searchedClass;
  1021. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1022. function $Browser(){return smalltalk.Browser||(typeof Browser=="undefined"?nil:Browser)}
  1023. function $ReferencesBrowser(){return smalltalk.ReferencesBrowser||(typeof ReferencesBrowser=="undefined"?nil:ReferencesBrowser)}
  1024. return smalltalk.withContext(function($ctx1) {
  1025. var $1;
  1026. searchedClass=_st(_st($Smalltalk())._current())._at_(aString);
  1027. $1=_st(searchedClass)._isClass();
  1028. if(smalltalk.assert($1)){
  1029. _st($Browser())._openOn_(searchedClass);
  1030. } else {
  1031. _st($ReferencesBrowser())._search_(aString);
  1032. };
  1033. return self}, function($ctx1) {$ctx1.fill(self,"search:",{aString:aString,searchedClass:searchedClass},smalltalk.TabManager)})},
  1034. messageSends: ["at:", "current", "ifTrue:ifFalse:", "openOn:", "search:", "isClass"]}),
  1035. smalltalk.TabManager);
  1036. smalltalk.addMethod(
  1037. smalltalk.method({
  1038. selector: "selectTab:",
  1039. fn: function (aWidget){
  1040. var self=this;
  1041. return smalltalk.withContext(function($ctx1) {
  1042. self._open();
  1043. self["@selectedTab"]=aWidget;
  1044. _st(self._tabs())._do_((function(each){
  1045. return smalltalk.withContext(function($ctx2) {
  1046. return _st(each)._hide();
  1047. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1048. _st(aWidget)._show();
  1049. self._update();
  1050. return self}, function($ctx1) {$ctx1.fill(self,"selectTab:",{aWidget:aWidget},smalltalk.TabManager)})},
  1051. messageSends: ["open", "do:", "hide", "tabs", "show", "update"]}),
  1052. smalltalk.TabManager);
  1053. smalltalk.addMethod(
  1054. smalltalk.method({
  1055. selector: "setBodyMargin:",
  1056. fn: function (anInteger){
  1057. var self=this;
  1058. return smalltalk.withContext(function($ctx1) {
  1059. _st(".amberBody"._asJQuery())._css_put_("margin-bottom",_st(_st(anInteger)._asString()).__comma("px"));
  1060. return self}, function($ctx1) {$ctx1.fill(self,"setBodyMargin:",{anInteger:anInteger},smalltalk.TabManager)})},
  1061. messageSends: ["css:put:", ",", "asString", "asJQuery"]}),
  1062. smalltalk.TabManager);
  1063. smalltalk.addMethod(
  1064. smalltalk.method({
  1065. selector: "tabs",
  1066. fn: function (){
  1067. var self=this;
  1068. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  1069. return smalltalk.withContext(function($ctx1) {
  1070. var $2,$1;
  1071. $2=self["@tabs"];
  1072. if(($receiver = $2) == nil || $receiver == undefined){
  1073. self["@tabs"]=_st($Array())._new();
  1074. $1=self["@tabs"];
  1075. } else {
  1076. $1=$2;
  1077. };
  1078. return $1;
  1079. }, function($ctx1) {$ctx1.fill(self,"tabs",{},smalltalk.TabManager)})},
  1080. messageSends: ["ifNil:", "new"]}),
  1081. smalltalk.TabManager);
  1082. smalltalk.addMethod(
  1083. smalltalk.method({
  1084. selector: "update",
  1085. fn: function (){
  1086. var self=this;
  1087. return smalltalk.withContext(function($ctx1) {
  1088. self._renderTabs();
  1089. return self}, function($ctx1) {$ctx1.fill(self,"update",{},smalltalk.TabManager)})},
  1090. messageSends: ["renderTabs"]}),
  1091. smalltalk.TabManager);
  1092. smalltalk.addMethod(
  1093. smalltalk.method({
  1094. selector: "updateBodyMargin",
  1095. fn: function (){
  1096. var self=this;
  1097. return smalltalk.withContext(function($ctx1) {
  1098. self._setBodyMargin_(_st("#amber"._asJQuery())._height());
  1099. return self}, function($ctx1) {$ctx1.fill(self,"updateBodyMargin",{},smalltalk.TabManager)})},
  1100. messageSends: ["setBodyMargin:", "height", "asJQuery"]}),
  1101. smalltalk.TabManager);
  1102. smalltalk.addMethod(
  1103. smalltalk.method({
  1104. selector: "updatePosition",
  1105. fn: function (){
  1106. var self=this;
  1107. return smalltalk.withContext(function($ctx1) {
  1108. var $1,$2;
  1109. $1="#amber"._asJQuery();
  1110. _st($1)._css_put_("top","");
  1111. $2=_st($1)._css_put_("bottom","0px");
  1112. return self}, function($ctx1) {$ctx1.fill(self,"updatePosition",{},smalltalk.TabManager)})},
  1113. messageSends: ["css:put:", "asJQuery"]}),
  1114. smalltalk.TabManager);
  1115. smalltalk.TabManager.klass.iVarNames = ['current'];
  1116. smalltalk.addMethod(
  1117. smalltalk.method({
  1118. selector: "current",
  1119. fn: function (){
  1120. var self=this;
  1121. return smalltalk.withContext(function($ctx1) {
  1122. var $2,$1;
  1123. $2=self["@current"];
  1124. if(($receiver = $2) == nil || $receiver == undefined){
  1125. self["@current"]=smalltalk.TabManager.klass.superclass.fn.prototype._new.apply(_st(self), []);
  1126. $1=self["@current"];
  1127. } else {
  1128. $1=$2;
  1129. };
  1130. return $1;
  1131. }, function($ctx1) {$ctx1.fill(self,"current",{},smalltalk.TabManager.klass)})},
  1132. messageSends: ["ifNil:", "new"]}),
  1133. smalltalk.TabManager.klass);
  1134. smalltalk.addMethod(
  1135. smalltalk.method({
  1136. selector: "new",
  1137. fn: function (){
  1138. var self=this;
  1139. return smalltalk.withContext(function($ctx1) {
  1140. self._shouldNotImplement();
  1141. return self}, function($ctx1) {$ctx1.fill(self,"new",{},smalltalk.TabManager.klass)})},
  1142. messageSends: ["shouldNotImplement"]}),
  1143. smalltalk.TabManager.klass);
  1144. smalltalk.addMethod(
  1145. smalltalk.method({
  1146. selector: "toggleAmberIDE",
  1147. fn: function (){
  1148. var self=this;
  1149. function $Browser(){return smalltalk.Browser||(typeof Browser=="undefined"?nil:Browser)}
  1150. function $TabManager(){return smalltalk.TabManager||(typeof TabManager=="undefined"?nil:TabManager)}
  1151. return smalltalk.withContext(function($ctx1) {
  1152. var $1,$2;
  1153. $1=_st(_st("#amber"._asJQuery())._length()).__eq((0));
  1154. if(smalltalk.assert($1)){
  1155. _st($Browser())._open();
  1156. } else {
  1157. $2=_st("#amber"._asJQuery())._is_(":visible");
  1158. if(smalltalk.assert($2)){
  1159. _st(_st($TabManager())._current())._close();
  1160. } else {
  1161. _st(_st($TabManager())._current())._open();
  1162. };
  1163. };
  1164. return self}, function($ctx1) {$ctx1.fill(self,"toggleAmberIDE",{},smalltalk.TabManager.klass)})},
  1165. messageSends: ["ifTrue:ifFalse:", "open", "close", "current", "is:", "asJQuery", "=", "length"]}),
  1166. smalltalk.TabManager.klass);
  1167. smalltalk.addClass('TabWidget', smalltalk.Widget, ['div'], 'IDE');
  1168. smalltalk.addMethod(
  1169. smalltalk.method({
  1170. selector: "canBeClosed",
  1171. fn: function (){
  1172. var self=this;
  1173. return smalltalk.withContext(function($ctx1) {
  1174. return false;
  1175. }, function($ctx1) {$ctx1.fill(self,"canBeClosed",{},smalltalk.TabWidget)})},
  1176. messageSends: []}),
  1177. smalltalk.TabWidget);
  1178. smalltalk.addMethod(
  1179. smalltalk.method({
  1180. selector: "close",
  1181. fn: function (){
  1182. var self=this;
  1183. function $TabManager(){return smalltalk.TabManager||(typeof TabManager=="undefined"?nil:TabManager)}
  1184. return smalltalk.withContext(function($ctx1) {
  1185. _st(_st($TabManager())._current())._closeTab_(self);
  1186. return self}, function($ctx1) {$ctx1.fill(self,"close",{},smalltalk.TabWidget)})},
  1187. messageSends: ["closeTab:", "current"]}),
  1188. smalltalk.TabWidget);
  1189. smalltalk.addMethod(
  1190. smalltalk.method({
  1191. selector: "hide",
  1192. fn: function (){
  1193. var self=this;
  1194. return smalltalk.withContext(function($ctx1) {
  1195. _st(_st(self["@div"])._asJQuery())._hide();
  1196. return self}, function($ctx1) {$ctx1.fill(self,"hide",{},smalltalk.TabWidget)})},
  1197. messageSends: ["hide", "asJQuery"]}),
  1198. smalltalk.TabWidget);
  1199. smalltalk.addMethod(
  1200. smalltalk.method({
  1201. selector: "label",
  1202. fn: function (){
  1203. var self=this;
  1204. return smalltalk.withContext(function($ctx1) {
  1205. self._subclassResponsibility();
  1206. return self}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.TabWidget)})},
  1207. messageSends: ["subclassResponsibility"]}),
  1208. smalltalk.TabWidget);
  1209. smalltalk.addMethod(
  1210. smalltalk.method({
  1211. selector: "open",
  1212. fn: function (){
  1213. var self=this;
  1214. function $TabManager(){return smalltalk.TabManager||(typeof TabManager=="undefined"?nil:TabManager)}
  1215. return smalltalk.withContext(function($ctx1) {
  1216. _st(_st($TabManager())._current())._addTab_(self);
  1217. _st(_st($TabManager())._current())._selectTab_(self);
  1218. return self}, function($ctx1) {$ctx1.fill(self,"open",{},smalltalk.TabWidget)})},
  1219. messageSends: ["addTab:", "current", "selectTab:"]}),
  1220. smalltalk.TabWidget);
  1221. smalltalk.addMethod(
  1222. smalltalk.method({
  1223. selector: "remove",
  1224. fn: function (){
  1225. var self=this;
  1226. return smalltalk.withContext(function($ctx1) {
  1227. _st(_st(self["@div"])._asJQuery())._remove();
  1228. return self}, function($ctx1) {$ctx1.fill(self,"remove",{},smalltalk.TabWidget)})},
  1229. messageSends: ["remove", "asJQuery"]}),
  1230. smalltalk.TabWidget);
  1231. smalltalk.addMethod(
  1232. smalltalk.method({
  1233. selector: "renderBoxOn:",
  1234. fn: function (html){
  1235. var self=this;
  1236. return smalltalk.withContext(function($ctx1) {
  1237. return self}, function($ctx1) {$ctx1.fill(self,"renderBoxOn:",{html:html},smalltalk.TabWidget)})},
  1238. messageSends: []}),
  1239. smalltalk.TabWidget);
  1240. smalltalk.addMethod(
  1241. smalltalk.method({
  1242. selector: "renderButtonsOn:",
  1243. fn: function (html){
  1244. var self=this;
  1245. return smalltalk.withContext(function($ctx1) {
  1246. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},smalltalk.TabWidget)})},
  1247. messageSends: []}),
  1248. smalltalk.TabWidget);
  1249. smalltalk.addMethod(
  1250. smalltalk.method({
  1251. selector: "renderOn:",
  1252. fn: function (html){
  1253. var self=this;
  1254. return smalltalk.withContext(function($ctx1) {
  1255. var $1,$2;
  1256. $1=_st(html)._div();
  1257. _st($1)._class_("amberTool");
  1258. $2=_st($1)._yourself();
  1259. self["@div"]=$2;
  1260. self._renderTab();
  1261. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.TabWidget)})},
  1262. messageSends: ["class:", "div", "yourself", "renderTab"]}),
  1263. smalltalk.TabWidget);
  1264. smalltalk.addMethod(
  1265. smalltalk.method({
  1266. selector: "renderTab",
  1267. fn: function (){
  1268. var self=this;
  1269. return smalltalk.withContext(function($ctx1) {
  1270. var $1,$2,$3,$4;
  1271. _st(self["@div"])._contents_((function(html){
  1272. return smalltalk.withContext(function($ctx2) {
  1273. $1=_st(html)._div();
  1274. _st($1)._class_("amber_box");
  1275. $2=_st($1)._with_((function(){
  1276. return smalltalk.withContext(function($ctx3) {
  1277. return self._renderBoxOn_(html);
  1278. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  1279. $2;
  1280. $3=_st(html)._div();
  1281. _st($3)._class_("amber_buttons");
  1282. $4=_st($3)._with_((function(){
  1283. return smalltalk.withContext(function($ctx3) {
  1284. return self._renderButtonsOn_(html);
  1285. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  1286. return $4;
  1287. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}));
  1288. return self}, function($ctx1) {$ctx1.fill(self,"renderTab",{},smalltalk.TabWidget)})},
  1289. messageSends: ["contents:", "class:", "div", "with:", "renderBoxOn:", "renderButtonsOn:"]}),
  1290. smalltalk.TabWidget);
  1291. smalltalk.addMethod(
  1292. smalltalk.method({
  1293. selector: "show",
  1294. fn: function (){
  1295. var self=this;
  1296. return smalltalk.withContext(function($ctx1) {
  1297. _st(_st(self["@div"])._asJQuery())._show();
  1298. return self}, function($ctx1) {$ctx1.fill(self,"show",{},smalltalk.TabWidget)})},
  1299. messageSends: ["show", "asJQuery"]}),
  1300. smalltalk.TabWidget);
  1301. smalltalk.addMethod(
  1302. smalltalk.method({
  1303. selector: "update",
  1304. fn: function (){
  1305. var self=this;
  1306. return smalltalk.withContext(function($ctx1) {
  1307. self._renderTab();
  1308. return self}, function($ctx1) {$ctx1.fill(self,"update",{},smalltalk.TabWidget)})},
  1309. messageSends: ["renderTab"]}),
  1310. smalltalk.TabWidget);
  1311. smalltalk.addMethod(
  1312. smalltalk.method({
  1313. selector: "open",
  1314. fn: function (){
  1315. var self=this;
  1316. return smalltalk.withContext(function($ctx1) {
  1317. var $1;
  1318. $1=_st(self._new())._open();
  1319. return $1;
  1320. }, function($ctx1) {$ctx1.fill(self,"open",{},smalltalk.TabWidget.klass)})},
  1321. messageSends: ["open", "new"]}),
  1322. smalltalk.TabWidget.klass);
  1323. smalltalk.addClass('Browser', smalltalk.TabWidget, ['selectedPackage', 'selectedClass', 'selectedProtocol', 'selectedMethod', 'packagesList', 'classesList', 'protocolsList', 'methodsList', 'sourceArea', 'tabsList', 'selectedTab', 'saveButton', 'classButtons', 'methodButtons', 'unsavedChanges'], 'IDE');
  1324. smalltalk.addMethod(
  1325. smalltalk.method({
  1326. selector: "addInstanceVariableNamed:toClass:",
  1327. fn: function (aString,aClass){
  1328. var self=this;
  1329. function $ClassBuilder(){return smalltalk.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  1330. return smalltalk.withContext(function($ctx1) {
  1331. var $1,$2;
  1332. $1=_st(_st(aClass)._instanceVariableNames())._copy();
  1333. _st($1)._add_(aString);
  1334. $2=_st($1)._yourself();
  1335. _st(_st($ClassBuilder())._new())._addSubclassOf_named_instanceVariableNames_package_(_st(aClass)._superclass(),_st(aClass)._name(),$2,_st(_st(aClass)._package())._name());
  1336. return self}, function($ctx1) {$ctx1.fill(self,"addInstanceVariableNamed:toClass:",{aString:aString,aClass:aClass},smalltalk.Browser)})},
  1337. messageSends: ["addSubclassOf:named:instanceVariableNames:package:", "superclass", "name", "add:", "copy", "instanceVariableNames", "yourself", "package", "new"]}),
  1338. smalltalk.Browser);
  1339. smalltalk.addMethod(
  1340. smalltalk.method({
  1341. selector: "addNewClass",
  1342. fn: function (){
  1343. var self=this;
  1344. var className;
  1345. function $Object(){return smalltalk.Object||(typeof Object=="undefined"?nil:Object)}
  1346. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1347. return smalltalk.withContext(function($ctx1) {
  1348. var $1,$2,$3;
  1349. className=self._prompt_("New class");
  1350. $1=_st(_st(className)._notNil())._and_((function(){
  1351. return smalltalk.withContext(function($ctx2) {
  1352. return _st(className)._notEmpty();
  1353. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1354. if(smalltalk.assert($1)){
  1355. _st($Object())._subclass_instanceVariableNames_package_(className,"",self._selectedPackage());
  1356. $2=self;
  1357. _st($2)._resetClassesList();
  1358. $3=_st($2)._updateClassesList();
  1359. $3;
  1360. self._selectClass_(_st(_st($Smalltalk())._current())._at_(className));
  1361. };
  1362. return self}, function($ctx1) {$ctx1.fill(self,"addNewClass",{className:className},smalltalk.Browser)})},
  1363. messageSends: ["prompt:", "ifTrue:", "subclass:instanceVariableNames:package:", "selectedPackage", "resetClassesList", "updateClassesList", "selectClass:", "at:", "current", "and:", "notEmpty", "notNil"]}),
  1364. smalltalk.Browser);
  1365. smalltalk.addMethod(
  1366. smalltalk.method({
  1367. selector: "addNewProtocol",
  1368. fn: function (){
  1369. var self=this;
  1370. var newProtocol;
  1371. return smalltalk.withContext(function($ctx1) {
  1372. var $1;
  1373. newProtocol=self._prompt_("New method protocol");
  1374. $1=_st(_st(newProtocol)._notNil())._and_((function(){
  1375. return smalltalk.withContext(function($ctx2) {
  1376. return _st(newProtocol)._notEmpty();
  1377. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1378. if(smalltalk.assert($1)){
  1379. _st(self["@selectedMethod"])._category_(newProtocol);
  1380. self._setMethodProtocol_(newProtocol);
  1381. };
  1382. return self}, function($ctx1) {$ctx1.fill(self,"addNewProtocol",{newProtocol:newProtocol},smalltalk.Browser)})},
  1383. messageSends: ["prompt:", "ifTrue:", "category:", "setMethodProtocol:", "and:", "notEmpty", "notNil"]}),
  1384. smalltalk.Browser);
  1385. smalltalk.addMethod(
  1386. smalltalk.method({
  1387. selector: "canBeClosed",
  1388. fn: function (){
  1389. var self=this;
  1390. return smalltalk.withContext(function($ctx1) {
  1391. return true;
  1392. }, function($ctx1) {$ctx1.fill(self,"canBeClosed",{},smalltalk.Browser)})},
  1393. messageSends: []}),
  1394. smalltalk.Browser);
  1395. smalltalk.addMethod(
  1396. smalltalk.method({
  1397. selector: "cancelChanges",
  1398. fn: function (){
  1399. var self=this;
  1400. return smalltalk.withContext(function($ctx1) {
  1401. var $2,$1;
  1402. $2=self["@unsavedChanges"];
  1403. if(smalltalk.assert($2)){
  1404. $1=self._confirm_("Cancel changes?");
  1405. } else {
  1406. $1=true;
  1407. };
  1408. return $1;
  1409. }, function($ctx1) {$ctx1.fill(self,"cancelChanges",{},smalltalk.Browser)})},
  1410. messageSends: ["ifTrue:ifFalse:", "confirm:"]}),
  1411. smalltalk.Browser);
  1412. smalltalk.addMethod(
  1413. smalltalk.method({
  1414. selector: "classCommentSource",
  1415. fn: function (){
  1416. var self=this;
  1417. return smalltalk.withContext(function($ctx1) {
  1418. var $1;
  1419. $1=_st(self["@selectedClass"])._comment();
  1420. return $1;
  1421. }, function($ctx1) {$ctx1.fill(self,"classCommentSource",{},smalltalk.Browser)})},
  1422. messageSends: ["comment"]}),
  1423. smalltalk.Browser);
  1424. smalltalk.addMethod(
  1425. smalltalk.method({
  1426. selector: "classDeclarationSource",
  1427. fn: function (){
  1428. var self=this;
  1429. var stream;
  1430. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  1431. return smalltalk.withContext(function($ctx1) {
  1432. var $1,$2,$3,$4,$5,$6,$7;
  1433. stream=""._writeStream();
  1434. $1=self["@selectedClass"];
  1435. if(($receiver = $1) == nil || $receiver == undefined){
  1436. $2=self._classDeclarationTemplate();
  1437. return $2;
  1438. } else {
  1439. $1;
  1440. };
  1441. $3=stream;
  1442. _st($3)._nextPutAll_(_st(_st(self["@selectedClass"])._superclass())._asString());
  1443. _st($3)._nextPutAll_(" subclass: #");
  1444. _st($3)._nextPutAll_(_st(self["@selectedClass"])._name());
  1445. _st($3)._nextPutAll_(_st(_st($String())._lf()).__comma(_st($String())._tab()));
  1446. $4=_st($3)._nextPutAll_("instanceVariableNames: '");
  1447. _st(_st(self["@selectedClass"])._instanceVariableNames())._do_separatedBy_((function(each){
  1448. return smalltalk.withContext(function($ctx2) {
  1449. return _st(stream)._nextPutAll_(each);
  1450. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  1451. return smalltalk.withContext(function($ctx2) {
  1452. return _st(stream)._nextPutAll_(" ");
  1453. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1454. $5=stream;
  1455. _st($5)._nextPutAll_(_st("'".__comma(_st($String())._lf())).__comma(_st($String())._tab()));
  1456. _st($5)._nextPutAll_("package: '");
  1457. _st($5)._nextPutAll_(_st(self["@selectedClass"])._category());
  1458. $6=_st($5)._nextPutAll_("'");
  1459. $7=_st(stream)._contents();
  1460. return $7;
  1461. }, function($ctx1) {$ctx1.fill(self,"classDeclarationSource",{stream:stream},smalltalk.Browser)})},
  1462. messageSends: ["writeStream", "ifNil:", "classDeclarationTemplate", "nextPutAll:", "asString", "superclass", "name", ",", "tab", "lf", "do:separatedBy:", "instanceVariableNames", "category", "contents"]}),
  1463. smalltalk.Browser);
  1464. smalltalk.addMethod(
  1465. smalltalk.method({
  1466. selector: "classDeclarationTemplate",
  1467. fn: function (){
  1468. var self=this;
  1469. return smalltalk.withContext(function($ctx1) {
  1470. var $1;
  1471. $1=_st("Object subclass: #NameOfSubclass\x0a\x09instanceVariableNames: ''\x0a\x09package: '".__comma(self._selectedPackage())).__comma("'");
  1472. return $1;
  1473. }, function($ctx1) {$ctx1.fill(self,"classDeclarationTemplate",{},smalltalk.Browser)})},
  1474. messageSends: [",", "selectedPackage"]}),
  1475. smalltalk.Browser);
  1476. smalltalk.addMethod(
  1477. smalltalk.method({
  1478. selector: "classes",
  1479. fn: function (){
  1480. var self=this;
  1481. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1482. return smalltalk.withContext(function($ctx1) {
  1483. var $1;
  1484. $1=_st(_st(_st(_st(_st($Smalltalk())._current())._classes())._select_((function(each){
  1485. return smalltalk.withContext(function($ctx2) {
  1486. return _st(_st(each)._category()).__eq(self["@selectedPackage"]);
  1487. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._sort_((function(a,b){
  1488. return smalltalk.withContext(function($ctx2) {
  1489. return _st(_st(a)._name()).__lt(_st(b)._name());
  1490. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})})))._asSet();
  1491. return $1;
  1492. }, function($ctx1) {$ctx1.fill(self,"classes",{},smalltalk.Browser)})},
  1493. messageSends: ["asSet", "sort:", "<", "name", "select:", "=", "category", "classes", "current"]}),
  1494. smalltalk.Browser);
  1495. smalltalk.addMethod(
  1496. smalltalk.method({
  1497. selector: "commitPackage",
  1498. fn: function (){
  1499. var self=this;
  1500. function $Package(){return smalltalk.Package||(typeof Package=="undefined"?nil:Package)}
  1501. return smalltalk.withContext(function($ctx1) {
  1502. var $1;
  1503. $1=self["@selectedPackage"];
  1504. if(($receiver = $1) == nil || $receiver == undefined){
  1505. $1;
  1506. } else {
  1507. _st(_st($Package())._named_(self["@selectedPackage"]))._commit();
  1508. };
  1509. return self}, function($ctx1) {$ctx1.fill(self,"commitPackage",{},smalltalk.Browser)})},
  1510. messageSends: ["ifNotNil:", "commit", "named:"]}),
  1511. smalltalk.Browser);
  1512. smalltalk.addMethod(
  1513. smalltalk.method({
  1514. selector: "compile",
  1515. fn: function (){
  1516. var self=this;
  1517. var currentEditLine;
  1518. return smalltalk.withContext(function($ctx1) {
  1519. var $1,$2,$3;
  1520. self._disableSaveButton();
  1521. currentEditLine=_st(_st(self["@sourceArea"])._editor())._getCursor();
  1522. $1=_st(self["@selectedTab"]).__eq("comment");
  1523. if(smalltalk.assert($1)){
  1524. $2=self["@selectedClass"];
  1525. if(($receiver = $2) == nil || $receiver == undefined){
  1526. $2;
  1527. } else {
  1528. self._compileClassComment();
  1529. };
  1530. } else {
  1531. $3=_st(_st(self["@selectedProtocol"])._notNil())._or_((function(){
  1532. return smalltalk.withContext(function($ctx2) {
  1533. return _st(self["@selectedMethod"])._notNil();
  1534. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1535. if(smalltalk.assert($3)){
  1536. self._compileMethodDefinition();
  1537. } else {
  1538. self._compileDefinition();
  1539. };
  1540. };
  1541. _st(_st(self["@sourceArea"])._editor())._setCursor_(currentEditLine);
  1542. return self}, function($ctx1) {$ctx1.fill(self,"compile",{currentEditLine:currentEditLine},smalltalk.Browser)})},
  1543. messageSends: ["disableSaveButton", "getCursor", "editor", "ifTrue:ifFalse:", "ifNotNil:", "compileClassComment", "ifFalse:ifTrue:", "compileDefinition", "compileMethodDefinition", "or:", "notNil", "=", "setCursor:"]}),
  1544. smalltalk.Browser);
  1545. smalltalk.addMethod(
  1546. smalltalk.method({
  1547. selector: "compileClassComment",
  1548. fn: function (){
  1549. var self=this;
  1550. return smalltalk.withContext(function($ctx1) {
  1551. _st(self["@selectedClass"])._comment_(_st(self["@sourceArea"])._val());
  1552. return self}, function($ctx1) {$ctx1.fill(self,"compileClassComment",{},smalltalk.Browser)})},
  1553. messageSends: ["comment:", "val"]}),
  1554. smalltalk.Browser);
  1555. smalltalk.addMethod(
  1556. smalltalk.method({
  1557. selector: "compileDefinition",
  1558. fn: function (){
  1559. var self=this;
  1560. var newClass;
  1561. function $Compiler(){return smalltalk.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
  1562. return smalltalk.withContext(function($ctx1) {
  1563. var $1,$2;
  1564. newClass=_st(_st($Compiler())._new())._evaluateExpression_(_st(self["@sourceArea"])._val());
  1565. $1=self;
  1566. _st($1)._resetClassesList();
  1567. _st($1)._updateCategoriesList();
  1568. $2=_st($1)._updateClassesList();
  1569. self._selectClass_(newClass);
  1570. return self}, function($ctx1) {$ctx1.fill(self,"compileDefinition",{newClass:newClass},smalltalk.Browser)})},
  1571. messageSends: ["evaluateExpression:", "val", "new", "resetClassesList", "updateCategoriesList", "updateClassesList", "selectClass:"]}),
  1572. smalltalk.Browser);
  1573. smalltalk.addMethod(
  1574. smalltalk.method({
  1575. selector: "compileMethodDefinition",
  1576. fn: function (){
  1577. var self=this;
  1578. return smalltalk.withContext(function($ctx1) {
  1579. var $1;
  1580. $1=_st(self["@selectedTab"]).__eq("instance");
  1581. if(smalltalk.assert($1)){
  1582. self._compileMethodDefinitionFor_(self["@selectedClass"]);
  1583. } else {
  1584. self._compileMethodDefinitionFor_(_st(self["@selectedClass"])._class());
  1585. };
  1586. return self}, function($ctx1) {$ctx1.fill(self,"compileMethodDefinition",{},smalltalk.Browser)})},
  1587. messageSends: ["ifTrue:ifFalse:", "compileMethodDefinitionFor:", "class", "="]}),
  1588. smalltalk.Browser);
  1589. smalltalk.addMethod(
  1590. smalltalk.method({
  1591. selector: "compileMethodDefinitionFor:",
  1592. fn: function (aClass){
  1593. var self=this;
  1594. var compiler,method,source,node;
  1595. function $Compiler(){return smalltalk.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
  1596. function $PlatformInterface(){return smalltalk.PlatformInterface||(typeof PlatformInterface=="undefined"?nil:PlatformInterface)}
  1597. function $ClassBuilder(){return smalltalk.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  1598. return smalltalk.withContext(function($ctx1) {
  1599. var $1,$2,$3,$4,$5,$6;
  1600. var $early={};
  1601. try {
  1602. source=_st(self["@sourceArea"])._val();
  1603. $1=self["@selectedProtocol"];
  1604. if(($receiver = $1) == nil || $receiver == undefined){
  1605. self["@selectedProtocol"]=_st(self["@selectedMethod"])._category();
  1606. self["@selectedProtocol"];
  1607. } else {
  1608. $1;
  1609. };
  1610. compiler=_st($Compiler())._new();
  1611. _st(compiler)._source_(source);
  1612. node=_st(compiler)._parse_(source);
  1613. $2=_st(node)._isParseFailure();
  1614. if(smalltalk.assert($2)){
  1615. $3=self._alert_(_st(_st("PARSE ERROR: ".__comma(_st(node)._reason())).__comma(", position: ")).__comma(_st(_st(node)._position())._asString()));
  1616. return $3;
  1617. };
  1618. _st(compiler)._currentClass_(aClass);
  1619. method=_st(compiler)._eval_(_st(compiler)._compileNode_(node));
  1620. _st(_st(compiler)._unknownVariables())._do_((function(each){
  1621. return smalltalk.withContext(function($ctx2) {
  1622. $4=_st($PlatformInterface())._existsGlobal_(each);
  1623. if(! smalltalk.assert($4)){
  1624. $5=self._confirm_(_st("Declare '".__comma(each)).__comma("' as instance variable?"));
  1625. if(smalltalk.assert($5)){
  1626. self._addInstanceVariableNamed_toClass_(each,aClass);
  1627. $6=self._compileMethodDefinitionFor_(aClass);
  1628. throw $early=[$6];
  1629. };
  1630. };
  1631. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1632. _st(_st($ClassBuilder())._new())._installMethod_forClass_category_(method,aClass,self["@selectedProtocol"]);
  1633. self._updateMethodsList();
  1634. self._selectMethod_(method);
  1635. return self}
  1636. catch(e) {if(e===$early)return e[0]; throw e}
  1637. }, function($ctx1) {$ctx1.fill(self,"compileMethodDefinitionFor:",{aClass:aClass,compiler:compiler,method:method,source:source,node:node},smalltalk.Browser)})},
  1638. messageSends: ["val", "ifNil:", "category", "new", "source:", "parse:", "ifTrue:", "alert:", ",", "asString", "position", "reason", "isParseFailure", "currentClass:", "eval:", "compileNode:", "do:", "ifFalse:", "addInstanceVariableNamed:toClass:", "compileMethodDefinitionFor:", "confirm:", "existsGlobal:", "unknownVariables", "installMethod:forClass:category:", "updateMethodsList", "selectMethod:"]}),
  1639. smalltalk.Browser);
  1640. smalltalk.addMethod(
  1641. smalltalk.method({
  1642. selector: "copyClass",
  1643. fn: function (){
  1644. var self=this;
  1645. var className;
  1646. function $ClassBuilder(){return smalltalk.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  1647. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1648. return smalltalk.withContext(function($ctx1) {
  1649. var $1,$2,$3;
  1650. className=self._prompt_("Copy class");
  1651. $1=_st(_st(className)._notNil())._and_((function(){
  1652. return smalltalk.withContext(function($ctx2) {
  1653. return _st(className)._notEmpty();
  1654. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1655. if(smalltalk.assert($1)){
  1656. _st(_st($ClassBuilder())._new())._copyClass_named_(self._selectedClass(),className);
  1657. $2=self;
  1658. _st($2)._resetClassesList();
  1659. $3=_st($2)._updateClassesList();
  1660. $3;
  1661. self._selectClass_(_st(_st($Smalltalk())._current())._at_(className));
  1662. };
  1663. return self}, function($ctx1) {$ctx1.fill(self,"copyClass",{className:className},smalltalk.Browser)})},
  1664. messageSends: ["prompt:", "ifTrue:", "copyClass:named:", "selectedClass", "new", "resetClassesList", "updateClassesList", "selectClass:", "at:", "current", "and:", "notEmpty", "notNil"]}),
  1665. smalltalk.Browser);
  1666. smalltalk.addMethod(
  1667. smalltalk.method({
  1668. selector: "declarationSource",
  1669. fn: function (){
  1670. var self=this;
  1671. return smalltalk.withContext(function($ctx1) {
  1672. var $2,$1;
  1673. $2=_st(self["@selectedTab"]).__eq("instance");
  1674. if(smalltalk.assert($2)){
  1675. $1=self._classDeclarationSource();
  1676. } else {
  1677. $1=self._metaclassDeclarationSource();
  1678. };
  1679. return $1;
  1680. }, function($ctx1) {$ctx1.fill(self,"declarationSource",{},smalltalk.Browser)})},
  1681. messageSends: ["ifTrue:ifFalse:", "classDeclarationSource", "metaclassDeclarationSource", "="]}),
  1682. smalltalk.Browser);
  1683. smalltalk.addMethod(
  1684. smalltalk.method({
  1685. selector: "disableSaveButton",
  1686. fn: function (){
  1687. var self=this;
  1688. return smalltalk.withContext(function($ctx1) {
  1689. var $1;
  1690. $1=self["@saveButton"];
  1691. if(($receiver = $1) == nil || $receiver == undefined){
  1692. $1;
  1693. } else {
  1694. _st(self["@saveButton"])._at_put_("disabled",true);
  1695. };
  1696. self["@unsavedChanges"]=false;
  1697. return self}, function($ctx1) {$ctx1.fill(self,"disableSaveButton",{},smalltalk.Browser)})},
  1698. messageSends: ["ifNotNil:", "at:put:"]}),
  1699. smalltalk.Browser);
  1700. smalltalk.addMethod(
  1701. smalltalk.method({
  1702. selector: "dummyMethodSource",
  1703. fn: function (){
  1704. var self=this;
  1705. return smalltalk.withContext(function($ctx1) {
  1706. return "messageSelectorAndArgumentNames\x0a\x09\x22comment stating purpose of message\x22\x0a\x0a\x09| temporary variable names |\x0a\x09statements";
  1707. }, function($ctx1) {$ctx1.fill(self,"dummyMethodSource",{},smalltalk.Browser)})},
  1708. messageSends: []}),
  1709. smalltalk.Browser);
  1710. smalltalk.addMethod(
  1711. smalltalk.method({
  1712. selector: "handleSourceAreaKeyDown:",
  1713. fn: function (anEvent){
  1714. var self=this;
  1715. return smalltalk.withContext(function($ctx1) {
  1716. if(anEvent.ctrlKey) {
  1717. if(anEvent.keyCode === 83) { //ctrl+s
  1718. self._compile();
  1719. anEvent.preventDefault();
  1720. return false;
  1721. }
  1722. }
  1723. ;
  1724. return self}, function($ctx1) {$ctx1.fill(self,"handleSourceAreaKeyDown:",{anEvent:anEvent},smalltalk.Browser)})},
  1725. messageSends: []}),
  1726. smalltalk.Browser);
  1727. smalltalk.addMethod(
  1728. smalltalk.method({
  1729. selector: "hideClassButtons",
  1730. fn: function (){
  1731. var self=this;
  1732. return smalltalk.withContext(function($ctx1) {
  1733. _st(_st(self["@classButtons"])._asJQuery())._hide();
  1734. return self}, function($ctx1) {$ctx1.fill(self,"hideClassButtons",{},smalltalk.Browser)})},
  1735. messageSends: ["hide", "asJQuery"]}),
  1736. smalltalk.Browser);
  1737. smalltalk.addMethod(
  1738. smalltalk.method({
  1739. selector: "hideMethodButtons",
  1740. fn: function (){
  1741. var self=this;
  1742. return smalltalk.withContext(function($ctx1) {
  1743. _st(_st(self["@methodButtons"])._asJQuery())._hide();
  1744. return self}, function($ctx1) {$ctx1.fill(self,"hideMethodButtons",{},smalltalk.Browser)})},
  1745. messageSends: ["hide", "asJQuery"]}),
  1746. smalltalk.Browser);
  1747. smalltalk.addMethod(
  1748. smalltalk.method({
  1749. selector: "initialize",
  1750. fn: function (){
  1751. var self=this;
  1752. return smalltalk.withContext(function($ctx1) {
  1753. smalltalk.Browser.superclass.fn.prototype._initialize.apply(_st(self), []);
  1754. self["@selectedTab"]="instance";
  1755. self["@selectedPackage"]=_st(self._packages())._first();
  1756. self["@unsavedChanges"]=false;
  1757. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.Browser)})},
  1758. messageSends: ["initialize", "first", "packages"]}),
  1759. smalltalk.Browser);
  1760. smalltalk.addMethod(
  1761. smalltalk.method({
  1762. selector: "label",
  1763. fn: function (){
  1764. var self=this;
  1765. return smalltalk.withContext(function($ctx1) {
  1766. var $2,$1;
  1767. $2=self["@selectedClass"];
  1768. if(($receiver = $2) == nil || $receiver == undefined){
  1769. $1="Browser (nil)";
  1770. } else {
  1771. $1="Browser: ".__comma(_st(self["@selectedClass"])._name());
  1772. };
  1773. return $1;
  1774. }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.Browser)})},
  1775. messageSends: ["ifNil:ifNotNil:", ",", "name"]}),
  1776. smalltalk.Browser);
  1777. smalltalk.addMethod(
  1778. smalltalk.method({
  1779. selector: "metaclassDeclarationSource",
  1780. fn: function (){
  1781. var self=this;
  1782. var stream;
  1783. return smalltalk.withContext(function($ctx1) {
  1784. var $1,$2,$3,$4;
  1785. stream=""._writeStream();
  1786. $1=self["@selectedClass"];
  1787. if(($receiver = $1) == nil || $receiver == undefined){
  1788. $1;
  1789. } else {
  1790. $2=stream;
  1791. _st($2)._nextPutAll_(_st(self["@selectedClass"])._asString());
  1792. _st($2)._nextPutAll_(" class ");
  1793. $3=_st($2)._nextPutAll_("instanceVariableNames: '");
  1794. $3;
  1795. _st(_st(_st(self["@selectedClass"])._class())._instanceVariableNames())._do_separatedBy_((function(each){
  1796. return smalltalk.withContext(function($ctx2) {
  1797. return _st(stream)._nextPutAll_(each);
  1798. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  1799. return smalltalk.withContext(function($ctx2) {
  1800. return _st(stream)._nextPutAll_(" ");
  1801. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1802. _st(stream)._nextPutAll_("'");
  1803. };
  1804. $4=_st(stream)._contents();
  1805. return $4;
  1806. }, function($ctx1) {$ctx1.fill(self,"metaclassDeclarationSource",{stream:stream},smalltalk.Browser)})},
  1807. messageSends: ["writeStream", "ifNotNil:", "nextPutAll:", "asString", "do:separatedBy:", "instanceVariableNames", "class", "contents"]}),
  1808. smalltalk.Browser);
  1809. smalltalk.addMethod(
  1810. smalltalk.method({
  1811. selector: "methodSource",
  1812. fn: function (){
  1813. var self=this;
  1814. return smalltalk.withContext(function($ctx1) {
  1815. var $2,$1;
  1816. $2=self["@selectedMethod"];
  1817. if(($receiver = $2) == nil || $receiver == undefined){
  1818. $1=self._dummyMethodSource();
  1819. } else {
  1820. $1=_st(self["@selectedMethod"])._source();
  1821. };
  1822. return $1;
  1823. }, function($ctx1) {$ctx1.fill(self,"methodSource",{},smalltalk.Browser)})},
  1824. messageSends: ["ifNil:ifNotNil:", "dummyMethodSource", "source"]}),
  1825. smalltalk.Browser);
  1826. smalltalk.addMethod(
  1827. smalltalk.method({
  1828. selector: "methods",
  1829. fn: function (){
  1830. var self=this;
  1831. var klass;
  1832. return smalltalk.withContext(function($ctx1) {
  1833. var $1,$2,$3,$4,$7,$8,$6,$5;
  1834. $1=_st(self["@selectedTab"]).__eq("comment");
  1835. if(smalltalk.assert($1)){
  1836. $2=[];
  1837. return $2;
  1838. };
  1839. $3=self["@selectedClass"];
  1840. if(($receiver = $3) == nil || $receiver == undefined){
  1841. $3;
  1842. } else {
  1843. $4=_st(self["@selectedTab"]).__eq("instance");
  1844. if(smalltalk.assert($4)){
  1845. klass=self["@selectedClass"];
  1846. } else {
  1847. klass=_st(self["@selectedClass"])._class();
  1848. };
  1849. klass;
  1850. };
  1851. $7=self["@selectedProtocol"];
  1852. if(($receiver = $7) == nil || $receiver == undefined){
  1853. $8=klass;
  1854. if(($receiver = $8) == nil || $receiver == undefined){
  1855. $6=[];
  1856. } else {
  1857. $6=_st(_st(klass)._methodDictionary())._values();
  1858. };
  1859. } else {
  1860. $6=_st(_st(_st(klass)._methodDictionary())._values())._select_((function(each){
  1861. return smalltalk.withContext(function($ctx2) {
  1862. return _st(_st(each)._category()).__eq(self["@selectedProtocol"]);
  1863. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1864. };
  1865. $5=_st($6)._sort_((function(a,b){
  1866. return smalltalk.withContext(function($ctx2) {
  1867. return _st(_st(a)._selector()).__lt(_st(b)._selector());
  1868. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})}));
  1869. return $5;
  1870. }, function($ctx1) {$ctx1.fill(self,"methods",{klass:klass},smalltalk.Browser)})},
  1871. messageSends: ["ifTrue:", "=", "ifNotNil:", "ifTrue:ifFalse:", "class", "sort:", "<", "selector", "ifNil:ifNotNil:", "values", "methodDictionary", "select:", "category"]}),
  1872. smalltalk.Browser);
  1873. smalltalk.addMethod(
  1874. smalltalk.method({
  1875. selector: "packages",
  1876. fn: function (){
  1877. var self=this;
  1878. var packages;
  1879. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  1880. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1881. return smalltalk.withContext(function($ctx1) {
  1882. var $1,$2;
  1883. packages=_st($Array())._new();
  1884. _st(_st(_st($Smalltalk())._current())._classes())._do_((function(each){
  1885. return smalltalk.withContext(function($ctx2) {
  1886. $1=_st(packages)._includes_(_st(each)._category());
  1887. if(! smalltalk.assert($1)){
  1888. return _st(packages)._add_(_st(each)._category());
  1889. };
  1890. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1891. $2=_st(packages)._sort();
  1892. return $2;
  1893. }, function($ctx1) {$ctx1.fill(self,"packages",{packages:packages},smalltalk.Browser)})},
  1894. messageSends: ["new", "do:", "ifFalse:", "add:", "category", "includes:", "classes", "current", "sort"]}),
  1895. smalltalk.Browser);
  1896. smalltalk.addMethod(
  1897. smalltalk.method({
  1898. selector: "protocols",
  1899. fn: function (){
  1900. var self=this;
  1901. var klass;
  1902. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  1903. return smalltalk.withContext(function($ctx1) {
  1904. var $1,$2,$3,$4,$5,$6,$7,$8;
  1905. $1=self["@selectedClass"];
  1906. if(($receiver = $1) == nil || $receiver == undefined){
  1907. $1;
  1908. } else {
  1909. $2=_st(self["@selectedTab"]).__eq("comment");
  1910. if(smalltalk.assert($2)){
  1911. $3=[];
  1912. return $3;
  1913. };
  1914. $4=_st(self["@selectedTab"]).__eq("instance");
  1915. if(smalltalk.assert($4)){
  1916. klass=self["@selectedClass"];
  1917. } else {
  1918. klass=_st(self["@selectedClass"])._class();
  1919. };
  1920. klass;
  1921. $5=_st(_st(klass)._methodDictionary())._isEmpty();
  1922. if(smalltalk.assert($5)){
  1923. $6=_st($Array())._with_("not yet classified");
  1924. return $6;
  1925. };
  1926. $7=_st(klass)._protocols();
  1927. return $7;
  1928. };
  1929. $8=_st($Array())._new();
  1930. return $8;
  1931. }, function($ctx1) {$ctx1.fill(self,"protocols",{klass:klass},smalltalk.Browser)})},
  1932. messageSends: ["ifNotNil:", "ifTrue:", "=", "ifTrue:ifFalse:", "class", "with:", "isEmpty", "methodDictionary", "protocols", "new"]}),
  1933. smalltalk.Browser);
  1934. smalltalk.addMethod(
  1935. smalltalk.method({
  1936. selector: "removeClass",
  1937. fn: function (){
  1938. var self=this;
  1939. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1940. return smalltalk.withContext(function($ctx1) {
  1941. var $1;
  1942. $1=self._confirm_(_st("Do you really want to remove ".__comma(_st(self["@selectedClass"])._name())).__comma("?"));
  1943. if(smalltalk.assert($1)){
  1944. _st(_st($Smalltalk())._current())._removeClass_(self["@selectedClass"]);
  1945. self._resetClassesList();
  1946. self._selectClass_(nil);
  1947. };
  1948. return self}, function($ctx1) {$ctx1.fill(self,"removeClass",{},smalltalk.Browser)})},
  1949. messageSends: ["ifTrue:", "removeClass:", "current", "resetClassesList", "selectClass:", "confirm:", ",", "name"]}),
  1950. smalltalk.Browser);
  1951. smalltalk.addMethod(
  1952. smalltalk.method({
  1953. selector: "removeMethod",
  1954. fn: function (){
  1955. var self=this;
  1956. return smalltalk.withContext(function($ctx1) {
  1957. var $1,$2,$3;
  1958. $1=self._cancelChanges();
  1959. if(smalltalk.assert($1)){
  1960. $2=self._confirm_(_st("Do you really want to remove #".__comma(_st(self["@selectedMethod"])._selector())).__comma("?"));
  1961. if(smalltalk.assert($2)){
  1962. $3=_st(self["@selectedTab"]).__eq("instance");
  1963. if(smalltalk.assert($3)){
  1964. _st(self["@selectedClass"])._removeCompiledMethod_(self["@selectedMethod"]);
  1965. } else {
  1966. _st(_st(self["@selectedClass"])._class())._removeCompiledMethod_(self["@selectedMethod"]);
  1967. };
  1968. self._selectMethod_(nil);
  1969. };
  1970. };
  1971. return self}, function($ctx1) {$ctx1.fill(self,"removeMethod",{},smalltalk.Browser)})},
  1972. messageSends: ["ifTrue:", "ifTrue:ifFalse:", "removeCompiledMethod:", "class", "=", "selectMethod:", "confirm:", ",", "selector", "cancelChanges"]}),
  1973. smalltalk.Browser);
  1974. smalltalk.addMethod(
  1975. smalltalk.method({
  1976. selector: "removePackage",
  1977. fn: function (){
  1978. var self=this;
  1979. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1980. return smalltalk.withContext(function($ctx1) {
  1981. var $1;
  1982. $1=self._confirm_(_st("Do you really want to remove the whole package ".__comma(self["@selectedPackage"])).__comma(" with all its classes?"));
  1983. if(smalltalk.assert($1)){
  1984. _st(_st($Smalltalk())._current())._removePackage_(self["@selectedPackage"]);
  1985. self._updateCategoriesList();
  1986. };
  1987. return self}, function($ctx1) {$ctx1.fill(self,"removePackage",{},smalltalk.Browser)})},
  1988. messageSends: ["ifTrue:", "removePackage:", "current", "updateCategoriesList", "confirm:", ","]}),
  1989. smalltalk.Browser);
  1990. smalltalk.addMethod(
  1991. smalltalk.method({
  1992. selector: "renameClass",
  1993. fn: function (){
  1994. var self=this;
  1995. var newName;
  1996. return smalltalk.withContext(function($ctx1) {
  1997. var $1,$2,$3;
  1998. newName=self._prompt_("Rename class ".__comma(_st(self["@selectedClass"])._name()));
  1999. $1=_st(_st(newName)._notNil())._and_((function(){
  2000. return smalltalk.withContext(function($ctx2) {
  2001. return _st(newName)._notEmpty();
  2002. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2003. if(smalltalk.assert($1)){
  2004. _st(self["@selectedClass"])._rename_(newName);
  2005. $2=self;
  2006. _st($2)._updateClassesList();
  2007. $3=_st($2)._updateSourceAndButtons();
  2008. $3;
  2009. };
  2010. return self}, function($ctx1) {$ctx1.fill(self,"renameClass",{newName:newName},smalltalk.Browser)})},
  2011. messageSends: ["prompt:", ",", "name", "ifTrue:", "rename:", "updateClassesList", "updateSourceAndButtons", "and:", "notEmpty", "notNil"]}),
  2012. smalltalk.Browser);
  2013. smalltalk.addMethod(
  2014. smalltalk.method({
  2015. selector: "renamePackage",
  2016. fn: function (){
  2017. var self=this;
  2018. var newName;
  2019. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  2020. return smalltalk.withContext(function($ctx1) {
  2021. var $1,$2;
  2022. newName=self._prompt_("Rename package ".__comma(self["@selectedPackage"]));
  2023. $1=newName;
  2024. if(($receiver = $1) == nil || $receiver == undefined){
  2025. $1;
  2026. } else {
  2027. $2=_st(newName)._notEmpty();
  2028. if(smalltalk.assert($2)){
  2029. _st(_st($Smalltalk())._current())._renamePackage_to_(self["@selectedPackage"],newName);
  2030. self._updateCategoriesList();
  2031. };
  2032. };
  2033. return self}, function($ctx1) {$ctx1.fill(self,"renamePackage",{newName:newName},smalltalk.Browser)})},
  2034. messageSends: ["prompt:", ",", "ifNotNil:", "ifTrue:", "renamePackage:to:", "current", "updateCategoriesList", "notEmpty"]}),
  2035. smalltalk.Browser);
  2036. smalltalk.addMethod(
  2037. smalltalk.method({
  2038. selector: "renderBottomPanelOn:",
  2039. fn: function (html){
  2040. var self=this;
  2041. function $SourceArea(){return smalltalk.SourceArea||(typeof SourceArea=="undefined"?nil:SourceArea)}
  2042. return smalltalk.withContext(function($ctx1) {
  2043. var $1,$2;
  2044. $1=_st(html)._div();
  2045. _st($1)._class_("amber_sourceCode");
  2046. $2=_st($1)._with_((function(){
  2047. return smalltalk.withContext(function($ctx2) {
  2048. self["@sourceArea"]=_st($SourceArea())._new();
  2049. self["@sourceArea"];
  2050. _st(self["@sourceArea"])._renderOn_(html);
  2051. _st(self["@sourceArea"])._onKeyDown_((function(e){
  2052. return smalltalk.withContext(function($ctx3) {
  2053. return self._handleSourceAreaKeyDown_(e);
  2054. }, function($ctx3) {$ctx3.fillBlock({e:e},$ctx2)})}));
  2055. return _st(self["@sourceArea"])._onKeyUp_((function(){
  2056. return smalltalk.withContext(function($ctx3) {
  2057. return self._updateStatus();
  2058. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  2059. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2060. return self}, function($ctx1) {$ctx1.fill(self,"renderBottomPanelOn:",{html:html},smalltalk.Browser)})},
  2061. messageSends: ["class:", "div", "with:", "new", "renderOn:", "onKeyDown:", "handleSourceAreaKeyDown:", "onKeyUp:", "updateStatus"]}),
  2062. smalltalk.Browser);
  2063. smalltalk.addMethod(
  2064. smalltalk.method({
  2065. selector: "renderBoxOn:",
  2066. fn: function (html){
  2067. var self=this;
  2068. return smalltalk.withContext(function($ctx1) {
  2069. var $1,$2;
  2070. $1=self;
  2071. _st($1)._renderTopPanelOn_(html);
  2072. _st($1)._renderTabsOn_(html);
  2073. $2=_st($1)._renderBottomPanelOn_(html);
  2074. return self}, function($ctx1) {$ctx1.fill(self,"renderBoxOn:",{html:html},smalltalk.Browser)})},
  2075. messageSends: ["renderTopPanelOn:", "renderTabsOn:", "renderBottomPanelOn:"]}),
  2076. smalltalk.Browser);
  2077. smalltalk.addMethod(
  2078. smalltalk.method({
  2079. selector: "renderButtonsOn:",
  2080. fn: function (html){
  2081. var self=this;
  2082. return smalltalk.withContext(function($ctx1) {
  2083. var $1,$2,$3,$5,$6,$7,$8,$9,$10,$4;
  2084. self["@saveButton"]=_st(html)._button();
  2085. $1=self["@saveButton"];
  2086. _st($1)._with_("Save");
  2087. $2=_st($1)._onClick_((function(){
  2088. return smalltalk.withContext(function($ctx2) {
  2089. return self._compile();
  2090. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2091. self["@methodButtons"]=_st(html)._span();
  2092. self["@classButtons"]=_st(html)._span();
  2093. $3=_st(html)._div();
  2094. _st($3)._class_("right");
  2095. $4=_st($3)._with_((function(){
  2096. return smalltalk.withContext(function($ctx2) {
  2097. $5=_st(html)._button();
  2098. _st($5)._with_("DoIt");
  2099. $6=_st($5)._onClick_((function(){
  2100. return smalltalk.withContext(function($ctx3) {
  2101. return _st(self["@sourceArea"])._doIt();
  2102. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  2103. $6;
  2104. $7=_st(html)._button();
  2105. _st($7)._with_("PrintIt");
  2106. $8=_st($7)._onClick_((function(){
  2107. return smalltalk.withContext(function($ctx3) {
  2108. return _st(self["@sourceArea"])._printIt();
  2109. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  2110. $8;
  2111. $9=_st(html)._button();
  2112. _st($9)._with_("InspectIt");
  2113. $10=_st($9)._onClick_((function(){
  2114. return smalltalk.withContext(function($ctx3) {
  2115. return _st(self["@sourceArea"])._inspectIt();
  2116. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  2117. return $10;
  2118. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2119. self._updateSourceAndButtons();
  2120. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},smalltalk.Browser)})},
  2121. messageSends: ["button", "with:", "onClick:", "compile", "span", "class:", "div", "doIt", "printIt", "inspectIt", "updateSourceAndButtons"]}),
  2122. smalltalk.Browser);
  2123. smalltalk.addMethod(
  2124. smalltalk.method({
  2125. selector: "renderTabsOn:",
  2126. fn: function (html){
  2127. var self=this;
  2128. return smalltalk.withContext(function($ctx1) {
  2129. self["@tabsList"]=_st(_st(html)._ul())._class_("amber_tabs amber_browser");
  2130. self._updateTabsList();
  2131. return self}, function($ctx1) {$ctx1.fill(self,"renderTabsOn:",{html:html},smalltalk.Browser)})},
  2132. messageSends: ["class:", "ul", "updateTabsList"]}),
  2133. smalltalk.Browser);
  2134. smalltalk.addMethod(
  2135. smalltalk.method({
  2136. selector: "renderTopPanelOn:",
  2137. fn: function (html){
  2138. var self=this;
  2139. function $ClassesList(){return smalltalk.ClassesList||(typeof ClassesList=="undefined"?nil:ClassesList)}
  2140. return smalltalk.withContext(function($ctx1) {
  2141. var $1,$3,$5,$6,$7,$8,$9,$10,$4,$11,$12,$2;
  2142. $1=_st(html)._div();
  2143. _st($1)._class_("top");
  2144. $2=_st($1)._with_((function(){
  2145. return smalltalk.withContext(function($ctx2) {
  2146. self["@packagesList"]=_st(_st(html)._ul())._class_("amber_column browser packages");
  2147. self["@packagesList"];
  2148. $3=_st(html)._div();
  2149. _st($3)._class_("amber_packagesButtons");
  2150. $4=_st($3)._with_((function(){
  2151. return smalltalk.withContext(function($ctx3) {
  2152. $5=_st(html)._button();
  2153. _st($5)._title_("Commit classes in this package to disk");
  2154. _st($5)._onClick_((function(){
  2155. return smalltalk.withContext(function($ctx4) {
  2156. return self._commitPackage();
  2157. }, function($ctx4) {$ctx4.fillBlock({},$ctx3)})}));
  2158. $6=_st($5)._with_("Commit");
  2159. $6;
  2160. $7=_st(html)._button();
  2161. _st($7)._title_("Rename package");
  2162. _st($7)._onClick_((function(){
  2163. return smalltalk.withContext(function($ctx4) {
  2164. return self._renamePackage();
  2165. }, function($ctx4) {$ctx4.fillBlock({},$ctx3)})}));
  2166. $8=_st($7)._with_("Rename");
  2167. $8;
  2168. $9=_st(html)._button();
  2169. _st($9)._title_("Remove this package from the system");
  2170. _st($9)._onClick_((function(){
  2171. return smalltalk.withContext(function($ctx4) {
  2172. return self._removePackage();
  2173. }, function($ctx4) {$ctx4.fillBlock({},$ctx3)})}));
  2174. $10=_st($9)._with_("Remove");
  2175. return $10;
  2176. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  2177. $4;
  2178. self["@classesList"]=_st($ClassesList())._on_(self);
  2179. self["@classesList"];
  2180. _st(self["@classesList"])._renderOn_(html);
  2181. self["@protocolsList"]=_st(_st(html)._ul())._class_("amber_column browser protocols");
  2182. self["@protocolsList"];
  2183. self["@methodsList"]=_st(_st(html)._ul())._class_("amber_column browser methods");
  2184. self["@methodsList"];
  2185. $11=self;
  2186. _st($11)._updateCategoriesList();
  2187. _st($11)._updateClassesList();
  2188. _st($11)._updateProtocolsList();
  2189. $12=_st($11)._updateMethodsList();
  2190. $12;
  2191. return _st(_st(html)._div())._class_("amber_clear");
  2192. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2193. return self}, function($ctx1) {$ctx1.fill(self,"renderTopPanelOn:",{html:html},smalltalk.Browser)})},
  2194. messageSends: ["class:", "div", "with:", "ul", "title:", "button", "onClick:", "commitPackage", "renamePackage", "removePackage", "on:", "renderOn:", "updateCategoriesList", "updateClassesList", "updateProtocolsList", "updateMethodsList"]}),
  2195. smalltalk.Browser);
  2196. smalltalk.addMethod(
  2197. smalltalk.method({
  2198. selector: "resetClassesList",
  2199. fn: function (){
  2200. var self=this;
  2201. return smalltalk.withContext(function($ctx1) {
  2202. _st(self["@classesList"])._resetNodes();
  2203. return self}, function($ctx1) {$ctx1.fill(self,"resetClassesList",{},smalltalk.Browser)})},
  2204. messageSends: ["resetNodes"]}),
  2205. smalltalk.Browser);
  2206. smalltalk.addMethod(
  2207. smalltalk.method({
  2208. selector: "search:",
  2209. fn: function (aString){
  2210. var self=this;
  2211. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  2212. return smalltalk.withContext(function($ctx1) {
  2213. var $1,$2;
  2214. $1=self._cancelChanges();
  2215. if(smalltalk.assert($1)){
  2216. var searchedClass;
  2217. searchedClass=_st(_st($Smalltalk())._current())._at_(aString);
  2218. searchedClass;
  2219. $2=_st(searchedClass)._isClass();
  2220. if(smalltalk.assert($2)){
  2221. _st(self._class())._openOn_(searchedClass);
  2222. } else {
  2223. self._searchReferencesOf_(aString);
  2224. };
  2225. };
  2226. return self}, function($ctx1) {$ctx1.fill(self,"search:",{aString:aString},smalltalk.Browser)})},
  2227. messageSends: ["ifTrue:", "at:", "current", "ifTrue:ifFalse:", "openOn:", "class", "searchReferencesOf:", "isClass", "cancelChanges"]}),
  2228. smalltalk.Browser);
  2229. smalltalk.addMethod(
  2230. smalltalk.method({
  2231. selector: "searchClassReferences",
  2232. fn: function (){
  2233. var self=this;
  2234. function $ReferencesBrowser(){return smalltalk.ReferencesBrowser||(typeof ReferencesBrowser=="undefined"?nil:ReferencesBrowser)}
  2235. return smalltalk.withContext(function($ctx1) {
  2236. _st($ReferencesBrowser())._search_(_st(self["@selectedClass"])._name());
  2237. return self}, function($ctx1) {$ctx1.fill(self,"searchClassReferences",{},smalltalk.Browser)})},
  2238. messageSends: ["search:", "name"]}),
  2239. smalltalk.Browser);
  2240. smalltalk.addMethod(
  2241. smalltalk.method({
  2242. selector: "searchReferencesOf:",
  2243. fn: function (aString){
  2244. var self=this;
  2245. function $ReferencesBrowser(){return smalltalk.ReferencesBrowser||(typeof ReferencesBrowser=="undefined"?nil:ReferencesBrowser)}
  2246. return smalltalk.withContext(function($ctx1) {
  2247. _st($ReferencesBrowser())._search_(aString);
  2248. return self}, function($ctx1) {$ctx1.fill(self,"searchReferencesOf:",{aString:aString},smalltalk.Browser)})},
  2249. messageSends: ["search:"]}),
  2250. smalltalk.Browser);
  2251. smalltalk.addMethod(
  2252. smalltalk.method({
  2253. selector: "selectCategory:",
  2254. fn: function (aCategory){
  2255. var self=this;
  2256. return smalltalk.withContext(function($ctx1) {
  2257. var $1,$2,$3;
  2258. $1=self._cancelChanges();
  2259. if(smalltalk.assert($1)){
  2260. self["@selectedPackage"]=aCategory;
  2261. self["@selectedPackage"];
  2262. self["@selectedMethod"]=nil;
  2263. self["@selectedProtocol"]=self["@selectedMethod"];
  2264. self["@selectedClass"]=self["@selectedProtocol"];
  2265. self["@selectedClass"];
  2266. self._resetClassesList();
  2267. $2=self;
  2268. _st($2)._updateCategoriesList();
  2269. _st($2)._updateClassesList();
  2270. _st($2)._updateProtocolsList();
  2271. _st($2)._updateMethodsList();
  2272. $3=_st($2)._updateSourceAndButtons();
  2273. $3;
  2274. };
  2275. return self}, function($ctx1) {$ctx1.fill(self,"selectCategory:",{aCategory:aCategory},smalltalk.Browser)})},
  2276. messageSends: ["ifTrue:", "resetClassesList", "updateCategoriesList", "updateClassesList", "updateProtocolsList", "updateMethodsList", "updateSourceAndButtons", "cancelChanges"]}),
  2277. smalltalk.Browser);
  2278. smalltalk.addMethod(
  2279. smalltalk.method({
  2280. selector: "selectClass:",
  2281. fn: function (aClass){
  2282. var self=this;
  2283. return smalltalk.withContext(function($ctx1) {
  2284. var $1,$2,$3;
  2285. $1=self._cancelChanges();
  2286. if(smalltalk.assert($1)){
  2287. self["@selectedClass"]=aClass;
  2288. self["@selectedClass"];
  2289. self["@selectedMethod"]=nil;
  2290. self["@selectedProtocol"]=self["@selectedMethod"];
  2291. self["@selectedProtocol"];
  2292. $2=self;
  2293. _st($2)._updateClassesList();
  2294. _st($2)._updateProtocolsList();
  2295. _st($2)._updateMethodsList();
  2296. $3=_st($2)._updateSourceAndButtons();
  2297. $3;
  2298. };
  2299. return self}, function($ctx1) {$ctx1.fill(self,"selectClass:",{aClass:aClass},smalltalk.Browser)})},
  2300. messageSends: ["ifTrue:", "updateClassesList", "updateProtocolsList", "updateMethodsList", "updateSourceAndButtons", "cancelChanges"]}),
  2301. smalltalk.Browser);
  2302. smalltalk.addMethod(
  2303. smalltalk.method({
  2304. selector: "selectMethod:",
  2305. fn: function (aMethod){
  2306. var self=this;
  2307. return smalltalk.withContext(function($ctx1) {
  2308. var $1,$2,$3;
  2309. $1=self._cancelChanges();
  2310. if(smalltalk.assert($1)){
  2311. self["@selectedMethod"]=aMethod;
  2312. self["@selectedMethod"];
  2313. $2=self;
  2314. _st($2)._updateProtocolsList();
  2315. _st($2)._updateMethodsList();
  2316. $3=_st($2)._updateSourceAndButtons();
  2317. $3;
  2318. };
  2319. return self}, function($ctx1) {$ctx1.fill(self,"selectMethod:",{aMethod:aMethod},smalltalk.Browser)})},
  2320. messageSends: ["ifTrue:", "updateProtocolsList", "updateMethodsList", "updateSourceAndButtons", "cancelChanges"]}),
  2321. smalltalk.Browser);
  2322. smalltalk.addMethod(
  2323. smalltalk.method({
  2324. selector: "selectProtocol:",
  2325. fn: function (aString){
  2326. var self=this;
  2327. return smalltalk.withContext(function($ctx1) {
  2328. var $1,$2,$3;
  2329. $1=self._cancelChanges();
  2330. if(smalltalk.assert($1)){
  2331. self["@selectedProtocol"]=aString;
  2332. self["@selectedProtocol"];
  2333. self["@selectedMethod"]=nil;
  2334. self["@selectedMethod"];
  2335. $2=self;
  2336. _st($2)._updateProtocolsList();
  2337. _st($2)._updateMethodsList();
  2338. $3=_st($2)._updateSourceAndButtons();
  2339. $3;
  2340. };
  2341. return self}, function($ctx1) {$ctx1.fill(self,"selectProtocol:",{aString:aString},smalltalk.Browser)})},
  2342. messageSends: ["ifTrue:", "updateProtocolsList", "updateMethodsList", "updateSourceAndButtons", "cancelChanges"]}),
  2343. smalltalk.Browser);
  2344. smalltalk.addMethod(
  2345. smalltalk.method({
  2346. selector: "selectTab:",
  2347. fn: function (aString){
  2348. var self=this;
  2349. return smalltalk.withContext(function($ctx1) {
  2350. var $1;
  2351. $1=self._cancelChanges();
  2352. if(smalltalk.assert($1)){
  2353. self["@selectedTab"]=aString;
  2354. self["@selectedTab"];
  2355. self._selectProtocol_(nil);
  2356. self._updateTabsList();
  2357. };
  2358. return self}, function($ctx1) {$ctx1.fill(self,"selectTab:",{aString:aString},smalltalk.Browser)})},
  2359. messageSends: ["ifTrue:", "selectProtocol:", "updateTabsList", "cancelChanges"]}),
  2360. smalltalk.Browser);
  2361. smalltalk.addMethod(
  2362. smalltalk.method({
  2363. selector: "selectedClass",
  2364. fn: function (){
  2365. var self=this;
  2366. return smalltalk.withContext(function($ctx1) {
  2367. var $1;
  2368. $1=self["@selectedClass"];
  2369. return $1;
  2370. }, function($ctx1) {$ctx1.fill(self,"selectedClass",{},smalltalk.Browser)})},
  2371. messageSends: []}),
  2372. smalltalk.Browser);
  2373. smalltalk.addMethod(
  2374. smalltalk.method({
  2375. selector: "selectedPackage",
  2376. fn: function (){
  2377. var self=this;
  2378. return smalltalk.withContext(function($ctx1) {
  2379. var $1;
  2380. $1=self["@selectedPackage"];
  2381. return $1;
  2382. }, function($ctx1) {$ctx1.fill(self,"selectedPackage",{},smalltalk.Browser)})},
  2383. messageSends: []}),
  2384. smalltalk.Browser);
  2385. smalltalk.addMethod(
  2386. smalltalk.method({
  2387. selector: "setMethodProtocol:",
  2388. fn: function (aString){
  2389. var self=this;
  2390. return smalltalk.withContext(function($ctx1) {
  2391. var $1,$2,$3,$4;
  2392. $1=self._cancelChanges();
  2393. if(smalltalk.assert($1)){
  2394. $2=_st(self._protocols())._includes_(aString);
  2395. if(smalltalk.assert($2)){
  2396. _st(self["@selectedMethod"])._category_(aString);
  2397. self["@selectedProtocol"]=aString;
  2398. self["@selectedProtocol"];
  2399. self["@selectedMethod"]=self["@selectedMethod"];
  2400. self["@selectedMethod"];
  2401. $3=self;
  2402. _st($3)._updateProtocolsList();
  2403. _st($3)._updateMethodsList();
  2404. $4=_st($3)._updateSourceAndButtons();
  2405. $4;
  2406. } else {
  2407. self._addNewProtocol();
  2408. };
  2409. };
  2410. return self}, function($ctx1) {$ctx1.fill(self,"setMethodProtocol:",{aString:aString},smalltalk.Browser)})},
  2411. messageSends: ["ifTrue:", "ifFalse:ifTrue:", "addNewProtocol", "category:", "updateProtocolsList", "updateMethodsList", "updateSourceAndButtons", "includes:", "protocols", "cancelChanges"]}),
  2412. smalltalk.Browser);
  2413. smalltalk.addMethod(
  2414. smalltalk.method({
  2415. selector: "showClassButtons",
  2416. fn: function (){
  2417. var self=this;
  2418. return smalltalk.withContext(function($ctx1) {
  2419. _st(_st(self["@classButtons"])._asJQuery())._show();
  2420. return self}, function($ctx1) {$ctx1.fill(self,"showClassButtons",{},smalltalk.Browser)})},
  2421. messageSends: ["show", "asJQuery"]}),
  2422. smalltalk.Browser);
  2423. smalltalk.addMethod(
  2424. smalltalk.method({
  2425. selector: "showMethodButtons",
  2426. fn: function (){
  2427. var self=this;
  2428. return smalltalk.withContext(function($ctx1) {
  2429. _st(_st(self["@methodButtons"])._asJQuery())._show();
  2430. return self}, function($ctx1) {$ctx1.fill(self,"showMethodButtons",{},smalltalk.Browser)})},
  2431. messageSends: ["show", "asJQuery"]}),
  2432. smalltalk.Browser);
  2433. smalltalk.addMethod(
  2434. smalltalk.method({
  2435. selector: "source",
  2436. fn: function (){
  2437. var self=this;
  2438. return smalltalk.withContext(function($ctx1) {
  2439. var $1,$3,$2,$5,$4;
  2440. $1=_st(self["@selectedTab"]).__eq("comment");
  2441. if(! smalltalk.assert($1)){
  2442. $3=_st(_st(self["@selectedProtocol"])._notNil())._or_((function(){
  2443. return smalltalk.withContext(function($ctx2) {
  2444. return _st(self["@selectedMethod"])._notNil();
  2445. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2446. if(smalltalk.assert($3)){
  2447. $2=self._methodSource();
  2448. } else {
  2449. $2=self._declarationSource();
  2450. };
  2451. return $2;
  2452. };
  2453. $5=self["@selectedClass"];
  2454. if(($receiver = $5) == nil || $receiver == undefined){
  2455. $4="";
  2456. } else {
  2457. $4=self._classCommentSource();
  2458. };
  2459. return $4;
  2460. }, function($ctx1) {$ctx1.fill(self,"source",{},smalltalk.Browser)})},
  2461. messageSends: ["ifFalse:", "ifFalse:ifTrue:", "declarationSource", "methodSource", "or:", "notNil", "=", "ifNil:ifNotNil:", "classCommentSource"]}),
  2462. smalltalk.Browser);
  2463. smalltalk.addMethod(
  2464. smalltalk.method({
  2465. selector: "updateCategoriesList",
  2466. fn: function (){
  2467. var self=this;
  2468. return smalltalk.withContext(function($ctx1) {
  2469. var $1,$2,$3,$4;
  2470. _st(self["@packagesList"])._contents_((function(html){
  2471. return smalltalk.withContext(function($ctx2) {
  2472. return _st(self._packages())._do_((function(each){
  2473. var li,label;
  2474. return smalltalk.withContext(function($ctx3) {
  2475. $1=_st(each)._isEmpty();
  2476. if(smalltalk.assert($1)){
  2477. label="Unclassified";
  2478. label;
  2479. } else {
  2480. label=each;
  2481. label;
  2482. };
  2483. li=_st(html)._li();
  2484. li;
  2485. $2=_st(self["@selectedPackage"]).__eq(each);
  2486. if(smalltalk.assert($2)){
  2487. _st(li)._class_("selected");
  2488. };
  2489. $3=li;
  2490. _st($3)._with_(label);
  2491. $4=_st($3)._onClick_((function(){
  2492. return smalltalk.withContext(function($ctx4) {
  2493. return self._selectCategory_(each);
  2494. }, function($ctx4) {$ctx4.fillBlock({},$ctx3)})}));
  2495. return $4;
  2496. }, function($ctx3) {$ctx3.fillBlock({each:each,li:li,label:label},$ctx2)})}));
  2497. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}));
  2498. return self}, function($ctx1) {$ctx1.fill(self,"updateCategoriesList",{},smalltalk.Browser)})},
  2499. messageSends: ["contents:", "do:", "ifTrue:ifFalse:", "isEmpty", "li", "ifTrue:", "class:", "=", "with:", "onClick:", "selectCategory:", "packages"]}),
  2500. smalltalk.Browser);
  2501. smalltalk.addMethod(
  2502. smalltalk.method({
  2503. selector: "updateClassesList",
  2504. fn: function (){
  2505. var self=this;
  2506. function $TabManager(){return smalltalk.TabManager||(typeof TabManager=="undefined"?nil:TabManager)}
  2507. return smalltalk.withContext(function($ctx1) {
  2508. _st(_st($TabManager())._current())._update();
  2509. _st(self["@classesList"])._updateNodes();
  2510. return self}, function($ctx1) {$ctx1.fill(self,"updateClassesList",{},smalltalk.Browser)})},
  2511. messageSends: ["update", "current", "updateNodes"]}),
  2512. smalltalk.Browser);
  2513. smalltalk.addMethod(
  2514. smalltalk.method({
  2515. selector: "updateMethodsList",
  2516. fn: function (){
  2517. var self=this;
  2518. return smalltalk.withContext(function($ctx1) {
  2519. var $1,$2,$3;
  2520. _st(self["@methodsList"])._contents_((function(html){
  2521. return smalltalk.withContext(function($ctx2) {
  2522. return _st(self._methods())._do_((function(each){
  2523. var li;
  2524. return smalltalk.withContext(function($ctx3) {
  2525. li=_st(html)._li();
  2526. li;
  2527. $1=_st(self["@selectedMethod"]).__eq(each);
  2528. if(smalltalk.assert($1)){
  2529. _st(li)._class_("selected");
  2530. };
  2531. $2=li;
  2532. _st($2)._with_(_st(each)._selector());
  2533. $3=_st($2)._onClick_((function(){
  2534. return smalltalk.withContext(function($ctx4) {
  2535. return self._selectMethod_(each);
  2536. }, function($ctx4) {$ctx4.fillBlock({},$ctx3)})}));
  2537. return $3;
  2538. }, function($ctx3) {$ctx3.fillBlock({each:each,li:li},$ctx2)})}));
  2539. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}));
  2540. return self}, function($ctx1) {$ctx1.fill(self,"updateMethodsList",{},smalltalk.Browser)})},
  2541. messageSends: ["contents:", "do:", "li", "ifTrue:", "class:", "=", "with:", "selector", "onClick:", "selectMethod:", "methods"]}),
  2542. smalltalk.Browser);
  2543. smalltalk.addMethod(
  2544. smalltalk.method({
  2545. selector: "updateProtocolsList",
  2546. fn: function (){
  2547. var self=this;
  2548. return smalltalk.withContext(function($ctx1) {
  2549. var $1,$2,$3;
  2550. _st(self["@protocolsList"])._contents_((function(html){
  2551. return smalltalk.withContext(function($ctx2) {
  2552. return _st(self._protocols())._do_((function(each){
  2553. var li;
  2554. return smalltalk.withContext(function($ctx3) {
  2555. li=_st(html)._li();
  2556. li;
  2557. $1=_st(self["@selectedProtocol"]).__eq(each);
  2558. if(smalltalk.assert($1)){
  2559. _st(li)._class_("selected");
  2560. };
  2561. $2=li;
  2562. _st($2)._with_(each);
  2563. $3=_st($2)._onClick_((function(){
  2564. return smalltalk.withContext(function($ctx4) {
  2565. return self._selectProtocol_(each);
  2566. }, function($ctx4) {$ctx4.fillBlock({},$ctx3)})}));
  2567. return $3;
  2568. }, function($ctx3) {$ctx3.fillBlock({each:each,li:li},$ctx2)})}));
  2569. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}));
  2570. return self}, function($ctx1) {$ctx1.fill(self,"updateProtocolsList",{},smalltalk.Browser)})},
  2571. messageSends: ["contents:", "do:", "li", "ifTrue:", "class:", "=", "with:", "onClick:", "selectProtocol:", "protocols"]}),
  2572. smalltalk.Browser);
  2573. smalltalk.addMethod(
  2574. smalltalk.method({
  2575. selector: "updateSourceAndButtons",
  2576. fn: function (){
  2577. var self=this;
  2578. var currentProtocol;
  2579. return smalltalk.withContext(function($ctx1) {
  2580. var $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$15,$16,$17,$18,$19,$20,$14,$21,$22,$24,$25,$26,$27,$23,$28,$29;
  2581. self._disableSaveButton();
  2582. _st(self["@classButtons"])._contents_((function(html){
  2583. return smalltalk.withContext(function($ctx2) {
  2584. $1=_st(html)._button();
  2585. _st($1)._title_("Create a new class");
  2586. _st($1)._onClick_((function(){
  2587. return smalltalk.withContext(function($ctx3) {
  2588. return self._addNewClass();
  2589. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  2590. $2=_st($1)._with_("New class");
  2591. $2;
  2592. $3=_st(html)._button();
  2593. _st($3)._with_("Rename class");
  2594. $4=_st($3)._onClick_((function(){
  2595. return smalltalk.withContext(function($ctx3) {
  2596. return self._renameClass();
  2597. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  2598. $4;
  2599. $5=_st(html)._button();
  2600. _st($5)._with_("Copy class");
  2601. $6=_st($5)._onClick_((function(){
  2602. return smalltalk.withContext(function($ctx3) {
  2603. return self._copyClass();
  2604. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  2605. $6;
  2606. $7=_st(html)._button();
  2607. _st($7)._with_("Remove class");
  2608. $8=_st($7)._onClick_((function(){
  2609. return smalltalk.withContext(function($ctx3) {
  2610. return self._removeClass();
  2611. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  2612. $8;
  2613. $9=_st(html)._button();
  2614. _st($9)._with_("References");
  2615. $10=_st($9)._onClick_((function(){
  2616. return smalltalk.withContext(function($ctx3) {
  2617. return self._searchClassReferences();
  2618. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  2619. return $10;
  2620. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}));
  2621. _st(self["@methodButtons"])._contents_((function(html){
  2622. var protocolSelect,referencesSelect;
  2623. return smalltalk.withContext(function($ctx2) {
  2624. $11=_st(html)._button();
  2625. _st($11)._with_("Remove method");
  2626. $12=_st($11)._onClick_((function(){
  2627. return smalltalk.withContext(function($ctx3) {
  2628. return self._removeMethod();
  2629. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  2630. $12;
  2631. protocolSelect=_st(html)._select();
  2632. protocolSelect;
  2633. $13=protocolSelect;
  2634. _st($13)._onChange_((function(){
  2635. return smalltalk.withContext(function($ctx3) {
  2636. return self._setMethodProtocol_(_st(_st(protocolSelect)._asJQuery())._val());
  2637. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  2638. $14=_st($13)._with_((function(){
  2639. return smalltalk.withContext(function($ctx3) {
  2640. $15=_st(html)._option();
  2641. _st($15)._with_("Method protocol");
  2642. $16=_st($15)._at_put_("disabled","disabled");
  2643. $16;
  2644. $17=_st(html)._option();
  2645. _st($17)._class_("important");
  2646. $18=_st($17)._with_("New...");
  2647. $18;
  2648. currentProtocol=self["@selectedProtocol"];
  2649. currentProtocol;
  2650. $19=_st(_st(currentProtocol)._isNil())._and_((function(){
  2651. return smalltalk.withContext(function($ctx4) {
  2652. return _st(self["@selectedMethod"])._notNil();
  2653. }, function($ctx4) {$ctx4.fillBlock({},$ctx3)})}));
  2654. if(smalltalk.assert($19)){
  2655. currentProtocol=_st(self["@selectedMethod"])._category();
  2656. currentProtocol;
  2657. };
  2658. return _st(self._protocols())._do_((function(each){
  2659. var option;
  2660. return smalltalk.withContext(function($ctx4) {
  2661. option=_st(_st(html)._option())._with_(each);
  2662. option;
  2663. $20=_st(currentProtocol).__eq(each);
  2664. if(smalltalk.assert($20)){
  2665. return _st(option)._at_put_("selected","selected");
  2666. };
  2667. }, function($ctx4) {$ctx4.fillBlock({each:each,option:option},$ctx3)})}));
  2668. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  2669. $14;
  2670. $21=_st(self["@selectedMethod"])._isNil();
  2671. if(! smalltalk.assert($21)){
  2672. referencesSelect=_st(html)._select();
  2673. referencesSelect;
  2674. $22=referencesSelect;
  2675. _st($22)._onChange_((function(){
  2676. return smalltalk.withContext(function($ctx3) {
  2677. return self._searchReferencesOf_(_st(_st(referencesSelect)._asJQuery())._val());
  2678. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  2679. $23=_st($22)._with_((function(){
  2680. var option;
  2681. return smalltalk.withContext(function($ctx3) {
  2682. $24=_st(html)._option();
  2683. _st($24)._with_("References");
  2684. _st($24)._at_put_("disabled","disabled");
  2685. $25=_st($24)._at_put_("selected","selected");
  2686. $25;
  2687. $26=_st(html)._option();
  2688. _st($26)._class_("important");
  2689. $27=_st($26)._with_(_st(self["@selectedMethod"])._selector());
  2690. $27;
  2691. return _st(_st(_st(self["@selectedMethod"])._messageSends())._sorted())._do_((function(each){
  2692. return smalltalk.withContext(function($ctx4) {
  2693. return _st(_st(html)._option())._with_(each);
  2694. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx3)})}));
  2695. }, function($ctx3) {$ctx3.fillBlock({option:option},$ctx2)})}));
  2696. return $23;
  2697. };
  2698. }, function($ctx2) {$ctx2.fillBlock({html:html,protocolSelect:protocolSelect,referencesSelect:referencesSelect},$ctx1)})}));
  2699. $28=_st(self["@selectedMethod"])._isNil();
  2700. if(smalltalk.assert($28)){
  2701. self._hideMethodButtons();
  2702. $29=_st(_st(self["@selectedClass"])._isNil())._or_((function(){
  2703. return smalltalk.withContext(function($ctx2) {
  2704. return _st(self["@selectedProtocol"])._notNil();
  2705. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2706. if(smalltalk.assert($29)){
  2707. self._hideClassButtons();
  2708. } else {
  2709. self._showClassButtons();
  2710. };
  2711. } else {
  2712. self._hideClassButtons();
  2713. self._showMethodButtons();
  2714. };
  2715. _st(self["@sourceArea"])._val_(self._source());
  2716. return self}, function($ctx1) {$ctx1.fill(self,"updateSourceAndButtons",{currentProtocol:currentProtocol},smalltalk.Browser)})},
  2717. messageSends: ["disableSaveButton", "contents:", "title:", "button", "onClick:", "addNewClass", "with:", "renameClass", "copyClass", "removeClass", "searchClassReferences", "removeMethod", "select", "onChange:", "setMethodProtocol:", "val", "asJQuery", "option", "at:put:", "class:", "ifTrue:", "category", "and:", "notNil", "isNil", "do:", "=", "protocols", "ifFalse:", "searchReferencesOf:", "selector", "sorted", "messageSends", "ifTrue:ifFalse:", "hideMethodButtons", "hideClassButtons", "showClassButtons", "or:", "showMethodButtons", "val:", "source"]}),
  2718. smalltalk.Browser);
  2719. smalltalk.addMethod(
  2720. smalltalk.method({
  2721. selector: "updateStatus",
  2722. fn: function (){
  2723. var self=this;
  2724. return smalltalk.withContext(function($ctx1) {
  2725. var $1,$2,$3;
  2726. $1=_st(_st(self["@sourceArea"])._val()).__eq(self._source());
  2727. if(smalltalk.assert($1)){
  2728. $2=self["@saveButton"];
  2729. if(($receiver = $2) == nil || $receiver == undefined){
  2730. $2;
  2731. } else {
  2732. _st(self["@saveButton"])._at_put_("disabled",true);
  2733. };
  2734. self["@unsavedChanges"]=false;
  2735. self["@unsavedChanges"];
  2736. } else {
  2737. $3=self["@saveButton"];
  2738. if(($receiver = $3) == nil || $receiver == undefined){
  2739. $3;
  2740. } else {
  2741. _st(self["@saveButton"])._removeAt_("disabled");
  2742. };
  2743. self["@unsavedChanges"]=true;
  2744. self["@unsavedChanges"];
  2745. };
  2746. return self}, function($ctx1) {$ctx1.fill(self,"updateStatus",{},smalltalk.Browser)})},
  2747. messageSends: ["ifTrue:ifFalse:", "ifNotNil:", "at:put:", "removeAt:", "=", "source", "val"]}),
  2748. smalltalk.Browser);
  2749. smalltalk.addMethod(
  2750. smalltalk.method({
  2751. selector: "updateTabsList",
  2752. fn: function (){
  2753. var self=this;
  2754. return smalltalk.withContext(function($ctx1) {
  2755. var $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15;
  2756. _st(self["@tabsList"])._contents_((function(html){
  2757. var li;
  2758. return smalltalk.withContext(function($ctx2) {
  2759. li=_st(html)._li();
  2760. li;
  2761. $1=_st(self["@selectedTab"]).__eq("instance");
  2762. if(smalltalk.assert($1)){
  2763. _st(li)._class_("selected");
  2764. };
  2765. $2=li;
  2766. _st($2)._with_((function(){
  2767. return smalltalk.withContext(function($ctx3) {
  2768. _st(_st(html)._span())._class_("ltab");
  2769. $3=_st(html)._span();
  2770. _st($3)._class_("mtab");
  2771. $4=_st($3)._with_("Instance");
  2772. $4;
  2773. return _st(_st(html)._span())._class_("rtab");
  2774. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  2775. $5=_st($2)._onClick_((function(){
  2776. return smalltalk.withContext(function($ctx3) {
  2777. return self._selectTab_("instance");
  2778. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  2779. $5;
  2780. li=_st(html)._li();
  2781. li;
  2782. $6=_st(self["@selectedTab"]).__eq("class");
  2783. if(smalltalk.assert($6)){
  2784. _st(li)._class_("selected");
  2785. };
  2786. $7=li;
  2787. _st($7)._with_((function(){
  2788. return smalltalk.withContext(function($ctx3) {
  2789. _st(_st(html)._span())._class_("ltab");
  2790. $8=_st(html)._span();
  2791. _st($8)._class_("mtab");
  2792. $9=_st($8)._with_("Class");
  2793. $9;
  2794. return _st(_st(html)._span())._class_("rtab");
  2795. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  2796. $10=_st($7)._onClick_((function(){
  2797. return smalltalk.withContext(function($ctx3) {
  2798. return self._selectTab_("class");
  2799. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  2800. $10;
  2801. li=_st(html)._li();
  2802. li;
  2803. $11=_st(self["@selectedTab"]).__eq("comment");
  2804. if(smalltalk.assert($11)){
  2805. _st(li)._class_("selected");
  2806. };
  2807. $12=li;
  2808. _st($12)._with_((function(){
  2809. return smalltalk.withContext(function($ctx3) {
  2810. _st(_st(html)._span())._class_("ltab");
  2811. $13=_st(html)._span();
  2812. _st($13)._class_("mtab");
  2813. $14=_st($13)._with_("Comment");
  2814. $14;
  2815. return _st(_st(html)._span())._class_("rtab");
  2816. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  2817. $15=_st($12)._onClick_((function(){
  2818. return smalltalk.withContext(function($ctx3) {
  2819. return self._selectTab_("comment");
  2820. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  2821. return $15;
  2822. }, function($ctx2) {$ctx2.fillBlock({html:html,li:li},$ctx1)})}));
  2823. return self}, function($ctx1) {$ctx1.fill(self,"updateTabsList",{},smalltalk.Browser)})},
  2824. messageSends: ["contents:", "li", "ifTrue:", "class:", "=", "with:", "span", "onClick:", "selectTab:"]}),
  2825. smalltalk.Browser);
  2826. smalltalk.addMethod(
  2827. smalltalk.method({
  2828. selector: "open",
  2829. fn: function (){
  2830. var self=this;
  2831. return smalltalk.withContext(function($ctx1) {
  2832. _st(self._new())._open();
  2833. return self}, function($ctx1) {$ctx1.fill(self,"open",{},smalltalk.Browser.klass)})},
  2834. messageSends: ["open", "new"]}),
  2835. smalltalk.Browser.klass);
  2836. smalltalk.addMethod(
  2837. smalltalk.method({
  2838. selector: "openOn:",
  2839. fn: function (aClass){
  2840. var self=this;
  2841. return smalltalk.withContext(function($ctx1) {
  2842. var $2,$3,$1;
  2843. $2=self._new();
  2844. _st($2)._open();
  2845. _st($2)._selectCategory_(_st(aClass)._category());
  2846. $3=_st($2)._selectClass_(aClass);
  2847. $1=$3;
  2848. return $1;
  2849. }, function($ctx1) {$ctx1.fill(self,"openOn:",{aClass:aClass},smalltalk.Browser.klass)})},
  2850. messageSends: ["open", "new", "selectCategory:", "category", "selectClass:"]}),
  2851. smalltalk.Browser.klass);
  2852. smalltalk.addClass('Debugger', smalltalk.TabWidget, ['error', 'selectedContext', 'sourceArea', 'ul', 'ul2', 'inspector', 'saveButton', 'unsavedChanges', 'selectedVariable', 'selectedVariableName', 'inspectButton'], 'IDE');
  2853. smalltalk.addMethod(
  2854. smalltalk.method({
  2855. selector: "allVariables",
  2856. fn: function (){
  2857. var self=this;
  2858. var all;
  2859. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  2860. return smalltalk.withContext(function($ctx1) {
  2861. var $1;
  2862. all=_st($Dictionary())._new();
  2863. _st(_st(_st(self._receiver())._class())._allInstanceVariableNames())._do_((function(each){
  2864. return smalltalk.withContext(function($ctx2) {
  2865. return _st(all)._at_put_(each,_st(self._receiver())._instVarAt_(each));
  2866. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  2867. _st(_st(self["@selectedContext"])._locals())._keysAndValuesDo_((function(key,value){
  2868. return smalltalk.withContext(function($ctx2) {
  2869. return _st(all)._at_put_(key,value);
  2870. }, function($ctx2) {$ctx2.fillBlock({key:key,value:value},$ctx1)})}));
  2871. $1=all;
  2872. return $1;
  2873. }, function($ctx1) {$ctx1.fill(self,"allVariables",{all:all},smalltalk.Debugger)})},
  2874. messageSends: ["new", "do:", "at:put:", "instVarAt:", "receiver", "allInstanceVariableNames", "class", "keysAndValuesDo:", "locals"]}),
  2875. smalltalk.Debugger);
  2876. smalltalk.addMethod(
  2877. smalltalk.method({
  2878. selector: "canBeClosed",
  2879. fn: function (){
  2880. var self=this;
  2881. return smalltalk.withContext(function($ctx1) {
  2882. return true;
  2883. }, function($ctx1) {$ctx1.fill(self,"canBeClosed",{},smalltalk.Debugger)})},
  2884. messageSends: []}),
  2885. smalltalk.Debugger);
  2886. smalltalk.addMethod(
  2887. smalltalk.method({
  2888. selector: "error",
  2889. fn: function (){
  2890. var self=this;
  2891. return smalltalk.withContext(function($ctx1) {
  2892. var $1;
  2893. $1=self["@error"];
  2894. return $1;
  2895. }, function($ctx1) {$ctx1.fill(self,"error",{},smalltalk.Debugger)})},
  2896. messageSends: []}),
  2897. smalltalk.Debugger);
  2898. smalltalk.addMethod(
  2899. smalltalk.method({
  2900. selector: "error:",
  2901. fn: function (anError){
  2902. var self=this;
  2903. return smalltalk.withContext(function($ctx1) {
  2904. self["@error"]=anError;
  2905. return self}, function($ctx1) {$ctx1.fill(self,"error:",{anError:anError},smalltalk.Debugger)})},
  2906. messageSends: []}),
  2907. smalltalk.Debugger);
  2908. smalltalk.addMethod(
  2909. smalltalk.method({
  2910. selector: "initialize",
  2911. fn: function (){
  2912. var self=this;
  2913. return smalltalk.withContext(function($ctx1) {
  2914. smalltalk.Debugger.superclass.fn.prototype._initialize.apply(_st(self), []);
  2915. _st(self["@unsavedChanges"]).__eq(false);
  2916. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.Debugger)})},
  2917. messageSends: ["initialize", "="]}),
  2918. smalltalk.Debugger);
  2919. smalltalk.addMethod(
  2920. smalltalk.method({
  2921. selector: "inspectSelectedVariable",
  2922. fn: function (){
  2923. var self=this;
  2924. return smalltalk.withContext(function($ctx1) {
  2925. _st(self["@selectedVariable"])._inspect();
  2926. return self}, function($ctx1) {$ctx1.fill(self,"inspectSelectedVariable",{},smalltalk.Debugger)})},
  2927. messageSends: ["inspect"]}),
  2928. smalltalk.Debugger);
  2929. smalltalk.addMethod(
  2930. smalltalk.method({
  2931. selector: "label",
  2932. fn: function (){
  2933. var self=this;
  2934. return smalltalk.withContext(function($ctx1) {
  2935. return "[Debugger]";
  2936. }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.Debugger)})},
  2937. messageSends: []}),
  2938. smalltalk.Debugger);
  2939. smalltalk.addMethod(
  2940. smalltalk.method({
  2941. selector: "method",
  2942. fn: function (){
  2943. var self=this;
  2944. return smalltalk.withContext(function($ctx1) {
  2945. var $1;
  2946. $1=_st(self["@selectedContext"])._method();
  2947. return $1;
  2948. }, function($ctx1) {$ctx1.fill(self,"method",{},smalltalk.Debugger)})},
  2949. messageSends: ["method"]}),
  2950. smalltalk.Debugger);
  2951. smalltalk.addMethod(
  2952. smalltalk.method({
  2953. selector: "proceed",
  2954. fn: function (){
  2955. var self=this;
  2956. return smalltalk.withContext(function($ctx1) {
  2957. self._close();
  2958. _st(_st(self["@selectedContext"])._receiver())._perform_withArguments_(_st(self["@selectedContext"])._selector(),_st(self["@selectedContext"])._temps());
  2959. return self}, function($ctx1) {$ctx1.fill(self,"proceed",{},smalltalk.Debugger)})},
  2960. messageSends: ["close", "perform:withArguments:", "selector", "temps", "receiver"]}),
  2961. smalltalk.Debugger);
  2962. smalltalk.addMethod(
  2963. smalltalk.method({
  2964. selector: "receiver",
  2965. fn: function (){
  2966. var self=this;
  2967. return smalltalk.withContext(function($ctx1) {
  2968. var $1;
  2969. $1=_st(self["@selectedContext"])._receiver();
  2970. return $1;
  2971. }, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.Debugger)})},
  2972. messageSends: ["receiver"]}),
  2973. smalltalk.Debugger);
  2974. smalltalk.addMethod(
  2975. smalltalk.method({
  2976. selector: "renderBottomPanelOn:",
  2977. fn: function (html){
  2978. var self=this;
  2979. function $SourceArea(){return smalltalk.SourceArea||(typeof SourceArea=="undefined"?nil:SourceArea)}
  2980. return smalltalk.withContext(function($ctx1) {
  2981. var $1,$2;
  2982. $1=_st(html)._div();
  2983. _st($1)._class_("amber_sourceCode debugger");
  2984. $2=_st($1)._with_((function(){
  2985. return smalltalk.withContext(function($ctx2) {
  2986. self["@sourceArea"]=_st($SourceArea())._new();
  2987. self["@sourceArea"];
  2988. return _st(self["@sourceArea"])._renderOn_(html);
  2989. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2990. self["@ul2"]=_st(_st(html)._ul())._class_("amber_column debugger variables");
  2991. self["@inspector"]=_st(_st(html)._div())._class_("amber_column debugger inspector");
  2992. _st(self["@sourceArea"])._onKeyUp_((function(){
  2993. return smalltalk.withContext(function($ctx2) {
  2994. return self._updateStatus();
  2995. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2996. return self}, function($ctx1) {$ctx1.fill(self,"renderBottomPanelOn:",{html:html},smalltalk.Debugger)})},
  2997. messageSends: ["class:", "div", "with:", "new", "renderOn:", "ul", "onKeyUp:", "updateStatus"]}),
  2998. smalltalk.Debugger);
  2999. smalltalk.addMethod(
  3000. smalltalk.method({
  3001. selector: "renderBoxOn:",
  3002. fn: function (html){
  3003. var self=this;
  3004. return smalltalk.withContext(function($ctx1) {
  3005. var $1,$2;
  3006. $1=self;
  3007. _st($1)._renderTopPanelOn_(html);
  3008. $2=_st($1)._renderBottomPanelOn_(html);
  3009. return self}, function($ctx1) {$ctx1.fill(self,"renderBoxOn:",{html:html},smalltalk.Debugger)})},
  3010. messageSends: ["renderTopPanelOn:", "renderBottomPanelOn:"]}),
  3011. smalltalk.Debugger);
  3012. smalltalk.addMethod(
  3013. smalltalk.method({
  3014. selector: "renderButtonsOn:",
  3015. fn: function (html){
  3016. var self=this;
  3017. return smalltalk.withContext(function($ctx1) {
  3018. var $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16;
  3019. $1=_st(html)._button();
  3020. _st($1)._with_("Save");
  3021. $2=_st($1)._onClick_((function(){
  3022. return smalltalk.withContext(function($ctx2) {
  3023. return self._save();
  3024. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3025. self["@saveButton"]=$2;
  3026. $3=_st(html)._button();
  3027. _st($3)._with_("DoIt");
  3028. $4=_st($3)._onClick_((function(){
  3029. return smalltalk.withContext(function($ctx2) {
  3030. return _st(self["@sourceArea"])._doIt();
  3031. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3032. $5=_st(html)._button();
  3033. _st($5)._with_("PrintIt");
  3034. $6=_st($5)._onClick_((function(){
  3035. return smalltalk.withContext(function($ctx2) {
  3036. return _st(self["@sourceArea"])._printIt();
  3037. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3038. $7=_st(html)._button();
  3039. _st($7)._with_("InspectIt");
  3040. $8=_st($7)._onClick_((function(){
  3041. return smalltalk.withContext(function($ctx2) {
  3042. return _st(self["@sourceArea"])._inspectIt();
  3043. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3044. $9=_st(html)._button();
  3045. _st($9)._with_("Proceed");
  3046. $10=_st($9)._onClick_((function(){
  3047. return smalltalk.withContext(function($ctx2) {
  3048. return self._proceed();
  3049. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3050. $11=_st(html)._button();
  3051. _st($11)._with_("Abandon");
  3052. $12=_st($11)._onClick_((function(){
  3053. return smalltalk.withContext(function($ctx2) {
  3054. return self._close();
  3055. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3056. $13=_st(html)._button();
  3057. _st($13)._class_("amber_button debugger inspect");
  3058. _st($13)._with_("Inspect");
  3059. $14=_st($13)._onClick_((function(){
  3060. return smalltalk.withContext(function($ctx2) {
  3061. return self._inspectSelectedVariable();
  3062. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3063. self["@inspectButton"]=$14;
  3064. $15=self;
  3065. _st($15)._updateSourceArea();
  3066. _st($15)._updateStatus();
  3067. _st($15)._updateVariablesList();
  3068. $16=_st($15)._updateInspector();
  3069. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},smalltalk.Debugger)})},
  3070. messageSends: ["with:", "button", "onClick:", "save", "doIt", "printIt", "inspectIt", "proceed", "close", "class:", "inspectSelectedVariable", "updateSourceArea", "updateStatus", "updateVariablesList", "updateInspector"]}),
  3071. smalltalk.Debugger);
  3072. smalltalk.addMethod(
  3073. smalltalk.method({
  3074. selector: "renderContext:on:",
  3075. fn: function (aContext,html){
  3076. var self=this;
  3077. var li;
  3078. return smalltalk.withContext(function($ctx1) {
  3079. var $1,$2,$3,$4;
  3080. li=_st(html)._li();
  3081. $1=_st(self["@selectedContext"]).__eq(aContext);
  3082. if(smalltalk.assert($1)){
  3083. _st(li)._class_("selected");
  3084. };
  3085. $2=li;
  3086. _st($2)._with_(_st(aContext)._asString());
  3087. $3=_st($2)._onClick_((function(){
  3088. return smalltalk.withContext(function($ctx2) {
  3089. return self._selectContext_(aContext);
  3090. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3091. $4=_st(aContext)._outerContext();
  3092. if(($receiver = $4) == nil || $receiver == undefined){
  3093. $4;
  3094. } else {
  3095. self._renderContext_on_(_st(aContext)._outerContext(),html);
  3096. };
  3097. return self}, function($ctx1) {$ctx1.fill(self,"renderContext:on:",{aContext:aContext,html:html,li:li},smalltalk.Debugger)})},
  3098. messageSends: ["li", "ifTrue:", "class:", "=", "with:", "asString", "onClick:", "selectContext:", "ifNotNil:", "renderContext:on:", "outerContext"]}),
  3099. smalltalk.Debugger);
  3100. smalltalk.addMethod(
  3101. smalltalk.method({
  3102. selector: "renderTopPanelOn:",
  3103. fn: function (html){
  3104. var self=this;
  3105. return smalltalk.withContext(function($ctx1) {
  3106. var $1,$3,$4,$5,$6,$2;
  3107. self["@selectedContext"]=_st(self._error())._context();
  3108. $1=_st(html)._div();
  3109. _st($1)._class_("top");
  3110. $2=_st($1)._with_((function(){
  3111. return smalltalk.withContext(function($ctx2) {
  3112. $3=_st(html)._div();
  3113. _st($3)._class_("label");
  3114. $4=_st($3)._with_(_st(self._error())._messageText());
  3115. $4;
  3116. $5=_st(html)._ul();
  3117. _st($5)._class_("amber_column debugger contexts");
  3118. $6=_st($5)._with_((function(){
  3119. return smalltalk.withContext(function($ctx3) {
  3120. return self._renderContext_on_(_st(self._error())._context(),html);
  3121. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  3122. self["@ul"]=$6;
  3123. return self["@ul"];
  3124. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3125. return self}, function($ctx1) {$ctx1.fill(self,"renderTopPanelOn:",{html:html},smalltalk.Debugger)})},
  3126. messageSends: ["context", "error", "class:", "div", "with:", "messageText", "ul", "renderContext:on:"]}),
  3127. smalltalk.Debugger);
  3128. smalltalk.addMethod(
  3129. smalltalk.method({
  3130. selector: "save",
  3131. fn: function (){
  3132. var self=this;
  3133. var protocol;
  3134. return smalltalk.withContext(function($ctx1) {
  3135. protocol=_st(_st(_st(_st(_st(self["@selectedContext"])._receiver())._class())._methodDictionary())._at_(_st(self["@selectedContext"])._selector()))._category();
  3136. _st(_st(_st(self["@selectedContext"])._receiver())._class())._compile_category_(_st(self["@sourceArea"])._val(),protocol);
  3137. self._updateStatus();
  3138. return self}, function($ctx1) {$ctx1.fill(self,"save",{protocol:protocol},smalltalk.Debugger)})},
  3139. messageSends: ["category", "at:", "selector", "methodDictionary", "class", "receiver", "compile:category:", "val", "updateStatus"]}),
  3140. smalltalk.Debugger);
  3141. smalltalk.addMethod(
  3142. smalltalk.method({
  3143. selector: "selectContext:",
  3144. fn: function (aContext){
  3145. var self=this;
  3146. return smalltalk.withContext(function($ctx1) {
  3147. var $1,$2;
  3148. self["@selectedContext"]=aContext;
  3149. self["@selectedVariable"]=nil;
  3150. self["@selectedVariableName"]=nil;
  3151. $1=self;
  3152. _st($1)._updateContextsList();
  3153. _st($1)._updateSourceArea();
  3154. _st($1)._updateInspector();
  3155. _st($1)._updateVariablesList();
  3156. $2=_st($1)._updateStatus();
  3157. return self}, function($ctx1) {$ctx1.fill(self,"selectContext:",{aContext:aContext},smalltalk.Debugger)})},
  3158. messageSends: ["updateContextsList", "updateSourceArea", "updateInspector", "updateVariablesList", "updateStatus"]}),
  3159. smalltalk.Debugger);
  3160. smalltalk.addMethod(
  3161. smalltalk.method({
  3162. selector: "selectVariable:named:",
  3163. fn: function (anObject,aString){
  3164. var self=this;
  3165. return smalltalk.withContext(function($ctx1) {
  3166. self["@selectedVariable"]=anObject;
  3167. self["@selectedVariableName"]=aString;
  3168. _st(self["@inspector"])._contents_((function(html){
  3169. return smalltalk.withContext(function($ctx2) {
  3170. return _st(html)._with_(_st(anObject)._printString());
  3171. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}));
  3172. self._updateVariablesList();
  3173. return self}, function($ctx1) {$ctx1.fill(self,"selectVariable:named:",{anObject:anObject,aString:aString},smalltalk.Debugger)})},
  3174. messageSends: ["contents:", "with:", "printString", "updateVariablesList"]}),
  3175. smalltalk.Debugger);
  3176. smalltalk.addMethod(
  3177. smalltalk.method({
  3178. selector: "source",
  3179. fn: function (){
  3180. var self=this;
  3181. return smalltalk.withContext(function($ctx1) {
  3182. var $2,$1;
  3183. $2=self._method();
  3184. if(($receiver = $2) == nil || $receiver == undefined){
  3185. $1="Method doesn't exist!";
  3186. } else {
  3187. $1=_st(self._method())._source();
  3188. };
  3189. return $1;
  3190. }, function($ctx1) {$ctx1.fill(self,"source",{},smalltalk.Debugger)})},
  3191. messageSends: ["ifNil:ifNotNil:", "source", "method"]}),
  3192. smalltalk.Debugger);
  3193. smalltalk.addMethod(
  3194. smalltalk.method({
  3195. selector: "updateContextsList",
  3196. fn: function (){
  3197. var self=this;
  3198. return smalltalk.withContext(function($ctx1) {
  3199. _st(self["@ul"])._contents_((function(html){
  3200. return smalltalk.withContext(function($ctx2) {
  3201. return self._renderContext_on_(_st(self._error())._context(),html);
  3202. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}));
  3203. return self}, function($ctx1) {$ctx1.fill(self,"updateContextsList",{},smalltalk.Debugger)})},
  3204. messageSends: ["contents:", "renderContext:on:", "context", "error"]}),
  3205. smalltalk.Debugger);
  3206. smalltalk.addMethod(
  3207. smalltalk.method({
  3208. selector: "updateInspector",
  3209. fn: function (){
  3210. var self=this;
  3211. return smalltalk.withContext(function($ctx1) {
  3212. _st(self["@inspector"])._contents_((function(html){
  3213. return smalltalk.withContext(function($ctx2) {
  3214. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}));
  3215. return self}, function($ctx1) {$ctx1.fill(self,"updateInspector",{},smalltalk.Debugger)})},
  3216. messageSends: ["contents:"]}),
  3217. smalltalk.Debugger);
  3218. smalltalk.addMethod(
  3219. smalltalk.method({
  3220. selector: "updateSourceArea",
  3221. fn: function (){
  3222. var self=this;
  3223. return smalltalk.withContext(function($ctx1) {
  3224. _st(self["@sourceArea"])._val_(self._source());
  3225. return self}, function($ctx1) {$ctx1.fill(self,"updateSourceArea",{},smalltalk.Debugger)})},
  3226. messageSends: ["val:", "source"]}),
  3227. smalltalk.Debugger);
  3228. smalltalk.addMethod(
  3229. smalltalk.method({
  3230. selector: "updateStatus",
  3231. fn: function (){
  3232. var self=this;
  3233. return smalltalk.withContext(function($ctx1) {
  3234. var $1,$2,$3;
  3235. $1=_st(_st(self["@sourceArea"])._val()).__eq(self._source());
  3236. if(smalltalk.assert($1)){
  3237. $2=self["@saveButton"];
  3238. if(($receiver = $2) == nil || $receiver == undefined){
  3239. $2;
  3240. } else {
  3241. _st(self["@saveButton"])._at_put_("disabled",true);
  3242. };
  3243. self["@unsavedChanges"]=false;
  3244. self["@unsavedChanges"];
  3245. } else {
  3246. $3=self["@saveButton"];
  3247. if(($receiver = $3) == nil || $receiver == undefined){
  3248. $3;
  3249. } else {
  3250. _st(self["@saveButton"])._removeAt_("disabled");
  3251. };
  3252. self["@unsavedChanges"]=true;
  3253. self["@unsavedChanges"];
  3254. };
  3255. return self}, function($ctx1) {$ctx1.fill(self,"updateStatus",{},smalltalk.Debugger)})},
  3256. messageSends: ["ifTrue:ifFalse:", "ifNotNil:", "at:put:", "removeAt:", "=", "source", "val"]}),
  3257. smalltalk.Debugger);
  3258. smalltalk.addMethod(
  3259. smalltalk.method({
  3260. selector: "updateVariablesList",
  3261. fn: function (){
  3262. var self=this;
  3263. return smalltalk.withContext(function($ctx1) {
  3264. var $1,$2,$3,$4,$5,$6,$7;
  3265. _st(self["@ul2"])._contents_((function(html){
  3266. var li;
  3267. return smalltalk.withContext(function($ctx2) {
  3268. $1=_st(html)._li();
  3269. _st($1)._with_("self");
  3270. $2=_st($1)._onClick_((function(){
  3271. return smalltalk.withContext(function($ctx3) {
  3272. return self._selectVariable_named_(self._receiver(),"self");
  3273. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  3274. li=$2;
  3275. li;
  3276. $3=_st(self["@selectedVariableName"]).__eq("self");
  3277. if(smalltalk.assert($3)){
  3278. _st(li)._class_("selected");
  3279. };
  3280. return _st(self._allVariables())._keysAndValuesDo_((function(key,value){
  3281. return smalltalk.withContext(function($ctx3) {
  3282. $4=_st(html)._li();
  3283. _st($4)._with_(key);
  3284. $5=_st($4)._onClick_((function(){
  3285. return smalltalk.withContext(function($ctx4) {
  3286. return self._selectVariable_named_(value,key);
  3287. }, function($ctx4) {$ctx4.fillBlock({},$ctx3)})}));
  3288. li=$5;
  3289. li;
  3290. $6=_st(self["@selectedVariableName"]).__eq(key);
  3291. if(smalltalk.assert($6)){
  3292. return _st(li)._class_("selected");
  3293. };
  3294. }, function($ctx3) {$ctx3.fillBlock({key:key,value:value},$ctx2)})}));
  3295. }, function($ctx2) {$ctx2.fillBlock({html:html,li:li},$ctx1)})}));
  3296. $7=self["@selectedVariable"];
  3297. if(($receiver = $7) == nil || $receiver == undefined){
  3298. _st(self["@inspectButton"])._at_put_("disabled",true);
  3299. } else {
  3300. _st(self["@inspectButton"])._removeAt_("disabled");
  3301. };
  3302. return self}, function($ctx1) {$ctx1.fill(self,"updateVariablesList",{},smalltalk.Debugger)})},
  3303. messageSends: ["contents:", "with:", "li", "onClick:", "selectVariable:named:", "receiver", "ifTrue:", "class:", "=", "keysAndValuesDo:", "allVariables", "ifNil:ifNotNil:", "at:put:", "removeAt:"]}),
  3304. smalltalk.Debugger);
  3305. smalltalk.addClass('IDETranscript', smalltalk.TabWidget, ['textarea'], 'IDE');
  3306. smalltalk.addMethod(
  3307. smalltalk.method({
  3308. selector: "clear",
  3309. fn: function (){
  3310. var self=this;
  3311. return smalltalk.withContext(function($ctx1) {
  3312. _st(_st(self["@textarea"])._asJQuery())._val_("");
  3313. return self}, function($ctx1) {$ctx1.fill(self,"clear",{},smalltalk.IDETranscript)})},
  3314. messageSends: ["val:", "asJQuery"]}),
  3315. smalltalk.IDETranscript);
  3316. smalltalk.addMethod(
  3317. smalltalk.method({
  3318. selector: "cr",
  3319. fn: function (){
  3320. var self=this;
  3321. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  3322. return smalltalk.withContext(function($ctx1) {
  3323. _st(_st(self["@textarea"])._asJQuery())._val_(_st(_st(_st(self["@textarea"])._asJQuery())._val()).__comma(_st($String())._cr()));
  3324. return self}, function($ctx1) {$ctx1.fill(self,"cr",{},smalltalk.IDETranscript)})},
  3325. messageSends: ["val:", ",", "cr", "val", "asJQuery"]}),
  3326. smalltalk.IDETranscript);
  3327. smalltalk.addMethod(
  3328. smalltalk.method({
  3329. selector: "label",
  3330. fn: function (){
  3331. var self=this;
  3332. return smalltalk.withContext(function($ctx1) {
  3333. return "Transcript";
  3334. }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.IDETranscript)})},
  3335. messageSends: []}),
  3336. smalltalk.IDETranscript);
  3337. smalltalk.addMethod(
  3338. smalltalk.method({
  3339. selector: "open",
  3340. fn: function (){
  3341. var self=this;
  3342. function $TabManager(){return smalltalk.TabManager||(typeof TabManager=="undefined"?nil:TabManager)}
  3343. return smalltalk.withContext(function($ctx1) {
  3344. var $1,$2;
  3345. $1=_st($TabManager())._current();
  3346. _st($1)._open();
  3347. $2=_st($1)._selectTab_(self);
  3348. return self}, function($ctx1) {$ctx1.fill(self,"open",{},smalltalk.IDETranscript)})},
  3349. messageSends: ["open", "current", "selectTab:"]}),
  3350. smalltalk.IDETranscript);
  3351. smalltalk.addMethod(
  3352. smalltalk.method({
  3353. selector: "renderBoxOn:",
  3354. fn: function (html){
  3355. var self=this;
  3356. return smalltalk.withContext(function($ctx1) {
  3357. var $1,$2;
  3358. self["@textarea"]=_st(html)._textarea();
  3359. $1=self["@textarea"];
  3360. _st($1)._class_("amber_transcript");
  3361. $2=_st($1)._at_put_("spellcheck","false");
  3362. return self}, function($ctx1) {$ctx1.fill(self,"renderBoxOn:",{html:html},smalltalk.IDETranscript)})},
  3363. messageSends: ["textarea", "class:", "at:put:"]}),
  3364. smalltalk.IDETranscript);
  3365. smalltalk.addMethod(
  3366. smalltalk.method({
  3367. selector: "renderButtonsOn:",
  3368. fn: function (html){
  3369. var self=this;
  3370. return smalltalk.withContext(function($ctx1) {
  3371. var $1,$2;
  3372. $1=_st(html)._button();
  3373. _st($1)._with_("Clear transcript");
  3374. $2=_st($1)._onClick_((function(){
  3375. return smalltalk.withContext(function($ctx2) {
  3376. return self._clear();
  3377. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3378. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},smalltalk.IDETranscript)})},
  3379. messageSends: ["with:", "button", "onClick:", "clear"]}),
  3380. smalltalk.IDETranscript);
  3381. smalltalk.addMethod(
  3382. smalltalk.method({
  3383. selector: "show:",
  3384. fn: function (anObject){
  3385. var self=this;
  3386. return smalltalk.withContext(function($ctx1) {
  3387. var $1;
  3388. $1=self["@textarea"];
  3389. if(($receiver = $1) == nil || $receiver == undefined){
  3390. self._open();
  3391. } else {
  3392. $1;
  3393. };
  3394. _st(_st(self["@textarea"])._asJQuery())._val_(_st(_st(_st(self["@textarea"])._asJQuery())._val()).__comma(_st(anObject)._asString()));
  3395. return self}, function($ctx1) {$ctx1.fill(self,"show:",{anObject:anObject},smalltalk.IDETranscript)})},
  3396. messageSends: ["ifNil:", "open", "val:", ",", "asString", "val", "asJQuery"]}),
  3397. smalltalk.IDETranscript);
  3398. smalltalk.IDETranscript.klass.iVarNames = ['current'];
  3399. smalltalk.addMethod(
  3400. smalltalk.method({
  3401. selector: "current",
  3402. fn: function (){
  3403. var self=this;
  3404. return smalltalk.withContext(function($ctx1) {
  3405. var $2,$1;
  3406. $2=self["@current"];
  3407. if(($receiver = $2) == nil || $receiver == undefined){
  3408. self["@current"]=smalltalk.IDETranscript.klass.superclass.fn.prototype._new.apply(_st(self), []);
  3409. $1=self["@current"];
  3410. } else {
  3411. $1=$2;
  3412. };
  3413. return $1;
  3414. }, function($ctx1) {$ctx1.fill(self,"current",{},smalltalk.IDETranscript.klass)})},
  3415. messageSends: ["ifNil:", "new"]}),
  3416. smalltalk.IDETranscript.klass);
  3417. smalltalk.addMethod(
  3418. smalltalk.method({
  3419. selector: "initialize",
  3420. fn: function (){
  3421. var self=this;
  3422. function $Transcript(){return smalltalk.Transcript||(typeof Transcript=="undefined"?nil:Transcript)}
  3423. return smalltalk.withContext(function($ctx1) {
  3424. _st($Transcript())._register_(self._current());
  3425. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.IDETranscript.klass)})},
  3426. messageSends: ["register:", "current"]}),
  3427. smalltalk.IDETranscript.klass);
  3428. smalltalk.addMethod(
  3429. smalltalk.method({
  3430. selector: "new",
  3431. fn: function (){
  3432. var self=this;
  3433. return smalltalk.withContext(function($ctx1) {
  3434. self._shouldNotImplement();
  3435. return self}, function($ctx1) {$ctx1.fill(self,"new",{},smalltalk.IDETranscript.klass)})},
  3436. messageSends: ["shouldNotImplement"]}),
  3437. smalltalk.IDETranscript.klass);
  3438. smalltalk.addMethod(
  3439. smalltalk.method({
  3440. selector: "open",
  3441. fn: function (){
  3442. var self=this;
  3443. function $TabManager(){return smalltalk.TabManager||(typeof TabManager=="undefined"?nil:TabManager)}
  3444. return smalltalk.withContext(function($ctx1) {
  3445. var $1,$2;
  3446. $1=_st($TabManager())._current();
  3447. _st($1)._open();
  3448. $2=_st($1)._selectTab_(self._current());
  3449. return self}, function($ctx1) {$ctx1.fill(self,"open",{},smalltalk.IDETranscript.klass)})},
  3450. messageSends: ["open", "current", "selectTab:"]}),
  3451. smalltalk.IDETranscript.klass);
  3452. smalltalk.addClass('Inspector', smalltalk.TabWidget, ['label', 'variables', 'object', 'selectedVariable', 'variablesList', 'valueTextarea', 'diveButton', 'sourceArea'], 'IDE');
  3453. smalltalk.addMethod(
  3454. smalltalk.method({
  3455. selector: "canBeClosed",
  3456. fn: function (){
  3457. var self=this;
  3458. return smalltalk.withContext(function($ctx1) {
  3459. return true;
  3460. }, function($ctx1) {$ctx1.fill(self,"canBeClosed",{},smalltalk.Inspector)})},
  3461. messageSends: []}),
  3462. smalltalk.Inspector);
  3463. smalltalk.addMethod(
  3464. smalltalk.method({
  3465. selector: "dive",
  3466. fn: function (){
  3467. var self=this;
  3468. return smalltalk.withContext(function($ctx1) {
  3469. _st(_st(self._variables())._at_(self._selectedVariable()))._inspect();
  3470. return self}, function($ctx1) {$ctx1.fill(self,"dive",{},smalltalk.Inspector)})},
  3471. messageSends: ["inspect", "at:", "selectedVariable", "variables"]}),
  3472. smalltalk.Inspector);
  3473. smalltalk.addMethod(
  3474. smalltalk.method({
  3475. selector: "inspect:",
  3476. fn: function (anObject){
  3477. var self=this;
  3478. return smalltalk.withContext(function($ctx1) {
  3479. self["@object"]=anObject;
  3480. self["@variables"]=[];
  3481. _st(self["@object"])._inspectOn_(self);
  3482. return self}, function($ctx1) {$ctx1.fill(self,"inspect:",{anObject:anObject},smalltalk.Inspector)})},
  3483. messageSends: ["inspectOn:"]}),
  3484. smalltalk.Inspector);
  3485. smalltalk.addMethod(
  3486. smalltalk.method({
  3487. selector: "label",
  3488. fn: function (){
  3489. var self=this;
  3490. return smalltalk.withContext(function($ctx1) {
  3491. var $2,$1;
  3492. $2=self["@label"];
  3493. if(($receiver = $2) == nil || $receiver == undefined){
  3494. $1="Inspector (nil)";
  3495. } else {
  3496. $1=$2;
  3497. };
  3498. return $1;
  3499. }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.Inspector)})},
  3500. messageSends: ["ifNil:"]}),
  3501. smalltalk.Inspector);
  3502. smalltalk.addMethod(
  3503. smalltalk.method({
  3504. selector: "refresh",
  3505. fn: function (){
  3506. var self=this;
  3507. return smalltalk.withContext(function($ctx1) {
  3508. var $1,$2;
  3509. $1=self;
  3510. _st($1)._inspect_(self["@object"]);
  3511. _st($1)._updateVariablesList();
  3512. $2=_st($1)._updateValueTextarea();
  3513. return self}, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.Inspector)})},
  3514. messageSends: ["inspect:", "updateVariablesList", "updateValueTextarea"]}),
  3515. smalltalk.Inspector);
  3516. smalltalk.addMethod(
  3517. smalltalk.method({
  3518. selector: "renderBottomPanelOn:",
  3519. fn: function (html){
  3520. var self=this;
  3521. function $SourceArea(){return smalltalk.SourceArea||(typeof SourceArea=="undefined"?nil:SourceArea)}
  3522. return smalltalk.withContext(function($ctx1) {
  3523. var $1,$3,$4,$2;
  3524. $1=_st(html)._div();
  3525. _st($1)._class_("amber_sourceCode");
  3526. $2=_st($1)._with_((function(){
  3527. return smalltalk.withContext(function($ctx2) {
  3528. $3=_st($SourceArea())._new();
  3529. _st($3)._receiver_(self["@object"]);
  3530. _st($3)._onDoIt_((function(){
  3531. return smalltalk.withContext(function($ctx3) {
  3532. return self._refresh();
  3533. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  3534. $4=_st($3)._yourself();
  3535. self["@sourceArea"]=$4;
  3536. self["@sourceArea"];
  3537. return _st(self["@sourceArea"])._renderOn_(html);
  3538. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3539. return self}, function($ctx1) {$ctx1.fill(self,"renderBottomPanelOn:",{html:html},smalltalk.Inspector)})},
  3540. messageSends: ["class:", "div", "with:", "receiver:", "new", "onDoIt:", "refresh", "yourself", "renderOn:"]}),
  3541. smalltalk.Inspector);
  3542. smalltalk.addMethod(
  3543. smalltalk.method({
  3544. selector: "renderBoxOn:",
  3545. fn: function (html){
  3546. var self=this;
  3547. return smalltalk.withContext(function($ctx1) {
  3548. var $1,$2;
  3549. $1=self;
  3550. _st($1)._renderTopPanelOn_(html);
  3551. $2=_st($1)._renderBottomPanelOn_(html);
  3552. return self}, function($ctx1) {$ctx1.fill(self,"renderBoxOn:",{html:html},smalltalk.Inspector)})},
  3553. messageSends: ["renderTopPanelOn:", "renderBottomPanelOn:"]}),
  3554. smalltalk.Inspector);
  3555. smalltalk.addMethod(
  3556. smalltalk.method({
  3557. selector: "renderButtonsOn:",
  3558. fn: function (html){
  3559. var self=this;
  3560. return smalltalk.withContext(function($ctx1) {
  3561. var $1,$2,$3,$4,$5,$6;
  3562. $1=_st(html)._button();
  3563. _st($1)._with_("DoIt");
  3564. $2=_st($1)._onClick_((function(){
  3565. return smalltalk.withContext(function($ctx2) {
  3566. return _st(self._sourceArea())._doIt();
  3567. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3568. $3=_st(html)._button();
  3569. _st($3)._with_("PrintIt");
  3570. $4=_st($3)._onClick_((function(){
  3571. return smalltalk.withContext(function($ctx2) {
  3572. return _st(self._sourceArea())._printIt();
  3573. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3574. $5=_st(html)._button();
  3575. _st($5)._with_("InspectIt");
  3576. $6=_st($5)._onClick_((function(){
  3577. return smalltalk.withContext(function($ctx2) {
  3578. return _st(self._sourceArea())._inspectIt();
  3579. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3580. self._updateButtons();
  3581. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},smalltalk.Inspector)})},
  3582. messageSends: ["with:", "button", "onClick:", "doIt", "sourceArea", "printIt", "inspectIt", "updateButtons"]}),
  3583. smalltalk.Inspector);
  3584. smalltalk.addMethod(
  3585. smalltalk.method({
  3586. selector: "renderTopPanelOn:",
  3587. fn: function (html){
  3588. var self=this;
  3589. return smalltalk.withContext(function($ctx1) {
  3590. var $1,$3,$4,$5,$7,$8,$9,$10,$6,$2,$11,$12;
  3591. $1=_st(html)._div();
  3592. _st($1)._class_("top");
  3593. $2=_st($1)._with_((function(){
  3594. return smalltalk.withContext(function($ctx2) {
  3595. self["@variablesList"]=_st(_st(html)._ul())._class_("amber_column variables");
  3596. self["@variablesList"];
  3597. $3=_st(html)._textarea();
  3598. _st($3)._class_("amber_column value");
  3599. $4=_st($3)._at_put_("readonly","readonly");
  3600. self["@valueTextarea"]=$4;
  3601. self["@valueTextarea"];
  3602. $5=_st(html)._div();
  3603. _st($5)._class_("amber_tabs inspector");
  3604. $6=_st($5)._with_((function(){
  3605. return smalltalk.withContext(function($ctx3) {
  3606. $7=_st(html)._button();
  3607. _st($7)._class_("amber_button inspector refresh");
  3608. _st($7)._with_("Refresh");
  3609. $8=_st($7)._onClick_((function(){
  3610. return smalltalk.withContext(function($ctx4) {
  3611. return self._refresh();
  3612. }, function($ctx4) {$ctx4.fillBlock({},$ctx3)})}));
  3613. $8;
  3614. $9=_st(html)._button();
  3615. _st($9)._class_("amber_button inspector dive");
  3616. _st($9)._with_("Dive");
  3617. $10=_st($9)._onClick_((function(){
  3618. return smalltalk.withContext(function($ctx4) {
  3619. return self._dive();
  3620. }, function($ctx4) {$ctx4.fillBlock({},$ctx3)})}));
  3621. self["@diveButton"]=$10;
  3622. return self["@diveButton"];
  3623. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  3624. $6;
  3625. return _st(_st(html)._div())._class_("amber_clear");
  3626. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3627. $11=self;
  3628. _st($11)._updateVariablesList();
  3629. $12=_st($11)._updateValueTextarea();
  3630. return self}, function($ctx1) {$ctx1.fill(self,"renderTopPanelOn:",{html:html},smalltalk.Inspector)})},
  3631. messageSends: ["class:", "div", "with:", "ul", "textarea", "at:put:", "button", "onClick:", "refresh", "dive", "updateVariablesList", "updateValueTextarea"]}),
  3632. smalltalk.Inspector);
  3633. smalltalk.addMethod(
  3634. smalltalk.method({
  3635. selector: "selectVariable:",
  3636. fn: function (aString){
  3637. var self=this;
  3638. return smalltalk.withContext(function($ctx1) {
  3639. var $1,$2;
  3640. self._selectedVariable_(aString);
  3641. $1=self;
  3642. _st($1)._updateVariablesList();
  3643. _st($1)._updateValueTextarea();
  3644. $2=_st($1)._updateButtons();
  3645. return self}, function($ctx1) {$ctx1.fill(self,"selectVariable:",{aString:aString},smalltalk.Inspector)})},
  3646. messageSends: ["selectedVariable:", "updateVariablesList", "updateValueTextarea", "updateButtons"]}),
  3647. smalltalk.Inspector);
  3648. smalltalk.addMethod(
  3649. smalltalk.method({
  3650. selector: "selectedVariable",
  3651. fn: function (){
  3652. var self=this;
  3653. return smalltalk.withContext(function($ctx1) {
  3654. var $1;
  3655. $1=self["@selectedVariable"];
  3656. return $1;
  3657. }, function($ctx1) {$ctx1.fill(self,"selectedVariable",{},smalltalk.Inspector)})},
  3658. messageSends: []}),
  3659. smalltalk.Inspector);
  3660. smalltalk.addMethod(
  3661. smalltalk.method({
  3662. selector: "selectedVariable:",
  3663. fn: function (aString){
  3664. var self=this;
  3665. return smalltalk.withContext(function($ctx1) {
  3666. self["@selectedVariable"]=aString;
  3667. return self}, function($ctx1) {$ctx1.fill(self,"selectedVariable:",{aString:aString},smalltalk.Inspector)})},
  3668. messageSends: []}),
  3669. smalltalk.Inspector);
  3670. smalltalk.addMethod(
  3671. smalltalk.method({
  3672. selector: "setLabel:",
  3673. fn: function (aString){
  3674. var self=this;
  3675. return smalltalk.withContext(function($ctx1) {
  3676. self["@label"]=aString;
  3677. return self}, function($ctx1) {$ctx1.fill(self,"setLabel:",{aString:aString},smalltalk.Inspector)})},
  3678. messageSends: []}),
  3679. smalltalk.Inspector);
  3680. smalltalk.addMethod(
  3681. smalltalk.method({
  3682. selector: "setVariables:",
  3683. fn: function (aCollection){
  3684. var self=this;
  3685. return smalltalk.withContext(function($ctx1) {
  3686. self["@variables"]=aCollection;
  3687. return self}, function($ctx1) {$ctx1.fill(self,"setVariables:",{aCollection:aCollection},smalltalk.Inspector)})},
  3688. messageSends: []}),
  3689. smalltalk.Inspector);
  3690. smalltalk.addMethod(
  3691. smalltalk.method({
  3692. selector: "sourceArea",
  3693. fn: function (){
  3694. var self=this;
  3695. return smalltalk.withContext(function($ctx1) {
  3696. var $1;
  3697. $1=self["@sourceArea"];
  3698. return $1;
  3699. }, function($ctx1) {$ctx1.fill(self,"sourceArea",{},smalltalk.Inspector)})},
  3700. messageSends: []}),
  3701. smalltalk.Inspector);
  3702. smalltalk.addMethod(
  3703. smalltalk.method({
  3704. selector: "updateButtons",
  3705. fn: function (){
  3706. var self=this;
  3707. return smalltalk.withContext(function($ctx1) {
  3708. var $1;
  3709. $1=_st(_st(self._selectedVariable())._notNil())._and_((function(){
  3710. return smalltalk.withContext(function($ctx2) {
  3711. return _st(_st(self._variables())._at_(self._selectedVariable()))._notNil();
  3712. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3713. if(smalltalk.assert($1)){
  3714. _st(self["@diveButton"])._removeAt_("disabled");
  3715. } else {
  3716. _st(self["@diveButton"])._at_put_("disabled",true);
  3717. };
  3718. return self}, function($ctx1) {$ctx1.fill(self,"updateButtons",{},smalltalk.Inspector)})},
  3719. messageSends: ["ifFalse:ifTrue:", "at:put:", "removeAt:", "and:", "notNil", "at:", "selectedVariable", "variables"]}),
  3720. smalltalk.Inspector);
  3721. smalltalk.addMethod(
  3722. smalltalk.method({
  3723. selector: "updateValueTextarea",
  3724. fn: function (){
  3725. var self=this;
  3726. return smalltalk.withContext(function($ctx1) {
  3727. var $1,$3,$2;
  3728. $1=_st(self["@valueTextarea"])._asJQuery();
  3729. $3=_st(self._selectedVariable())._isNil();
  3730. if(smalltalk.assert($3)){
  3731. $2="";
  3732. } else {
  3733. $2=_st(_st(self._variables())._at_(self._selectedVariable()))._printString();
  3734. };
  3735. _st($1)._val_($2);
  3736. return self}, function($ctx1) {$ctx1.fill(self,"updateValueTextarea",{},smalltalk.Inspector)})},
  3737. messageSends: ["val:", "ifTrue:ifFalse:", "printString", "at:", "selectedVariable", "variables", "isNil", "asJQuery"]}),
  3738. smalltalk.Inspector);
  3739. smalltalk.addMethod(
  3740. smalltalk.method({
  3741. selector: "updateVariablesList",
  3742. fn: function (){
  3743. var self=this;
  3744. return smalltalk.withContext(function($ctx1) {
  3745. var $1,$2,$3;
  3746. _st(self["@variablesList"])._contents_((function(html){
  3747. return smalltalk.withContext(function($ctx2) {
  3748. return _st(_st(self._variables())._keys())._do_((function(each){
  3749. var li;
  3750. return smalltalk.withContext(function($ctx3) {
  3751. li=_st(html)._li();
  3752. li;
  3753. $1=li;
  3754. _st($1)._with_(each);
  3755. $2=_st($1)._onClick_((function(){
  3756. return smalltalk.withContext(function($ctx4) {
  3757. return self._selectVariable_(each);
  3758. }, function($ctx4) {$ctx4.fillBlock({},$ctx3)})}));
  3759. $2;
  3760. $3=_st(self._selectedVariable()).__eq(each);
  3761. if(smalltalk.assert($3)){
  3762. return _st(li)._class_("selected");
  3763. };
  3764. }, function($ctx3) {$ctx3.fillBlock({each:each,li:li},$ctx2)})}));
  3765. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}));
  3766. return self}, function($ctx1) {$ctx1.fill(self,"updateVariablesList",{},smalltalk.Inspector)})},
  3767. messageSends: ["contents:", "do:", "li", "with:", "onClick:", "selectVariable:", "ifTrue:", "class:", "=", "selectedVariable", "keys", "variables"]}),
  3768. smalltalk.Inspector);
  3769. smalltalk.addMethod(
  3770. smalltalk.method({
  3771. selector: "variables",
  3772. fn: function (){
  3773. var self=this;
  3774. return smalltalk.withContext(function($ctx1) {
  3775. var $1;
  3776. $1=self["@variables"];
  3777. return $1;
  3778. }, function($ctx1) {$ctx1.fill(self,"variables",{},smalltalk.Inspector)})},
  3779. messageSends: []}),
  3780. smalltalk.Inspector);
  3781. smalltalk.addMethod(
  3782. smalltalk.method({
  3783. selector: "inspect:",
  3784. fn: function (anObject){
  3785. var self=this;
  3786. return smalltalk.withContext(function($ctx1) {
  3787. var $2,$3,$1;
  3788. $2=self._new();
  3789. _st($2)._inspect_(anObject);
  3790. $3=_st($2)._yourself();
  3791. $1=$3;
  3792. return $1;
  3793. }, function($ctx1) {$ctx1.fill(self,"inspect:",{anObject:anObject},smalltalk.Inspector.klass)})},
  3794. messageSends: ["inspect:", "new", "yourself"]}),
  3795. smalltalk.Inspector.klass);
  3796. smalltalk.addMethod(
  3797. smalltalk.method({
  3798. selector: "on:",
  3799. fn: function (anObject){
  3800. var self=this;
  3801. return smalltalk.withContext(function($ctx1) {
  3802. var $2,$3,$1;
  3803. $2=self._new();
  3804. _st($2)._inspect_(anObject);
  3805. $3=_st($2)._yourself();
  3806. $1=$3;
  3807. return $1;
  3808. }, function($ctx1) {$ctx1.fill(self,"on:",{anObject:anObject},smalltalk.Inspector.klass)})},
  3809. messageSends: ["inspect:", "new", "yourself"]}),
  3810. smalltalk.Inspector.klass);
  3811. smalltalk.addClass('ProgressBar', smalltalk.TabWidget, ['percent', 'progressDiv', 'div'], 'IDE');
  3812. smalltalk.addMethod(
  3813. smalltalk.method({
  3814. selector: "percent",
  3815. fn: function (){
  3816. var self=this;
  3817. return smalltalk.withContext(function($ctx1) {
  3818. var $2,$1;
  3819. $2=self["@percent"];
  3820. if(($receiver = $2) == nil || $receiver == undefined){
  3821. $1=(0);
  3822. } else {
  3823. $1=$2;
  3824. };
  3825. return $1;
  3826. }, function($ctx1) {$ctx1.fill(self,"percent",{},smalltalk.ProgressBar)})},
  3827. messageSends: ["ifNil:"]}),
  3828. smalltalk.ProgressBar);
  3829. smalltalk.addMethod(
  3830. smalltalk.method({
  3831. selector: "percent:",
  3832. fn: function (aNumber){
  3833. var self=this;
  3834. return smalltalk.withContext(function($ctx1) {
  3835. self["@percent"]=aNumber;
  3836. return self}, function($ctx1) {$ctx1.fill(self,"percent:",{aNumber:aNumber},smalltalk.ProgressBar)})},
  3837. messageSends: []}),
  3838. smalltalk.ProgressBar);
  3839. smalltalk.addMethod(
  3840. smalltalk.method({
  3841. selector: "renderOn:",
  3842. fn: function (html){
  3843. var self=this;
  3844. return smalltalk.withContext(function($ctx1) {
  3845. var $1,$2;
  3846. $1=_st(html)._div();
  3847. _st($1)._class_("progress_bar");
  3848. $2=_st($1)._yourself();
  3849. self["@div"]=$2;
  3850. self._renderProgressBar();
  3851. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.ProgressBar)})},
  3852. messageSends: ["class:", "div", "yourself", "renderProgressBar"]}),
  3853. smalltalk.ProgressBar);
  3854. smalltalk.addMethod(
  3855. smalltalk.method({
  3856. selector: "renderProgressBar",
  3857. fn: function (){
  3858. var self=this;
  3859. return smalltalk.withContext(function($ctx1) {
  3860. var $1,$2;
  3861. _st(self["@div"])._contents_((function(html){
  3862. return smalltalk.withContext(function($ctx2) {
  3863. $1=_st(html)._div();
  3864. _st($1)._class_("progress");
  3865. $2=_st($1)._style_(_st("width:".__comma(_st(self._percent())._asString())).__comma("%"));
  3866. return $2;
  3867. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}));
  3868. return self}, function($ctx1) {$ctx1.fill(self,"renderProgressBar",{},smalltalk.ProgressBar)})},
  3869. messageSends: ["contents:", "class:", "div", "style:", ",", "asString", "percent"]}),
  3870. smalltalk.ProgressBar);
  3871. smalltalk.addMethod(
  3872. smalltalk.method({
  3873. selector: "updatePercent:",
  3874. fn: function (aNumber){
  3875. var self=this;
  3876. return smalltalk.withContext(function($ctx1) {
  3877. self._percent_(aNumber);
  3878. self._renderProgressBar();
  3879. return self}, function($ctx1) {$ctx1.fill(self,"updatePercent:",{aNumber:aNumber},smalltalk.ProgressBar)})},
  3880. messageSends: ["percent:", "renderProgressBar"]}),
  3881. smalltalk.ProgressBar);
  3882. smalltalk.addClass('ReferencesBrowser', smalltalk.TabWidget, ['implementors', 'senders', 'implementorsList', 'input', 'timer', 'selector', 'sendersList', 'referencedClasses', 'referencedClassesList', 'matches', 'matchesList'], 'IDE');
  3883. smalltalk.addMethod(
  3884. smalltalk.method({
  3885. selector: "canBeClosed",
  3886. fn: function (){
  3887. var self=this;
  3888. return smalltalk.withContext(function($ctx1) {
  3889. return true;
  3890. }, function($ctx1) {$ctx1.fill(self,"canBeClosed",{},smalltalk.ReferencesBrowser)})},
  3891. messageSends: []}),
  3892. smalltalk.ReferencesBrowser);
  3893. smalltalk.addMethod(
  3894. smalltalk.method({
  3895. selector: "classesAndMetaclasses",
  3896. fn: function (){
  3897. var self=this;
  3898. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  3899. return smalltalk.withContext(function($ctx1) {
  3900. var $1;
  3901. $1=_st(_st(_st($Smalltalk())._current())._classes()).__comma(_st(_st(_st($Smalltalk())._current())._classes())._collect_((function(each){
  3902. return smalltalk.withContext(function($ctx2) {
  3903. return _st(each)._class();
  3904. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})));
  3905. return $1;
  3906. }, function($ctx1) {$ctx1.fill(self,"classesAndMetaclasses",{},smalltalk.ReferencesBrowser)})},
  3907. messageSends: [",", "collect:", "class", "classes", "current"]}),
  3908. smalltalk.ReferencesBrowser);
  3909. smalltalk.addMethod(
  3910. smalltalk.method({
  3911. selector: "implementors",
  3912. fn: function (){
  3913. var self=this;
  3914. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  3915. return smalltalk.withContext(function($ctx1) {
  3916. var $2,$1;
  3917. $2=self["@implementors"];
  3918. if(($receiver = $2) == nil || $receiver == undefined){
  3919. self["@implementors"]=_st($Array())._new();
  3920. $1=self["@implementors"];
  3921. } else {
  3922. $1=$2;
  3923. };
  3924. return $1;
  3925. }, function($ctx1) {$ctx1.fill(self,"implementors",{},smalltalk.ReferencesBrowser)})},
  3926. messageSends: ["ifNil:", "new"]}),
  3927. smalltalk.ReferencesBrowser);
  3928. smalltalk.addMethod(
  3929. smalltalk.method({
  3930. selector: "initialize",
  3931. fn: function (){
  3932. var self=this;
  3933. return smalltalk.withContext(function($ctx1) {
  3934. smalltalk.ReferencesBrowser.superclass.fn.prototype._initialize.apply(_st(self), []);
  3935. self["@selector"]="";
  3936. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.ReferencesBrowser)})},
  3937. messageSends: ["initialize"]}),
  3938. smalltalk.ReferencesBrowser);
  3939. smalltalk.addMethod(
  3940. smalltalk.method({
  3941. selector: "label",
  3942. fn: function (){
  3943. var self=this;
  3944. return smalltalk.withContext(function($ctx1) {
  3945. return "[References]";
  3946. }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.ReferencesBrowser)})},
  3947. messageSends: []}),
  3948. smalltalk.ReferencesBrowser);
  3949. smalltalk.addMethod(
  3950. smalltalk.method({
  3951. selector: "matches",
  3952. fn: function (){
  3953. var self=this;
  3954. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  3955. return smalltalk.withContext(function($ctx1) {
  3956. var $2,$1;
  3957. $2=self["@matches"];
  3958. if(($receiver = $2) == nil || $receiver == undefined){
  3959. self["@matches"]=_st($Array())._new();
  3960. $1=self["@matches"];
  3961. } else {
  3962. $1=$2;
  3963. };
  3964. return $1;
  3965. }, function($ctx1) {$ctx1.fill(self,"matches",{},smalltalk.ReferencesBrowser)})},
  3966. messageSends: ["ifNil:", "new"]}),
  3967. smalltalk.ReferencesBrowser);
  3968. smalltalk.addMethod(
  3969. smalltalk.method({
  3970. selector: "openBrowserOn:",
  3971. fn: function (aMethod){
  3972. var self=this;
  3973. var browser;
  3974. function $Browser(){return smalltalk.Browser||(typeof Browser=="undefined"?nil:Browser)}
  3975. return smalltalk.withContext(function($ctx1) {
  3976. var $1,$3,$2,$4,$5,$6;
  3977. $1=$Browser();
  3978. $3=_st(_st(aMethod)._methodClass())._isMetaclass();
  3979. if(smalltalk.assert($3)){
  3980. $2=_st(_st(aMethod)._methodClass())._instanceClass();
  3981. } else {
  3982. $2=_st(aMethod)._methodClass();
  3983. };
  3984. browser=_st($1)._openOn_($2);
  3985. $4=_st(_st(aMethod)._methodClass())._isMetaclass();
  3986. if(smalltalk.assert($4)){
  3987. _st(browser)._selectTab_("class");
  3988. };
  3989. $5=browser;
  3990. _st($5)._selectProtocol_(_st(aMethod)._category());
  3991. $6=_st($5)._selectMethod_(aMethod);
  3992. return self}, function($ctx1) {$ctx1.fill(self,"openBrowserOn:",{aMethod:aMethod,browser:browser},smalltalk.ReferencesBrowser)})},
  3993. messageSends: ["openOn:", "ifTrue:ifFalse:", "instanceClass", "methodClass", "isMetaclass", "ifTrue:", "selectTab:", "selectProtocol:", "category", "selectMethod:"]}),
  3994. smalltalk.ReferencesBrowser);
  3995. smalltalk.addMethod(
  3996. smalltalk.method({
  3997. selector: "referencedClasses",
  3998. fn: function (){
  3999. var self=this;
  4000. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  4001. return smalltalk.withContext(function($ctx1) {
  4002. var $2,$1;
  4003. $2=self["@referencedClasses"];
  4004. if(($receiver = $2) == nil || $receiver == undefined){
  4005. self["@referencedClasses"]=_st($Array())._new();
  4006. $1=self["@referencedClasses"];
  4007. } else {
  4008. $1=$2;
  4009. };
  4010. return $1;
  4011. }, function($ctx1) {$ctx1.fill(self,"referencedClasses",{},smalltalk.ReferencesBrowser)})},
  4012. messageSends: ["ifNil:", "new"]}),
  4013. smalltalk.ReferencesBrowser);
  4014. smalltalk.addMethod(
  4015. smalltalk.method({
  4016. selector: "renderBoxOn:",
  4017. fn: function (html){
  4018. var self=this;
  4019. return smalltalk.withContext(function($ctx1) {
  4020. var $1,$2;
  4021. $1=self;
  4022. _st($1)._renderInputOn_(html);
  4023. _st($1)._renderImplementorsOn_(html);
  4024. _st($1)._renderSendersOn_(html);
  4025. _st($1)._renderReferencedClassesOn_(html);
  4026. $2=_st($1)._renderMatchesOn_(html);
  4027. return self}, function($ctx1) {$ctx1.fill(self,"renderBoxOn:",{html:html},smalltalk.ReferencesBrowser)})},
  4028. messageSends: ["renderInputOn:", "renderImplementorsOn:", "renderSendersOn:", "renderReferencedClassesOn:", "renderMatchesOn:"]}),
  4029. smalltalk.ReferencesBrowser);
  4030. smalltalk.addMethod(
  4031. smalltalk.method({
  4032. selector: "renderImplementorsOn:",
  4033. fn: function (html){
  4034. var self=this;
  4035. return smalltalk.withContext(function($ctx1) {
  4036. self["@implementorsList"]=_st(_st(html)._ul())._class_("amber_column implementors");
  4037. self._updateImplementorsList();
  4038. return self}, function($ctx1) {$ctx1.fill(self,"renderImplementorsOn:",{html:html},smalltalk.ReferencesBrowser)})},
  4039. messageSends: ["class:", "ul", "updateImplementorsList"]}),
  4040. smalltalk.ReferencesBrowser);
  4041. smalltalk.addMethod(
  4042. smalltalk.method({
  4043. selector: "renderInputOn:",
  4044. fn: function (html){
  4045. var self=this;
  4046. return smalltalk.withContext(function($ctx1) {
  4047. var $1,$2;
  4048. $1=_st(html)._input();
  4049. _st($1)._class_("implementors");
  4050. $2=_st($1)._yourself();
  4051. self["@input"]=$2;
  4052. _st(_st(self["@input"])._asJQuery())._val_(self["@selector"]);
  4053. self._setInputEvents();
  4054. return self}, function($ctx1) {$ctx1.fill(self,"renderInputOn:",{html:html},smalltalk.ReferencesBrowser)})},
  4055. messageSends: ["class:", "input", "yourself", "val:", "asJQuery", "setInputEvents"]}),
  4056. smalltalk.ReferencesBrowser);
  4057. smalltalk.addMethod(
  4058. smalltalk.method({
  4059. selector: "renderMatchesOn:",
  4060. fn: function (html){
  4061. var self=this;
  4062. return smalltalk.withContext(function($ctx1) {
  4063. self["@matchesList"]=_st(_st(html)._ul())._class_("amber_column matches");
  4064. self._updateMatchesList();
  4065. return self}, function($ctx1) {$ctx1.fill(self,"renderMatchesOn:",{html:html},smalltalk.ReferencesBrowser)})},
  4066. messageSends: ["class:", "ul", "updateMatchesList"]}),
  4067. smalltalk.ReferencesBrowser);
  4068. smalltalk.addMethod(
  4069. smalltalk.method({
  4070. selector: "renderReferencedClassesOn:",
  4071. fn: function (html){
  4072. var self=this;
  4073. return smalltalk.withContext(function($ctx1) {
  4074. self["@referencedClassesList"]=_st(_st(html)._ul())._class_("amber_column referenced_classes");
  4075. self._updateReferencedClassesList();
  4076. return self}, function($ctx1) {$ctx1.fill(self,"renderReferencedClassesOn:",{html:html},smalltalk.ReferencesBrowser)})},
  4077. messageSends: ["class:", "ul", "updateReferencedClassesList"]}),
  4078. smalltalk.ReferencesBrowser);
  4079. smalltalk.addMethod(
  4080. smalltalk.method({
  4081. selector: "renderSendersOn:",
  4082. fn: function (html){
  4083. var self=this;
  4084. return smalltalk.withContext(function($ctx1) {
  4085. self["@sendersList"]=_st(_st(html)._ul())._class_("amber_column senders");
  4086. self._updateSendersList();
  4087. return self}, function($ctx1) {$ctx1.fill(self,"renderSendersOn:",{html:html},smalltalk.ReferencesBrowser)})},
  4088. messageSends: ["class:", "ul", "updateSendersList"]}),
  4089. smalltalk.ReferencesBrowser);
  4090. smalltalk.addMethod(
  4091. smalltalk.method({
  4092. selector: "search:",
  4093. fn: function (aString){
  4094. var self=this;
  4095. return smalltalk.withContext(function($ctx1) {
  4096. var $1,$2;
  4097. $1=self;
  4098. _st($1)._searchReferencesFor_(aString);
  4099. _st($1)._updateImplementorsList();
  4100. _st($1)._updateSendersList();
  4101. _st($1)._updateReferencedClassesList();
  4102. $2=_st($1)._updateMatchesList();
  4103. return self}, function($ctx1) {$ctx1.fill(self,"search:",{aString:aString},smalltalk.ReferencesBrowser)})},
  4104. messageSends: ["searchReferencesFor:", "updateImplementorsList", "updateSendersList", "updateReferencedClassesList", "updateMatchesList"]}),
  4105. smalltalk.ReferencesBrowser);
  4106. smalltalk.addMethod(
  4107. smalltalk.method({
  4108. selector: "searchMethodSource",
  4109. fn: function (){
  4110. var self=this;
  4111. var regex;
  4112. return smalltalk.withContext(function($ctx1) {
  4113. var $1;
  4114. regex=_st(self["@selector"])._allButFirst();
  4115. _st(self._classesAndMetaclasses())._do_((function(each){
  4116. return smalltalk.withContext(function($ctx2) {
  4117. return _st(_st(_st(each)._methodDictionary())._values())._do_((function(value){
  4118. return smalltalk.withContext(function($ctx3) {
  4119. $1=_st(_st(value)._source())._match_(regex);
  4120. if(smalltalk.assert($1)){
  4121. return _st(self._matches())._add_(value);
  4122. };
  4123. }, function($ctx3) {$ctx3.fillBlock({value:value},$ctx2)})}));
  4124. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  4125. return self}, function($ctx1) {$ctx1.fill(self,"searchMethodSource",{regex:regex},smalltalk.ReferencesBrowser)})},
  4126. messageSends: ["allButFirst", "do:", "ifTrue:", "add:", "matches", "match:", "source", "values", "methodDictionary", "classesAndMetaclasses"]}),
  4127. smalltalk.ReferencesBrowser);
  4128. smalltalk.addMethod(
  4129. smalltalk.method({
  4130. selector: "searchReferencedClasses",
  4131. fn: function (){
  4132. var self=this;
  4133. return smalltalk.withContext(function($ctx1) {
  4134. var $1;
  4135. _st(self._classesAndMetaclasses())._do_((function(each){
  4136. return smalltalk.withContext(function($ctx2) {
  4137. return _st(_st(_st(each)._methodDictionary())._values())._do_((function(value){
  4138. return smalltalk.withContext(function($ctx3) {
  4139. $1=_st(_st(value)._referencedClasses())._includes_(self["@selector"]);
  4140. if(smalltalk.assert($1)){
  4141. return _st(self._referencedClasses())._add_(value);
  4142. };
  4143. }, function($ctx3) {$ctx3.fillBlock({value:value},$ctx2)})}));
  4144. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  4145. return self}, function($ctx1) {$ctx1.fill(self,"searchReferencedClasses",{},smalltalk.ReferencesBrowser)})},
  4146. messageSends: ["do:", "ifTrue:", "add:", "referencedClasses", "includes:", "values", "methodDictionary", "classesAndMetaclasses"]}),
  4147. smalltalk.ReferencesBrowser);
  4148. smalltalk.addMethod(
  4149. smalltalk.method({
  4150. selector: "searchReferencesFor:",
  4151. fn: function (aString){
  4152. var self=this;
  4153. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  4154. return smalltalk.withContext(function($ctx1) {
  4155. var $1;
  4156. self["@selector"]=aString;
  4157. self["@implementors"]=_st($Array())._new();
  4158. self["@senders"]=_st($Array())._new();
  4159. self["@referencedClasses"]=_st($Array())._new();
  4160. self["@matches"]=_st($Array())._new();
  4161. self._searchMethodSource();
  4162. $1=_st(self["@selector"])._match_("^[A-Z]");
  4163. if(smalltalk.assert($1)){
  4164. self._searchReferencedClasses();
  4165. } else {
  4166. self._searchSelectorReferences();
  4167. };
  4168. return self}, function($ctx1) {$ctx1.fill(self,"searchReferencesFor:",{aString:aString},smalltalk.ReferencesBrowser)})},
  4169. messageSends: ["new", "searchMethodSource", "ifFalse:ifTrue:", "searchSelectorReferences", "searchReferencedClasses", "match:"]}),
  4170. smalltalk.ReferencesBrowser);
  4171. smalltalk.addMethod(
  4172. smalltalk.method({
  4173. selector: "searchSelectorReferences",
  4174. fn: function (){
  4175. var self=this;
  4176. return smalltalk.withContext(function($ctx1) {
  4177. var $1,$2;
  4178. _st(self._classesAndMetaclasses())._do_((function(each){
  4179. return smalltalk.withContext(function($ctx2) {
  4180. return _st(_st(each)._methodDictionary())._keysAndValuesDo_((function(key,value){
  4181. return smalltalk.withContext(function($ctx3) {
  4182. $1=_st(key).__eq(self["@selector"]);
  4183. if(smalltalk.assert($1)){
  4184. _st(self._implementors())._add_(value);
  4185. };
  4186. $2=_st(_st(value)._messageSends())._includes_(self["@selector"]);
  4187. if(smalltalk.assert($2)){
  4188. return _st(self._senders())._add_(value);
  4189. };
  4190. }, function($ctx3) {$ctx3.fillBlock({key:key,value:value},$ctx2)})}));
  4191. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  4192. return self}, function($ctx1) {$ctx1.fill(self,"searchSelectorReferences",{},smalltalk.ReferencesBrowser)})},
  4193. messageSends: ["do:", "keysAndValuesDo:", "ifTrue:", "add:", "implementors", "=", "senders", "includes:", "messageSends", "methodDictionary", "classesAndMetaclasses"]}),
  4194. smalltalk.ReferencesBrowser);
  4195. smalltalk.addMethod(
  4196. smalltalk.method({
  4197. selector: "selector",
  4198. fn: function (){
  4199. var self=this;
  4200. return smalltalk.withContext(function($ctx1) {
  4201. var $1;
  4202. $1=self["@selector"];
  4203. return $1;
  4204. }, function($ctx1) {$ctx1.fill(self,"selector",{},smalltalk.ReferencesBrowser)})},
  4205. messageSends: []}),
  4206. smalltalk.ReferencesBrowser);
  4207. smalltalk.addMethod(
  4208. smalltalk.method({
  4209. selector: "senders",
  4210. fn: function (){
  4211. var self=this;
  4212. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  4213. return smalltalk.withContext(function($ctx1) {
  4214. var $2,$1;
  4215. $2=self["@senders"];
  4216. if(($receiver = $2) == nil || $receiver == undefined){
  4217. self["@senders"]=_st($Array())._new();
  4218. $1=self["@senders"];
  4219. } else {
  4220. $1=$2;
  4221. };
  4222. return $1;
  4223. }, function($ctx1) {$ctx1.fill(self,"senders",{},smalltalk.ReferencesBrowser)})},
  4224. messageSends: ["ifNil:", "new"]}),
  4225. smalltalk.ReferencesBrowser);
  4226. smalltalk.addMethod(
  4227. smalltalk.method({
  4228. selector: "setInputEvents",
  4229. fn: function (){
  4230. var self=this;
  4231. return smalltalk.withContext(function($ctx1) {
  4232. var $1,$3,$2;
  4233. $1=self["@input"];
  4234. _st($1)._onKeyUp_((function(){
  4235. return smalltalk.withContext(function($ctx2) {
  4236. self["@timer"]=_st((function(){
  4237. return smalltalk.withContext(function($ctx3) {
  4238. return self._search_(_st(_st(self["@input"])._asJQuery())._val());
  4239. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}))._valueWithTimeout_((100));
  4240. return self["@timer"];
  4241. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  4242. $2=_st($1)._onKeyDown_((function(){
  4243. return smalltalk.withContext(function($ctx2) {
  4244. $3=self["@timer"];
  4245. if(($receiver = $3) == nil || $receiver == undefined){
  4246. return $3;
  4247. } else {
  4248. return _st(self["@timer"])._clearTimeout();
  4249. };
  4250. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  4251. return self}, function($ctx1) {$ctx1.fill(self,"setInputEvents",{},smalltalk.ReferencesBrowser)})},
  4252. messageSends: ["onKeyUp:", "valueWithTimeout:", "search:", "val", "asJQuery", "onKeyDown:", "ifNotNil:", "clearTimeout"]}),
  4253. smalltalk.ReferencesBrowser);
  4254. smalltalk.addMethod(
  4255. smalltalk.method({
  4256. selector: "updateImplementorsList",
  4257. fn: function (){
  4258. var self=this;
  4259. return smalltalk.withContext(function($ctx1) {
  4260. var $1,$2,$3,$4;
  4261. _st(self["@implementorsList"])._contents_((function(html){
  4262. return smalltalk.withContext(function($ctx2) {
  4263. $1=_st(html)._li();
  4264. _st($1)._class_("column_label");
  4265. _st($1)._with_(_st("Implementors (".__comma(_st(_st(self._implementors())._size())._asString())).__comma(")"));
  4266. $2=_st($1)._style_("font-weight: bold");
  4267. $2;
  4268. return _st(self._implementors())._do_((function(each){
  4269. var li;
  4270. return smalltalk.withContext(function($ctx3) {
  4271. li=_st(html)._li();
  4272. li;
  4273. $3=li;
  4274. _st($3)._with_(_st(_st(_st(_st(each)._methodClass())._asString()).__comma(" >> ")).__comma(self._selector()));
  4275. $4=_st($3)._onClick_((function(){
  4276. return smalltalk.withContext(function($ctx4) {
  4277. return self._openBrowserOn_(each);
  4278. }, function($ctx4) {$ctx4.fillBlock({},$ctx3)})}));
  4279. return $4;
  4280. }, function($ctx3) {$ctx3.fillBlock({each:each,li:li},$ctx2)})}));
  4281. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}));
  4282. return self}, function($ctx1) {$ctx1.fill(self,"updateImplementorsList",{},smalltalk.ReferencesBrowser)})},
  4283. messageSends: ["contents:", "class:", "li", "with:", ",", "asString", "size", "implementors", "style:", "do:", "selector", "methodClass", "onClick:", "openBrowserOn:"]}),
  4284. smalltalk.ReferencesBrowser);
  4285. smalltalk.addMethod(
  4286. smalltalk.method({
  4287. selector: "updateMatchesList",
  4288. fn: function (){
  4289. var self=this;
  4290. return smalltalk.withContext(function($ctx1) {
  4291. var $1,$2,$3,$4;
  4292. _st(self["@matchesList"])._contents_((function(html){
  4293. return smalltalk.withContext(function($ctx2) {
  4294. $1=_st(html)._li();
  4295. _st($1)._class_("column_label");
  4296. _st($1)._with_(_st("Regex matches (".__comma(_st(_st(self._matches())._size())._asString())).__comma(")"));
  4297. $2=_st($1)._style_("font-weight: bold");
  4298. $2;
  4299. return _st(self._matches())._do_((function(each){
  4300. var li;
  4301. return smalltalk.withContext(function($ctx3) {
  4302. li=_st(html)._li();
  4303. li;
  4304. $3=li;
  4305. _st($3)._with_(_st(_st(_st(_st(each)._methodClass())._asString()).__comma(" >> ")).__comma(_st(each)._selector()));
  4306. $4=_st($3)._onClick_((function(){
  4307. return smalltalk.withContext(function($ctx4) {
  4308. return self._openBrowserOn_(each);
  4309. }, function($ctx4) {$ctx4.fillBlock({},$ctx3)})}));
  4310. return $4;
  4311. }, function($ctx3) {$ctx3.fillBlock({each:each,li:li},$ctx2)})}));
  4312. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}));
  4313. return self}, function($ctx1) {$ctx1.fill(self,"updateMatchesList",{},smalltalk.ReferencesBrowser)})},
  4314. messageSends: ["contents:", "class:", "li", "with:", ",", "asString", "size", "matches", "style:", "do:", "selector", "methodClass", "onClick:", "openBrowserOn:"]}),
  4315. smalltalk.ReferencesBrowser);
  4316. smalltalk.addMethod(
  4317. smalltalk.method({
  4318. selector: "updateReferencedClassesList",
  4319. fn: function (){
  4320. var self=this;
  4321. return smalltalk.withContext(function($ctx1) {
  4322. var $1,$2,$3,$4;
  4323. _st(self["@referencedClassesList"])._contents_((function(html){
  4324. return smalltalk.withContext(function($ctx2) {
  4325. $1=_st(html)._li();
  4326. _st($1)._class_("column_label");
  4327. _st($1)._with_(_st("Class references (".__comma(_st(_st(self._referencedClasses())._size())._asString())).__comma(")"));
  4328. $2=_st($1)._style_("font-weight: bold");
  4329. $2;
  4330. return _st(self._referencedClasses())._do_((function(each){
  4331. return smalltalk.withContext(function($ctx3) {
  4332. $3=_st(html)._li();
  4333. _st($3)._with_(_st(_st(_st(_st(each)._methodClass())._asString()).__comma(" >> ")).__comma(_st(each)._selector()));
  4334. $4=_st($3)._onClick_((function(){
  4335. return smalltalk.withContext(function($ctx4) {
  4336. return self._openBrowserOn_(each);
  4337. }, function($ctx4) {$ctx4.fillBlock({},$ctx3)})}));
  4338. return $4;
  4339. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2)})}));
  4340. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}));
  4341. return self}, function($ctx1) {$ctx1.fill(self,"updateReferencedClassesList",{},smalltalk.ReferencesBrowser)})},
  4342. messageSends: ["contents:", "class:", "li", "with:", ",", "asString", "size", "referencedClasses", "style:", "do:", "selector", "methodClass", "onClick:", "openBrowserOn:"]}),
  4343. smalltalk.ReferencesBrowser);
  4344. smalltalk.addMethod(
  4345. smalltalk.method({
  4346. selector: "updateSendersList",
  4347. fn: function (){
  4348. var self=this;
  4349. return smalltalk.withContext(function($ctx1) {
  4350. var $1,$2,$3,$4;
  4351. _st(self["@sendersList"])._contents_((function(html){
  4352. return smalltalk.withContext(function($ctx2) {
  4353. $1=_st(html)._li();
  4354. _st($1)._class_("column_label");
  4355. _st($1)._with_(_st("Senders (".__comma(_st(_st(self._senders())._size())._asString())).__comma(")"));
  4356. $2=_st($1)._style_("font-weight: bold");
  4357. $2;
  4358. return _st(self._senders())._do_((function(each){
  4359. return smalltalk.withContext(function($ctx3) {
  4360. $3=_st(html)._li();
  4361. _st($3)._with_(_st(_st(_st(_st(each)._methodClass())._asString()).__comma(" >> ")).__comma(_st(each)._selector()));
  4362. $4=_st($3)._onClick_((function(){
  4363. return smalltalk.withContext(function($ctx4) {
  4364. return self._openBrowserOn_(each);
  4365. }, function($ctx4) {$ctx4.fillBlock({},$ctx3)})}));
  4366. return $4;
  4367. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2)})}));
  4368. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}));
  4369. return self}, function($ctx1) {$ctx1.fill(self,"updateSendersList",{},smalltalk.ReferencesBrowser)})},
  4370. messageSends: ["contents:", "class:", "li", "with:", ",", "asString", "size", "senders", "style:", "do:", "selector", "methodClass", "onClick:", "openBrowserOn:"]}),
  4371. smalltalk.ReferencesBrowser);
  4372. smalltalk.addMethod(
  4373. smalltalk.method({
  4374. selector: "search:",
  4375. fn: function (aString){
  4376. var self=this;
  4377. return smalltalk.withContext(function($ctx1) {
  4378. var $2,$3,$1;
  4379. $2=self._new();
  4380. _st($2)._searchReferencesFor_(aString);
  4381. $3=_st($2)._open();
  4382. $1=$3;
  4383. return $1;
  4384. }, function($ctx1) {$ctx1.fill(self,"search:",{aString:aString},smalltalk.ReferencesBrowser.klass)})},
  4385. messageSends: ["searchReferencesFor:", "new", "open"]}),
  4386. smalltalk.ReferencesBrowser.klass);
  4387. smalltalk.addClass('TestRunner', smalltalk.TabWidget, ['selectedCategories', 'packagesList', 'selectedClasses', 'classesList', 'selectedMethods', 'progressBar', 'methodsList', 'result', 'statusDiv'], 'IDE');
  4388. smalltalk.addMethod(
  4389. smalltalk.method({
  4390. selector: "allClasses",
  4391. fn: function (){
  4392. var self=this;
  4393. function $TestCase(){return smalltalk.TestCase||(typeof TestCase=="undefined"?nil:TestCase)}
  4394. return smalltalk.withContext(function($ctx1) {
  4395. var $1;
  4396. $1=_st(_st($TestCase())._allSubclasses())._select_((function(each){
  4397. return smalltalk.withContext(function($ctx2) {
  4398. return _st(_st(each)._isAbstract())._not();
  4399. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  4400. return $1;
  4401. }, function($ctx1) {$ctx1.fill(self,"allClasses",{},smalltalk.TestRunner)})},
  4402. messageSends: ["select:", "not", "isAbstract", "allSubclasses"]}),
  4403. smalltalk.TestRunner);
  4404. smalltalk.addMethod(
  4405. smalltalk.method({
  4406. selector: "classes",
  4407. fn: function (){
  4408. var self=this;
  4409. return smalltalk.withContext(function($ctx1) {
  4410. var $1;
  4411. $1=_st(_st(self._allClasses())._select_((function(each){
  4412. return smalltalk.withContext(function($ctx2) {
  4413. return _st(self._selectedCategories())._includes_(_st(each)._category());
  4414. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._sort_((function(a,b){
  4415. return smalltalk.withContext(function($ctx2) {
  4416. return _st(_st(a)._name()).__gt(_st(b)._name());
  4417. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})}));
  4418. return $1;
  4419. }, function($ctx1) {$ctx1.fill(self,"classes",{},smalltalk.TestRunner)})},
  4420. messageSends: ["sort:", ">", "name", "select:", "includes:", "category", "selectedCategories", "allClasses"]}),
  4421. smalltalk.TestRunner);
  4422. smalltalk.addMethod(
  4423. smalltalk.method({
  4424. selector: "initialize",
  4425. fn: function (){
  4426. var self=this;
  4427. function $TestResult(){return smalltalk.TestResult||(typeof TestResult=="undefined"?nil:TestResult)}
  4428. return smalltalk.withContext(function($ctx1) {
  4429. smalltalk.TestRunner.superclass.fn.prototype._initialize.apply(_st(self), []);
  4430. self["@result"]=_st($TestResult())._new();
  4431. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.TestRunner)})},
  4432. messageSends: ["initialize", "new"]}),
  4433. smalltalk.TestRunner);
  4434. smalltalk.addMethod(
  4435. smalltalk.method({
  4436. selector: "isSelectedCategory:",
  4437. fn: function (aCategory){
  4438. var self=this;
  4439. return smalltalk.withContext(function($ctx1) {
  4440. var $1;
  4441. $1=_st(self._selectedCategories())._includes_(aCategory);
  4442. return $1;
  4443. }, function($ctx1) {$ctx1.fill(self,"isSelectedCategory:",{aCategory:aCategory},smalltalk.TestRunner)})},
  4444. messageSends: ["includes:", "selectedCategories"]}),
  4445. smalltalk.TestRunner);
  4446. smalltalk.addMethod(
  4447. smalltalk.method({
  4448. selector: "isSelectedClass:",
  4449. fn: function (aClass){
  4450. var self=this;
  4451. return smalltalk.withContext(function($ctx1) {
  4452. var $1;
  4453. $1=_st(self._selectedClasses())._includes_(aClass);
  4454. return $1;
  4455. }, function($ctx1) {$ctx1.fill(self,"isSelectedClass:",{aClass:aClass},smalltalk.TestRunner)})},
  4456. messageSends: ["includes:", "selectedClasses"]}),
  4457. smalltalk.TestRunner);
  4458. smalltalk.addMethod(
  4459. smalltalk.method({
  4460. selector: "label",
  4461. fn: function (){
  4462. var self=this;
  4463. return smalltalk.withContext(function($ctx1) {
  4464. return "SUnit";
  4465. }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.TestRunner)})},
  4466. messageSends: []}),
  4467. smalltalk.TestRunner);
  4468. smalltalk.addMethod(
  4469. smalltalk.method({
  4470. selector: "packages",
  4471. fn: function (){
  4472. var self=this;
  4473. var packages;
  4474. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  4475. return smalltalk.withContext(function($ctx1) {
  4476. var $1,$2;
  4477. packages=_st($Array())._new();
  4478. _st(self._allClasses())._do_((function(each){
  4479. return smalltalk.withContext(function($ctx2) {
  4480. $1=_st(packages)._includes_(_st(each)._category());
  4481. if(! smalltalk.assert($1)){
  4482. return _st(packages)._add_(_st(each)._category());
  4483. };
  4484. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  4485. $2=_st(packages)._sort();
  4486. return $2;
  4487. }, function($ctx1) {$ctx1.fill(self,"packages",{packages:packages},smalltalk.TestRunner)})},
  4488. messageSends: ["new", "do:", "ifFalse:", "add:", "category", "includes:", "allClasses", "sort"]}),
  4489. smalltalk.TestRunner);
  4490. smalltalk.addMethod(
  4491. smalltalk.method({
  4492. selector: "performFailure:",
  4493. fn: function (aTestCase){
  4494. var self=this;
  4495. return smalltalk.withContext(function($ctx1) {
  4496. _st(aTestCase)._runCase();
  4497. return self}, function($ctx1) {$ctx1.fill(self,"performFailure:",{aTestCase:aTestCase},smalltalk.TestRunner)})},
  4498. messageSends: ["runCase"]}),
  4499. smalltalk.TestRunner);
  4500. smalltalk.addMethod(
  4501. smalltalk.method({
  4502. selector: "printErrors",
  4503. fn: function (){
  4504. var self=this;
  4505. return smalltalk.withContext(function($ctx1) {
  4506. var $1;
  4507. $1=_st(_st(_st(_st(self._result())._errors())._size())._asString()).__comma(" errors, ");
  4508. return $1;
  4509. }, function($ctx1) {$ctx1.fill(self,"printErrors",{},smalltalk.TestRunner)})},
  4510. messageSends: [",", "asString", "size", "errors", "result"]}),
  4511. smalltalk.TestRunner);
  4512. smalltalk.addMethod(
  4513. smalltalk.method({
  4514. selector: "printFailures",
  4515. fn: function (){
  4516. var self=this;
  4517. return smalltalk.withContext(function($ctx1) {
  4518. var $1;
  4519. $1=_st(_st(_st(_st(self._result())._failures())._size())._asString()).__comma(" failures");
  4520. return $1;
  4521. }, function($ctx1) {$ctx1.fill(self,"printFailures",{},smalltalk.TestRunner)})},
  4522. messageSends: [",", "asString", "size", "failures", "result"]}),
  4523. smalltalk.TestRunner);
  4524. smalltalk.addMethod(
  4525. smalltalk.method({
  4526. selector: "printPasses",
  4527. fn: function (){
  4528. var self=this;
  4529. return smalltalk.withContext(function($ctx1) {
  4530. var $1;
  4531. $1=_st(_st(_st(_st(_st(self._result())._runs()).__minus(_st(_st(self._result())._errors())._size())).__minus(_st(_st(self._result())._failures())._size()))._asString()).__comma(" passes, ");
  4532. return $1;
  4533. }, function($ctx1) {$ctx1.fill(self,"printPasses",{},smalltalk.TestRunner)})},
  4534. messageSends: [",", "asString", "-", "size", "failures", "result", "errors", "runs"]}),
  4535. smalltalk.TestRunner);
  4536. smalltalk.addMethod(
  4537. smalltalk.method({
  4538. selector: "printTotal",
  4539. fn: function (){
  4540. var self=this;
  4541. return smalltalk.withContext(function($ctx1) {
  4542. var $1;
  4543. $1=_st(_st(_st(self._result())._total())._asString()).__comma(" runs, ");
  4544. return $1;
  4545. }, function($ctx1) {$ctx1.fill(self,"printTotal",{},smalltalk.TestRunner)})},
  4546. messageSends: [",", "asString", "total", "result"]}),
  4547. smalltalk.TestRunner);
  4548. smalltalk.addMethod(
  4549. smalltalk.method({
  4550. selector: "progressBar",
  4551. fn: function (){
  4552. var self=this;
  4553. function $ProgressBar(){return smalltalk.ProgressBar||(typeof ProgressBar=="undefined"?nil:ProgressBar)}
  4554. return smalltalk.withContext(function($ctx1) {
  4555. var $2,$1;
  4556. $2=self["@progressBar"];
  4557. if(($receiver = $2) == nil || $receiver == undefined){
  4558. self["@progressBar"]=_st($ProgressBar())._new();
  4559. $1=self["@progressBar"];
  4560. } else {
  4561. $1=$2;
  4562. };
  4563. return $1;
  4564. }, function($ctx1) {$ctx1.fill(self,"progressBar",{},smalltalk.TestRunner)})},
  4565. messageSends: ["ifNil:", "new"]}),
  4566. smalltalk.TestRunner);
  4567. smalltalk.addMethod(
  4568. smalltalk.method({
  4569. selector: "renderBoxOn:",
  4570. fn: function (html){
  4571. var self=this;
  4572. return smalltalk.withContext(function($ctx1) {
  4573. var $1,$2;
  4574. $1=self;
  4575. _st($1)._renderCategoriesOn_(html);
  4576. _st($1)._renderClassesOn_(html);
  4577. $2=_st($1)._renderResultsOn_(html);
  4578. return self}, function($ctx1) {$ctx1.fill(self,"renderBoxOn:",{html:html},smalltalk.TestRunner)})},
  4579. messageSends: ["renderCategoriesOn:", "renderClassesOn:", "renderResultsOn:"]}),
  4580. smalltalk.TestRunner);
  4581. smalltalk.addMethod(
  4582. smalltalk.method({
  4583. selector: "renderButtonsOn:",
  4584. fn: function (html){
  4585. var self=this;
  4586. return smalltalk.withContext(function($ctx1) {
  4587. var $1,$2;
  4588. $1=_st(html)._button();
  4589. _st($1)._with_("Run selected");
  4590. $2=_st($1)._onClick_((function(){
  4591. return smalltalk.withContext(function($ctx2) {
  4592. return self._run_(self._testCases());
  4593. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  4594. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},smalltalk.TestRunner)})},
  4595. messageSends: ["with:", "button", "onClick:", "run:", "testCases"]}),
  4596. smalltalk.TestRunner);
  4597. smalltalk.addMethod(
  4598. smalltalk.method({
  4599. selector: "renderCategoriesOn:",
  4600. fn: function (html){
  4601. var self=this;
  4602. return smalltalk.withContext(function($ctx1) {
  4603. self["@packagesList"]=_st(_st(html)._ul())._class_("amber_column sunit packages");
  4604. self._updateCategoriesList();
  4605. return self}, function($ctx1) {$ctx1.fill(self,"renderCategoriesOn:",{html:html},smalltalk.TestRunner)})},
  4606. messageSends: ["class:", "ul", "updateCategoriesList"]}),
  4607. smalltalk.TestRunner);
  4608. smalltalk.addMethod(
  4609. smalltalk.method({
  4610. selector: "renderClassesOn:",
  4611. fn: function (html){
  4612. var self=this;
  4613. return smalltalk.withContext(function($ctx1) {
  4614. self["@classesList"]=_st(_st(html)._ul())._class_("amber_column sunit classes");
  4615. self._updateClassesList();
  4616. return self}, function($ctx1) {$ctx1.fill(self,"renderClassesOn:",{html:html},smalltalk.TestRunner)})},
  4617. messageSends: ["class:", "ul", "updateClassesList"]}),
  4618. smalltalk.TestRunner);
  4619. smalltalk.addMethod(
  4620. smalltalk.method({
  4621. selector: "renderErrorsOn:",
  4622. fn: function (html){
  4623. var self=this;
  4624. return smalltalk.withContext(function($ctx1) {
  4625. var $1,$2;
  4626. _st(_st(self._result())._errors())._do_((function(each){
  4627. return smalltalk.withContext(function($ctx2) {
  4628. $1=_st(html)._li();
  4629. _st($1)._class_("errors");
  4630. _st($1)._with_(_st(_st(_st(_st(each)._class())._name()).__comma(" >> ")).__comma(_st(each)._selector()));
  4631. $2=_st($1)._onClick_((function(){
  4632. return smalltalk.withContext(function($ctx3) {
  4633. return self._performFailure_(each);
  4634. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  4635. return $2;
  4636. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  4637. return self}, function($ctx1) {$ctx1.fill(self,"renderErrorsOn:",{html:html},smalltalk.TestRunner)})},
  4638. messageSends: ["do:", "class:", "li", "with:", ",", "selector", "name", "class", "onClick:", "performFailure:", "errors", "result"]}),
  4639. smalltalk.TestRunner);
  4640. smalltalk.addMethod(
  4641. smalltalk.method({
  4642. selector: "renderFailuresOn:",
  4643. fn: function (html){
  4644. var self=this;
  4645. return smalltalk.withContext(function($ctx1) {
  4646. var $1,$2;
  4647. _st(_st(self._result())._failures())._do_((function(each){
  4648. return smalltalk.withContext(function($ctx2) {
  4649. $1=_st(html)._li();
  4650. _st($1)._class_("failures");
  4651. _st($1)._with_(_st(_st(_st(_st(each)._class())._name()).__comma(" >> ")).__comma(_st(each)._selector()));
  4652. $2=_st($1)._onClick_((function(){
  4653. return smalltalk.withContext(function($ctx3) {
  4654. return self._performFailure_(each);
  4655. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  4656. return $2;
  4657. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  4658. return self}, function($ctx1) {$ctx1.fill(self,"renderFailuresOn:",{html:html},smalltalk.TestRunner)})},
  4659. messageSends: ["do:", "class:", "li", "with:", ",", "selector", "name", "class", "onClick:", "performFailure:", "failures", "result"]}),
  4660. smalltalk.TestRunner);
  4661. smalltalk.addMethod(
  4662. smalltalk.method({
  4663. selector: "renderResultsOn:",
  4664. fn: function (html){
  4665. var self=this;
  4666. return smalltalk.withContext(function($ctx1) {
  4667. self["@statusDiv"]=_st(html)._div();
  4668. _st(html)._with_(self._progressBar());
  4669. self["@methodsList"]=_st(_st(html)._ul())._class_("amber_column sunit results");
  4670. self._updateMethodsList();
  4671. self._updateStatusDiv();
  4672. return self}, function($ctx1) {$ctx1.fill(self,"renderResultsOn:",{html:html},smalltalk.TestRunner)})},
  4673. messageSends: ["div", "with:", "progressBar", "class:", "ul", "updateMethodsList", "updateStatusDiv"]}),
  4674. smalltalk.TestRunner);
  4675. smalltalk.addMethod(
  4676. smalltalk.method({
  4677. selector: "result",
  4678. fn: function (){
  4679. var self=this;
  4680. return smalltalk.withContext(function($ctx1) {
  4681. var $1;
  4682. $1=self["@result"];
  4683. return $1;
  4684. }, function($ctx1) {$ctx1.fill(self,"result",{},smalltalk.TestRunner)})},
  4685. messageSends: []}),
  4686. smalltalk.TestRunner);
  4687. smalltalk.addMethod(
  4688. smalltalk.method({
  4689. selector: "run:",
  4690. fn: function (aCollection){
  4691. var self=this;
  4692. var worker;
  4693. function $TestSuiteRunner(){return smalltalk.TestSuiteRunner||(typeof TestSuiteRunner=="undefined"?nil:TestSuiteRunner)}
  4694. function $ResultAnnouncement(){return smalltalk.ResultAnnouncement||(typeof ResultAnnouncement=="undefined"?nil:ResultAnnouncement)}
  4695. return smalltalk.withContext(function($ctx1) {
  4696. var $1;
  4697. worker=_st($TestSuiteRunner())._on_(aCollection);
  4698. self["@result"]=_st(worker)._result();
  4699. _st(_st(worker)._announcer())._on_do_($ResultAnnouncement(),(function(ann){
  4700. return smalltalk.withContext(function($ctx2) {
  4701. $1=_st(_st(ann)._result()).__eq_eq(self["@result"]);
  4702. if(smalltalk.assert($1)){
  4703. _st(self._progressBar())._updatePercent_(_st(_st(_st(self["@result"])._runs()).__slash(_st(self["@result"])._total())).__star((100)));
  4704. self._updateStatusDiv();
  4705. return self._updateMethodsList();
  4706. };
  4707. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  4708. _st(worker)._run();
  4709. return self}, function($ctx1) {$ctx1.fill(self,"run:",{aCollection:aCollection,worker:worker},smalltalk.TestRunner)})},
  4710. messageSends: ["on:", "result", "on:do:", "ifTrue:", "updatePercent:", "*", "/", "total", "runs", "progressBar", "updateStatusDiv", "updateMethodsList", "==", "announcer", "run"]}),
  4711. smalltalk.TestRunner);
  4712. smalltalk.addMethod(
  4713. smalltalk.method({
  4714. selector: "selectAllCategories",
  4715. fn: function (){
  4716. var self=this;
  4717. return smalltalk.withContext(function($ctx1) {
  4718. var $1,$2,$3;
  4719. _st(self._packages())._do_((function(each){
  4720. return smalltalk.withContext(function($ctx2) {
  4721. $1=_st(self["@selectedCategories"])._includes_(each);
  4722. if(! smalltalk.assert($1)){
  4723. return _st(self._selectedCategories())._add_(each);
  4724. };
  4725. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  4726. $2=self;
  4727. _st($2)._updateCategoriesList();
  4728. $3=_st($2)._updateClassesList();
  4729. return self}, function($ctx1) {$ctx1.fill(self,"selectAllCategories",{},smalltalk.TestRunner)})},
  4730. messageSends: ["do:", "ifFalse:", "add:", "selectedCategories", "includes:", "packages", "updateCategoriesList", "updateClassesList"]}),
  4731. smalltalk.TestRunner);
  4732. smalltalk.addMethod(
  4733. smalltalk.method({
  4734. selector: "selectAllClasses",
  4735. fn: function (){
  4736. var self=this;
  4737. return smalltalk.withContext(function($ctx1) {
  4738. var $1,$2,$3;
  4739. _st(self._classes())._do_((function(each){
  4740. return smalltalk.withContext(function($ctx2) {
  4741. $1=_st(self["@selectedClasses"])._includes_(each);
  4742. if(! smalltalk.assert($1)){
  4743. return _st(self._selectedClasses())._add_(each);
  4744. };
  4745. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  4746. $2=self;
  4747. _st($2)._updateCategoriesList();
  4748. $3=_st($2)._updateClassesList();
  4749. return self}, function($ctx1) {$ctx1.fill(self,"selectAllClasses",{},smalltalk.TestRunner)})},
  4750. messageSends: ["do:", "ifFalse:", "add:", "selectedClasses", "includes:", "classes", "updateCategoriesList", "updateClassesList"]}),
  4751. smalltalk.TestRunner);
  4752. smalltalk.addMethod(
  4753. smalltalk.method({
  4754. selector: "selectedCategories",
  4755. fn: function (){
  4756. var self=this;
  4757. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  4758. return smalltalk.withContext(function($ctx1) {
  4759. var $2,$1;
  4760. $2=self["@selectedCategories"];
  4761. if(($receiver = $2) == nil || $receiver == undefined){
  4762. self["@selectedCategories"]=_st($Array())._new();
  4763. $1=self["@selectedCategories"];
  4764. } else {
  4765. $1=$2;
  4766. };
  4767. return $1;
  4768. }, function($ctx1) {$ctx1.fill(self,"selectedCategories",{},smalltalk.TestRunner)})},
  4769. messageSends: ["ifNil:", "new"]}),
  4770. smalltalk.TestRunner);
  4771. smalltalk.addMethod(
  4772. smalltalk.method({
  4773. selector: "selectedClasses",
  4774. fn: function (){
  4775. var self=this;
  4776. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  4777. return smalltalk.withContext(function($ctx1) {
  4778. var $2,$1;
  4779. $2=self["@selectedClasses"];
  4780. if(($receiver = $2) == nil || $receiver == undefined){
  4781. self["@selectedClasses"]=_st($Array())._new();
  4782. $1=self["@selectedClasses"];
  4783. } else {
  4784. $1=$2;
  4785. };
  4786. return $1;
  4787. }, function($ctx1) {$ctx1.fill(self,"selectedClasses",{},smalltalk.TestRunner)})},
  4788. messageSends: ["ifNil:", "new"]}),
  4789. smalltalk.TestRunner);
  4790. smalltalk.addMethod(
  4791. smalltalk.method({
  4792. selector: "statusInfo",
  4793. fn: function (){
  4794. var self=this;
  4795. return smalltalk.withContext(function($ctx1) {
  4796. var $1;
  4797. $1=_st(_st(_st(self._printTotal()).__comma(self._printPasses())).__comma(self._printErrors())).__comma(self._printFailures());
  4798. return $1;
  4799. }, function($ctx1) {$ctx1.fill(self,"statusInfo",{},smalltalk.TestRunner)})},
  4800. messageSends: [",", "printFailures", "printErrors", "printPasses", "printTotal"]}),
  4801. smalltalk.TestRunner);
  4802. smalltalk.addMethod(
  4803. smalltalk.method({
  4804. selector: "testCases",
  4805. fn: function (){
  4806. var self=this;
  4807. var testCases;
  4808. return smalltalk.withContext(function($ctx1) {
  4809. var $1;
  4810. testCases=[];
  4811. _st(_st(self._selectedClasses())._select_((function(each){
  4812. return smalltalk.withContext(function($ctx2) {
  4813. return _st(self._selectedCategories())._includes_(_st(each)._category());
  4814. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._do_((function(each){
  4815. return smalltalk.withContext(function($ctx2) {
  4816. return _st(testCases)._addAll_(_st(each)._buildSuite());
  4817. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  4818. $1=testCases;
  4819. return $1;
  4820. }, function($ctx1) {$ctx1.fill(self,"testCases",{testCases:testCases},smalltalk.TestRunner)})},
  4821. messageSends: ["do:", "addAll:", "buildSuite", "select:", "includes:", "category", "selectedCategories", "selectedClasses"]}),
  4822. smalltalk.TestRunner);
  4823. smalltalk.addMethod(
  4824. smalltalk.method({
  4825. selector: "toggleCategory:",
  4826. fn: function (aCategory){
  4827. var self=this;
  4828. return smalltalk.withContext(function($ctx1) {
  4829. var $1,$2,$3;
  4830. $1=self._isSelectedCategory_(aCategory);
  4831. if(smalltalk.assert($1)){
  4832. _st(self["@selectedCategories"])._remove_(aCategory);
  4833. } else {
  4834. _st(self["@selectedCategories"])._add_(aCategory);
  4835. };
  4836. $2=self;
  4837. _st($2)._updateCategoriesList();
  4838. $3=_st($2)._updateClassesList();
  4839. return self}, function($ctx1) {$ctx1.fill(self,"toggleCategory:",{aCategory:aCategory},smalltalk.TestRunner)})},
  4840. messageSends: ["ifFalse:ifTrue:", "add:", "remove:", "isSelectedCategory:", "updateCategoriesList", "updateClassesList"]}),
  4841. smalltalk.TestRunner);
  4842. smalltalk.addMethod(
  4843. smalltalk.method({
  4844. selector: "toggleClass:",
  4845. fn: function (aClass){
  4846. var self=this;
  4847. return smalltalk.withContext(function($ctx1) {
  4848. var $1;
  4849. $1=self._isSelectedClass_(aClass);
  4850. if(smalltalk.assert($1)){
  4851. _st(self["@selectedClasses"])._remove_(aClass);
  4852. } else {
  4853. _st(self["@selectedClasses"])._add_(aClass);
  4854. };
  4855. self._updateClassesList();
  4856. return self}, function($ctx1) {$ctx1.fill(self,"toggleClass:",{aClass:aClass},smalltalk.TestRunner)})},
  4857. messageSends: ["ifFalse:ifTrue:", "add:", "remove:", "isSelectedClass:", "updateClassesList"]}),
  4858. smalltalk.TestRunner);
  4859. smalltalk.addMethod(
  4860. smalltalk.method({
  4861. selector: "updateCategoriesList",
  4862. fn: function (){
  4863. var self=this;
  4864. return smalltalk.withContext(function($ctx1) {
  4865. var $1,$2,$3,$4,$5;
  4866. _st(self["@packagesList"])._contents_((function(html){
  4867. return smalltalk.withContext(function($ctx2) {
  4868. $1=_st(html)._li();
  4869. _st($1)._class_("all");
  4870. _st($1)._with_("All");
  4871. $2=_st($1)._onClick_((function(){
  4872. return smalltalk.withContext(function($ctx3) {
  4873. return self._selectAllCategories();
  4874. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  4875. $2;
  4876. return _st(self._packages())._do_((function(each){
  4877. var li;
  4878. return smalltalk.withContext(function($ctx3) {
  4879. li=_st(html)._li();
  4880. li;
  4881. $3=_st(self._selectedCategories())._includes_(each);
  4882. if(smalltalk.assert($3)){
  4883. _st(li)._class_("selected");
  4884. };
  4885. $4=li;
  4886. _st($4)._with_(each);
  4887. $5=_st($4)._onClick_((function(){
  4888. return smalltalk.withContext(function($ctx4) {
  4889. return self._toggleCategory_(each);
  4890. }, function($ctx4) {$ctx4.fillBlock({},$ctx3)})}));
  4891. return $5;
  4892. }, function($ctx3) {$ctx3.fillBlock({each:each,li:li},$ctx2)})}));
  4893. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}));
  4894. return self}, function($ctx1) {$ctx1.fill(self,"updateCategoriesList",{},smalltalk.TestRunner)})},
  4895. messageSends: ["contents:", "class:", "li", "with:", "onClick:", "selectAllCategories", "do:", "ifTrue:", "includes:", "selectedCategories", "toggleCategory:", "packages"]}),
  4896. smalltalk.TestRunner);
  4897. smalltalk.addMethod(
  4898. smalltalk.method({
  4899. selector: "updateClassesList",
  4900. fn: function (){
  4901. var self=this;
  4902. return smalltalk.withContext(function($ctx1) {
  4903. var $1,$2,$3,$4,$5,$6;
  4904. _st(self["@classesList"])._contents_((function(html){
  4905. return smalltalk.withContext(function($ctx2) {
  4906. $1=_st(self._selectedCategories())._isEmpty();
  4907. if(! smalltalk.assert($1)){
  4908. $2=_st(html)._li();
  4909. _st($2)._class_("all");
  4910. _st($2)._with_("All");
  4911. $3=_st($2)._onClick_((function(){
  4912. return smalltalk.withContext(function($ctx3) {
  4913. return self._selectAllClasses();
  4914. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  4915. $3;
  4916. };
  4917. return _st(self._classes())._do_((function(each){
  4918. var li;
  4919. return smalltalk.withContext(function($ctx3) {
  4920. li=_st(html)._li();
  4921. li;
  4922. $4=_st(self._selectedClasses())._includes_(each);
  4923. if(smalltalk.assert($4)){
  4924. _st(li)._class_("selected");
  4925. };
  4926. $5=li;
  4927. _st($5)._with_(_st(each)._name());
  4928. $6=_st($5)._onClick_((function(){
  4929. return smalltalk.withContext(function($ctx4) {
  4930. return self._toggleClass_(each);
  4931. }, function($ctx4) {$ctx4.fillBlock({},$ctx3)})}));
  4932. return $6;
  4933. }, function($ctx3) {$ctx3.fillBlock({each:each,li:li},$ctx2)})}));
  4934. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}));
  4935. return self}, function($ctx1) {$ctx1.fill(self,"updateClassesList",{},smalltalk.TestRunner)})},
  4936. messageSends: ["contents:", "ifFalse:", "class:", "li", "with:", "onClick:", "selectAllClasses", "isEmpty", "selectedCategories", "do:", "ifTrue:", "includes:", "selectedClasses", "name", "toggleClass:", "classes"]}),
  4937. smalltalk.TestRunner);
  4938. smalltalk.addMethod(
  4939. smalltalk.method({
  4940. selector: "updateMethodsList",
  4941. fn: function (){
  4942. var self=this;
  4943. return smalltalk.withContext(function($ctx1) {
  4944. _st(self["@methodsList"])._contents_((function(html){
  4945. return smalltalk.withContext(function($ctx2) {
  4946. self._renderErrorsOn_(html);
  4947. return self._renderFailuresOn_(html);
  4948. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}));
  4949. return self}, function($ctx1) {$ctx1.fill(self,"updateMethodsList",{},smalltalk.TestRunner)})},
  4950. messageSends: ["contents:", "renderErrorsOn:", "renderFailuresOn:"]}),
  4951. smalltalk.TestRunner);
  4952. smalltalk.addMethod(
  4953. smalltalk.method({
  4954. selector: "updateStatusDiv",
  4955. fn: function (){
  4956. var self=this;
  4957. return smalltalk.withContext(function($ctx1) {
  4958. _st(self["@statusDiv"])._class_("sunit status ".__comma(_st(self["@result"])._status()));
  4959. _st(self["@statusDiv"])._contents_((function(html){
  4960. return smalltalk.withContext(function($ctx2) {
  4961. return _st(_st(html)._span())._with_(self._statusInfo());
  4962. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}));
  4963. return self}, function($ctx1) {$ctx1.fill(self,"updateStatusDiv",{},smalltalk.TestRunner)})},
  4964. messageSends: ["class:", ",", "status", "contents:", "with:", "statusInfo", "span"]}),
  4965. smalltalk.TestRunner);
  4966. smalltalk.addClass('Workspace', smalltalk.TabWidget, ['sourceArea'], 'IDE');
  4967. smalltalk.addMethod(
  4968. smalltalk.method({
  4969. selector: "clearWorkspace",
  4970. fn: function (){
  4971. var self=this;
  4972. return smalltalk.withContext(function($ctx1) {
  4973. _st(self["@sourceArea"])._clear();
  4974. return self}, function($ctx1) {$ctx1.fill(self,"clearWorkspace",{},smalltalk.Workspace)})},
  4975. messageSends: ["clear"]}),
  4976. smalltalk.Workspace);
  4977. smalltalk.addMethod(
  4978. smalltalk.method({
  4979. selector: "doIt",
  4980. fn: function (){
  4981. var self=this;
  4982. return smalltalk.withContext(function($ctx1) {
  4983. _st(self["@sourceArea"])._doIt();
  4984. return self}, function($ctx1) {$ctx1.fill(self,"doIt",{},smalltalk.Workspace)})},
  4985. messageSends: ["doIt"]}),
  4986. smalltalk.Workspace);
  4987. smalltalk.addMethod(
  4988. smalltalk.method({
  4989. selector: "fileIn",
  4990. fn: function (){
  4991. var self=this;
  4992. return smalltalk.withContext(function($ctx1) {
  4993. _st(self["@sourceArea"])._fileIn();
  4994. return self}, function($ctx1) {$ctx1.fill(self,"fileIn",{},smalltalk.Workspace)})},
  4995. messageSends: ["fileIn"]}),
  4996. smalltalk.Workspace);
  4997. smalltalk.addMethod(
  4998. smalltalk.method({
  4999. selector: "inspectIt",
  5000. fn: function (){
  5001. var self=this;
  5002. return smalltalk.withContext(function($ctx1) {
  5003. _st(self["@sourceArea"])._inspectIt();
  5004. return self}, function($ctx1) {$ctx1.fill(self,"inspectIt",{},smalltalk.Workspace)})},
  5005. messageSends: ["inspectIt"]}),
  5006. smalltalk.Workspace);
  5007. smalltalk.addMethod(
  5008. smalltalk.method({
  5009. selector: "label",
  5010. fn: function (){
  5011. var self=this;
  5012. return smalltalk.withContext(function($ctx1) {
  5013. return "Workspace";
  5014. }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.Workspace)})},
  5015. messageSends: []}),
  5016. smalltalk.Workspace);
  5017. smalltalk.addMethod(
  5018. smalltalk.method({
  5019. selector: "printIt",
  5020. fn: function (){
  5021. var self=this;
  5022. return smalltalk.withContext(function($ctx1) {
  5023. _st(self["@sourceArea"])._printIt();
  5024. return self}, function($ctx1) {$ctx1.fill(self,"printIt",{},smalltalk.Workspace)})},
  5025. messageSends: ["printIt"]}),
  5026. smalltalk.Workspace);
  5027. smalltalk.addMethod(
  5028. smalltalk.method({
  5029. selector: "renderBoxOn:",
  5030. fn: function (html){
  5031. var self=this;
  5032. function $SourceArea(){return smalltalk.SourceArea||(typeof SourceArea=="undefined"?nil:SourceArea)}
  5033. return smalltalk.withContext(function($ctx1) {
  5034. self["@sourceArea"]=_st($SourceArea())._new();
  5035. _st(self["@sourceArea"])._renderOn_(html);
  5036. return self}, function($ctx1) {$ctx1.fill(self,"renderBoxOn:",{html:html},smalltalk.Workspace)})},
  5037. messageSends: ["new", "renderOn:"]}),
  5038. smalltalk.Workspace);
  5039. smalltalk.addMethod(
  5040. smalltalk.method({
  5041. selector: "renderButtonsOn:",
  5042. fn: function (html){
  5043. var self=this;
  5044. return smalltalk.withContext(function($ctx1) {
  5045. var $1,$2,$3,$4,$5,$6,$7,$8,$9,$10;
  5046. $1=_st(html)._button();
  5047. _st($1)._with_("DoIt");
  5048. _st($1)._title_("ctrl+d");
  5049. $2=_st($1)._onClick_((function(){
  5050. return smalltalk.withContext(function($ctx2) {
  5051. return self._doIt();
  5052. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  5053. $3=_st(html)._button();
  5054. _st($3)._with_("PrintIt");
  5055. _st($3)._title_("ctrl+p");
  5056. $4=_st($3)._onClick_((function(){
  5057. return smalltalk.withContext(function($ctx2) {
  5058. return self._printIt();
  5059. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  5060. $5=_st(html)._button();
  5061. _st($5)._with_("InspectIt");
  5062. _st($5)._title_("ctrl+i");
  5063. $6=_st($5)._onClick_((function(){
  5064. return smalltalk.withContext(function($ctx2) {
  5065. return self._inspectIt();
  5066. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  5067. $7=_st(html)._button();
  5068. _st($7)._with_("FileIn");
  5069. _st($7)._title_("ctrl+f");
  5070. $8=_st($7)._onClick_((function(){
  5071. return smalltalk.withContext(function($ctx2) {
  5072. return self._fileIn();
  5073. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  5074. $9=_st(html)._button();
  5075. _st($9)._with_("Clear workspace");
  5076. $10=_st($9)._onClick_((function(){
  5077. return smalltalk.withContext(function($ctx2) {
  5078. return self._clearWorkspace();
  5079. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  5080. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},smalltalk.Workspace)})},
  5081. messageSends: ["with:", "button", "title:", "onClick:", "doIt", "printIt", "inspectIt", "fileIn", "clearWorkspace"]}),
  5082. smalltalk.Workspace);
  5083. smalltalk.addMethod(
  5084. smalltalk.method({
  5085. selector: "show",
  5086. fn: function (){
  5087. var self=this;
  5088. return smalltalk.withContext(function($ctx1) {
  5089. smalltalk.Workspace.superclass.fn.prototype._show.apply(_st(self), []);
  5090. _st(self["@sourceArea"])._focus();
  5091. return self}, function($ctx1) {$ctx1.fill(self,"show",{},smalltalk.Workspace)})},
  5092. messageSends: ["show", "focus"]}),
  5093. smalltalk.Workspace);
  5094. smalltalk.addMethod(
  5095. smalltalk.method({
  5096. selector: "inspectOn:",
  5097. fn: function (anInspector){
  5098. var self=this;
  5099. var variables;
  5100. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  5101. return smalltalk.withContext(function($ctx1) {
  5102. var $1,$2;
  5103. variables=_st($Dictionary())._new();
  5104. _st(variables)._at_put_("#self",self);
  5105. self._withIndexDo_((function(each,i){
  5106. return smalltalk.withContext(function($ctx2) {
  5107. return _st(variables)._at_put_(i,each);
  5108. }, function($ctx2) {$ctx2.fillBlock({each:each,i:i},$ctx1)})}));
  5109. $1=anInspector;
  5110. _st($1)._setLabel_(self._printString());
  5111. $2=_st($1)._setVariables_(variables);
  5112. return self}, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector,variables:variables},smalltalk.Collection)})},
  5113. messageSends: ["new", "at:put:", "withIndexDo:", "setLabel:", "printString", "setVariables:"]}),
  5114. smalltalk.Collection);
  5115. smalltalk.addMethod(
  5116. smalltalk.method({
  5117. selector: "inspectOn:",
  5118. fn: function (anInspector){
  5119. var self=this;
  5120. var variables;
  5121. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  5122. return smalltalk.withContext(function($ctx1) {
  5123. var $1,$2;
  5124. variables=_st($Dictionary())._new();
  5125. _st(variables)._at_put_("#self",self);
  5126. _st(variables)._at_put_("#keys",self._keys());
  5127. self._keysAndValuesDo_((function(key,value){
  5128. return smalltalk.withContext(function($ctx2) {
  5129. return _st(variables)._at_put_(key,value);
  5130. }, function($ctx2) {$ctx2.fillBlock({key:key,value:value},$ctx1)})}));
  5131. $1=anInspector;
  5132. _st($1)._setLabel_(self._printString());
  5133. $2=_st($1)._setVariables_(variables);
  5134. return self}, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector,variables:variables},smalltalk.HashedCollection)})},
  5135. messageSends: ["new", "at:put:", "keys", "keysAndValuesDo:", "setLabel:", "printString", "setVariables:"]}),
  5136. smalltalk.HashedCollection);
  5137. smalltalk.addMethod(
  5138. smalltalk.method({
  5139. selector: "inspectOn:",
  5140. fn: function (anInspector){
  5141. var self=this;
  5142. var label;
  5143. return smalltalk.withContext(function($ctx1) {
  5144. var $1;
  5145. smalltalk.String.superclass.fn.prototype._inspectOn_.apply(_st(self), [anInspector]);
  5146. $1=_st(_st(self._printString())._size()).__gt((30));
  5147. if(smalltalk.assert($1)){
  5148. label=_st(_st(self._printString())._copyFrom_to_((1),(30))).__comma("...'");
  5149. label;
  5150. } else {
  5151. label=self._printString();
  5152. label;
  5153. };
  5154. _st(anInspector)._setLabel_(label);
  5155. return self}, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector,label:label},smalltalk.String)})},
  5156. messageSends: ["inspectOn:", "ifTrue:ifFalse:", ",", "copyFrom:to:", "printString", ">", "size", "setLabel:"]}),
  5157. smalltalk.String);
  5158. smalltalk.addMethod(
  5159. smalltalk.method({
  5160. selector: "inspectOn:",
  5161. fn: function (anInspector){
  5162. var self=this;
  5163. var variables;
  5164. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  5165. return smalltalk.withContext(function($ctx1) {
  5166. var $1,$2;
  5167. variables=_st($Dictionary())._new();
  5168. _st(variables)._at_put_("#self",self);
  5169. _st(self["@elements"])._withIndexDo_((function(each,i){
  5170. return smalltalk.withContext(function($ctx2) {
  5171. return _st(variables)._at_put_(i,each);
  5172. }, function($ctx2) {$ctx2.fillBlock({each:each,i:i},$ctx1)})}));
  5173. $1=anInspector;
  5174. _st($1)._setLabel_(self._printString());
  5175. $2=_st($1)._setVariables_(variables);
  5176. return self}, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector,variables:variables},smalltalk.Set)})},
  5177. messageSends: ["new", "at:put:", "withIndexDo:", "setLabel:", "printString", "setVariables:"]}),
  5178. smalltalk.Set);
  5179. smalltalk.addMethod(
  5180. smalltalk.method({
  5181. selector: "inspectOn:",
  5182. fn: function (anInspector){
  5183. var self=this;
  5184. var variables;
  5185. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  5186. return smalltalk.withContext(function($ctx1) {
  5187. var $1,$2;
  5188. variables=_st($Dictionary())._new();
  5189. _st(variables)._at_put_("#self",self);
  5190. _st(variables)._at_put_("#year",self._year());
  5191. _st(variables)._at_put_("#month",self._month());
  5192. _st(variables)._at_put_("#day",self._day());
  5193. _st(variables)._at_put_("#hours",self._hours());
  5194. _st(variables)._at_put_("#minutes",self._minutes());
  5195. _st(variables)._at_put_("#seconds",self._seconds());
  5196. _st(variables)._at_put_("#milliseconds",self._milliseconds());
  5197. $1=anInspector;
  5198. _st($1)._setLabel_(self._printString());
  5199. $2=_st($1)._setVariables_(variables);
  5200. return self}, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector,variables:variables},smalltalk.Date)})},
  5201. messageSends: ["new", "at:put:", "year", "month", "day", "hours", "minutes", "seconds", "milliseconds", "setLabel:", "printString", "setVariables:"]}),
  5202. smalltalk.Date);
  5203. smalltalk.addMethod(
  5204. smalltalk.method({
  5205. selector: "inspectOn:",
  5206. fn: function (anInspector){
  5207. var self=this;
  5208. var variables;
  5209. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  5210. return smalltalk.withContext(function($ctx1) {
  5211. var $1,$2;
  5212. variables=_st($Dictionary())._new();
  5213. _st(variables)._at_put_("#self",self);
  5214. _st(variables)._at_put_("#home",self._home());
  5215. _st(variables)._at_put_("#receiver",self._receiver());
  5216. _st(variables)._at_put_("#selector",self._selector());
  5217. _st(variables)._at_put_("#temps",self._temps());
  5218. _st(_st(self._class())._instanceVariableNames())._do_((function(each){
  5219. return smalltalk.withContext(function($ctx2) {
  5220. return _st(variables)._at_put_(each,self._instVarAt_(each));
  5221. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  5222. $1=anInspector;
  5223. _st($1)._setLabel_(self._printString());
  5224. $2=_st($1)._setVariables_(variables);
  5225. return self}, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector,variables:variables},smalltalk.MethodContext)})},
  5226. messageSends: ["new", "at:put:", "home", "receiver", "selector", "temps", "do:", "instVarAt:", "instanceVariableNames", "class", "setLabel:", "printString", "setVariables:"]}),
  5227. smalltalk.MethodContext);
  5228. });