IDE.deploy.js 189 KB

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