1
0

IDE.deploy.js 188 KB

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