ext-all.js 674 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042
  1. /*
  2. * Ext JS Library 2.0.2 Copyright(c) 2006-2008, Ext JS, LLC. licensing@extjs.com
  3. *
  4. * http://extjs.com/license
  5. */
  6. Ext.DomHelper = function() {
  7. var L = null;
  8. var F = /^(?:br|frame|hr|img|input|link|meta|range|spacer|wbr|area|param|col)$/i;
  9. var B = /^table|tbody|tr|td$/i;
  10. var A = function(T) {
  11. if (typeof T == "string") {
  12. return T
  13. }
  14. var O = "";
  15. if (Ext.isArray(T)) {
  16. for (var R = 0, P = T.length; R < P; R++) {
  17. O += A(T[R])
  18. }
  19. return O
  20. }
  21. if (!T.tag) {
  22. T.tag = "div"
  23. }
  24. O += "<" + T.tag;
  25. for (var N in T) {
  26. if (N == "tag" || N == "children" || N == "cn" || N == "html"
  27. || typeof T[N] == "function") {
  28. continue
  29. }
  30. if (N == "style") {
  31. var S = T["style"];
  32. if (typeof S == "function") {
  33. S = S.call()
  34. }
  35. if (typeof S == "string") {
  36. O += " style=\"" + S + "\""
  37. } else {
  38. if (typeof S == "object") {
  39. O += " style=\"";
  40. for (var Q in S) {
  41. if (typeof S[Q] != "function") {
  42. O += Q + ":" + S[Q] + ";"
  43. }
  44. }
  45. O += "\""
  46. }
  47. }
  48. } else {
  49. if (N == "cls") {
  50. O += " class=\"" + T["cls"] + "\""
  51. } else {
  52. if (N == "htmlFor") {
  53. O += " for=\"" + T["htmlFor"] + "\""
  54. } else {
  55. O += " " + N + "=\"" + T[N] + "\""
  56. }
  57. }
  58. }
  59. }
  60. if (F.test(T.tag)) {
  61. O += "/>"
  62. } else {
  63. O += ">";
  64. var U = T.children || T.cn;
  65. if (U) {
  66. O += A(U)
  67. } else {
  68. if (T.html) {
  69. O += T.html
  70. }
  71. }
  72. O += "</" + T.tag + ">"
  73. }
  74. return O
  75. };
  76. var M = function(T, O) {
  77. var S;
  78. if (Ext.isArray(T)) {
  79. S = document.createDocumentFragment();
  80. for (var R = 0, P = T.length; R < P; R++) {
  81. M(T[R], S)
  82. }
  83. } else {
  84. if (typeof T == "string)") {
  85. S = document.createTextNode(T)
  86. } else {
  87. S = document.createElement(T.tag || "div");
  88. var Q = !!S.setAttribute;
  89. for (var N in T) {
  90. if (N == "tag" || N == "children" || N == "cn"
  91. || N == "html" || N == "style"
  92. || typeof T[N] == "function") {
  93. continue
  94. }
  95. if (N == "cls") {
  96. S.className = T["cls"]
  97. } else {
  98. if (Q) {
  99. S.setAttribute(N, T[N])
  100. } else {
  101. S[N] = T[N]
  102. }
  103. }
  104. }
  105. Ext.DomHelper.applyStyles(S, T.style);
  106. var U = T.children || T.cn;
  107. if (U) {
  108. M(U, S)
  109. } else {
  110. if (T.html) {
  111. S.innerHTML = T.html
  112. }
  113. }
  114. }
  115. }
  116. if (O) {
  117. O.appendChild(S)
  118. }
  119. return S
  120. };
  121. var I = function(S, Q, P, R) {
  122. L.innerHTML = [Q, P, R].join("");
  123. var N = -1, O = L;
  124. while (++N < S) {
  125. O = O.firstChild
  126. }
  127. return O
  128. };
  129. var J = "<table>", E = "</table>", C = J + "<tbody>", K = "</tbody>" + E, H = C
  130. + "<tr>", D = "</tr>" + K;
  131. var G = function(N, O, Q, P) {
  132. if (!L) {
  133. L = document.createElement("div")
  134. }
  135. var R;
  136. var S = null;
  137. if (N == "td") {
  138. if (O == "afterbegin" || O == "beforeend") {
  139. return
  140. }
  141. if (O == "beforebegin") {
  142. S = Q;
  143. Q = Q.parentNode
  144. } else {
  145. S = Q.nextSibling;
  146. Q = Q.parentNode
  147. }
  148. R = I(4, H, P, D)
  149. } else {
  150. if (N == "tr") {
  151. if (O == "beforebegin") {
  152. S = Q;
  153. Q = Q.parentNode;
  154. R = I(3, C, P, K)
  155. } else {
  156. if (O == "afterend") {
  157. S = Q.nextSibling;
  158. Q = Q.parentNode;
  159. R = I(3, C, P, K)
  160. } else {
  161. if (O == "afterbegin") {
  162. S = Q.firstChild
  163. }
  164. R = I(4, H, P, D)
  165. }
  166. }
  167. } else {
  168. if (N == "tbody") {
  169. if (O == "beforebegin") {
  170. S = Q;
  171. Q = Q.parentNode;
  172. R = I(2, J, P, E)
  173. } else {
  174. if (O == "afterend") {
  175. S = Q.nextSibling;
  176. Q = Q.parentNode;
  177. R = I(2, J, P, E)
  178. } else {
  179. if (O == "afterbegin") {
  180. S = Q.firstChild
  181. }
  182. R = I(3, C, P, K)
  183. }
  184. }
  185. } else {
  186. if (O == "beforebegin" || O == "afterend") {
  187. return
  188. }
  189. if (O == "afterbegin") {
  190. S = Q.firstChild
  191. }
  192. R = I(2, J, P, E)
  193. }
  194. }
  195. }
  196. Q.insertBefore(R, S);
  197. return R
  198. };
  199. return {
  200. useDom : false,
  201. markup : function(N) {
  202. return A(N)
  203. },
  204. applyStyles : function(P, Q) {
  205. if (Q) {
  206. P = Ext.fly(P);
  207. if (typeof Q == "string") {
  208. var O = /\s?([a-z\-]*)\:\s?([^;]*);?/gi;
  209. var R;
  210. while ((R = O.exec(Q)) != null) {
  211. P.setStyle(R[1], R[2])
  212. }
  213. } else {
  214. if (typeof Q == "object") {
  215. for (var N in Q) {
  216. P.setStyle(N, Q[N])
  217. }
  218. } else {
  219. if (typeof Q == "function") {
  220. Ext.DomHelper.applyStyles(P, Q.call())
  221. }
  222. }
  223. }
  224. }
  225. },
  226. insertHtml : function(P, R, Q) {
  227. P = P.toLowerCase();
  228. if (R.insertAdjacentHTML) {
  229. if (B.test(R.tagName)) {
  230. var O;
  231. if (O = G(R.tagName.toLowerCase(), P, R, Q)) {
  232. return O
  233. }
  234. }
  235. switch (P) {
  236. case "beforebegin" :
  237. R.insertAdjacentHTML("BeforeBegin", Q);
  238. return R.previousSibling;
  239. case "afterbegin" :
  240. R.insertAdjacentHTML("AfterBegin", Q);
  241. return R.firstChild;
  242. case "beforeend" :
  243. R.insertAdjacentHTML("BeforeEnd", Q);
  244. return R.lastChild;
  245. case "afterend" :
  246. R.insertAdjacentHTML("AfterEnd", Q);
  247. return R.nextSibling
  248. }
  249. throw "Illegal insertion point -> \"" + P + "\""
  250. }
  251. var N = R.ownerDocument.createRange();
  252. var S;
  253. switch (P) {
  254. case "beforebegin" :
  255. N.setStartBefore(R);
  256. S = N.createContextualFragment(Q);
  257. R.parentNode.insertBefore(S, R);
  258. return R.previousSibling;
  259. case "afterbegin" :
  260. if (R.firstChild) {
  261. N.setStartBefore(R.firstChild);
  262. S = N.createContextualFragment(Q);
  263. R.insertBefore(S, R.firstChild);
  264. return R.firstChild
  265. } else {
  266. R.innerHTML = Q;
  267. return R.firstChild
  268. }
  269. case "beforeend" :
  270. if (R.lastChild) {
  271. N.setStartAfter(R.lastChild);
  272. S = N.createContextualFragment(Q);
  273. R.appendChild(S);
  274. return R.lastChild
  275. } else {
  276. R.innerHTML = Q;
  277. return R.lastChild
  278. }
  279. case "afterend" :
  280. N.setStartAfter(R);
  281. S = N.createContextualFragment(Q);
  282. R.parentNode.insertBefore(S, R.nextSibling);
  283. return R.nextSibling
  284. }
  285. throw "Illegal insertion point -> \"" + P + "\""
  286. },
  287. insertBefore : function(N, P, O) {
  288. return this.doInsert(N, P, O, "beforeBegin")
  289. },
  290. insertAfter : function(N, P, O) {
  291. return this.doInsert(N, P, O, "afterEnd", "nextSibling")
  292. },
  293. insertFirst : function(N, P, O) {
  294. return this.doInsert(N, P, O, "afterBegin", "firstChild")
  295. },
  296. doInsert : function(Q, S, R, T, P) {
  297. Q = Ext.getDom(Q);
  298. var O;
  299. if (this.useDom) {
  300. O = M(S, null);
  301. (P === "firstChild" ? Q : Q.parentNode).insertBefore(O, P
  302. ? Q[P]
  303. : Q)
  304. } else {
  305. var N = A(S);
  306. O = this.insertHtml(T, Q, N)
  307. }
  308. return R ? Ext.get(O, true) : O
  309. },
  310. append : function(P, R, Q) {
  311. P = Ext.getDom(P);
  312. var O;
  313. if (this.useDom) {
  314. O = M(R, null);
  315. P.appendChild(O)
  316. } else {
  317. var N = A(R);
  318. O = this.insertHtml("beforeEnd", P, N)
  319. }
  320. return Q ? Ext.get(O, true) : O
  321. },
  322. overwrite : function(N, P, O) {
  323. N = Ext.getDom(N);
  324. N.innerHTML = A(P);
  325. return O ? Ext.get(N.firstChild, true) : N.firstChild
  326. },
  327. createTemplate : function(O) {
  328. var N = A(O);
  329. return new Ext.Template(N)
  330. }
  331. }
  332. }();
  333. Ext.Template = function(E) {
  334. var B = arguments;
  335. if (Ext.isArray(E)) {
  336. E = E.join("")
  337. } else {
  338. if (B.length > 1) {
  339. var C = [];
  340. for (var D = 0, A = B.length; D < A; D++) {
  341. if (typeof B[D] == "object") {
  342. Ext.apply(this, B[D])
  343. } else {
  344. C[C.length] = B[D]
  345. }
  346. }
  347. E = C.join("")
  348. }
  349. }
  350. this.html = E;
  351. if (this.compiled) {
  352. this.compile()
  353. }
  354. };
  355. Ext.Template.prototype = {
  356. applyTemplate : function(B) {
  357. if (this.compiled) {
  358. return this.compiled(B)
  359. }
  360. var A = this.disableFormats !== true;
  361. var E = Ext.util.Format, C = this;
  362. var D = function(G, I, L, H) {
  363. if (L && A) {
  364. if (L.substr(0, 5) == "this.") {
  365. return C.call(L.substr(5), B[I], B)
  366. } else {
  367. if (H) {
  368. var K = /^\s*['"](.*)["']\s*$/;
  369. H = H.split(",");
  370. for (var J = 0, F = H.length; J < F; J++) {
  371. H[J] = H[J].replace(K, "$1")
  372. }
  373. H = [B[I]].concat(H)
  374. } else {
  375. H = [B[I]]
  376. }
  377. return E[L].apply(E, H)
  378. }
  379. } else {
  380. return B[I] !== undefined ? B[I] : ""
  381. }
  382. };
  383. return this.html.replace(this.re, D)
  384. },
  385. set : function(A, B) {
  386. this.html = A;
  387. this.compiled = null;
  388. if (B) {
  389. this.compile()
  390. }
  391. return this
  392. },
  393. disableFormats : false,
  394. re : /\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,
  395. compile : function() {
  396. var fm = Ext.util.Format;
  397. var useF = this.disableFormats !== true;
  398. var sep = Ext.isGecko ? "+" : ",";
  399. var fn = function(m, name, format, args) {
  400. if (format && useF) {
  401. args = args ? "," + args : "";
  402. if (format.substr(0, 5) != "this.") {
  403. format = "fm." + format + "("
  404. } else {
  405. format = "this.call(\"" + format.substr(5) + "\", ";
  406. args = ", values"
  407. }
  408. } else {
  409. args = "";
  410. format = "(values['" + name + "'] == undefined ? '' : "
  411. }
  412. return "'" + sep + format + "values['" + name + "']" + args + ")"
  413. + sep + "'"
  414. };
  415. var body;
  416. if (Ext.isGecko) {
  417. body = "this.compiled = function(values){ return '"
  418. + this.html.replace(/\\/g, "\\\\").replace(/(\r\n|\n)/g,
  419. "\\n").replace(/'/g, "\\'").replace(this.re, fn)
  420. + "';};"
  421. } else {
  422. body = ["this.compiled = function(values){ return ['"];
  423. body.push(this.html.replace(/\\/g, "\\\\").replace(/(\r\n|\n)/g,
  424. "\\n").replace(/'/g, "\\'").replace(this.re, fn));
  425. body.push("'].join('');};");
  426. body = body.join("")
  427. }
  428. eval(body);
  429. return this
  430. },
  431. call : function(C, B, A) {
  432. return this[C](B, A)
  433. },
  434. insertFirst : function(B, A, C) {
  435. return this.doInsert("afterBegin", B, A, C)
  436. },
  437. insertBefore : function(B, A, C) {
  438. return this.doInsert("beforeBegin", B, A, C)
  439. },
  440. insertAfter : function(B, A, C) {
  441. return this.doInsert("afterEnd", B, A, C)
  442. },
  443. append : function(B, A, C) {
  444. return this.doInsert("beforeEnd", B, A, C)
  445. },
  446. doInsert : function(C, E, B, A) {
  447. E = Ext.getDom(E);
  448. var D = Ext.DomHelper.insertHtml(C, E, this.applyTemplate(B));
  449. return A ? Ext.get(D, true) : D
  450. },
  451. overwrite : function(B, A, C) {
  452. B = Ext.getDom(B);
  453. B.innerHTML = this.applyTemplate(A);
  454. return C ? Ext.get(B.firstChild, true) : B.firstChild
  455. }
  456. };
  457. Ext.Template.prototype.apply = Ext.Template.prototype.applyTemplate;
  458. Ext.DomHelper.Template = Ext.Template;
  459. Ext.Template.from = function(B, A) {
  460. B = Ext.getDom(B);
  461. return new Ext.Template(B.value || B.innerHTML, A || "")
  462. };
  463. Ext.DomQuery = function() {
  464. var cache = {}, simpleCache = {}, valueCache = {};
  465. var nonSpace = /\S/;
  466. var trimRe = /^\s+|\s+$/g;
  467. var tplRe = /\{(\d+)\}/g;
  468. var modeRe = /^(\s?[\/>+~]\s?|\s|$)/;
  469. var tagTokenRe = /^(#)?([\w-\*]+)/;
  470. var nthRe = /(\d*)n\+?(\d*)/, nthRe2 = /\D/;
  471. function child(p, index) {
  472. var i = 0;
  473. var n = p.firstChild;
  474. while (n) {
  475. if (n.nodeType == 1) {
  476. if (++i == index) {
  477. return n
  478. }
  479. }
  480. n = n.nextSibling
  481. }
  482. return null
  483. }
  484. function next(n) {
  485. while ((n = n.nextSibling) && n.nodeType != 1) {
  486. }
  487. return n
  488. }
  489. function prev(n) {
  490. while ((n = n.previousSibling) && n.nodeType != 1) {
  491. }
  492. return n
  493. }
  494. function children(d) {
  495. var n = d.firstChild, ni = -1;
  496. while (n) {
  497. var nx = n.nextSibling;
  498. if (n.nodeType == 3 && !nonSpace.test(n.nodeValue)) {
  499. d.removeChild(n)
  500. } else {
  501. n.nodeIndex = ++ni
  502. }
  503. n = nx
  504. }
  505. return this
  506. }
  507. function byClassName(c, a, v) {
  508. if (!v) {
  509. return c
  510. }
  511. var r = [], ri = -1, cn;
  512. for (var i = 0, ci; ci = c[i]; i++) {
  513. if ((" " + ci.className + " ").indexOf(v) != -1) {
  514. r[++ri] = ci
  515. }
  516. }
  517. return r
  518. }
  519. function attrValue(n, attr) {
  520. if (!n.tagName && typeof n.length != "undefined") {
  521. n = n[0]
  522. }
  523. if (!n) {
  524. return null
  525. }
  526. if (attr == "for") {
  527. return n.htmlFor
  528. }
  529. if (attr == "class" || attr == "className") {
  530. return n.className
  531. }
  532. return n.getAttribute(attr) || n[attr]
  533. }
  534. function getNodes(ns, mode, tagName) {
  535. var result = [], ri = -1, cs;
  536. if (!ns) {
  537. return result
  538. }
  539. tagName = tagName || "*";
  540. if (typeof ns.getElementsByTagName != "undefined") {
  541. ns = [ns]
  542. }
  543. if (!mode) {
  544. for (var i = 0, ni; ni = ns[i]; i++) {
  545. cs = ni.getElementsByTagName(tagName);
  546. for (var j = 0, ci; ci = cs[j]; j++) {
  547. result[++ri] = ci
  548. }
  549. }
  550. } else {
  551. if (mode == "/" || mode == ">") {
  552. var utag = tagName.toUpperCase();
  553. for (var i = 0, ni, cn; ni = ns[i]; i++) {
  554. cn = ni.children || ni.childNodes;
  555. for (var j = 0, cj; cj = cn[j]; j++) {
  556. if (cj.nodeName == utag || cj.nodeName == tagName
  557. || tagName == "*") {
  558. result[++ri] = cj
  559. }
  560. }
  561. }
  562. } else {
  563. if (mode == "+") {
  564. var utag = tagName.toUpperCase();
  565. for (var i = 0, n; n = ns[i]; i++) {
  566. while ((n = n.nextSibling) && n.nodeType != 1) {
  567. }
  568. if (n
  569. && (n.nodeName == utag || n.nodeName == tagName || tagName == "*")) {
  570. result[++ri] = n
  571. }
  572. }
  573. } else {
  574. if (mode == "~") {
  575. for (var i = 0, n; n = ns[i]; i++) {
  576. while ((n = n.nextSibling)
  577. && (n.nodeType != 1 || (tagName == "*" || n.tagName
  578. .toLowerCase() != tagName))) {
  579. }
  580. if (n) {
  581. result[++ri] = n
  582. }
  583. }
  584. }
  585. }
  586. }
  587. }
  588. return result
  589. }
  590. function concat(a, b) {
  591. if (b.slice) {
  592. return a.concat(b)
  593. }
  594. for (var i = 0, l = b.length; i < l; i++) {
  595. a[a.length] = b[i]
  596. }
  597. return a
  598. }
  599. function byTag(cs, tagName) {
  600. if (cs.tagName || cs == document) {
  601. cs = [cs]
  602. }
  603. if (!tagName) {
  604. return cs
  605. }
  606. var r = [], ri = -1;
  607. tagName = tagName.toLowerCase();
  608. for (var i = 0, ci; ci = cs[i]; i++) {
  609. if (ci.nodeType == 1 && ci.tagName.toLowerCase() == tagName) {
  610. r[++ri] = ci
  611. }
  612. }
  613. return r
  614. }
  615. function byId(cs, attr, id) {
  616. if (cs.tagName || cs == document) {
  617. cs = [cs]
  618. }
  619. if (!id) {
  620. return cs
  621. }
  622. var r = [], ri = -1;
  623. for (var i = 0, ci; ci = cs[i]; i++) {
  624. if (ci && ci.id == id) {
  625. r[++ri] = ci;
  626. return r
  627. }
  628. }
  629. return r
  630. }
  631. function byAttribute(cs, attr, value, op, custom) {
  632. var r = [], ri = -1, st = custom == "{";
  633. var f = Ext.DomQuery.operators[op];
  634. for (var i = 0, ci; ci = cs[i]; i++) {
  635. var a;
  636. if (st) {
  637. a = Ext.DomQuery.getStyle(ci, attr)
  638. } else {
  639. if (attr == "class" || attr == "className") {
  640. a = ci.className
  641. } else {
  642. if (attr == "for") {
  643. a = ci.htmlFor
  644. } else {
  645. if (attr == "href") {
  646. a = ci.getAttribute("href", 2)
  647. } else {
  648. a = ci.getAttribute(attr)
  649. }
  650. }
  651. }
  652. }
  653. if ((f && f(a, value)) || (!f && a)) {
  654. r[++ri] = ci
  655. }
  656. }
  657. return r
  658. }
  659. function byPseudo(cs, name, value) {
  660. return Ext.DomQuery.pseudos[name](cs, value)
  661. }
  662. var isIE = window.ActiveXObject ? true : false;
  663. eval("var batch = 30803;");
  664. var key = 30803;
  665. function nodupIEXml(cs) {
  666. var d = ++key;
  667. cs[0].setAttribute("_nodup", d);
  668. var r = [cs[0]];
  669. for (var i = 1, len = cs.length; i < len; i++) {
  670. var c = cs[i];
  671. if (!c.getAttribute("_nodup") != d) {
  672. c.setAttribute("_nodup", d);
  673. r[r.length] = c
  674. }
  675. }
  676. for (var i = 0, len = cs.length; i < len; i++) {
  677. cs[i].removeAttribute("_nodup")
  678. }
  679. return r
  680. }
  681. function nodup(cs) {
  682. if (!cs) {
  683. return []
  684. }
  685. var len = cs.length, c, i, r = cs, cj, ri = -1;
  686. if (!len || typeof cs.nodeType != "undefined" || len == 1) {
  687. return cs
  688. }
  689. if (isIE && typeof cs[0].selectSingleNode != "undefined") {
  690. return nodupIEXml(cs)
  691. }
  692. var d = ++key;
  693. cs[0]._nodup = d;
  694. for (i = 1; c = cs[i]; i++) {
  695. if (c._nodup != d) {
  696. c._nodup = d
  697. } else {
  698. r = [];
  699. for (var j = 0; j < i; j++) {
  700. r[++ri] = cs[j]
  701. }
  702. for (j = i + 1; cj = cs[j]; j++) {
  703. if (cj._nodup != d) {
  704. cj._nodup = d;
  705. r[++ri] = cj
  706. }
  707. }
  708. return r
  709. }
  710. }
  711. return r
  712. }
  713. function quickDiffIEXml(c1, c2) {
  714. var d = ++key;
  715. for (var i = 0, len = c1.length; i < len; i++) {
  716. c1[i].setAttribute("_qdiff", d)
  717. }
  718. var r = [];
  719. for (var i = 0, len = c2.length; i < len; i++) {
  720. if (c2[i].getAttribute("_qdiff") != d) {
  721. r[r.length] = c2[i]
  722. }
  723. }
  724. for (var i = 0, len = c1.length; i < len; i++) {
  725. c1[i].removeAttribute("_qdiff")
  726. }
  727. return r
  728. }
  729. function quickDiff(c1, c2) {
  730. var len1 = c1.length;
  731. if (!len1) {
  732. return c2
  733. }
  734. if (isIE && c1[0].selectSingleNode) {
  735. return quickDiffIEXml(c1, c2)
  736. }
  737. var d = ++key;
  738. for (var i = 0; i < len1; i++) {
  739. c1[i]._qdiff = d
  740. }
  741. var r = [];
  742. for (var i = 0, len = c2.length; i < len; i++) {
  743. if (c2[i]._qdiff != d) {
  744. r[r.length] = c2[i]
  745. }
  746. }
  747. return r
  748. }
  749. function quickId(ns, mode, root, id) {
  750. if (ns == root) {
  751. var d = root.ownerDocument || root;
  752. return d.getElementById(id)
  753. }
  754. ns = getNodes(ns, mode, "*");
  755. return byId(ns, null, id)
  756. }
  757. return {
  758. getStyle : function(el, name) {
  759. return Ext.fly(el).getStyle(name)
  760. },
  761. compile : function(path, type) {
  762. type = type || "select";
  763. var fn = ["var f = function(root){\n var mode; ++batch; var n = root || document;\n"];
  764. var q = path, mode, lq;
  765. var tk = Ext.DomQuery.matchers;
  766. var tklen = tk.length;
  767. var mm;
  768. var lmode = q.match(modeRe);
  769. if (lmode && lmode[1]) {
  770. fn[fn.length] = "mode=\"" + lmode[1].replace(trimRe, "")
  771. + "\";";
  772. q = q.replace(lmode[1], "")
  773. }
  774. while (path.substr(0, 1) == "/") {
  775. path = path.substr(1)
  776. }
  777. while (q && lq != q) {
  778. lq = q;
  779. var tm = q.match(tagTokenRe);
  780. if (type == "select") {
  781. if (tm) {
  782. if (tm[1] == "#") {
  783. fn[fn.length] = "n = quickId(n, mode, root, \""
  784. + tm[2] + "\");"
  785. } else {
  786. fn[fn.length] = "n = getNodes(n, mode, \"" + tm[2]
  787. + "\");"
  788. }
  789. q = q.replace(tm[0], "")
  790. } else {
  791. if (q.substr(0, 1) != "@") {
  792. fn[fn.length] = "n = getNodes(n, mode, \"*\");"
  793. }
  794. }
  795. } else {
  796. if (tm) {
  797. if (tm[1] == "#") {
  798. fn[fn.length] = "n = byId(n, null, \"" + tm[2]
  799. + "\");"
  800. } else {
  801. fn[fn.length] = "n = byTag(n, \"" + tm[2] + "\");"
  802. }
  803. q = q.replace(tm[0], "")
  804. }
  805. }
  806. while (!(mm = q.match(modeRe))) {
  807. var matched = false;
  808. for (var j = 0; j < tklen; j++) {
  809. var t = tk[j];
  810. var m = q.match(t.re);
  811. if (m) {
  812. fn[fn.length] = t.select.replace(tplRe, function(x,
  813. i) {
  814. return m[i]
  815. });
  816. q = q.replace(m[0], "");
  817. matched = true;
  818. break
  819. }
  820. }
  821. if (!matched) {
  822. throw "Error parsing selector, parsing failed at \""
  823. + q + "\""
  824. }
  825. }
  826. if (mm[1]) {
  827. fn[fn.length] = "mode=\"" + mm[1].replace(trimRe, "")
  828. + "\";";
  829. q = q.replace(mm[1], "")
  830. }
  831. }
  832. fn[fn.length] = "return nodup(n);\n}";
  833. eval(fn.join(""));
  834. return f
  835. },
  836. select : function(path, root, type) {
  837. if (!root || root == document) {
  838. root = document
  839. }
  840. if (typeof root == "string") {
  841. root = document.getElementById(root)
  842. }
  843. var paths = path.split(",");
  844. var results = [];
  845. for (var i = 0, len = paths.length; i < len; i++) {
  846. var p = paths[i].replace(trimRe, "");
  847. if (!cache[p]) {
  848. cache[p] = Ext.DomQuery.compile(p);
  849. if (!cache[p]) {
  850. throw p + " is not a valid selector"
  851. }
  852. }
  853. var result = cache[p](root);
  854. if (result && result != document) {
  855. results = results.concat(result)
  856. }
  857. }
  858. if (paths.length > 1) {
  859. return nodup(results)
  860. }
  861. return results
  862. },
  863. selectNode : function(path, root) {
  864. return Ext.DomQuery.select(path, root)[0]
  865. },
  866. selectValue : function(path, root, defaultValue) {
  867. path = path.replace(trimRe, "");
  868. if (!valueCache[path]) {
  869. valueCache[path] = Ext.DomQuery.compile(path, "select")
  870. }
  871. var n = valueCache[path](root);
  872. n = n[0] ? n[0] : n;
  873. var v = (n && n.firstChild ? n.firstChild.nodeValue : null);
  874. return ((v === null || v === undefined || v === "")
  875. ? defaultValue
  876. : v)
  877. },
  878. selectNumber : function(path, root, defaultValue) {
  879. var v = Ext.DomQuery.selectValue(path, root, defaultValue || 0);
  880. return parseFloat(v)
  881. },
  882. is : function(el, ss) {
  883. if (typeof el == "string") {
  884. el = document.getElementById(el)
  885. }
  886. var isArray = Ext.isArray(el);
  887. var result = Ext.DomQuery.filter(isArray ? el : [el], ss);
  888. return isArray ? (result.length == el.length) : (result.length > 0)
  889. },
  890. filter : function(els, ss, nonMatches) {
  891. ss = ss.replace(trimRe, "");
  892. if (!simpleCache[ss]) {
  893. simpleCache[ss] = Ext.DomQuery.compile(ss, "simple")
  894. }
  895. var result = simpleCache[ss](els);
  896. return nonMatches ? quickDiff(result, els) : result
  897. },
  898. matchers : [{
  899. re : /^\.([\w-]+)/,
  900. select : "n = byClassName(n, null, \" {1} \");"
  901. }, {
  902. re : /^\:([\w-]+)(?:\(((?:[^\s>\/]*|.*?))\))?/,
  903. select : "n = byPseudo(n, \"{1}\", \"{2}\");"
  904. }, {
  905. re : /^(?:([\[\{])(?:@)?([\w-]+)\s?(?:(=|.=)\s?['"]?(.*?)["']?)?[\]\}])/,
  906. select : "n = byAttribute(n, \"{2}\", \"{4}\", \"{3}\", \"{1}\");"
  907. }, {
  908. re : /^#([\w-]+)/,
  909. select : "n = byId(n, null, \"{1}\");"
  910. }, {
  911. re : /^@([\w-]+)/,
  912. select : "return {firstChild:{nodeValue:attrValue(n, \"{1}\")}};"
  913. }],
  914. operators : {
  915. "=" : function(a, v) {
  916. return a == v
  917. },
  918. "!=" : function(a, v) {
  919. return a != v
  920. },
  921. "^=" : function(a, v) {
  922. return a && a.substr(0, v.length) == v
  923. },
  924. "$=" : function(a, v) {
  925. return a && a.substr(a.length - v.length) == v
  926. },
  927. "*=" : function(a, v) {
  928. return a && a.indexOf(v) !== -1
  929. },
  930. "%=" : function(a, v) {
  931. return (a % v) == 0
  932. },
  933. "|=" : function(a, v) {
  934. return a && (a == v || a.substr(0, v.length + 1) == v + "-")
  935. },
  936. "~=" : function(a, v) {
  937. return a && (" " + a + " ").indexOf(" " + v + " ") != -1
  938. }
  939. },
  940. pseudos : {
  941. "first-child" : function(c) {
  942. var r = [], ri = -1, n;
  943. for (var i = 0, ci; ci = n = c[i]; i++) {
  944. while ((n = n.previousSibling) && n.nodeType != 1) {
  945. }
  946. if (!n) {
  947. r[++ri] = ci
  948. }
  949. }
  950. return r
  951. },
  952. "last-child" : function(c) {
  953. var r = [], ri = -1, n;
  954. for (var i = 0, ci; ci = n = c[i]; i++) {
  955. while ((n = n.nextSibling) && n.nodeType != 1) {
  956. }
  957. if (!n) {
  958. r[++ri] = ci
  959. }
  960. }
  961. return r
  962. },
  963. "nth-child" : function(c, a) {
  964. var r = [], ri = -1;
  965. var m = nthRe.exec(a == "even" && "2n" || a == "odd" && "2n+1"
  966. || !nthRe2.test(a) && "n+" + a || a);
  967. var f = (m[1] || 1) - 0, l = m[2] - 0;
  968. for (var i = 0, n; n = c[i]; i++) {
  969. var pn = n.parentNode;
  970. if (batch != pn._batch) {
  971. var j = 0;
  972. for (var cn = pn.firstChild; cn; cn = cn.nextSibling) {
  973. if (cn.nodeType == 1) {
  974. cn.nodeIndex = ++j
  975. }
  976. }
  977. pn._batch = batch
  978. }
  979. if (f == 1) {
  980. if (l == 0 || n.nodeIndex == l) {
  981. r[++ri] = n
  982. }
  983. } else {
  984. if ((n.nodeIndex + l) % f == 0) {
  985. r[++ri] = n
  986. }
  987. }
  988. }
  989. return r
  990. },
  991. "only-child" : function(c) {
  992. var r = [], ri = -1;
  993. for (var i = 0, ci; ci = c[i]; i++) {
  994. if (!prev(ci) && !next(ci)) {
  995. r[++ri] = ci
  996. }
  997. }
  998. return r
  999. },
  1000. "empty" : function(c) {
  1001. var r = [], ri = -1;
  1002. for (var i = 0, ci; ci = c[i]; i++) {
  1003. var cns = ci.childNodes, j = 0, cn, empty = true;
  1004. while (cn = cns[j]) {
  1005. ++j;
  1006. if (cn.nodeType == 1 || cn.nodeType == 3) {
  1007. empty = false;
  1008. break
  1009. }
  1010. }
  1011. if (empty) {
  1012. r[++ri] = ci
  1013. }
  1014. }
  1015. return r
  1016. },
  1017. "contains" : function(c, v) {
  1018. var r = [], ri = -1;
  1019. for (var i = 0, ci; ci = c[i]; i++) {
  1020. if ((ci.textContent || ci.innerText || "").indexOf(v) != -1) {
  1021. r[++ri] = ci
  1022. }
  1023. }
  1024. return r
  1025. },
  1026. "nodeValue" : function(c, v) {
  1027. var r = [], ri = -1;
  1028. for (var i = 0, ci; ci = c[i]; i++) {
  1029. if (ci.firstChild && ci.firstChild.nodeValue == v) {
  1030. r[++ri] = ci
  1031. }
  1032. }
  1033. return r
  1034. },
  1035. "checked" : function(c) {
  1036. var r = [], ri = -1;
  1037. for (var i = 0, ci; ci = c[i]; i++) {
  1038. if (ci.checked == true) {
  1039. r[++ri] = ci
  1040. }
  1041. }
  1042. return r
  1043. },
  1044. "not" : function(c, ss) {
  1045. return Ext.DomQuery.filter(c, ss, true)
  1046. },
  1047. "any" : function(c, selectors) {
  1048. var ss = selectors.split("|");
  1049. var r = [], ri = -1, s;
  1050. for (var i = 0, ci; ci = c[i]; i++) {
  1051. for (var j = 0; s = ss[j]; j++) {
  1052. if (Ext.DomQuery.is(ci, s)) {
  1053. r[++ri] = ci;
  1054. break
  1055. }
  1056. }
  1057. }
  1058. return r
  1059. },
  1060. "odd" : function(c) {
  1061. return this["nth-child"](c, "odd")
  1062. },
  1063. "even" : function(c) {
  1064. return this["nth-child"](c, "even")
  1065. },
  1066. "nth" : function(c, a) {
  1067. return c[a - 1] || []
  1068. },
  1069. "first" : function(c) {
  1070. return c[0] || []
  1071. },
  1072. "last" : function(c) {
  1073. return c[c.length - 1] || []
  1074. },
  1075. "has" : function(c, ss) {
  1076. var s = Ext.DomQuery.select;
  1077. var r = [], ri = -1;
  1078. for (var i = 0, ci; ci = c[i]; i++) {
  1079. if (s(ss, ci).length > 0) {
  1080. r[++ri] = ci
  1081. }
  1082. }
  1083. return r
  1084. },
  1085. "next" : function(c, ss) {
  1086. var is = Ext.DomQuery.is;
  1087. var r = [], ri = -1;
  1088. for (var i = 0, ci; ci = c[i]; i++) {
  1089. var n = next(ci);
  1090. if (n && is(n, ss)) {
  1091. r[++ri] = ci
  1092. }
  1093. }
  1094. return r
  1095. },
  1096. "prev" : function(c, ss) {
  1097. var is = Ext.DomQuery.is;
  1098. var r = [], ri = -1;
  1099. for (var i = 0, ci; ci = c[i]; i++) {
  1100. var n = prev(ci);
  1101. if (n && is(n, ss)) {
  1102. r[++ri] = ci
  1103. }
  1104. }
  1105. return r
  1106. }
  1107. }
  1108. }
  1109. }();
  1110. Ext.query = Ext.DomQuery.select;
  1111. Ext.util.Observable = function() {
  1112. if (this.listeners) {
  1113. this.on(this.listeners);
  1114. delete this.listeners
  1115. }
  1116. };
  1117. Ext.util.Observable.prototype = {
  1118. fireEvent : function() {
  1119. if (this.eventsSuspended !== true) {
  1120. var A = this.events[arguments[0].toLowerCase()];
  1121. if (typeof A == "object") {
  1122. return A.fire
  1123. .apply(A, Array.prototype.slice.call(arguments, 1))
  1124. }
  1125. }
  1126. return true
  1127. },
  1128. filterOptRe : /^(?:scope|delay|buffer|single)$/,
  1129. addListener : function(A, C, B, F) {
  1130. if (typeof A == "object") {
  1131. F = A;
  1132. for (var E in F) {
  1133. if (this.filterOptRe.test(E)) {
  1134. continue
  1135. }
  1136. if (typeof F[E] == "function") {
  1137. this.addListener(E, F[E], F.scope, F)
  1138. } else {
  1139. this.addListener(E, F[E].fn, F[E].scope, F[E])
  1140. }
  1141. }
  1142. return
  1143. }
  1144. F = (!F || typeof F == "boolean") ? {} : F;
  1145. A = A.toLowerCase();
  1146. var D = this.events[A] || true;
  1147. if (typeof D == "boolean") {
  1148. D = new Ext.util.Event(this, A);
  1149. this.events[A] = D
  1150. }
  1151. D.addListener(C, B, F)
  1152. },
  1153. removeListener : function(A, C, B) {
  1154. var D = this.events[A.toLowerCase()];
  1155. if (typeof D == "object") {
  1156. D.removeListener(C, B)
  1157. }
  1158. },
  1159. purgeListeners : function() {
  1160. for (var A in this.events) {
  1161. if (typeof this.events[A] == "object") {
  1162. this.events[A].clearListeners()
  1163. }
  1164. }
  1165. },
  1166. relayEvents : function(F, D) {
  1167. var E = function(G) {
  1168. return function() {
  1169. return this.fireEvent.apply(this, Ext.combine(G,
  1170. Array.prototype.slice.call(arguments, 0)))
  1171. }
  1172. };
  1173. for (var C = 0, A = D.length; C < A; C++) {
  1174. var B = D[C];
  1175. if (!this.events[B]) {
  1176. this.events[B] = true
  1177. }
  1178. F.on(B, E(B), this)
  1179. }
  1180. },
  1181. addEvents : function(D) {
  1182. if (!this.events) {
  1183. this.events = {}
  1184. }
  1185. if (typeof D == "string") {
  1186. for (var C = 0, A = arguments, B; B = A[C]; C++) {
  1187. if (!this.events[A[C]]) {
  1188. D[A[C]] = true
  1189. }
  1190. }
  1191. } else {
  1192. Ext.applyIf(this.events, D)
  1193. }
  1194. },
  1195. hasListener : function(A) {
  1196. var B = this.events[A];
  1197. return typeof B == "object" && B.listeners.length > 0
  1198. },
  1199. suspendEvents : function() {
  1200. this.eventsSuspended = true
  1201. },
  1202. resumeEvents : function() {
  1203. this.eventsSuspended = false
  1204. },
  1205. getMethodEvent : function(G) {
  1206. if (!this.methodEvents) {
  1207. this.methodEvents = {}
  1208. }
  1209. var F = this.methodEvents[G];
  1210. if (!F) {
  1211. F = {};
  1212. this.methodEvents[G] = F;
  1213. F.originalFn = this[G];
  1214. F.methodName = G;
  1215. F.before = [];
  1216. F.after = [];
  1217. var C, B, D;
  1218. var E = this;
  1219. var A = function(J, I, H) {
  1220. if ((B = J.apply(I || E, H)) !== undefined) {
  1221. if (typeof B === "object") {
  1222. if (B.returnValue !== undefined) {
  1223. C = B.returnValue
  1224. } else {
  1225. C = B
  1226. }
  1227. if (B.cancel === true) {
  1228. D = true
  1229. }
  1230. } else {
  1231. if (B === false) {
  1232. D = true
  1233. } else {
  1234. C = B
  1235. }
  1236. }
  1237. }
  1238. };
  1239. this[G] = function() {
  1240. C = B = undefined;
  1241. D = false;
  1242. var I = Array.prototype.slice.call(arguments, 0);
  1243. for (var J = 0, H = F.before.length; J < H; J++) {
  1244. A(F.before[J].fn, F.before[J].scope, I);
  1245. if (D) {
  1246. return C
  1247. }
  1248. }
  1249. if ((B = F.originalFn.apply(E, I)) !== undefined) {
  1250. C = B
  1251. }
  1252. for (var J = 0, H = F.after.length; J < H; J++) {
  1253. A(F.after[J].fn, F.after[J].scope, I);
  1254. if (D) {
  1255. return C
  1256. }
  1257. }
  1258. return C
  1259. }
  1260. }
  1261. return F
  1262. },
  1263. beforeMethod : function(D, B, A) {
  1264. var C = this.getMethodEvent(D);
  1265. C.before.push({
  1266. fn : B,
  1267. scope : A
  1268. })
  1269. },
  1270. afterMethod : function(D, B, A) {
  1271. var C = this.getMethodEvent(D);
  1272. C.after.push({
  1273. fn : B,
  1274. scope : A
  1275. })
  1276. },
  1277. removeMethodListener : function(F, D, C) {
  1278. var E = this.getMethodEvent(F);
  1279. for (var B = 0, A = E.before.length; B < A; B++) {
  1280. if (E.before[B].fn == D && E.before[B].scope == C) {
  1281. E.before.splice(B, 1);
  1282. return
  1283. }
  1284. }
  1285. for (var B = 0, A = E.after.length; B < A; B++) {
  1286. if (E.after[B].fn == D && E.after[B].scope == C) {
  1287. E.after.splice(B, 1);
  1288. return
  1289. }
  1290. }
  1291. }
  1292. };
  1293. Ext.util.Observable.prototype.on = Ext.util.Observable.prototype.addListener;
  1294. Ext.util.Observable.prototype.un = Ext.util.Observable.prototype.removeListener;
  1295. Ext.util.Observable.capture = function(C, B, A) {
  1296. C.fireEvent = C.fireEvent.createInterceptor(B, A)
  1297. };
  1298. Ext.util.Observable.releaseCapture = function(A) {
  1299. A.fireEvent = Ext.util.Observable.prototype.fireEvent
  1300. };
  1301. (function() {
  1302. var B = function(F, G, E) {
  1303. var D = new Ext.util.DelayedTask();
  1304. return function() {
  1305. D.delay(G.buffer, F, E, Array.prototype.slice.call(arguments, 0))
  1306. }
  1307. };
  1308. var C = function(F, G, E, D) {
  1309. return function() {
  1310. G.removeListener(E, D);
  1311. return F.apply(D, arguments)
  1312. }
  1313. };
  1314. var A = function(E, F, D) {
  1315. return function() {
  1316. var G = Array.prototype.slice.call(arguments, 0);
  1317. setTimeout(function() {
  1318. E.apply(D, G)
  1319. }, F.delay || 10)
  1320. }
  1321. };
  1322. Ext.util.Event = function(E, D) {
  1323. this.name = D;
  1324. this.obj = E;
  1325. this.listeners = []
  1326. };
  1327. Ext.util.Event.prototype = {
  1328. addListener : function(G, F, E) {
  1329. F = F || this.obj;
  1330. if (!this.isListening(G, F)) {
  1331. var D = this.createListener(G, F, E);
  1332. if (!this.firing) {
  1333. this.listeners.push(D)
  1334. } else {
  1335. this.listeners = this.listeners.slice(0);
  1336. this.listeners.push(D)
  1337. }
  1338. }
  1339. },
  1340. createListener : function(G, F, H) {
  1341. H = H || {};
  1342. F = F || this.obj;
  1343. var D = {
  1344. fn : G,
  1345. scope : F,
  1346. options : H
  1347. };
  1348. var E = G;
  1349. if (H.delay) {
  1350. E = A(E, H, F)
  1351. }
  1352. if (H.single) {
  1353. E = C(E, this, G, F)
  1354. }
  1355. if (H.buffer) {
  1356. E = B(E, H, F)
  1357. }
  1358. D.fireFn = E;
  1359. return D
  1360. },
  1361. findListener : function(I, H) {
  1362. H = H || this.obj;
  1363. var F = this.listeners;
  1364. for (var G = 0, D = F.length; G < D; G++) {
  1365. var E = F[G];
  1366. if (E.fn == I && E.scope == H) {
  1367. return G
  1368. }
  1369. }
  1370. return -1
  1371. },
  1372. isListening : function(E, D) {
  1373. return this.findListener(E, D) != -1
  1374. },
  1375. removeListener : function(F, E) {
  1376. var D;
  1377. if ((D = this.findListener(F, E)) != -1) {
  1378. if (!this.firing) {
  1379. this.listeners.splice(D, 1)
  1380. } else {
  1381. this.listeners = this.listeners.slice(0);
  1382. this.listeners.splice(D, 1)
  1383. }
  1384. return true
  1385. }
  1386. return false
  1387. },
  1388. clearListeners : function() {
  1389. this.listeners = []
  1390. },
  1391. fire : function() {
  1392. var F = this.listeners, I, D = F.length;
  1393. if (D > 0) {
  1394. this.firing = true;
  1395. var G = Array.prototype.slice.call(arguments, 0);
  1396. for (var H = 0; H < D; H++) {
  1397. var E = F[H];
  1398. if (E.fireFn
  1399. .apply(E.scope || this.obj || window, arguments) === false) {
  1400. this.firing = false;
  1401. return false
  1402. }
  1403. }
  1404. this.firing = false
  1405. }
  1406. return true
  1407. }
  1408. }
  1409. })();
  1410. Ext.EventManager = function() {
  1411. var T, M, I = false;
  1412. var K, S, C, O;
  1413. var L = Ext.lib.Event;
  1414. var N = Ext.lib.Dom;
  1415. var B = function() {
  1416. if (!I) {
  1417. I = true;
  1418. Ext.isReady = true;
  1419. if (M) {
  1420. clearInterval(M)
  1421. }
  1422. if (Ext.isGecko || Ext.isOpera) {
  1423. document.removeEventListener("DOMContentLoaded", B, false)
  1424. }
  1425. if (Ext.isIE) {
  1426. var D = document.getElementById("ie-deferred-loader");
  1427. if (D) {
  1428. D.onreadystatechange = null;
  1429. D.parentNode.removeChild(D)
  1430. }
  1431. }
  1432. if (T) {
  1433. T.fire();
  1434. T.clearListeners()
  1435. }
  1436. }
  1437. };
  1438. var A = function() {
  1439. T = new Ext.util.Event();
  1440. if (Ext.isGecko || Ext.isOpera) {
  1441. document.addEventListener("DOMContentLoaded", B, false)
  1442. } else {
  1443. if (Ext.isIE) {
  1444. document
  1445. .write("<s"
  1446. + "cript id=\"ie-deferred-loader\" defer=\"defer\" src=\"/"
  1447. + "/:\"></s" + "cript>");
  1448. var D = document.getElementById("ie-deferred-loader");
  1449. D.onreadystatechange = function() {
  1450. if (this.readyState == "complete") {
  1451. B()
  1452. }
  1453. }
  1454. } else {
  1455. if (Ext.isSafari) {
  1456. M = setInterval(function() {
  1457. var E = document.readyState;
  1458. if (E == "complete") {
  1459. B()
  1460. }
  1461. }, 10)
  1462. }
  1463. }
  1464. }
  1465. L.on(window, "load", B)
  1466. };
  1467. var R = function(E, U) {
  1468. var D = new Ext.util.DelayedTask(E);
  1469. return function(V) {
  1470. V = new Ext.EventObjectImpl(V);
  1471. D.delay(U.buffer, E, null, [V])
  1472. }
  1473. };
  1474. var P = function(V, U, D, E) {
  1475. return function(W) {
  1476. Ext.EventManager.removeListener(U, D, E);
  1477. V(W)
  1478. }
  1479. };
  1480. var F = function(D, E) {
  1481. return function(U) {
  1482. U = new Ext.EventObjectImpl(U);
  1483. setTimeout(function() {
  1484. D(U)
  1485. }, E.delay || 10)
  1486. }
  1487. };
  1488. var J = function(U, E, D, Y, X) {
  1489. var Z = (!D || typeof D == "boolean") ? {} : D;
  1490. Y = Y || Z.fn;
  1491. X = X || Z.scope;
  1492. var W = Ext.getDom(U);
  1493. if (!W) {
  1494. throw "Error listening for \"" + E + "\". Element \"" + U
  1495. + "\" doesn't exist."
  1496. }
  1497. var V = function(b) {
  1498. b = Ext.EventObject.setEvent(b);
  1499. var a;
  1500. if (Z.delegate) {
  1501. a = b.getTarget(Z.delegate, W);
  1502. if (!a) {
  1503. return
  1504. }
  1505. } else {
  1506. a = b.target
  1507. }
  1508. if (Z.stopEvent === true) {
  1509. b.stopEvent()
  1510. }
  1511. if (Z.preventDefault === true) {
  1512. b.preventDefault()
  1513. }
  1514. if (Z.stopPropagation === true) {
  1515. b.stopPropagation()
  1516. }
  1517. if (Z.normalized === false) {
  1518. b = b.browserEvent
  1519. }
  1520. Y.call(X || W, b, a, Z)
  1521. };
  1522. if (Z.delay) {
  1523. V = F(V, Z)
  1524. }
  1525. if (Z.single) {
  1526. V = P(V, W, E, Y)
  1527. }
  1528. if (Z.buffer) {
  1529. V = R(V, Z)
  1530. }
  1531. Y._handlers = Y._handlers || [];
  1532. Y._handlers.push([Ext.id(W), E, V]);
  1533. L.on(W, E, V);
  1534. if (E == "mousewheel" && W.addEventListener) {
  1535. W.addEventListener("DOMMouseScroll", V, false);
  1536. L.on(window, "unload", function() {
  1537. W.removeEventListener("DOMMouseScroll", V, false)
  1538. })
  1539. }
  1540. if (E == "mousedown" && W == document) {
  1541. Ext.EventManager.stoppedMouseDownEvent.addListener(V)
  1542. }
  1543. return V
  1544. };
  1545. var G = function(E, U, Z) {
  1546. var D = Ext.id(E), a = Z._handlers, X = Z;
  1547. if (a) {
  1548. for (var V = 0, Y = a.length; V < Y; V++) {
  1549. var W = a[V];
  1550. if (W[0] == D && W[1] == U) {
  1551. X = W[2];
  1552. a.splice(V, 1);
  1553. break
  1554. }
  1555. }
  1556. }
  1557. L.un(E, U, X);
  1558. E = Ext.getDom(E);
  1559. if (U == "mousewheel" && E.addEventListener) {
  1560. E.removeEventListener("DOMMouseScroll", X, false)
  1561. }
  1562. if (U == "mousedown" && E == document) {
  1563. Ext.EventManager.stoppedMouseDownEvent.removeListener(X)
  1564. }
  1565. };
  1566. var H = /^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/;
  1567. var Q = {
  1568. addListener : function(U, D, W, V, E) {
  1569. if (typeof D == "object") {
  1570. var Y = D;
  1571. for (var X in Y) {
  1572. if (H.test(X)) {
  1573. continue
  1574. }
  1575. if (typeof Y[X] == "function") {
  1576. J(U, X, Y, Y[X], Y.scope)
  1577. } else {
  1578. J(U, X, Y[X])
  1579. }
  1580. }
  1581. return
  1582. }
  1583. return J(U, D, E, W, V)
  1584. },
  1585. removeListener : function(E, D, U) {
  1586. return G(E, D, U)
  1587. },
  1588. onDocumentReady : function(U, E, D) {
  1589. if (I) {
  1590. T.addListener(U, E, D);
  1591. T.fire();
  1592. T.clearListeners();
  1593. return
  1594. }
  1595. if (!T) {
  1596. A()
  1597. }
  1598. T.addListener(U, E, D)
  1599. },
  1600. onWindowResize : function(U, E, D) {
  1601. if (!K) {
  1602. K = new Ext.util.Event();
  1603. S = new Ext.util.DelayedTask(function() {
  1604. K.fire(N.getViewWidth(), N.getViewHeight())
  1605. });
  1606. L.on(window, "resize", this.fireWindowResize, this)
  1607. }
  1608. K.addListener(U, E, D)
  1609. },
  1610. fireWindowResize : function() {
  1611. if (K) {
  1612. if ((Ext.isIE || Ext.isAir) && S) {
  1613. S.delay(50)
  1614. } else {
  1615. K.fire(N.getViewWidth(), N.getViewHeight())
  1616. }
  1617. }
  1618. },
  1619. onTextResize : function(V, U, D) {
  1620. if (!C) {
  1621. C = new Ext.util.Event();
  1622. var E = new Ext.Element(document.createElement("div"));
  1623. E.dom.className = "x-text-resize";
  1624. E.dom.innerHTML = "X";
  1625. E.appendTo(document.body);
  1626. O = E.dom.offsetHeight;
  1627. setInterval(function() {
  1628. if (E.dom.offsetHeight != O) {
  1629. C.fire(O, O = E.dom.offsetHeight)
  1630. }
  1631. }, this.textResizeInterval)
  1632. }
  1633. C.addListener(V, U, D)
  1634. },
  1635. removeResizeListener : function(E, D) {
  1636. if (K) {
  1637. K.removeListener(E, D)
  1638. }
  1639. },
  1640. fireResize : function() {
  1641. if (K) {
  1642. K.fire(N.getViewWidth(), N.getViewHeight())
  1643. }
  1644. },
  1645. ieDeferSrc : false,
  1646. textResizeInterval : 50
  1647. };
  1648. Q.on = Q.addListener;
  1649. Q.un = Q.removeListener;
  1650. Q.stoppedMouseDownEvent = new Ext.util.Event();
  1651. return Q
  1652. }();
  1653. Ext.onReady = Ext.EventManager.onDocumentReady;
  1654. Ext.onReady(function() {
  1655. var B = Ext.getBody();
  1656. if (!B) {
  1657. return
  1658. }
  1659. var A = [Ext.isIE
  1660. ? "ext-ie " + (Ext.isIE6 ? "ext-ie6" : "ext-ie7")
  1661. : Ext.isGecko ? "ext-gecko" : Ext.isOpera
  1662. ? "ext-opera"
  1663. : Ext.isSafari ? "ext-safari" : ""];
  1664. if (Ext.isMac) {
  1665. A.push("ext-mac")
  1666. }
  1667. if (Ext.isLinux) {
  1668. A.push("ext-linux")
  1669. }
  1670. if (Ext.isBorderBox) {
  1671. A.push("ext-border-box")
  1672. }
  1673. if (Ext.isStrict) {
  1674. var C = B.dom.parentNode;
  1675. if (C) {
  1676. C.className += " ext-strict"
  1677. }
  1678. }
  1679. B.addClass(A.join(" "))
  1680. });
  1681. Ext.EventObject = function() {
  1682. var B = Ext.lib.Event;
  1683. var A = {
  1684. 63234 : 37,
  1685. 63235 : 39,
  1686. 63232 : 38,
  1687. 63233 : 40,
  1688. 63276 : 33,
  1689. 63277 : 34,
  1690. 63272 : 46,
  1691. 63273 : 36,
  1692. 63275 : 35
  1693. };
  1694. var C = Ext.isIE ? {
  1695. 1 : 0,
  1696. 4 : 1,
  1697. 2 : 2
  1698. } : (Ext.isSafari ? {
  1699. 1 : 0,
  1700. 2 : 1,
  1701. 3 : 2
  1702. } : {
  1703. 0 : 0,
  1704. 1 : 1,
  1705. 2 : 2
  1706. });
  1707. Ext.EventObjectImpl = function(D) {
  1708. if (D) {
  1709. this.setEvent(D.browserEvent || D)
  1710. }
  1711. };
  1712. Ext.EventObjectImpl.prototype = {
  1713. browserEvent : null,
  1714. button : -1,
  1715. shiftKey : false,
  1716. ctrlKey : false,
  1717. altKey : false,
  1718. BACKSPACE : 8,
  1719. TAB : 9,
  1720. RETURN : 13,
  1721. ENTER : 13,
  1722. SHIFT : 16,
  1723. CONTROL : 17,
  1724. ESC : 27,
  1725. SPACE : 32,
  1726. PAGEUP : 33,
  1727. PAGEDOWN : 34,
  1728. END : 35,
  1729. HOME : 36,
  1730. LEFT : 37,
  1731. UP : 38,
  1732. RIGHT : 39,
  1733. DOWN : 40,
  1734. DELETE : 46,
  1735. F5 : 116,
  1736. setEvent : function(D) {
  1737. if (D == this || (D && D.browserEvent)) {
  1738. return D
  1739. }
  1740. this.browserEvent = D;
  1741. if (D) {
  1742. this.button = D.button ? C[D.button] : (D.which
  1743. ? D.which - 1
  1744. : -1);
  1745. if (D.type == "click" && this.button == -1) {
  1746. this.button = 0
  1747. }
  1748. this.type = D.type;
  1749. this.shiftKey = D.shiftKey;
  1750. this.ctrlKey = D.ctrlKey || D.metaKey;
  1751. this.altKey = D.altKey;
  1752. this.keyCode = D.keyCode;
  1753. this.charCode = D.charCode;
  1754. this.target = B.getTarget(D);
  1755. this.xy = B.getXY(D)
  1756. } else {
  1757. this.button = -1;
  1758. this.shiftKey = false;
  1759. this.ctrlKey = false;
  1760. this.altKey = false;
  1761. this.keyCode = 0;
  1762. this.charCode = 0;
  1763. this.target = null;
  1764. this.xy = [0, 0]
  1765. }
  1766. return this
  1767. },
  1768. stopEvent : function() {
  1769. if (this.browserEvent) {
  1770. if (this.browserEvent.type == "mousedown") {
  1771. Ext.EventManager.stoppedMouseDownEvent.fire(this)
  1772. }
  1773. B.stopEvent(this.browserEvent)
  1774. }
  1775. },
  1776. preventDefault : function() {
  1777. if (this.browserEvent) {
  1778. B.preventDefault(this.browserEvent)
  1779. }
  1780. },
  1781. isNavKeyPress : function() {
  1782. var D = this.keyCode;
  1783. D = Ext.isSafari ? (A[D] || D) : D;
  1784. return (D >= 33 && D <= 40) || D == this.RETURN || D == this.TAB
  1785. || D == this.ESC
  1786. },
  1787. isSpecialKey : function() {
  1788. var D = this.keyCode;
  1789. return (this.type == "keypress" && this.ctrlKey) || D == 9
  1790. || D == 13 || D == 40 || D == 27 || (D == 16) || (D == 17)
  1791. || (D >= 18 && D <= 20) || (D >= 33 && D <= 35)
  1792. || (D >= 36 && D <= 39) || (D >= 44 && D <= 45)
  1793. },
  1794. stopPropagation : function() {
  1795. if (this.browserEvent) {
  1796. if (this.browserEvent.type == "mousedown") {
  1797. Ext.EventManager.stoppedMouseDownEvent.fire(this)
  1798. }
  1799. B.stopPropagation(this.browserEvent)
  1800. }
  1801. },
  1802. getCharCode : function() {
  1803. return this.charCode || this.keyCode
  1804. },
  1805. getKey : function() {
  1806. var D = this.keyCode || this.charCode;
  1807. return Ext.isSafari ? (A[D] || D) : D
  1808. },
  1809. getPageX : function() {
  1810. return this.xy[0]
  1811. },
  1812. getPageY : function() {
  1813. return this.xy[1]
  1814. },
  1815. getTime : function() {
  1816. if (this.browserEvent) {
  1817. return B.getTime(this.browserEvent)
  1818. }
  1819. return null
  1820. },
  1821. getXY : function() {
  1822. return this.xy
  1823. },
  1824. getTarget : function(E, G, D) {
  1825. var F = Ext.get(this.target);
  1826. return E ? F.findParent(E, G, D) : (D ? F : this.target)
  1827. },
  1828. getRelatedTarget : function() {
  1829. if (this.browserEvent) {
  1830. return B.getRelatedTarget(this.browserEvent)
  1831. }
  1832. return null
  1833. },
  1834. getWheelDelta : function() {
  1835. var D = this.browserEvent;
  1836. var E = 0;
  1837. if (D.wheelDelta) {
  1838. E = D.wheelDelta / 120
  1839. } else {
  1840. if (D.detail) {
  1841. E = -D.detail / 3
  1842. }
  1843. }
  1844. return E
  1845. },
  1846. hasModifier : function() {
  1847. return ((this.ctrlKey || this.altKey) || this.shiftKey)
  1848. ? true
  1849. : false
  1850. },
  1851. within : function(E, F) {
  1852. var D = this[F ? "getRelatedTarget" : "getTarget"]();
  1853. return D && Ext.fly(E).contains(D)
  1854. },
  1855. getPoint : function() {
  1856. return new Ext.lib.Point(this.xy[0], this.xy[1])
  1857. }
  1858. };
  1859. return new Ext.EventObjectImpl()
  1860. }();
  1861. (function() {
  1862. var D = Ext.lib.Dom;
  1863. var E = Ext.lib.Event;
  1864. var A = Ext.lib.Anim;
  1865. var propCache = {};
  1866. var camelRe = /(-[a-z])/gi;
  1867. var camelFn = function(m, a) {
  1868. return a.charAt(1).toUpperCase()
  1869. };
  1870. var view = document.defaultView;
  1871. Ext.Element = function(element, forceNew) {
  1872. var dom = typeof element == "string"
  1873. ? document.getElementById(element)
  1874. : element;
  1875. if (!dom) {
  1876. return null
  1877. }
  1878. var id = dom.id;
  1879. if (forceNew !== true && id && Ext.Element.cache[id]) {
  1880. return Ext.Element.cache[id]
  1881. }
  1882. this.dom = dom;
  1883. this.id = id || Ext.id(dom)
  1884. };
  1885. var El = Ext.Element;
  1886. El.prototype = {
  1887. originalDisplay : "",
  1888. visibilityMode : 1,
  1889. defaultUnit : "px",
  1890. setVisibilityMode : function(visMode) {
  1891. this.visibilityMode = visMode;
  1892. return this
  1893. },
  1894. enableDisplayMode : function(display) {
  1895. this.setVisibilityMode(El.DISPLAY);
  1896. if (typeof display != "undefined") {
  1897. this.originalDisplay = display
  1898. }
  1899. return this
  1900. },
  1901. findParent : function(simpleSelector, maxDepth, returnEl) {
  1902. var p = this.dom, b = document.body, depth = 0, dq = Ext.DomQuery, stopEl;
  1903. maxDepth = maxDepth || 50;
  1904. if (typeof maxDepth != "number") {
  1905. stopEl = Ext.getDom(maxDepth);
  1906. maxDepth = 10
  1907. }
  1908. while (p && p.nodeType == 1 && depth < maxDepth && p != b
  1909. && p != stopEl) {
  1910. if (dq.is(p, simpleSelector)) {
  1911. return returnEl ? Ext.get(p) : p
  1912. }
  1913. depth++;
  1914. p = p.parentNode
  1915. }
  1916. return null
  1917. },
  1918. findParentNode : function(simpleSelector, maxDepth, returnEl) {
  1919. var p = Ext.fly(this.dom.parentNode, "_internal");
  1920. return p ? p.findParent(simpleSelector, maxDepth, returnEl) : null
  1921. },
  1922. up : function(simpleSelector, maxDepth) {
  1923. return this.findParentNode(simpleSelector, maxDepth, true)
  1924. },
  1925. is : function(simpleSelector) {
  1926. return Ext.DomQuery.is(this.dom, simpleSelector)
  1927. },
  1928. animate : function(args, duration, onComplete, easing, animType) {
  1929. this.anim(args, {
  1930. duration : duration,
  1931. callback : onComplete,
  1932. easing : easing
  1933. }, animType);
  1934. return this
  1935. },
  1936. anim : function(args, opt, animType, defaultDur, defaultEase, cb) {
  1937. animType = animType || "run";
  1938. opt = opt || {};
  1939. var anim = Ext.lib.Anim[animType](this.dom, args,
  1940. (opt.duration || defaultDur) || 0.35,
  1941. (opt.easing || defaultEase) || "easeOut", function() {
  1942. Ext.callback(cb, this);
  1943. Ext.callback(opt.callback, opt.scope || this, [this,
  1944. opt])
  1945. }, this);
  1946. opt.anim = anim;
  1947. return anim
  1948. },
  1949. preanim : function(a, i) {
  1950. return !a[i] ? false : (typeof a[i] == "object" ? a[i] : {
  1951. duration : a[i + 1],
  1952. callback : a[i + 2],
  1953. easing : a[i + 3]
  1954. })
  1955. },
  1956. clean : function(forceReclean) {
  1957. if (this.isCleaned && forceReclean !== true) {
  1958. return this
  1959. }
  1960. var ns = /\S/;
  1961. var d = this.dom, n = d.firstChild, ni = -1;
  1962. while (n) {
  1963. var nx = n.nextSibling;
  1964. if (n.nodeType == 3 && !ns.test(n.nodeValue)) {
  1965. d.removeChild(n)
  1966. } else {
  1967. n.nodeIndex = ++ni
  1968. }
  1969. n = nx
  1970. }
  1971. this.isCleaned = true;
  1972. return this
  1973. },
  1974. scrollIntoView : function(container, hscroll) {
  1975. var c = Ext.getDom(container) || Ext.getBody().dom;
  1976. var el = this.dom;
  1977. var o = this.getOffsetsTo(c), l = o[0] + c.scrollLeft, t = o[1]
  1978. + c.scrollTop, b = t + el.offsetHeight, r = l
  1979. + el.offsetWidth;
  1980. var ch = c.clientHeight;
  1981. var ct = parseInt(c.scrollTop, 10);
  1982. var cl = parseInt(c.scrollLeft, 10);
  1983. var cb = ct + ch;
  1984. var cr = cl + c.clientWidth;
  1985. if (el.offsetHeight > ch || t < ct) {
  1986. c.scrollTop = t
  1987. } else {
  1988. if (b > cb) {
  1989. c.scrollTop = b - ch
  1990. }
  1991. }
  1992. c.scrollTop = c.scrollTop;
  1993. if (hscroll !== false) {
  1994. if (el.offsetWidth > c.clientWidth || l < cl) {
  1995. c.scrollLeft = l
  1996. } else {
  1997. if (r > cr) {
  1998. c.scrollLeft = r - c.clientWidth
  1999. }
  2000. }
  2001. c.scrollLeft = c.scrollLeft
  2002. }
  2003. return this
  2004. },
  2005. scrollChildIntoView : function(child, hscroll) {
  2006. Ext.fly(child, "_scrollChildIntoView")
  2007. .scrollIntoView(this, hscroll)
  2008. },
  2009. autoHeight : function(animate, duration, onComplete, easing) {
  2010. var oldHeight = this.getHeight();
  2011. this.clip();
  2012. this.setHeight(1);
  2013. setTimeout(function() {
  2014. var height = parseInt(this.dom.scrollHeight, 10);
  2015. if (!animate) {
  2016. this.setHeight(height);
  2017. this.unclip();
  2018. if (typeof onComplete == "function") {
  2019. onComplete()
  2020. }
  2021. } else {
  2022. this.setHeight(oldHeight);
  2023. this.setHeight(height, animate, duration,
  2024. function() {
  2025. this.unclip();
  2026. if (typeof onComplete == "function") {
  2027. onComplete()
  2028. }
  2029. }.createDelegate(this), easing)
  2030. }
  2031. }.createDelegate(this), 0);
  2032. return this
  2033. },
  2034. contains : function(el) {
  2035. if (!el) {
  2036. return false
  2037. }
  2038. return D.isAncestor(this.dom, el.dom ? el.dom : el)
  2039. },
  2040. isVisible : function(deep) {
  2041. var vis = !(this.getStyle("visibility") == "hidden" || this
  2042. .getStyle("display") == "none");
  2043. if (deep !== true || !vis) {
  2044. return vis
  2045. }
  2046. var p = this.dom.parentNode;
  2047. while (p && p.tagName.toLowerCase() != "body") {
  2048. if (!Ext.fly(p, "_isVisible").isVisible()) {
  2049. return false
  2050. }
  2051. p = p.parentNode
  2052. }
  2053. return true
  2054. },
  2055. select : function(selector, unique) {
  2056. return El.select(selector, unique, this.dom)
  2057. },
  2058. query : function(selector, unique) {
  2059. return Ext.DomQuery.select(selector, this.dom)
  2060. },
  2061. child : function(selector, returnDom) {
  2062. var n = Ext.DomQuery.selectNode(selector, this.dom);
  2063. return returnDom ? n : Ext.get(n)
  2064. },
  2065. down : function(selector, returnDom) {
  2066. var n = Ext.DomQuery.selectNode(" > " + selector, this.dom);
  2067. return returnDom ? n : Ext.get(n)
  2068. },
  2069. initDD : function(group, config, overrides) {
  2070. var dd = new Ext.dd.DD(Ext.id(this.dom), group, config);
  2071. return Ext.apply(dd, overrides)
  2072. },
  2073. initDDProxy : function(group, config, overrides) {
  2074. var dd = new Ext.dd.DDProxy(Ext.id(this.dom), group, config);
  2075. return Ext.apply(dd, overrides)
  2076. },
  2077. initDDTarget : function(group, config, overrides) {
  2078. var dd = new Ext.dd.DDTarget(Ext.id(this.dom), group, config);
  2079. return Ext.apply(dd, overrides)
  2080. },
  2081. setVisible : function(visible, animate) {
  2082. if (!animate || !A) {
  2083. if (this.visibilityMode == El.DISPLAY) {
  2084. this.setDisplayed(visible)
  2085. } else {
  2086. this.fixDisplay();
  2087. this.dom.style.visibility = visible ? "visible" : "hidden"
  2088. }
  2089. } else {
  2090. var dom = this.dom;
  2091. var visMode = this.visibilityMode;
  2092. if (visible) {
  2093. this.setOpacity(0.01);
  2094. this.setVisible(true)
  2095. }
  2096. this.anim({
  2097. opacity : {
  2098. to : (visible ? 1 : 0)
  2099. }
  2100. }, this.preanim(arguments, 1), null, 0.35, "easeIn",
  2101. function() {
  2102. if (!visible) {
  2103. if (visMode == El.DISPLAY) {
  2104. dom.style.display = "none"
  2105. } else {
  2106. dom.style.visibility = "hidden"
  2107. }
  2108. Ext.get(dom).setOpacity(1)
  2109. }
  2110. })
  2111. }
  2112. return this
  2113. },
  2114. isDisplayed : function() {
  2115. return this.getStyle("display") != "none"
  2116. },
  2117. toggle : function(animate) {
  2118. this.setVisible(!this.isVisible(), this.preanim(arguments, 0));
  2119. return this
  2120. },
  2121. setDisplayed : function(value) {
  2122. if (typeof value == "boolean") {
  2123. value = value ? this.originalDisplay : "none"
  2124. }
  2125. this.setStyle("display", value);
  2126. return this
  2127. },
  2128. focus : function() {
  2129. try {
  2130. this.dom.focus()
  2131. } catch (e) {
  2132. }
  2133. return this
  2134. },
  2135. blur : function() {
  2136. try {
  2137. this.dom.blur()
  2138. } catch (e) {
  2139. }
  2140. return this
  2141. },
  2142. addClass : function(className) {
  2143. if (Ext.isArray(className)) {
  2144. for (var i = 0, len = className.length; i < len; i++) {
  2145. this.addClass(className[i])
  2146. }
  2147. } else {
  2148. if (className && !this.hasClass(className)) {
  2149. this.dom.className = this.dom.className + " " + className
  2150. }
  2151. }
  2152. return this
  2153. },
  2154. radioClass : function(className) {
  2155. var siblings = this.dom.parentNode.childNodes;
  2156. for (var i = 0; i < siblings.length; i++) {
  2157. var s = siblings[i];
  2158. if (s.nodeType == 1) {
  2159. Ext.get(s).removeClass(className)
  2160. }
  2161. }
  2162. this.addClass(className);
  2163. return this
  2164. },
  2165. removeClass : function(className) {
  2166. if (!className || !this.dom.className) {
  2167. return this
  2168. }
  2169. if (Ext.isArray(className)) {
  2170. for (var i = 0, len = className.length; i < len; i++) {
  2171. this.removeClass(className[i])
  2172. }
  2173. } else {
  2174. if (this.hasClass(className)) {
  2175. var re = this.classReCache[className];
  2176. if (!re) {
  2177. re = new RegExp(
  2178. "(?:^|\\s+)" + className + "(?:\\s+|$)", "g");
  2179. this.classReCache[className] = re
  2180. }
  2181. this.dom.className = this.dom.className.replace(re, " ")
  2182. }
  2183. }
  2184. return this
  2185. },
  2186. classReCache : {},
  2187. toggleClass : function(className) {
  2188. if (this.hasClass(className)) {
  2189. this.removeClass(className)
  2190. } else {
  2191. this.addClass(className)
  2192. }
  2193. return this
  2194. },
  2195. hasClass : function(className) {
  2196. return className
  2197. && (" " + this.dom.className + " ").indexOf(" " + className
  2198. + " ") != -1
  2199. },
  2200. replaceClass : function(oldClassName, newClassName) {
  2201. this.removeClass(oldClassName);
  2202. this.addClass(newClassName);
  2203. return this
  2204. },
  2205. getStyles : function() {
  2206. var a = arguments, len = a.length, r = {};
  2207. for (var i = 0; i < len; i++) {
  2208. r[a[i]] = this.getStyle(a[i])
  2209. }
  2210. return r
  2211. },
  2212. getStyle : function() {
  2213. return view && view.getComputedStyle ? function(prop) {
  2214. var el = this.dom, v, cs, camel;
  2215. if (prop == "float") {
  2216. prop = "cssFloat"
  2217. }
  2218. if (v = el.style[prop]) {
  2219. return v
  2220. }
  2221. if (cs = view.getComputedStyle(el, "")) {
  2222. if (!(camel = propCache[prop])) {
  2223. camel = propCache[prop] = prop
  2224. .replace(camelRe, camelFn)
  2225. }
  2226. return cs[camel]
  2227. }
  2228. return null
  2229. } : function(prop) {
  2230. var el = this.dom, v, cs, camel;
  2231. if (prop == "opacity") {
  2232. if (typeof el.style.filter == "string") {
  2233. var m = el.style.filter.match(/alpha\(opacity=(.*)\)/i);
  2234. if (m) {
  2235. var fv = parseFloat(m[1]);
  2236. if (!isNaN(fv)) {
  2237. return fv ? fv / 100 : 0
  2238. }
  2239. }
  2240. }
  2241. return 1
  2242. } else {
  2243. if (prop == "float") {
  2244. prop = "styleFloat"
  2245. }
  2246. }
  2247. if (!(camel = propCache[prop])) {
  2248. camel = propCache[prop] = prop.replace(camelRe, camelFn)
  2249. }
  2250. if (v = el.style[camel]) {
  2251. return v
  2252. }
  2253. if (cs = el.currentStyle) {
  2254. return cs[camel]
  2255. }
  2256. return null
  2257. }
  2258. }(),
  2259. setStyle : function(prop, value) {
  2260. if (typeof prop == "string") {
  2261. var camel;
  2262. if (!(camel = propCache[prop])) {
  2263. camel = propCache[prop] = prop.replace(camelRe, camelFn)
  2264. }
  2265. if (camel == "opacity") {
  2266. this.setOpacity(value)
  2267. } else {
  2268. this.dom.style[camel] = value
  2269. }
  2270. } else {
  2271. for (var style in prop) {
  2272. if (typeof prop[style] != "function") {
  2273. this.setStyle(style, prop[style])
  2274. }
  2275. }
  2276. }
  2277. return this
  2278. },
  2279. applyStyles : function(style) {
  2280. Ext.DomHelper.applyStyles(this.dom, style);
  2281. return this
  2282. },
  2283. getX : function() {
  2284. return D.getX(this.dom)
  2285. },
  2286. getY : function() {
  2287. return D.getY(this.dom)
  2288. },
  2289. getXY : function() {
  2290. return D.getXY(this.dom)
  2291. },
  2292. getOffsetsTo : function(el) {
  2293. var o = this.getXY();
  2294. var e = Ext.fly(el, "_internal").getXY();
  2295. return [o[0] - e[0], o[1] - e[1]]
  2296. },
  2297. setX : function(x, animate) {
  2298. if (!animate || !A) {
  2299. D.setX(this.dom, x)
  2300. } else {
  2301. this.setXY([x, this.getY()], this.preanim(arguments, 1))
  2302. }
  2303. return this
  2304. },
  2305. setY : function(y, animate) {
  2306. if (!animate || !A) {
  2307. D.setY(this.dom, y)
  2308. } else {
  2309. this.setXY([this.getX(), y], this.preanim(arguments, 1))
  2310. }
  2311. return this
  2312. },
  2313. setLeft : function(left) {
  2314. this.setStyle("left", this.addUnits(left));
  2315. return this
  2316. },
  2317. setTop : function(top) {
  2318. this.setStyle("top", this.addUnits(top));
  2319. return this
  2320. },
  2321. setRight : function(right) {
  2322. this.setStyle("right", this.addUnits(right));
  2323. return this
  2324. },
  2325. setBottom : function(bottom) {
  2326. this.setStyle("bottom", this.addUnits(bottom));
  2327. return this
  2328. },
  2329. setXY : function(pos, animate) {
  2330. if (!animate || !A) {
  2331. D.setXY(this.dom, pos)
  2332. } else {
  2333. this.anim({
  2334. points : {
  2335. to : pos
  2336. }
  2337. }, this.preanim(arguments, 1), "motion")
  2338. }
  2339. return this
  2340. },
  2341. setLocation : function(x, y, animate) {
  2342. this.setXY([x, y], this.preanim(arguments, 2));
  2343. return this
  2344. },
  2345. moveTo : function(x, y, animate) {
  2346. this.setXY([x, y], this.preanim(arguments, 2));
  2347. return this
  2348. },
  2349. getRegion : function() {
  2350. return D.getRegion(this.dom)
  2351. },
  2352. getHeight : function(contentHeight) {
  2353. var h = this.dom.offsetHeight || 0;
  2354. h = contentHeight !== true ? h : h - this.getBorderWidth("tb")
  2355. - this.getPadding("tb");
  2356. return h < 0 ? 0 : h
  2357. },
  2358. getWidth : function(contentWidth) {
  2359. var w = this.dom.offsetWidth || 0;
  2360. w = contentWidth !== true ? w : w - this.getBorderWidth("lr")
  2361. - this.getPadding("lr");
  2362. return w < 0 ? 0 : w
  2363. },
  2364. getComputedHeight : function() {
  2365. var h = Math.max(this.dom.offsetHeight, this.dom.clientHeight);
  2366. if (!h) {
  2367. h = parseInt(this.getStyle("height"), 10) || 0;
  2368. if (!this.isBorderBox()) {
  2369. h += this.getFrameWidth("tb")
  2370. }
  2371. }
  2372. return h
  2373. },
  2374. getComputedWidth : function() {
  2375. var w = Math.max(this.dom.offsetWidth, this.dom.clientWidth);
  2376. if (!w) {
  2377. w = parseInt(this.getStyle("width"), 10) || 0;
  2378. if (!this.isBorderBox()) {
  2379. w += this.getFrameWidth("lr")
  2380. }
  2381. }
  2382. return w
  2383. },
  2384. getSize : function(contentSize) {
  2385. return {
  2386. width : this.getWidth(contentSize),
  2387. height : this.getHeight(contentSize)
  2388. }
  2389. },
  2390. getStyleSize : function() {
  2391. var w, h, d = this.dom, s = d.style;
  2392. if (s.width && s.width != "auto") {
  2393. w = parseInt(s.width, 10);
  2394. if (Ext.isBorderBox) {
  2395. w -= this.getFrameWidth("lr")
  2396. }
  2397. }
  2398. if (s.height && s.height != "auto") {
  2399. h = parseInt(s.height, 10);
  2400. if (Ext.isBorderBox) {
  2401. h -= this.getFrameWidth("tb")
  2402. }
  2403. }
  2404. return {
  2405. width : w || this.getWidth(true),
  2406. height : h || this.getHeight(true)
  2407. }
  2408. },
  2409. getViewSize : function() {
  2410. var d = this.dom, doc = document, aw = 0, ah = 0;
  2411. if (d == doc || d == doc.body) {
  2412. return {
  2413. width : D.getViewWidth(),
  2414. height : D.getViewHeight()
  2415. }
  2416. } else {
  2417. return {
  2418. width : d.clientWidth,
  2419. height : d.clientHeight
  2420. }
  2421. }
  2422. },
  2423. getValue : function(asNumber) {
  2424. return asNumber ? parseInt(this.dom.value, 10) : this.dom.value
  2425. },
  2426. adjustWidth : function(width) {
  2427. if (typeof width == "number") {
  2428. if (this.autoBoxAdjust && !this.isBorderBox()) {
  2429. width -= (this.getBorderWidth("lr") + this.getPadding("lr"))
  2430. }
  2431. if (width < 0) {
  2432. width = 0
  2433. }
  2434. }
  2435. return width
  2436. },
  2437. adjustHeight : function(height) {
  2438. if (typeof height == "number") {
  2439. if (this.autoBoxAdjust && !this.isBorderBox()) {
  2440. height -= (this.getBorderWidth("tb") + this
  2441. .getPadding("tb"))
  2442. }
  2443. if (height < 0) {
  2444. height = 0
  2445. }
  2446. }
  2447. return height
  2448. },
  2449. setWidth : function(width, animate) {
  2450. width = this.adjustWidth(width);
  2451. if (!animate || !A) {
  2452. this.dom.style.width = this.addUnits(width)
  2453. } else {
  2454. this.anim({
  2455. width : {
  2456. to : width
  2457. }
  2458. }, this.preanim(arguments, 1))
  2459. }
  2460. return this
  2461. },
  2462. setHeight : function(height, animate) {
  2463. height = this.adjustHeight(height);
  2464. if (!animate || !A) {
  2465. this.dom.style.height = this.addUnits(height)
  2466. } else {
  2467. this.anim({
  2468. height : {
  2469. to : height
  2470. }
  2471. }, this.preanim(arguments, 1))
  2472. }
  2473. return this
  2474. },
  2475. setSize : function(width, height, animate) {
  2476. if (typeof width == "object") {
  2477. height = width.height;
  2478. width = width.width
  2479. }
  2480. width = this.adjustWidth(width);
  2481. height = this.adjustHeight(height);
  2482. if (!animate || !A) {
  2483. this.dom.style.width = this.addUnits(width);
  2484. this.dom.style.height = this.addUnits(height)
  2485. } else {
  2486. this.anim({
  2487. width : {
  2488. to : width
  2489. },
  2490. height : {
  2491. to : height
  2492. }
  2493. }, this.preanim(arguments, 2))
  2494. }
  2495. return this
  2496. },
  2497. setBounds : function(x, y, width, height, animate) {
  2498. if (!animate || !A) {
  2499. this.setSize(width, height);
  2500. this.setLocation(x, y)
  2501. } else {
  2502. width = this.adjustWidth(width);
  2503. height = this.adjustHeight(height);
  2504. this.anim({
  2505. points : {
  2506. to : [x, y]
  2507. },
  2508. width : {
  2509. to : width
  2510. },
  2511. height : {
  2512. to : height
  2513. }
  2514. }, this.preanim(arguments, 4), "motion")
  2515. }
  2516. return this
  2517. },
  2518. setRegion : function(region, animate) {
  2519. this.setBounds(region.left, region.top, region.right - region.left,
  2520. region.bottom - region.top, this.preanim(arguments, 1));
  2521. return this
  2522. },
  2523. addListener : function(eventName, fn, scope, options) {
  2524. Ext.EventManager
  2525. .on(this.dom, eventName, fn, scope || this, options)
  2526. },
  2527. removeListener : function(eventName, fn) {
  2528. Ext.EventManager.removeListener(this.dom, eventName, fn);
  2529. return this
  2530. },
  2531. removeAllListeners : function() {
  2532. E.purgeElement(this.dom);
  2533. return this
  2534. },
  2535. relayEvent : function(eventName, observable) {
  2536. this.on(eventName, function(e) {
  2537. observable.fireEvent(eventName, e)
  2538. })
  2539. },
  2540. setOpacity : function(opacity, animate) {
  2541. if (!animate || !A) {
  2542. var s = this.dom.style;
  2543. if (Ext.isIE) {
  2544. s.zoom = 1;
  2545. s.filter = (s.filter || "")
  2546. .replace(/alpha\([^\)]*\)/gi, "")
  2547. + (opacity == 1 ? "" : " alpha(opacity=" + opacity
  2548. * 100 + ")")
  2549. } else {
  2550. s.opacity = opacity
  2551. }
  2552. } else {
  2553. this.anim({
  2554. opacity : {
  2555. to : opacity
  2556. }
  2557. }, this.preanim(arguments, 1), null, 0.35, "easeIn")
  2558. }
  2559. return this
  2560. },
  2561. getLeft : function(local) {
  2562. if (!local) {
  2563. return this.getX()
  2564. } else {
  2565. return parseInt(this.getStyle("left"), 10) || 0
  2566. }
  2567. },
  2568. getRight : function(local) {
  2569. if (!local) {
  2570. return this.getX() + this.getWidth()
  2571. } else {
  2572. return (this.getLeft(true) + this.getWidth()) || 0
  2573. }
  2574. },
  2575. getTop : function(local) {
  2576. if (!local) {
  2577. return this.getY()
  2578. } else {
  2579. return parseInt(this.getStyle("top"), 10) || 0
  2580. }
  2581. },
  2582. getBottom : function(local) {
  2583. if (!local) {
  2584. return this.getY() + this.getHeight()
  2585. } else {
  2586. return (this.getTop(true) + this.getHeight()) || 0
  2587. }
  2588. },
  2589. position : function(pos, zIndex, x, y) {
  2590. if (!pos) {
  2591. if (this.getStyle("position") == "static") {
  2592. this.setStyle("position", "relative")
  2593. }
  2594. } else {
  2595. this.setStyle("position", pos)
  2596. }
  2597. if (zIndex) {
  2598. this.setStyle("z-index", zIndex)
  2599. }
  2600. if (x !== undefined && y !== undefined) {
  2601. this.setXY([x, y])
  2602. } else {
  2603. if (x !== undefined) {
  2604. this.setX(x)
  2605. } else {
  2606. if (y !== undefined) {
  2607. this.setY(y)
  2608. }
  2609. }
  2610. }
  2611. },
  2612. clearPositioning : function(value) {
  2613. value = value || "";
  2614. this.setStyle({
  2615. "left" : value,
  2616. "right" : value,
  2617. "top" : value,
  2618. "bottom" : value,
  2619. "z-index" : "",
  2620. "position" : "static"
  2621. });
  2622. return this
  2623. },
  2624. getPositioning : function() {
  2625. var l = this.getStyle("left");
  2626. var t = this.getStyle("top");
  2627. return {
  2628. "position" : this.getStyle("position"),
  2629. "left" : l,
  2630. "right" : l ? "" : this.getStyle("right"),
  2631. "top" : t,
  2632. "bottom" : t ? "" : this.getStyle("bottom"),
  2633. "z-index" : this.getStyle("z-index")
  2634. }
  2635. },
  2636. getBorderWidth : function(side) {
  2637. return this.addStyles(side, El.borders)
  2638. },
  2639. getPadding : function(side) {
  2640. return this.addStyles(side, El.paddings)
  2641. },
  2642. setPositioning : function(pc) {
  2643. this.applyStyles(pc);
  2644. if (pc.right == "auto") {
  2645. this.dom.style.right = ""
  2646. }
  2647. if (pc.bottom == "auto") {
  2648. this.dom.style.bottom = ""
  2649. }
  2650. return this
  2651. },
  2652. fixDisplay : function() {
  2653. if (this.getStyle("display") == "none") {
  2654. this.setStyle("visibility", "hidden");
  2655. this.setStyle("display", this.originalDisplay);
  2656. if (this.getStyle("display") == "none") {
  2657. this.setStyle("display", "block")
  2658. }
  2659. }
  2660. },
  2661. setOverflow : function(v) {
  2662. if (v == "auto" && Ext.isMac && Ext.isGecko) {
  2663. this.dom.style.overflow = "hidden";
  2664. (function() {
  2665. this.dom.style.overflow = "auto"
  2666. }).defer(1, this)
  2667. } else {
  2668. this.dom.style.overflow = v
  2669. }
  2670. },
  2671. setLeftTop : function(left, top) {
  2672. this.dom.style.left = this.addUnits(left);
  2673. this.dom.style.top = this.addUnits(top);
  2674. return this
  2675. },
  2676. move : function(direction, distance, animate) {
  2677. var xy = this.getXY();
  2678. direction = direction.toLowerCase();
  2679. switch (direction) {
  2680. case "l" :
  2681. case "left" :
  2682. this.moveTo(xy[0] - distance, xy[1], this.preanim(
  2683. arguments, 2));
  2684. break;
  2685. case "r" :
  2686. case "right" :
  2687. this.moveTo(xy[0] + distance, xy[1], this.preanim(
  2688. arguments, 2));
  2689. break;
  2690. case "t" :
  2691. case "top" :
  2692. case "up" :
  2693. this.moveTo(xy[0], xy[1] - distance, this.preanim(
  2694. arguments, 2));
  2695. break;
  2696. case "b" :
  2697. case "bottom" :
  2698. case "down" :
  2699. this.moveTo(xy[0], xy[1] + distance, this.preanim(
  2700. arguments, 2));
  2701. break
  2702. }
  2703. return this
  2704. },
  2705. clip : function() {
  2706. if (!this.isClipped) {
  2707. this.isClipped = true;
  2708. this.originalClip = {
  2709. "o" : this.getStyle("overflow"),
  2710. "x" : this.getStyle("overflow-x"),
  2711. "y" : this.getStyle("overflow-y")
  2712. };
  2713. this.setStyle("overflow", "hidden");
  2714. this.setStyle("overflow-x", "hidden");
  2715. this.setStyle("overflow-y", "hidden")
  2716. }
  2717. return this
  2718. },
  2719. unclip : function() {
  2720. if (this.isClipped) {
  2721. this.isClipped = false;
  2722. var o = this.originalClip;
  2723. if (o.o) {
  2724. this.setStyle("overflow", o.o)
  2725. }
  2726. if (o.x) {
  2727. this.setStyle("overflow-x", o.x)
  2728. }
  2729. if (o.y) {
  2730. this.setStyle("overflow-y", o.y)
  2731. }
  2732. }
  2733. return this
  2734. },
  2735. getAnchorXY : function(anchor, local, s) {
  2736. var w, h, vp = false;
  2737. if (!s) {
  2738. var d = this.dom;
  2739. if (d == document.body || d == document) {
  2740. vp = true;
  2741. w = D.getViewWidth();
  2742. h = D.getViewHeight()
  2743. } else {
  2744. w = this.getWidth();
  2745. h = this.getHeight()
  2746. }
  2747. } else {
  2748. w = s.width;
  2749. h = s.height
  2750. }
  2751. var x = 0, y = 0, r = Math.round;
  2752. switch ((anchor || "tl").toLowerCase()) {
  2753. case "c" :
  2754. x = r(w * 0.5);
  2755. y = r(h * 0.5);
  2756. break;
  2757. case "t" :
  2758. x = r(w * 0.5);
  2759. y = 0;
  2760. break;
  2761. case "l" :
  2762. x = 0;
  2763. y = r(h * 0.5);
  2764. break;
  2765. case "r" :
  2766. x = w;
  2767. y = r(h * 0.5);
  2768. break;
  2769. case "b" :
  2770. x = r(w * 0.5);
  2771. y = h;
  2772. break;
  2773. case "tl" :
  2774. x = 0;
  2775. y = 0;
  2776. break;
  2777. case "bl" :
  2778. x = 0;
  2779. y = h;
  2780. break;
  2781. case "br" :
  2782. x = w;
  2783. y = h;
  2784. break;
  2785. case "tr" :
  2786. x = w;
  2787. y = 0;
  2788. break
  2789. }
  2790. if (local === true) {
  2791. return [x, y]
  2792. }
  2793. if (vp) {
  2794. var sc = this.getScroll();
  2795. return [x + sc.left, y + sc.top]
  2796. }
  2797. var o = this.getXY();
  2798. return [x + o[0], y + o[1]]
  2799. },
  2800. getAlignToXY : function(el, p, o) {
  2801. el = Ext.get(el);
  2802. if (!el || !el.dom) {
  2803. throw "Element.alignToXY with an element that doesn't exist"
  2804. }
  2805. var d = this.dom;
  2806. var c = false;
  2807. var p1 = "", p2 = "";
  2808. o = o || [0, 0];
  2809. if (!p) {
  2810. p = "tl-bl"
  2811. } else {
  2812. if (p == "?") {
  2813. p = "tl-bl?"
  2814. } else {
  2815. if (p.indexOf("-") == -1) {
  2816. p = "tl-" + p
  2817. }
  2818. }
  2819. }
  2820. p = p.toLowerCase();
  2821. var m = p.match(/^([a-z]+)-([a-z]+)(\?)?$/);
  2822. if (!m) {
  2823. throw "Element.alignTo with an invalid alignment " + p
  2824. }
  2825. p1 = m[1];
  2826. p2 = m[2];
  2827. c = !!m[3];
  2828. var a1 = this.getAnchorXY(p1, true);
  2829. var a2 = el.getAnchorXY(p2, false);
  2830. var x = a2[0] - a1[0] + o[0];
  2831. var y = a2[1] - a1[1] + o[1];
  2832. if (c) {
  2833. var w = this.getWidth(), h = this.getHeight(), r = el
  2834. .getRegion();
  2835. var dw = D.getViewWidth() - 5, dh = D.getViewHeight() - 5;
  2836. var p1y = p1.charAt(0), p1x = p1.charAt(p1.length - 1);
  2837. var p2y = p2.charAt(0), p2x = p2.charAt(p2.length - 1);
  2838. var swapY = ((p1y == "t" && p2y == "b") || (p1y == "b" && p2y == "t"));
  2839. var swapX = ((p1x == "r" && p2x == "l") || (p1x == "l" && p2x == "r"));
  2840. var doc = document;
  2841. var scrollX = (doc.documentElement.scrollLeft
  2842. || doc.body.scrollLeft || 0)
  2843. + 5;
  2844. var scrollY = (doc.documentElement.scrollTop
  2845. || doc.body.scrollTop || 0)
  2846. + 5;
  2847. if ((x + w) > dw + scrollX) {
  2848. x = swapX ? r.left - w : dw + scrollX - w
  2849. }
  2850. if (x < scrollX) {
  2851. x = swapX ? r.right : scrollX
  2852. }
  2853. if ((y + h) > dh + scrollY) {
  2854. y = swapY ? r.top - h : dh + scrollY - h
  2855. }
  2856. if (y < scrollY) {
  2857. y = swapY ? r.bottom : scrollY
  2858. }
  2859. }
  2860. return [x, y]
  2861. },
  2862. getConstrainToXY : function() {
  2863. var os = {
  2864. top : 0,
  2865. left : 0,
  2866. bottom : 0,
  2867. right : 0
  2868. };
  2869. return function(el, local, offsets, proposedXY) {
  2870. el = Ext.get(el);
  2871. offsets = offsets ? Ext.applyIf(offsets, os) : os;
  2872. var vw, vh, vx = 0, vy = 0;
  2873. if (el.dom == document.body || el.dom == document) {
  2874. vw = Ext.lib.Dom.getViewWidth();
  2875. vh = Ext.lib.Dom.getViewHeight()
  2876. } else {
  2877. vw = el.dom.clientWidth;
  2878. vh = el.dom.clientHeight;
  2879. if (!local) {
  2880. var vxy = el.getXY();
  2881. vx = vxy[0];
  2882. vy = vxy[1]
  2883. }
  2884. }
  2885. var s = el.getScroll();
  2886. vx += offsets.left + s.left;
  2887. vy += offsets.top + s.top;
  2888. vw -= offsets.right;
  2889. vh -= offsets.bottom;
  2890. var vr = vx + vw;
  2891. var vb = vy + vh;
  2892. var xy = proposedXY
  2893. || (!local ? this.getXY() : [this.getLeft(true),
  2894. this.getTop(true)]);
  2895. var x = xy[0], y = xy[1];
  2896. var w = this.dom.offsetWidth, h = this.dom.offsetHeight;
  2897. var moved = false;
  2898. if ((x + w) > vr) {
  2899. x = vr - w;
  2900. moved = true
  2901. }
  2902. if ((y + h) > vb) {
  2903. y = vb - h;
  2904. moved = true
  2905. }
  2906. if (x < vx) {
  2907. x = vx;
  2908. moved = true
  2909. }
  2910. if (y < vy) {
  2911. y = vy;
  2912. moved = true
  2913. }
  2914. return moved ? [x, y] : false
  2915. }
  2916. }(),
  2917. adjustForConstraints : function(xy, parent, offsets) {
  2918. return this
  2919. .getConstrainToXY(parent || document, false, offsets, xy)
  2920. || xy
  2921. },
  2922. alignTo : function(element, position, offsets, animate) {
  2923. var xy = this.getAlignToXY(element, position, offsets);
  2924. this.setXY(xy, this.preanim(arguments, 3));
  2925. return this
  2926. },
  2927. anchorTo : function(el, alignment, offsets, animate, monitorScroll,
  2928. callback) {
  2929. var action = function() {
  2930. this.alignTo(el, alignment, offsets, animate);
  2931. Ext.callback(callback, this)
  2932. };
  2933. Ext.EventManager.onWindowResize(action, this);
  2934. var tm = typeof monitorScroll;
  2935. if (tm != "undefined") {
  2936. Ext.EventManager.on(window, "scroll", action, this, {
  2937. buffer : tm == "number" ? monitorScroll : 50
  2938. })
  2939. }
  2940. action.call(this);
  2941. return this
  2942. },
  2943. clearOpacity : function() {
  2944. if (window.ActiveXObject) {
  2945. if (typeof this.dom.style.filter == "string"
  2946. && (/alpha/i).test(this.dom.style.filter)) {
  2947. this.dom.style.filter = ""
  2948. }
  2949. } else {
  2950. this.dom.style.opacity = "";
  2951. this.dom.style["-moz-opacity"] = "";
  2952. this.dom.style["-khtml-opacity"] = ""
  2953. }
  2954. return this
  2955. },
  2956. hide : function(animate) {
  2957. this.setVisible(false, this.preanim(arguments, 0));
  2958. return this
  2959. },
  2960. show : function(animate) {
  2961. this.setVisible(true, this.preanim(arguments, 0));
  2962. return this
  2963. },
  2964. addUnits : function(size) {
  2965. return Ext.Element.addUnits(size, this.defaultUnit)
  2966. },
  2967. update : function(html, loadScripts, callback) {
  2968. if (typeof html == "undefined") {
  2969. html = ""
  2970. }
  2971. if (loadScripts !== true) {
  2972. this.dom.innerHTML = html;
  2973. if (typeof callback == "function") {
  2974. callback()
  2975. }
  2976. return this
  2977. }
  2978. var id = Ext.id();
  2979. var dom = this.dom;
  2980. html += "<span id=\"" + id + "\"></span>";
  2981. E.onAvailable(id, function() {
  2982. var hd = document.getElementsByTagName("head")[0];
  2983. var re = /(?:<script([^>]*)?>)((\n|\r|.)*?)(?:<\/script>)/ig;
  2984. var srcRe = /\ssrc=([\'\"])(.*?)\1/i;
  2985. var typeRe = /\stype=([\'\"])(.*?)\1/i;
  2986. var match;
  2987. while (match = re.exec(html)) {
  2988. var attrs = match[1];
  2989. var srcMatch = attrs ? attrs.match(srcRe) : false;
  2990. if (srcMatch && srcMatch[2]) {
  2991. var s = document.createElement("script");
  2992. s.src = srcMatch[2];
  2993. var typeMatch = attrs.match(typeRe);
  2994. if (typeMatch && typeMatch[2]) {
  2995. s.type = typeMatch[2]
  2996. }
  2997. hd.appendChild(s)
  2998. } else {
  2999. if (match[2] && match[2].length > 0) {
  3000. if (window.execScript) {
  3001. window.execScript(match[2])
  3002. } else {
  3003. window.eval(match[2])
  3004. }
  3005. }
  3006. }
  3007. }
  3008. var el = document.getElementById(id);
  3009. if (el) {
  3010. Ext.removeNode(el)
  3011. }
  3012. if (typeof callback == "function") {
  3013. callback()
  3014. }
  3015. });
  3016. dom.innerHTML = html.replace(
  3017. /(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/ig, "");
  3018. return this
  3019. },
  3020. load : function() {
  3021. var um = this.getUpdater();
  3022. um.update.apply(um, arguments);
  3023. return this
  3024. },
  3025. getUpdater : function() {
  3026. if (!this.updateManager) {
  3027. this.updateManager = new Ext.Updater(this)
  3028. }
  3029. return this.updateManager
  3030. },
  3031. unselectable : function() {
  3032. this.dom.unselectable = "on";
  3033. this.swallowEvent("selectstart", true);
  3034. this.applyStyles("-moz-user-select:none;-khtml-user-select:none;");
  3035. this.addClass("x-unselectable");
  3036. return this
  3037. },
  3038. getCenterXY : function() {
  3039. return this.getAlignToXY(document, "c-c")
  3040. },
  3041. center : function(centerIn) {
  3042. this.alignTo(centerIn || document, "c-c");
  3043. return this
  3044. },
  3045. isBorderBox : function() {
  3046. return noBoxAdjust[this.dom.tagName.toLowerCase()]
  3047. || Ext.isBorderBox
  3048. },
  3049. getBox : function(contentBox, local) {
  3050. var xy;
  3051. if (!local) {
  3052. xy = this.getXY()
  3053. } else {
  3054. var left = parseInt(this.getStyle("left"), 10) || 0;
  3055. var top = parseInt(this.getStyle("top"), 10) || 0;
  3056. xy = [left, top]
  3057. }
  3058. var el = this.dom, w = el.offsetWidth, h = el.offsetHeight, bx;
  3059. if (!contentBox) {
  3060. bx = {
  3061. x : xy[0],
  3062. y : xy[1],
  3063. 0 : xy[0],
  3064. 1 : xy[1],
  3065. width : w,
  3066. height : h
  3067. }
  3068. } else {
  3069. var l = this.getBorderWidth("l") + this.getPadding("l");
  3070. var r = this.getBorderWidth("r") + this.getPadding("r");
  3071. var t = this.getBorderWidth("t") + this.getPadding("t");
  3072. var b = this.getBorderWidth("b") + this.getPadding("b");
  3073. bx = {
  3074. x : xy[0] + l,
  3075. y : xy[1] + t,
  3076. 0 : xy[0] + l,
  3077. 1 : xy[1] + t,
  3078. width : w - (l + r),
  3079. height : h - (t + b)
  3080. }
  3081. }
  3082. bx.right = bx.x + bx.width;
  3083. bx.bottom = bx.y + bx.height;
  3084. return bx
  3085. },
  3086. getFrameWidth : function(sides, onlyContentBox) {
  3087. return onlyContentBox && Ext.isBorderBox ? 0 : (this
  3088. .getPadding(sides) + this.getBorderWidth(sides))
  3089. },
  3090. setBox : function(box, adjust, animate) {
  3091. var w = box.width, h = box.height;
  3092. if ((adjust && !this.autoBoxAdjust) && !this.isBorderBox()) {
  3093. w -= (this.getBorderWidth("lr") + this.getPadding("lr"));
  3094. h -= (this.getBorderWidth("tb") + this.getPadding("tb"))
  3095. }
  3096. this.setBounds(box.x, box.y, w, h, this.preanim(arguments, 2));
  3097. return this
  3098. },
  3099. repaint : function() {
  3100. var dom = this.dom;
  3101. this.addClass("x-repaint");
  3102. setTimeout(function() {
  3103. Ext.get(dom).removeClass("x-repaint")
  3104. }, 1);
  3105. return this
  3106. },
  3107. getMargins : function(side) {
  3108. if (!side) {
  3109. return {
  3110. top : parseInt(this.getStyle("margin-top"), 10) || 0,
  3111. left : parseInt(this.getStyle("margin-left"), 10) || 0,
  3112. bottom : parseInt(this.getStyle("margin-bottom"), 10) || 0,
  3113. right : parseInt(this.getStyle("margin-right"), 10) || 0
  3114. }
  3115. } else {
  3116. return this.addStyles(side, El.margins)
  3117. }
  3118. },
  3119. addStyles : function(sides, styles) {
  3120. var val = 0, v, w;
  3121. for (var i = 0, len = sides.length; i < len; i++) {
  3122. v = this.getStyle(styles[sides.charAt(i)]);
  3123. if (v) {
  3124. w = parseInt(v, 10);
  3125. if (w) {
  3126. val += (w >= 0 ? w : -1 * w)
  3127. }
  3128. }
  3129. }
  3130. return val
  3131. },
  3132. createProxy : function(config, renderTo, matchBox) {
  3133. config = typeof config == "object" ? config : {
  3134. tag : "div",
  3135. cls : config
  3136. };
  3137. var proxy;
  3138. if (renderTo) {
  3139. proxy = Ext.DomHelper.append(renderTo, config, true)
  3140. } else {
  3141. proxy = Ext.DomHelper.insertBefore(this.dom, config, true)
  3142. }
  3143. if (matchBox) {
  3144. proxy.setBox(this.getBox())
  3145. }
  3146. return proxy
  3147. },
  3148. mask : function(msg, msgCls) {
  3149. if (this.getStyle("position") == "static") {
  3150. this.setStyle("position", "relative")
  3151. }
  3152. if (this._maskMsg) {
  3153. this._maskMsg.remove()
  3154. }
  3155. if (this._mask) {
  3156. this._mask.remove()
  3157. }
  3158. this._mask = Ext.DomHelper.append(this.dom, {
  3159. cls : "ext-el-mask"
  3160. }, true);
  3161. this.addClass("x-masked");
  3162. this._mask.setDisplayed(true);
  3163. if (typeof msg == "string") {
  3164. this._maskMsg = Ext.DomHelper.append(this.dom, {
  3165. cls : "ext-el-mask-msg",
  3166. cn : {
  3167. tag : "div"
  3168. }
  3169. }, true);
  3170. var mm = this._maskMsg;
  3171. mm.dom.className = msgCls
  3172. ? "ext-el-mask-msg " + msgCls
  3173. : "ext-el-mask-msg";
  3174. mm.dom.firstChild.innerHTML = msg;
  3175. mm.setDisplayed(true);
  3176. mm.center(this)
  3177. }
  3178. if (Ext.isIE && !(Ext.isIE7 && Ext.isStrict)
  3179. && this.getStyle("height") == "auto") {
  3180. this._mask.setSize(this.dom.clientWidth, this.getHeight())
  3181. }
  3182. return this._mask
  3183. },
  3184. unmask : function() {
  3185. if (this._mask) {
  3186. if (this._maskMsg) {
  3187. this._maskMsg.remove();
  3188. delete this._maskMsg
  3189. }
  3190. this._mask.remove();
  3191. delete this._mask
  3192. }
  3193. this.removeClass("x-masked")
  3194. },
  3195. isMasked : function() {
  3196. return this._mask && this._mask.isVisible()
  3197. },
  3198. createShim : function() {
  3199. var el = document.createElement("iframe");
  3200. el.frameBorder = "no";
  3201. el.className = "ext-shim";
  3202. if (Ext.isIE && Ext.isSecure) {
  3203. el.src = Ext.SSL_SECURE_URL
  3204. }
  3205. var shim = Ext.get(this.dom.parentNode.insertBefore(el, this.dom));
  3206. shim.autoBoxAdjust = false;
  3207. return shim
  3208. },
  3209. remove : function() {
  3210. Ext.removeNode(this.dom);
  3211. delete El.cache[this.dom.id]
  3212. },
  3213. hover : function(overFn, outFn, scope) {
  3214. var preOverFn = function(e) {
  3215. if (!e.within(this, true)) {
  3216. overFn.apply(scope || this, arguments)
  3217. }
  3218. };
  3219. var preOutFn = function(e) {
  3220. if (!e.within(this, true)) {
  3221. outFn.apply(scope || this, arguments)
  3222. }
  3223. };
  3224. this.on("mouseover", preOverFn, this.dom);
  3225. this.on("mouseout", preOutFn, this.dom);
  3226. return this
  3227. },
  3228. addClassOnOver : function(className, preventFlicker) {
  3229. this.hover(function() {
  3230. Ext.fly(this, "_internal").addClass(className)
  3231. }, function() {
  3232. Ext.fly(this, "_internal").removeClass(className)
  3233. });
  3234. return this
  3235. },
  3236. addClassOnFocus : function(className) {
  3237. this.on("focus", function() {
  3238. Ext.fly(this, "_internal").addClass(className)
  3239. }, this.dom);
  3240. this.on("blur", function() {
  3241. Ext.fly(this, "_internal").removeClass(className)
  3242. }, this.dom);
  3243. return this
  3244. },
  3245. addClassOnClick : function(className) {
  3246. var dom = this.dom;
  3247. this.on("mousedown", function() {
  3248. Ext.fly(dom, "_internal").addClass(className);
  3249. var d = Ext.getDoc();
  3250. var fn = function() {
  3251. Ext.fly(dom, "_internal").removeClass(className);
  3252. d.removeListener("mouseup", fn)
  3253. };
  3254. d.on("mouseup", fn)
  3255. });
  3256. return this
  3257. },
  3258. swallowEvent : function(eventName, preventDefault) {
  3259. var fn = function(e) {
  3260. e.stopPropagation();
  3261. if (preventDefault) {
  3262. e.preventDefault()
  3263. }
  3264. };
  3265. if (Ext.isArray(eventName)) {
  3266. for (var i = 0, len = eventName.length; i < len; i++) {
  3267. this.on(eventName[i], fn)
  3268. }
  3269. return this
  3270. }
  3271. this.on(eventName, fn);
  3272. return this
  3273. },
  3274. parent : function(selector, returnDom) {
  3275. return this.matchNode("parentNode", "parentNode", selector,
  3276. returnDom)
  3277. },
  3278. next : function(selector, returnDom) {
  3279. return this.matchNode("nextSibling", "nextSibling", selector,
  3280. returnDom)
  3281. },
  3282. prev : function(selector, returnDom) {
  3283. return this.matchNode("previousSibling", "previousSibling",
  3284. selector, returnDom)
  3285. },
  3286. first : function(selector, returnDom) {
  3287. return this.matchNode("nextSibling", "firstChild", selector,
  3288. returnDom)
  3289. },
  3290. last : function(selector, returnDom) {
  3291. return this.matchNode("previousSibling", "lastChild", selector,
  3292. returnDom)
  3293. },
  3294. matchNode : function(dir, start, selector, returnDom) {
  3295. var n = this.dom[start];
  3296. while (n) {
  3297. if (n.nodeType == 1
  3298. && (!selector || Ext.DomQuery.is(n, selector))) {
  3299. return !returnDom ? Ext.get(n) : n
  3300. }
  3301. n = n[dir]
  3302. }
  3303. return null
  3304. },
  3305. appendChild : function(el) {
  3306. el = Ext.get(el);
  3307. el.appendTo(this);
  3308. return this
  3309. },
  3310. createChild : function(config, insertBefore, returnDom) {
  3311. config = config || {
  3312. tag : "div"
  3313. };
  3314. if (insertBefore) {
  3315. return Ext.DomHelper.insertBefore(insertBefore, config,
  3316. returnDom !== true)
  3317. }
  3318. return Ext.DomHelper[!this.dom.firstChild ? "overwrite" : "append"](
  3319. this.dom, config, returnDom !== true)
  3320. },
  3321. appendTo : function(el) {
  3322. el = Ext.getDom(el);
  3323. el.appendChild(this.dom);
  3324. return this
  3325. },
  3326. insertBefore : function(el) {
  3327. el = Ext.getDom(el);
  3328. el.parentNode.insertBefore(this.dom, el);
  3329. return this
  3330. },
  3331. insertAfter : function(el) {
  3332. el = Ext.getDom(el);
  3333. el.parentNode.insertBefore(this.dom, el.nextSibling);
  3334. return this
  3335. },
  3336. insertFirst : function(el, returnDom) {
  3337. el = el || {};
  3338. if (typeof el == "object" && !el.nodeType && !el.dom) {
  3339. return this.createChild(el, this.dom.firstChild, returnDom)
  3340. } else {
  3341. el = Ext.getDom(el);
  3342. this.dom.insertBefore(el, this.dom.firstChild);
  3343. return !returnDom ? Ext.get(el) : el
  3344. }
  3345. },
  3346. insertSibling : function(el, where, returnDom) {
  3347. var rt;
  3348. if (Ext.isArray(el)) {
  3349. for (var i = 0, len = el.length; i < len; i++) {
  3350. rt = this.insertSibling(el[i], where, returnDom)
  3351. }
  3352. return rt
  3353. }
  3354. where = where ? where.toLowerCase() : "before";
  3355. el = el || {};
  3356. var refNode = where == "before" ? this.dom : this.dom.nextSibling;
  3357. if (typeof el == "object" && !el.nodeType && !el.dom) {
  3358. if (where == "after" && !this.dom.nextSibling) {
  3359. rt = Ext.DomHelper.append(this.dom.parentNode, el,
  3360. !returnDom)
  3361. } else {
  3362. rt = Ext.DomHelper[where == "after"
  3363. ? "insertAfter"
  3364. : "insertBefore"](this.dom, el, !returnDom)
  3365. }
  3366. } else {
  3367. rt = this.dom.parentNode.insertBefore(Ext.getDom(el), refNode);
  3368. if (!returnDom) {
  3369. rt = Ext.get(rt)
  3370. }
  3371. }
  3372. return rt
  3373. },
  3374. wrap : function(config, returnDom) {
  3375. if (!config) {
  3376. config = {
  3377. tag : "div"
  3378. }
  3379. }
  3380. var newEl = Ext.DomHelper
  3381. .insertBefore(this.dom, config, !returnDom);
  3382. newEl.dom ? newEl.dom.appendChild(this.dom) : newEl
  3383. .appendChild(this.dom);
  3384. return newEl
  3385. },
  3386. replace : function(el) {
  3387. el = Ext.get(el);
  3388. this.insertBefore(el);
  3389. el.remove();
  3390. return this
  3391. },
  3392. replaceWith : function(el) {
  3393. if (typeof el == "object" && !el.nodeType && !el.dom) {
  3394. el = this.insertSibling(el, "before")
  3395. } else {
  3396. el = Ext.getDom(el);
  3397. this.dom.parentNode.insertBefore(el, this.dom)
  3398. }
  3399. El.uncache(this.id);
  3400. this.dom.parentNode.removeChild(this.dom);
  3401. this.dom = el;
  3402. this.id = Ext.id(el);
  3403. El.cache[this.id] = this;
  3404. return this
  3405. },
  3406. insertHtml : function(where, html, returnEl) {
  3407. var el = Ext.DomHelper.insertHtml(where, this.dom, html);
  3408. return returnEl ? Ext.get(el) : el
  3409. },
  3410. set : function(o, useSet) {
  3411. var el = this.dom;
  3412. useSet = typeof useSet == "undefined" ? (el.setAttribute
  3413. ? true
  3414. : false) : useSet;
  3415. for (var attr in o) {
  3416. if (attr == "style" || typeof o[attr] == "function") {
  3417. continue
  3418. }
  3419. if (attr == "cls") {
  3420. el.className = o["cls"]
  3421. } else {
  3422. if (o.hasOwnProperty(attr)) {
  3423. if (useSet) {
  3424. el.setAttribute(attr, o[attr])
  3425. } else {
  3426. el[attr] = o[attr]
  3427. }
  3428. }
  3429. }
  3430. }
  3431. if (o.style) {
  3432. Ext.DomHelper.applyStyles(el, o.style)
  3433. }
  3434. return this
  3435. },
  3436. addKeyListener : function(key, fn, scope) {
  3437. var config;
  3438. if (typeof key != "object" || Ext.isArray(key)) {
  3439. config = {
  3440. key : key,
  3441. fn : fn,
  3442. scope : scope
  3443. }
  3444. } else {
  3445. config = {
  3446. key : key.key,
  3447. shift : key.shift,
  3448. ctrl : key.ctrl,
  3449. alt : key.alt,
  3450. fn : fn,
  3451. scope : scope
  3452. }
  3453. }
  3454. return new Ext.KeyMap(this, config)
  3455. },
  3456. addKeyMap : function(config) {
  3457. return new Ext.KeyMap(this, config)
  3458. },
  3459. isScrollable : function() {
  3460. var dom = this.dom;
  3461. return dom.scrollHeight > dom.clientHeight
  3462. || dom.scrollWidth > dom.clientWidth
  3463. },
  3464. scrollTo : function(side, value, animate) {
  3465. var prop = side.toLowerCase() == "left"
  3466. ? "scrollLeft"
  3467. : "scrollTop";
  3468. if (!animate || !A) {
  3469. this.dom[prop] = value
  3470. } else {
  3471. var to = prop == "scrollLeft" ? [value, this.dom.scrollTop] : [
  3472. this.dom.scrollLeft, value];
  3473. this.anim({
  3474. scroll : {
  3475. "to" : to
  3476. }
  3477. }, this.preanim(arguments, 2), "scroll")
  3478. }
  3479. return this
  3480. },
  3481. scroll : function(direction, distance, animate) {
  3482. if (!this.isScrollable()) {
  3483. return
  3484. }
  3485. var el = this.dom;
  3486. var l = el.scrollLeft, t = el.scrollTop;
  3487. var w = el.scrollWidth, h = el.scrollHeight;
  3488. var cw = el.clientWidth, ch = el.clientHeight;
  3489. direction = direction.toLowerCase();
  3490. var scrolled = false;
  3491. var a = this.preanim(arguments, 2);
  3492. switch (direction) {
  3493. case "l" :
  3494. case "left" :
  3495. if (w - l > cw) {
  3496. var v = Math.min(l + distance, w - cw);
  3497. this.scrollTo("left", v, a);
  3498. scrolled = true
  3499. }
  3500. break;
  3501. case "r" :
  3502. case "right" :
  3503. if (l > 0) {
  3504. var v = Math.max(l - distance, 0);
  3505. this.scrollTo("left", v, a);
  3506. scrolled = true
  3507. }
  3508. break;
  3509. case "t" :
  3510. case "top" :
  3511. case "up" :
  3512. if (t > 0) {
  3513. var v = Math.max(t - distance, 0);
  3514. this.scrollTo("top", v, a);
  3515. scrolled = true
  3516. }
  3517. break;
  3518. case "b" :
  3519. case "bottom" :
  3520. case "down" :
  3521. if (h - t > ch) {
  3522. var v = Math.min(t + distance, h - ch);
  3523. this.scrollTo("top", v, a);
  3524. scrolled = true
  3525. }
  3526. break
  3527. }
  3528. return scrolled
  3529. },
  3530. translatePoints : function(x, y) {
  3531. if (typeof x == "object" || Ext.isArray(x)) {
  3532. y = x[1];
  3533. x = x[0]
  3534. }
  3535. var p = this.getStyle("position");
  3536. var o = this.getXY();
  3537. var l = parseInt(this.getStyle("left"), 10);
  3538. var t = parseInt(this.getStyle("top"), 10);
  3539. if (isNaN(l)) {
  3540. l = (p == "relative") ? 0 : this.dom.offsetLeft
  3541. }
  3542. if (isNaN(t)) {
  3543. t = (p == "relative") ? 0 : this.dom.offsetTop
  3544. }
  3545. return {
  3546. left : (x - o[0] + l),
  3547. top : (y - o[1] + t)
  3548. }
  3549. },
  3550. getScroll : function() {
  3551. var d = this.dom, doc = document;
  3552. if (d == doc || d == doc.body) {
  3553. var l, t;
  3554. if (Ext.isIE && Ext.isStrict) {
  3555. l = doc.documentElement.scrollLeft
  3556. || (doc.body.scrollLeft || 0);
  3557. t = doc.documentElement.scrollTop
  3558. || (doc.body.scrollTop || 0)
  3559. } else {
  3560. l = window.pageXOffset || (doc.body.scrollLeft || 0);
  3561. t = window.pageYOffset || (doc.body.scrollTop || 0)
  3562. }
  3563. return {
  3564. left : l,
  3565. top : t
  3566. }
  3567. } else {
  3568. return {
  3569. left : d.scrollLeft,
  3570. top : d.scrollTop
  3571. }
  3572. }
  3573. },
  3574. getColor : function(attr, defaultValue, prefix) {
  3575. var v = this.getStyle(attr);
  3576. if (!v || v == "transparent" || v == "inherit") {
  3577. return defaultValue
  3578. }
  3579. var color = typeof prefix == "undefined" ? "#" : prefix;
  3580. if (v.substr(0, 4) == "rgb(") {
  3581. var rvs = v.slice(4, v.length - 1).split(",");
  3582. for (var i = 0; i < 3; i++) {
  3583. var h = parseInt(rvs[i]);
  3584. var s = h.toString(16);
  3585. if (h < 16) {
  3586. s = "0" + s
  3587. }
  3588. color += s
  3589. }
  3590. } else {
  3591. if (v.substr(0, 1) == "#") {
  3592. if (v.length == 4) {
  3593. for (var i = 1; i < 4; i++) {
  3594. var c = v.charAt(i);
  3595. color += c + c
  3596. }
  3597. } else {
  3598. if (v.length == 7) {
  3599. color += v.substr(1)
  3600. }
  3601. }
  3602. }
  3603. }
  3604. return (color.length > 5 ? color.toLowerCase() : defaultValue)
  3605. },
  3606. boxWrap : function(cls) {
  3607. cls = cls || "x-box";
  3608. var el = Ext.get(this.insertHtml("beforeBegin", String.format(
  3609. "<div class=\"{0}\">" + El.boxMarkup + "</div>",
  3610. cls)));
  3611. el.child("." + cls + "-mc").dom.appendChild(this.dom);
  3612. return el
  3613. },
  3614. getAttributeNS : Ext.isIE ? function(ns, name) {
  3615. var d = this.dom;
  3616. var type = typeof d[ns + ":" + name];
  3617. if (type != "undefined" && type != "unknown") {
  3618. return d[ns + ":" + name]
  3619. }
  3620. return d[name]
  3621. } : function(ns, name) {
  3622. var d = this.dom;
  3623. return d.getAttributeNS(ns, name)
  3624. || d.getAttribute(ns + ":" + name) || d.getAttribute(name)
  3625. || d[name]
  3626. },
  3627. getTextWidth : function(text, min, max) {
  3628. return (Ext.util.TextMetrics.measure(this.dom, Ext.value(text,
  3629. this.dom.innerHTML, true)).width).constrain(min
  3630. || 0, max || 1000000)
  3631. }
  3632. };
  3633. var ep = El.prototype;
  3634. ep.on = ep.addListener;
  3635. ep.mon = ep.addListener;
  3636. ep.getUpdateManager = ep.getUpdater;
  3637. ep.un = ep.removeListener;
  3638. ep.autoBoxAdjust = true;
  3639. El.unitPattern = /\d+(px|em|%|en|ex|pt|in|cm|mm|pc)$/i;
  3640. El.addUnits = function(v, defaultUnit) {
  3641. if (v === "" || v == "auto") {
  3642. return v
  3643. }
  3644. if (v === undefined) {
  3645. return ""
  3646. }
  3647. if (typeof v == "number" || !El.unitPattern.test(v)) {
  3648. return v + (defaultUnit || "px")
  3649. }
  3650. return v
  3651. };
  3652. El.boxMarkup = "<div class=\"{0}-tl\"><div class=\"{0}-tr\"><div class=\"{0}-tc\"></div></div></div><div class=\"{0}-ml\"><div class=\"{0}-mr\"><div class=\"{0}-mc\"></div></div></div><div class=\"{0}-bl\"><div class=\"{0}-br\"><div class=\"{0}-bc\"></div></div></div>";
  3653. El.VISIBILITY = 1;
  3654. El.DISPLAY = 2;
  3655. El.borders = {
  3656. l : "border-left-width",
  3657. r : "border-right-width",
  3658. t : "border-top-width",
  3659. b : "border-bottom-width"
  3660. };
  3661. El.paddings = {
  3662. l : "padding-left",
  3663. r : "padding-right",
  3664. t : "padding-top",
  3665. b : "padding-bottom"
  3666. };
  3667. El.margins = {
  3668. l : "margin-left",
  3669. r : "margin-right",
  3670. t : "margin-top",
  3671. b : "margin-bottom"
  3672. };
  3673. El.cache = {};
  3674. var docEl;
  3675. El.get = function(el) {
  3676. var ex, elm, id;
  3677. if (!el) {
  3678. return null
  3679. }
  3680. if (typeof el == "string") {
  3681. if (!(elm = document.getElementById(el))) {
  3682. return null
  3683. }
  3684. if (ex = El.cache[el]) {
  3685. ex.dom = elm
  3686. } else {
  3687. ex = El.cache[el] = new El(elm)
  3688. }
  3689. return ex
  3690. } else {
  3691. if (el.tagName) {
  3692. if (!(id = el.id)) {
  3693. id = Ext.id(el)
  3694. }
  3695. if (ex = El.cache[id]) {
  3696. ex.dom = el
  3697. } else {
  3698. ex = El.cache[id] = new El(el)
  3699. }
  3700. return ex
  3701. } else {
  3702. if (el instanceof El) {
  3703. if (el != docEl) {
  3704. el.dom = document.getElementById(el.id) || el.dom;
  3705. El.cache[el.id] = el
  3706. }
  3707. return el
  3708. } else {
  3709. if (el.isComposite) {
  3710. return el
  3711. } else {
  3712. if (Ext.isArray(el)) {
  3713. return El.select(el)
  3714. } else {
  3715. if (el == document) {
  3716. if (!docEl) {
  3717. var f = function() {
  3718. };
  3719. f.prototype = El.prototype;
  3720. docEl = new f();
  3721. docEl.dom = document
  3722. }
  3723. return docEl
  3724. }
  3725. }
  3726. }
  3727. }
  3728. }
  3729. }
  3730. return null
  3731. };
  3732. El.uncache = function(el) {
  3733. for (var i = 0, a = arguments, len = a.length; i < len; i++) {
  3734. if (a[i]) {
  3735. delete El.cache[a[i].id || a[i]]
  3736. }
  3737. }
  3738. };
  3739. El.garbageCollect = function() {
  3740. if (!Ext.enableGarbageCollector) {
  3741. clearInterval(El.collectorThread);
  3742. return
  3743. }
  3744. for (var eid in El.cache) {
  3745. var el = El.cache[eid], d = el.dom;
  3746. if (!d || !d.parentNode
  3747. || (!d.offsetParent && !document.getElementById(eid))) {
  3748. delete El.cache[eid];
  3749. if (d && Ext.enableListenerCollection) {
  3750. E.purgeElement(d)
  3751. }
  3752. }
  3753. }
  3754. };
  3755. El.collectorThreadId = setInterval(El.garbageCollect, 30000);
  3756. var flyFn = function() {
  3757. };
  3758. flyFn.prototype = El.prototype;
  3759. var _cls = new flyFn();
  3760. El.Flyweight = function(dom) {
  3761. this.dom = dom
  3762. };
  3763. El.Flyweight.prototype = _cls;
  3764. El.Flyweight.prototype.isFlyweight = true;
  3765. El._flyweights = {};
  3766. El.fly = function(el, named) {
  3767. named = named || "_global";
  3768. el = Ext.getDom(el);
  3769. if (!el) {
  3770. return null
  3771. }
  3772. if (!El._flyweights[named]) {
  3773. El._flyweights[named] = new El.Flyweight()
  3774. }
  3775. El._flyweights[named].dom = el;
  3776. return El._flyweights[named]
  3777. };
  3778. Ext.get = El.get;
  3779. Ext.fly = El.fly;
  3780. var noBoxAdjust = Ext.isStrict ? {
  3781. select : 1
  3782. } : {
  3783. input : 1,
  3784. select : 1,
  3785. textarea : 1
  3786. };
  3787. if (Ext.isIE || Ext.isGecko) {
  3788. noBoxAdjust["button"] = 1
  3789. }
  3790. Ext.EventManager.on(window, "unload", function() {
  3791. delete El.cache;
  3792. delete El._flyweights
  3793. })
  3794. })();
  3795. Ext.enableFx = true;
  3796. Ext.Fx = {
  3797. slideIn : function(A, C) {
  3798. var B = this.getFxEl();
  3799. C = C || {};
  3800. B.queueFx(C, function() {
  3801. A = A || "t";
  3802. this.fixDisplay();
  3803. var D = this.getFxRestore();
  3804. var I = this.getBox();
  3805. this.setSize(I);
  3806. var F = this.fxWrap(D.pos, C, "hidden");
  3807. var K = this.dom.style;
  3808. K.visibility = "visible";
  3809. K.position = "absolute";
  3810. var E = function() {
  3811. B.fxUnwrap(F, D.pos, C);
  3812. K.width = D.width;
  3813. K.height = D.height;
  3814. B.afterFx(C)
  3815. };
  3816. var J, L = {
  3817. to : [I.x, I.y]
  3818. }, H = {
  3819. to : I.width
  3820. }, G = {
  3821. to : I.height
  3822. };
  3823. switch (A.toLowerCase()) {
  3824. case "t" :
  3825. F.setSize(I.width, 0);
  3826. K.left = K.bottom = "0";
  3827. J = {
  3828. height : G
  3829. };
  3830. break;
  3831. case "l" :
  3832. F.setSize(0, I.height);
  3833. K.right = K.top = "0";
  3834. J = {
  3835. width : H
  3836. };
  3837. break;
  3838. case "r" :
  3839. F.setSize(0, I.height);
  3840. F.setX(I.right);
  3841. K.left = K.top = "0";
  3842. J = {
  3843. width : H,
  3844. points : L
  3845. };
  3846. break;
  3847. case "b" :
  3848. F.setSize(I.width, 0);
  3849. F.setY(I.bottom);
  3850. K.left = K.top = "0";
  3851. J = {
  3852. height : G,
  3853. points : L
  3854. };
  3855. break;
  3856. case "tl" :
  3857. F.setSize(0, 0);
  3858. K.right = K.bottom = "0";
  3859. J = {
  3860. width : H,
  3861. height : G
  3862. };
  3863. break;
  3864. case "bl" :
  3865. F.setSize(0, 0);
  3866. F.setY(I.y + I.height);
  3867. K.right = K.top = "0";
  3868. J = {
  3869. width : H,
  3870. height : G,
  3871. points : L
  3872. };
  3873. break;
  3874. case "br" :
  3875. F.setSize(0, 0);
  3876. F.setXY([I.right, I.bottom]);
  3877. K.left = K.top = "0";
  3878. J = {
  3879. width : H,
  3880. height : G,
  3881. points : L
  3882. };
  3883. break;
  3884. case "tr" :
  3885. F.setSize(0, 0);
  3886. F.setX(I.x + I.width);
  3887. K.left = K.bottom = "0";
  3888. J = {
  3889. width : H,
  3890. height : G,
  3891. points : L
  3892. };
  3893. break
  3894. }
  3895. this.dom.style.visibility = "visible";
  3896. F.show();
  3897. arguments.callee.anim = F.fxanim(J, C, "motion", 0.5,
  3898. "easeOut", E)
  3899. });
  3900. return this
  3901. },
  3902. slideOut : function(A, C) {
  3903. var B = this.getFxEl();
  3904. C = C || {};
  3905. B.queueFx(C, function() {
  3906. A = A || "t";
  3907. var I = this.getFxRestore();
  3908. var D = this.getBox();
  3909. this.setSize(D);
  3910. var G = this.fxWrap(I.pos, C, "visible");
  3911. var F = this.dom.style;
  3912. F.visibility = "visible";
  3913. F.position = "absolute";
  3914. G.setSize(D);
  3915. var J = function() {
  3916. if (C.useDisplay) {
  3917. B.setDisplayed(false)
  3918. } else {
  3919. B.hide()
  3920. }
  3921. B.fxUnwrap(G, I.pos, C);
  3922. F.width = I.width;
  3923. F.height = I.height;
  3924. B.afterFx(C)
  3925. };
  3926. var E, H = {
  3927. to : 0
  3928. };
  3929. switch (A.toLowerCase()) {
  3930. case "t" :
  3931. F.left = F.bottom = "0";
  3932. E = {
  3933. height : H
  3934. };
  3935. break;
  3936. case "l" :
  3937. F.right = F.top = "0";
  3938. E = {
  3939. width : H
  3940. };
  3941. break;
  3942. case "r" :
  3943. F.left = F.top = "0";
  3944. E = {
  3945. width : H,
  3946. points : {
  3947. to : [D.right, D.y]
  3948. }
  3949. };
  3950. break;
  3951. case "b" :
  3952. F.left = F.top = "0";
  3953. E = {
  3954. height : H,
  3955. points : {
  3956. to : [D.x, D.bottom]
  3957. }
  3958. };
  3959. break;
  3960. case "tl" :
  3961. F.right = F.bottom = "0";
  3962. E = {
  3963. width : H,
  3964. height : H
  3965. };
  3966. break;
  3967. case "bl" :
  3968. F.right = F.top = "0";
  3969. E = {
  3970. width : H,
  3971. height : H,
  3972. points : {
  3973. to : [D.x, D.bottom]
  3974. }
  3975. };
  3976. break;
  3977. case "br" :
  3978. F.left = F.top = "0";
  3979. E = {
  3980. width : H,
  3981. height : H,
  3982. points : {
  3983. to : [D.x + D.width, D.bottom]
  3984. }
  3985. };
  3986. break;
  3987. case "tr" :
  3988. F.left = F.bottom = "0";
  3989. E = {
  3990. width : H,
  3991. height : H,
  3992. points : {
  3993. to : [D.right, D.y]
  3994. }
  3995. };
  3996. break
  3997. }
  3998. arguments.callee.anim = G.fxanim(E, C, "motion", 0.5,
  3999. "easeOut", J)
  4000. });
  4001. return this
  4002. },
  4003. puff : function(B) {
  4004. var A = this.getFxEl();
  4005. B = B || {};
  4006. A.queueFx(B, function() {
  4007. this.clearOpacity();
  4008. this.show();
  4009. var F = this.getFxRestore();
  4010. var D = this.dom.style;
  4011. var G = function() {
  4012. if (B.useDisplay) {
  4013. A.setDisplayed(false)
  4014. } else {
  4015. A.hide()
  4016. }
  4017. A.clearOpacity();
  4018. A.setPositioning(F.pos);
  4019. D.width = F.width;
  4020. D.height = F.height;
  4021. D.fontSize = "";
  4022. A.afterFx(B)
  4023. };
  4024. var E = this.getWidth();
  4025. var C = this.getHeight();
  4026. arguments.callee.anim = this.fxanim({
  4027. width : {
  4028. to : this.adjustWidth(E * 2)
  4029. },
  4030. height : {
  4031. to : this.adjustHeight(C * 2)
  4032. },
  4033. points : {
  4034. by : [-(E * 0.5), -(C * 0.5)]
  4035. },
  4036. opacity : {
  4037. to : 0
  4038. },
  4039. fontSize : {
  4040. to : 200,
  4041. unit : "%"
  4042. }
  4043. }, B, "motion", 0.5, "easeOut", G)
  4044. });
  4045. return this
  4046. },
  4047. switchOff : function(B) {
  4048. var A = this.getFxEl();
  4049. B = B || {};
  4050. A.queueFx(B, function() {
  4051. this.clearOpacity();
  4052. this.clip();
  4053. var D = this.getFxRestore();
  4054. var C = this.dom.style;
  4055. var E = function() {
  4056. if (B.useDisplay) {
  4057. A.setDisplayed(false)
  4058. } else {
  4059. A.hide()
  4060. }
  4061. A.clearOpacity();
  4062. A.setPositioning(D.pos);
  4063. C.width = D.width;
  4064. C.height = D.height;
  4065. A.afterFx(B)
  4066. };
  4067. this.fxanim({
  4068. opacity : {
  4069. to : 0.3
  4070. }
  4071. }, null, null, 0.1, null, function() {
  4072. this.clearOpacity();
  4073. (function() {
  4074. this.fxanim({
  4075. height : {
  4076. to : 1
  4077. },
  4078. points : {
  4079. by : [
  4080. 0,
  4081. this.getHeight()
  4082. * 0.5]
  4083. }
  4084. }, B, "motion", 0.3, "easeIn", E)
  4085. }).defer(100, this)
  4086. })
  4087. });
  4088. return this
  4089. },
  4090. highlight : function(A, C) {
  4091. var B = this.getFxEl();
  4092. C = C || {};
  4093. B.queueFx(C, function() {
  4094. A = A || "ffff9c";
  4095. var D = C.attr || "backgroundColor";
  4096. this.clearOpacity();
  4097. this.show();
  4098. var G = this.getColor(D);
  4099. var H = this.dom.style[D];
  4100. var F = (C.endColor || G) || "ffffff";
  4101. var I = function() {
  4102. B.dom.style[D] = H;
  4103. B.afterFx(C)
  4104. };
  4105. var E = {};
  4106. E[D] = {
  4107. from : A,
  4108. to : F
  4109. };
  4110. arguments.callee.anim = this.fxanim(E, C, "color", 1,
  4111. "easeIn", I)
  4112. });
  4113. return this
  4114. },
  4115. frame : function(A, C, D) {
  4116. var B = this.getFxEl();
  4117. D = D || {};
  4118. B.queueFx(D, function() {
  4119. A = A || "#C3DAF9";
  4120. if (A.length == 6) {
  4121. A = "#" + A
  4122. }
  4123. C = C || 1;
  4124. var G = D.duration || 1;
  4125. this.show();
  4126. var E = this.getBox();
  4127. var F = function() {
  4128. var H = Ext.getBody().createChild({
  4129. style : {
  4130. visbility : "hidden",
  4131. position : "absolute",
  4132. "z-index" : "35000",
  4133. border : "0px solid " + A
  4134. }
  4135. });
  4136. var I = Ext.isBorderBox ? 2 : 1;
  4137. H.animate({
  4138. top : {
  4139. from : E.y,
  4140. to : E.y - 20
  4141. },
  4142. left : {
  4143. from : E.x,
  4144. to : E.x - 20
  4145. },
  4146. borderWidth : {
  4147. from : 0,
  4148. to : 10
  4149. },
  4150. opacity : {
  4151. from : 1,
  4152. to : 0
  4153. },
  4154. height : {
  4155. from : E.height,
  4156. to : (E.height + (20 * I))
  4157. },
  4158. width : {
  4159. from : E.width,
  4160. to : (E.width + (20 * I))
  4161. }
  4162. }, G, function() {
  4163. H.remove();
  4164. if (--C > 0) {
  4165. F()
  4166. } else {
  4167. B.afterFx(D)
  4168. }
  4169. })
  4170. };
  4171. F.call(this)
  4172. });
  4173. return this
  4174. },
  4175. pause : function(C) {
  4176. var A = this.getFxEl();
  4177. var B = {};
  4178. A.queueFx(B, function() {
  4179. setTimeout(function() {
  4180. A.afterFx(B)
  4181. }, C * 1000)
  4182. });
  4183. return this
  4184. },
  4185. fadeIn : function(B) {
  4186. var A = this.getFxEl();
  4187. B = B || {};
  4188. A.queueFx(B, function() {
  4189. this.setOpacity(0);
  4190. this.fixDisplay();
  4191. this.dom.style.visibility = "visible";
  4192. var C = B.endOpacity || 1;
  4193. arguments.callee.anim = this.fxanim({
  4194. opacity : {
  4195. to : C
  4196. }
  4197. }, B, null, 0.5, "easeOut", function() {
  4198. if (C == 1) {
  4199. this.clearOpacity()
  4200. }
  4201. A.afterFx(B)
  4202. })
  4203. });
  4204. return this
  4205. },
  4206. fadeOut : function(B) {
  4207. var A = this.getFxEl();
  4208. B = B || {};
  4209. A.queueFx(B, function() {
  4210. arguments.callee.anim = this.fxanim({
  4211. opacity : {
  4212. to : B.endOpacity || 0
  4213. }
  4214. }, B, null, 0.5, "easeOut", function() {
  4215. if (this.visibilityMode == Ext.Element.DISPLAY
  4216. || B.useDisplay) {
  4217. this.dom.style.display = "none"
  4218. } else {
  4219. this.dom.style.visibility = "hidden"
  4220. }
  4221. this.clearOpacity();
  4222. A.afterFx(B)
  4223. })
  4224. });
  4225. return this
  4226. },
  4227. scale : function(A, B, C) {
  4228. this.shift(Ext.apply({}, C, {
  4229. width : A,
  4230. height : B
  4231. }));
  4232. return this
  4233. },
  4234. shift : function(B) {
  4235. var A = this.getFxEl();
  4236. B = B || {};
  4237. A.queueFx(B, function() {
  4238. var E = {}, D = B.width, F = B.height, C = B.x, H = B.y, G = B.opacity;
  4239. if (D !== undefined) {
  4240. E.width = {
  4241. to : this.adjustWidth(D)
  4242. }
  4243. }
  4244. if (F !== undefined) {
  4245. E.height = {
  4246. to : this.adjustHeight(F)
  4247. }
  4248. }
  4249. if (C !== undefined || H !== undefined) {
  4250. E.points = {
  4251. to : [C !== undefined ? C : this.getX(),
  4252. H !== undefined ? H : this.getY()]
  4253. }
  4254. }
  4255. if (G !== undefined) {
  4256. E.opacity = {
  4257. to : G
  4258. }
  4259. }
  4260. if (B.xy !== undefined) {
  4261. E.points = {
  4262. to : B.xy
  4263. }
  4264. }
  4265. arguments.callee.anim = this.fxanim(E, B, "motion", 0.35,
  4266. "easeOut", function() {
  4267. A.afterFx(B)
  4268. })
  4269. });
  4270. return this
  4271. },
  4272. ghost : function(A, C) {
  4273. var B = this.getFxEl();
  4274. C = C || {};
  4275. B.queueFx(C, function() {
  4276. A = A || "b";
  4277. var H = this.getFxRestore();
  4278. var E = this.getWidth(), G = this.getHeight();
  4279. var F = this.dom.style;
  4280. var J = function() {
  4281. if (C.useDisplay) {
  4282. B.setDisplayed(false)
  4283. } else {
  4284. B.hide()
  4285. }
  4286. B.clearOpacity();
  4287. B.setPositioning(H.pos);
  4288. F.width = H.width;
  4289. F.height = H.height;
  4290. B.afterFx(C)
  4291. };
  4292. var D = {
  4293. opacity : {
  4294. to : 0
  4295. },
  4296. points : {}
  4297. }, I = D.points;
  4298. switch (A.toLowerCase()) {
  4299. case "t" :
  4300. I.by = [0, -G];
  4301. break;
  4302. case "l" :
  4303. I.by = [-E, 0];
  4304. break;
  4305. case "r" :
  4306. I.by = [E, 0];
  4307. break;
  4308. case "b" :
  4309. I.by = [0, G];
  4310. break;
  4311. case "tl" :
  4312. I.by = [-E, -G];
  4313. break;
  4314. case "bl" :
  4315. I.by = [-E, G];
  4316. break;
  4317. case "br" :
  4318. I.by = [E, G];
  4319. break;
  4320. case "tr" :
  4321. I.by = [E, -G];
  4322. break
  4323. }
  4324. arguments.callee.anim = this.fxanim(D, C, "motion", 0.5,
  4325. "easeOut", J)
  4326. });
  4327. return this
  4328. },
  4329. syncFx : function() {
  4330. this.fxDefaults = Ext.apply(this.fxDefaults || {}, {
  4331. block : false,
  4332. concurrent : true,
  4333. stopFx : false
  4334. });
  4335. return this
  4336. },
  4337. sequenceFx : function() {
  4338. this.fxDefaults = Ext.apply(this.fxDefaults || {}, {
  4339. block : false,
  4340. concurrent : false,
  4341. stopFx : false
  4342. });
  4343. return this
  4344. },
  4345. nextFx : function() {
  4346. var A = this.fxQueue[0];
  4347. if (A) {
  4348. A.call(this)
  4349. }
  4350. },
  4351. hasActiveFx : function() {
  4352. return this.fxQueue && this.fxQueue[0]
  4353. },
  4354. stopFx : function() {
  4355. if (this.hasActiveFx()) {
  4356. var A = this.fxQueue[0];
  4357. if (A && A.anim && A.anim.isAnimated()) {
  4358. this.fxQueue = [A];
  4359. A.anim.stop(true)
  4360. }
  4361. }
  4362. return this
  4363. },
  4364. beforeFx : function(A) {
  4365. if (this.hasActiveFx() && !A.concurrent) {
  4366. if (A.stopFx) {
  4367. this.stopFx();
  4368. return true
  4369. }
  4370. return false
  4371. }
  4372. return true
  4373. },
  4374. hasFxBlock : function() {
  4375. var A = this.fxQueue;
  4376. return A && A[0] && A[0].block
  4377. },
  4378. queueFx : function(C, A) {
  4379. if (!this.fxQueue) {
  4380. this.fxQueue = []
  4381. }
  4382. if (!this.hasFxBlock()) {
  4383. Ext.applyIf(C, this.fxDefaults);
  4384. if (!C.concurrent) {
  4385. var B = this.beforeFx(C);
  4386. A.block = C.block;
  4387. this.fxQueue.push(A);
  4388. if (B) {
  4389. this.nextFx()
  4390. }
  4391. } else {
  4392. A.call(this)
  4393. }
  4394. }
  4395. return this
  4396. },
  4397. fxWrap : function(F, D, C) {
  4398. var B;
  4399. if (!D.wrap || !(B = Ext.get(D.wrap))) {
  4400. var A;
  4401. if (D.fixPosition) {
  4402. A = this.getXY()
  4403. }
  4404. var E = document.createElement("div");
  4405. E.style.visibility = C;
  4406. B = Ext.get(this.dom.parentNode.insertBefore(E, this.dom));
  4407. B.setPositioning(F);
  4408. if (B.getStyle("position") == "static") {
  4409. B.position("relative")
  4410. }
  4411. this.clearPositioning("auto");
  4412. B.clip();
  4413. B.dom.appendChild(this.dom);
  4414. if (A) {
  4415. B.setXY(A)
  4416. }
  4417. }
  4418. return B
  4419. },
  4420. fxUnwrap : function(A, C, B) {
  4421. this.clearPositioning();
  4422. this.setPositioning(C);
  4423. if (!B.wrap) {
  4424. A.dom.parentNode.insertBefore(this.dom, A.dom);
  4425. A.remove()
  4426. }
  4427. },
  4428. getFxRestore : function() {
  4429. var A = this.dom.style;
  4430. return {
  4431. pos : this.getPositioning(),
  4432. width : A.width,
  4433. height : A.height
  4434. }
  4435. },
  4436. afterFx : function(A) {
  4437. if (A.afterStyle) {
  4438. this.applyStyles(A.afterStyle)
  4439. }
  4440. if (A.afterCls) {
  4441. this.addClass(A.afterCls)
  4442. }
  4443. if (A.remove === true) {
  4444. this.remove()
  4445. }
  4446. Ext.callback(A.callback, A.scope, [this]);
  4447. if (!A.concurrent) {
  4448. this.fxQueue.shift();
  4449. this.nextFx()
  4450. }
  4451. },
  4452. getFxEl : function() {
  4453. return Ext.get(this.dom)
  4454. },
  4455. fxanim : function(D, E, B, F, C, A) {
  4456. B = B || "run";
  4457. E = E || {};
  4458. var G = Ext.lib.Anim[B](this.dom, D, (E.duration || F) || 0.35,
  4459. (E.easing || C) || "easeOut", function() {
  4460. Ext.callback(A, this)
  4461. }, this);
  4462. E.anim = G;
  4463. return G
  4464. }
  4465. };
  4466. Ext.Fx.resize = Ext.Fx.scale;
  4467. Ext.apply(Ext.Element.prototype, Ext.Fx);
  4468. Ext.CompositeElement = function(A) {
  4469. this.elements = [];
  4470. this.addElements(A)
  4471. };
  4472. Ext.CompositeElement.prototype = {
  4473. isComposite : true,
  4474. addElements : function(E) {
  4475. if (!E) {
  4476. return this
  4477. }
  4478. if (typeof E == "string") {
  4479. E = Ext.Element.selectorFunction(E)
  4480. }
  4481. var D = this.elements;
  4482. var B = D.length - 1;
  4483. for (var C = 0, A = E.length; C < A; C++) {
  4484. D[++B] = Ext.get(E[C])
  4485. }
  4486. return this
  4487. },
  4488. fill : function(A) {
  4489. this.elements = [];
  4490. this.add(A);
  4491. return this
  4492. },
  4493. filter : function(A) {
  4494. var B = [];
  4495. this.each(function(C) {
  4496. if (C.is(A)) {
  4497. B[B.length] = C.dom
  4498. }
  4499. });
  4500. this.fill(B);
  4501. return this
  4502. },
  4503. invoke : function(E, B) {
  4504. var D = this.elements;
  4505. for (var C = 0, A = D.length; C < A; C++) {
  4506. Ext.Element.prototype[E].apply(D[C], B)
  4507. }
  4508. return this
  4509. },
  4510. add : function(A) {
  4511. if (typeof A == "string") {
  4512. this.addElements(Ext.Element.selectorFunction(A))
  4513. } else {
  4514. if (A.length !== undefined) {
  4515. this.addElements(A)
  4516. } else {
  4517. this.addElements([A])
  4518. }
  4519. }
  4520. return this
  4521. },
  4522. each : function(E, D) {
  4523. var C = this.elements;
  4524. for (var B = 0, A = C.length; B < A; B++) {
  4525. if (E.call(D || C[B], C[B], this, B) === false) {
  4526. break
  4527. }
  4528. }
  4529. return this
  4530. },
  4531. item : function(A) {
  4532. return this.elements[A] || null
  4533. },
  4534. first : function() {
  4535. return this.item(0)
  4536. },
  4537. last : function() {
  4538. return this.item(this.elements.length - 1)
  4539. },
  4540. getCount : function() {
  4541. return this.elements.length
  4542. },
  4543. contains : function(A) {
  4544. return this.indexOf(A) !== -1
  4545. },
  4546. indexOf : function(A) {
  4547. return this.elements.indexOf(Ext.get(A))
  4548. },
  4549. removeElement : function(D, F) {
  4550. if (Ext.isArray(D)) {
  4551. for (var C = 0, A = D.length; C < A; C++) {
  4552. this.removeElement(D[C])
  4553. }
  4554. return this
  4555. }
  4556. var B = typeof D == "number" ? D : this.indexOf(D);
  4557. if (B !== -1 && this.elements[B]) {
  4558. if (F) {
  4559. var E = this.elements[B];
  4560. if (E.dom) {
  4561. E.remove()
  4562. } else {
  4563. Ext.removeNode(E)
  4564. }
  4565. }
  4566. this.elements.splice(B, 1)
  4567. }
  4568. return this
  4569. },
  4570. replaceElement : function(D, C, A) {
  4571. var B = typeof D == "number" ? D : this.indexOf(D);
  4572. if (B !== -1) {
  4573. if (A) {
  4574. this.elements[B].replaceWith(C)
  4575. } else {
  4576. this.elements.splice(B, 1, Ext.get(C))
  4577. }
  4578. }
  4579. return this
  4580. },
  4581. clear : function() {
  4582. this.elements = []
  4583. }
  4584. };
  4585. (function() {
  4586. Ext.CompositeElement.createCall = function(B, C) {
  4587. if (!B[C]) {
  4588. B[C] = function() {
  4589. return this.invoke(C, arguments)
  4590. }
  4591. }
  4592. };
  4593. for (var A in Ext.Element.prototype) {
  4594. if (typeof Ext.Element.prototype[A] == "function") {
  4595. Ext.CompositeElement.createCall(Ext.CompositeElement.prototype, A)
  4596. }
  4597. }
  4598. })();
  4599. Ext.CompositeElementLite = function(A) {
  4600. Ext.CompositeElementLite.superclass.constructor.call(this, A);
  4601. this.el = new Ext.Element.Flyweight()
  4602. };
  4603. Ext.extend(Ext.CompositeElementLite, Ext.CompositeElement, {
  4604. addElements : function(E) {
  4605. if (E) {
  4606. if (Ext.isArray(E)) {
  4607. this.elements = this.elements.concat(E)
  4608. } else {
  4609. var D = this.elements;
  4610. var B = D.length - 1;
  4611. for (var C = 0, A = E.length; C < A; C++) {
  4612. D[++B] = E[C]
  4613. }
  4614. }
  4615. }
  4616. return this
  4617. },
  4618. invoke : function(F, B) {
  4619. var D = this.elements;
  4620. var E = this.el;
  4621. for (var C = 0, A = D.length; C < A; C++) {
  4622. E.dom = D[C];
  4623. Ext.Element.prototype[F].apply(E, B)
  4624. }
  4625. return this
  4626. },
  4627. item : function(A) {
  4628. if (!this.elements[A]) {
  4629. return null
  4630. }
  4631. this.el.dom = this.elements[A];
  4632. return this.el
  4633. },
  4634. addListener : function(B, G, F, E) {
  4635. var D = this.elements;
  4636. for (var C = 0, A = D.length; C < A; C++) {
  4637. Ext.EventManager.on(D[C], B, G, F || D[C], E)
  4638. }
  4639. return this
  4640. },
  4641. each : function(F, E) {
  4642. var C = this.elements;
  4643. var D = this.el;
  4644. for (var B = 0, A = C.length; B < A; B++) {
  4645. D.dom = C[B];
  4646. if (F.call(E || D, D, this, B) === false) {
  4647. break
  4648. }
  4649. }
  4650. return this
  4651. },
  4652. indexOf : function(A) {
  4653. return this.elements.indexOf(Ext.getDom(A))
  4654. },
  4655. replaceElement : function(D, C, A) {
  4656. var B = typeof D == "number" ? D : this.indexOf(D);
  4657. if (B !== -1) {
  4658. C = Ext.getDom(C);
  4659. if (A) {
  4660. var E = this.elements[B];
  4661. E.parentNode.insertBefore(C, E);
  4662. Ext.removeNode(E)
  4663. }
  4664. this.elements.splice(B, 1, C)
  4665. }
  4666. return this
  4667. }
  4668. });
  4669. Ext.CompositeElementLite.prototype.on = Ext.CompositeElementLite.prototype.addListener;
  4670. if (Ext.DomQuery) {
  4671. Ext.Element.selectorFunction = Ext.DomQuery.select
  4672. }
  4673. Ext.Element.select = function(A, D, B) {
  4674. var C;
  4675. if (typeof A == "string") {
  4676. C = Ext.Element.selectorFunction(A, B)
  4677. } else {
  4678. if (A.length !== undefined) {
  4679. C = A
  4680. } else {
  4681. throw "Invalid selector"
  4682. }
  4683. }
  4684. if (D === true) {
  4685. return new Ext.CompositeElement(C)
  4686. } else {
  4687. return new Ext.CompositeElementLite(C)
  4688. }
  4689. };
  4690. Ext.select = Ext.Element.select;
  4691. Ext.data.Connection = function(A) {
  4692. Ext.apply(this, A);
  4693. this.addEvents("beforerequest", "requestcomplete", "requestexception");
  4694. Ext.data.Connection.superclass.constructor.call(this)
  4695. };
  4696. Ext.extend(Ext.data.Connection, Ext.util.Observable, {
  4697. timeout : 30000,
  4698. autoAbort : false,
  4699. disableCaching : true,
  4700. request : function(E) {
  4701. if (this.fireEvent("beforerequest", this, E) !== false) {
  4702. var C = E.params;
  4703. if (typeof C == "function") {
  4704. C = C.call(E.scope || window, E)
  4705. }
  4706. if (typeof C == "object") {
  4707. C = Ext.urlEncode(C)
  4708. }
  4709. if (this.extraParams) {
  4710. var G = Ext.urlEncode(this.extraParams);
  4711. C = C ? (C + "&" + G) : G
  4712. }
  4713. var B = E.url || this.url;
  4714. if (typeof B == "function") {
  4715. B = B.call(E.scope || window, E)
  4716. }
  4717. if (E.form) {
  4718. var D = Ext.getDom(E.form);
  4719. B = B || D.action;
  4720. var I = D.getAttribute("enctype");
  4721. if (E.isUpload
  4722. || (I && I.toLowerCase() == "multipart/form-data")) {
  4723. return this.doFormUpload(E, C, B)
  4724. }
  4725. var H = Ext.lib.Ajax.serializeForm(D);
  4726. C = C ? (C + "&" + H) : H
  4727. }
  4728. var J = E.headers;
  4729. if (this.defaultHeaders) {
  4730. J = Ext.apply(J || {}, this.defaultHeaders);
  4731. if (!E.headers) {
  4732. E.headers = J
  4733. }
  4734. }
  4735. var F = {
  4736. success : this.handleResponse,
  4737. failure : this.handleFailure,
  4738. scope : this,
  4739. argument : {
  4740. options : E
  4741. },
  4742. timeout : E.timeout || this.timeout
  4743. };
  4744. var A = E.method || this.method || (C ? "POST" : "GET");
  4745. if (A == "GET"
  4746. && (this.disableCaching && E.disableCaching !== false)
  4747. || E.disableCaching === true) {
  4748. B += (B.indexOf("?") != -1 ? "&" : "?") + "_dc="
  4749. + (new Date().getTime())
  4750. }
  4751. if (typeof E.autoAbort == "boolean") {
  4752. if (E.autoAbort) {
  4753. this.abort()
  4754. }
  4755. } else {
  4756. if (this.autoAbort !== false) {
  4757. this.abort()
  4758. }
  4759. }
  4760. if ((A == "GET" && C) || E.xmlData || E.jsonData) {
  4761. B += (B.indexOf("?") != -1 ? "&" : "?") + C;
  4762. C = ""
  4763. }
  4764. this.transId = Ext.lib.Ajax.request(A, B, F, C, E);
  4765. return this.transId
  4766. } else {
  4767. Ext.callback(E.callback, E.scope, [E, null, null]);
  4768. return null
  4769. }
  4770. },
  4771. isLoading : function(A) {
  4772. if (A) {
  4773. return Ext.lib.Ajax.isCallInProgress(A)
  4774. } else {
  4775. return this.transId ? true : false
  4776. }
  4777. },
  4778. abort : function(A) {
  4779. if (A || this.isLoading()) {
  4780. Ext.lib.Ajax.abort(A || this.transId)
  4781. }
  4782. },
  4783. handleResponse : function(A) {
  4784. this.transId = false;
  4785. var B = A.argument.options;
  4786. A.argument = B ? B.argument : null;
  4787. this.fireEvent("requestcomplete", this, A, B);
  4788. Ext.callback(B.success, B.scope, [A, B]);
  4789. Ext.callback(B.callback, B.scope, [B, true, A])
  4790. },
  4791. handleFailure : function(A, C) {
  4792. this.transId = false;
  4793. var B = A.argument.options;
  4794. A.argument = B ? B.argument : null;
  4795. this.fireEvent("requestexception", this, A, B, C);
  4796. Ext.callback(B.failure, B.scope, [A, B]);
  4797. Ext.callback(B.callback, B.scope, [B, false, A])
  4798. },
  4799. doFormUpload : function(E, A, B) {
  4800. var C = Ext.id();
  4801. var F = document.createElement("iframe");
  4802. F.id = C;
  4803. F.name = C;
  4804. F.className = "x-hidden";
  4805. if (Ext.isIE) {
  4806. F.src = Ext.SSL_SECURE_URL
  4807. }
  4808. document.body.appendChild(F);
  4809. if (Ext.isIE) {
  4810. document.frames[C].name = C
  4811. }
  4812. var D = Ext.getDom(E.form);
  4813. D.target = C;
  4814. D.method = "POST";
  4815. D.enctype = D.encoding = "multipart/form-data";
  4816. if (B) {
  4817. D.action = B
  4818. }
  4819. var L, J;
  4820. if (A) {
  4821. L = [];
  4822. A = Ext.urlDecode(A, false);
  4823. for (var H in A) {
  4824. if (A.hasOwnProperty(H)) {
  4825. J = document.createElement("input");
  4826. J.type = "hidden";
  4827. J.name = H;
  4828. J.value = A[H];
  4829. D.appendChild(J);
  4830. L.push(J)
  4831. }
  4832. }
  4833. }
  4834. function G() {
  4835. var M = {
  4836. responseText : "",
  4837. responseXML : null
  4838. };
  4839. M.argument = E ? E.argument : null;
  4840. try {
  4841. var O;
  4842. if (Ext.isIE) {
  4843. O = F.contentWindow.document
  4844. } else {
  4845. O = (F.contentDocument || window.frames[C].document)
  4846. }
  4847. if (O && O.body) {
  4848. M.responseText = O.body.innerHTML
  4849. }
  4850. if (O && O.XMLDocument) {
  4851. M.responseXML = O.XMLDocument
  4852. } else {
  4853. M.responseXML = O
  4854. }
  4855. } catch (N) {
  4856. }
  4857. Ext.EventManager.removeListener(F, "load", G, this);
  4858. this.fireEvent("requestcomplete", this, M, E);
  4859. Ext.callback(E.success, E.scope, [M, E]);
  4860. Ext.callback(E.callback, E.scope, [E, true, M]);
  4861. setTimeout(function() {
  4862. Ext.removeNode(F)
  4863. }, 100)
  4864. }
  4865. Ext.EventManager.on(F, "load", G, this);
  4866. D.submit();
  4867. if (L) {
  4868. for (var I = 0, K = L.length; I < K; I++) {
  4869. Ext.removeNode(L[I])
  4870. }
  4871. }
  4872. }
  4873. });
  4874. Ext.Ajax = new Ext.data.Connection({
  4875. autoAbort : false,
  4876. serializeForm : function(A) {
  4877. return Ext.lib.Ajax.serializeForm(A)
  4878. }
  4879. });
  4880. Ext.Updater = function(B, A) {
  4881. B = Ext.get(B);
  4882. if (!A && B.updateManager) {
  4883. return B.updateManager
  4884. }
  4885. this.el = B;
  4886. this.defaultUrl = null;
  4887. this.addEvents("beforeupdate", "update", "failure");
  4888. var C = Ext.Updater.defaults;
  4889. this.sslBlankUrl = C.sslBlankUrl;
  4890. this.disableCaching = C.disableCaching;
  4891. this.indicatorText = C.indicatorText;
  4892. this.showLoadIndicator = C.showLoadIndicator;
  4893. this.timeout = C.timeout;
  4894. this.loadScripts = C.loadScripts;
  4895. this.transaction = null;
  4896. this.autoRefreshProcId = null;
  4897. this.refreshDelegate = this.refresh.createDelegate(this);
  4898. this.updateDelegate = this.update.createDelegate(this);
  4899. this.formUpdateDelegate = this.formUpdate.createDelegate(this);
  4900. if (!this.renderer) {
  4901. this.renderer = new Ext.Updater.BasicRenderer()
  4902. }
  4903. Ext.Updater.superclass.constructor.call(this)
  4904. };
  4905. Ext.extend(Ext.Updater, Ext.util.Observable, {
  4906. getEl : function() {
  4907. return this.el
  4908. },
  4909. update : function(B, F, H, D) {
  4910. if (this.fireEvent("beforeupdate", this.el, B, F) !== false) {
  4911. var G = this.method, A, C;
  4912. if (typeof B == "object") {
  4913. A = B;
  4914. B = A.url;
  4915. F = F || A.params;
  4916. H = H || A.callback;
  4917. D = D || A.discardUrl;
  4918. C = A.scope;
  4919. if (typeof A.method != "undefined") {
  4920. G = A.method
  4921. }
  4922. if (typeof A.nocache != "undefined") {
  4923. this.disableCaching = A.nocache
  4924. }
  4925. if (typeof A.text != "undefined") {
  4926. this.indicatorText = "<div class=\"loading-indicator\">"
  4927. + A.text + "</div>"
  4928. }
  4929. if (typeof A.scripts != "undefined") {
  4930. this.loadScripts = A.scripts
  4931. }
  4932. if (typeof A.timeout != "undefined") {
  4933. this.timeout = A.timeout
  4934. }
  4935. }
  4936. this.showLoading();
  4937. if (!D) {
  4938. this.defaultUrl = B
  4939. }
  4940. if (typeof B == "function") {
  4941. B = B.call(this)
  4942. }
  4943. G = G || (F ? "POST" : "GET");
  4944. if (G == "GET") {
  4945. B = this.prepareUrl(B)
  4946. }
  4947. var E = Ext.apply(A || {}, {
  4948. url : B,
  4949. params : (typeof F == "function" && C) ? F
  4950. .createDelegate(C) : F,
  4951. success : this.processSuccess,
  4952. failure : this.processFailure,
  4953. scope : this,
  4954. callback : undefined,
  4955. timeout : (this.timeout * 1000),
  4956. argument : {
  4957. "options" : A,
  4958. "url" : B,
  4959. "form" : null,
  4960. "callback" : H,
  4961. "scope" : C || window,
  4962. "params" : F
  4963. }
  4964. });
  4965. this.transaction = Ext.Ajax.request(E)
  4966. }
  4967. },
  4968. formUpdate : function(C, A, B, D) {
  4969. if (this.fireEvent("beforeupdate", this.el, C, A) !== false) {
  4970. if (typeof A == "function") {
  4971. A = A.call(this)
  4972. }
  4973. C = Ext.getDom(C);
  4974. this.transaction = Ext.Ajax.request({
  4975. form : C,
  4976. url : A,
  4977. success : this.processSuccess,
  4978. failure : this.processFailure,
  4979. scope : this,
  4980. timeout : (this.timeout * 1000),
  4981. argument : {
  4982. "url" : A,
  4983. "form" : C,
  4984. "callback" : D,
  4985. "reset" : B
  4986. }
  4987. });
  4988. this.showLoading.defer(1, this)
  4989. }
  4990. },
  4991. refresh : function(A) {
  4992. if (this.defaultUrl == null) {
  4993. return
  4994. }
  4995. this.update(this.defaultUrl, null, A, true)
  4996. },
  4997. startAutoRefresh : function(B, C, D, E, A) {
  4998. if (A) {
  4999. this.update(C || this.defaultUrl, D, E, true)
  5000. }
  5001. if (this.autoRefreshProcId) {
  5002. clearInterval(this.autoRefreshProcId)
  5003. }
  5004. this.autoRefreshProcId = setInterval(this.update
  5005. .createDelegate(this, [C || this.defaultUrl, D,
  5006. E, true]), B * 1000)
  5007. },
  5008. stopAutoRefresh : function() {
  5009. if (this.autoRefreshProcId) {
  5010. clearInterval(this.autoRefreshProcId);
  5011. delete this.autoRefreshProcId
  5012. }
  5013. },
  5014. isAutoRefreshing : function() {
  5015. return this.autoRefreshProcId ? true : false
  5016. },
  5017. showLoading : function() {
  5018. if (this.showLoadIndicator) {
  5019. this.el.update(this.indicatorText)
  5020. }
  5021. },
  5022. prepareUrl : function(B) {
  5023. if (this.disableCaching) {
  5024. var A = "_dc=" + (new Date().getTime());
  5025. if (B.indexOf("?") !== -1) {
  5026. B += "&" + A
  5027. } else {
  5028. B += "?" + A
  5029. }
  5030. }
  5031. return B
  5032. },
  5033. processSuccess : function(A) {
  5034. this.transaction = null;
  5035. if (A.argument.form && A.argument.reset) {
  5036. try {
  5037. A.argument.form.reset()
  5038. } catch (B) {
  5039. }
  5040. }
  5041. if (this.loadScripts) {
  5042. this.renderer.render(this.el, A, this, this.updateComplete
  5043. .createDelegate(this, [A]))
  5044. } else {
  5045. this.renderer.render(this.el, A, this);
  5046. this.updateComplete(A)
  5047. }
  5048. },
  5049. updateComplete : function(A) {
  5050. this.fireEvent("update", this.el, A);
  5051. if (typeof A.argument.callback == "function") {
  5052. A.argument.callback.call(A.argument.scope, this.el, true,
  5053. A, A.argument.options)
  5054. }
  5055. },
  5056. processFailure : function(A) {
  5057. this.transaction = null;
  5058. this.fireEvent("failure", this.el, A);
  5059. if (typeof A.argument.callback == "function") {
  5060. A.argument.callback.call(A.argument.scope, this.el, false,
  5061. A, A.argument.options)
  5062. }
  5063. },
  5064. setRenderer : function(A) {
  5065. this.renderer = A
  5066. },
  5067. getRenderer : function() {
  5068. return this.renderer
  5069. },
  5070. setDefaultUrl : function(A) {
  5071. this.defaultUrl = A
  5072. },
  5073. abort : function() {
  5074. if (this.transaction) {
  5075. Ext.Ajax.abort(this.transaction)
  5076. }
  5077. },
  5078. isUpdating : function() {
  5079. if (this.transaction) {
  5080. return Ext.Ajax.isLoading(this.transaction)
  5081. }
  5082. return false
  5083. }
  5084. });
  5085. Ext.Updater.defaults = {
  5086. timeout : 30,
  5087. loadScripts : false,
  5088. sslBlankUrl : (Ext.SSL_SECURE_URL || "javascript:false"),
  5089. disableCaching : false,
  5090. showLoadIndicator : true,
  5091. indicatorText : "<div class=\"loading-indicator\">Loading...</div>"
  5092. };
  5093. Ext.Updater.updateElement = function(D, C, E, B) {
  5094. var A = Ext.get(D).getUpdater();
  5095. Ext.apply(A, B);
  5096. A.update(C, E, B ? B.callback : null)
  5097. };
  5098. Ext.Updater.update = Ext.Updater.updateElement;
  5099. Ext.Updater.BasicRenderer = function() {
  5100. };
  5101. Ext.Updater.BasicRenderer.prototype = {
  5102. render : function(C, A, B, D) {
  5103. C.update(A.responseText, B.loadScripts, D)
  5104. }
  5105. };
  5106. Ext.UpdateManager = Ext.Updater;
  5107. Date.parseFunctions = {
  5108. count : 0
  5109. };
  5110. Date.parseRegexes = [];
  5111. Date.formatFunctions = {
  5112. count : 0
  5113. };
  5114. Date.prototype.dateFormat = function(B) {
  5115. if (Date.formatFunctions[B] == null) {
  5116. Date.createNewFormat(B)
  5117. }
  5118. var A = Date.formatFunctions[B];
  5119. return this[A]()
  5120. };
  5121. Date.prototype.format = Date.prototype.dateFormat;
  5122. Date.createNewFormat = function(format) {
  5123. var funcName = "format" + Date.formatFunctions.count++;
  5124. Date.formatFunctions[format] = funcName;
  5125. var code = "Date.prototype." + funcName + " = function(){return ";
  5126. var special = false;
  5127. var ch = "";
  5128. for (var i = 0; i < format.length; ++i) {
  5129. ch = format.charAt(i);
  5130. if (!special && ch == "\\") {
  5131. special = true
  5132. } else {
  5133. if (special) {
  5134. special = false;
  5135. code += "'" + String.escape(ch) + "' + "
  5136. } else {
  5137. code += Date.getFormatCode(ch)
  5138. }
  5139. }
  5140. }
  5141. eval(code.substring(0, code.length - 3) + ";}")
  5142. };
  5143. Date.getFormatCode = function(D) {
  5144. switch (D) {
  5145. case "d" :
  5146. return "String.leftPad(this.getDate(), 2, '0') + ";
  5147. case "D" :
  5148. return "Date.getShortDayName(this.getDay()) + ";
  5149. case "j" :
  5150. return "this.getDate() + ";
  5151. case "l" :
  5152. return "Date.dayNames[this.getDay()] + ";
  5153. case "N" :
  5154. return "(this.getDay() ? this.getDay() : 7) + ";
  5155. case "S" :
  5156. return "this.getSuffix() + ";
  5157. case "w" :
  5158. return "this.getDay() + ";
  5159. case "z" :
  5160. return "this.getDayOfYear() + ";
  5161. case "W" :
  5162. return "String.leftPad(this.getWeekOfYear(), 2, '0') + ";
  5163. case "F" :
  5164. return "Date.monthNames[this.getMonth()] + ";
  5165. case "m" :
  5166. return "String.leftPad(this.getMonth() + 1, 2, '0') + ";
  5167. case "M" :
  5168. return "Date.getShortMonthName(this.getMonth()) + ";
  5169. case "n" :
  5170. return "(this.getMonth() + 1) + ";
  5171. case "t" :
  5172. return "this.getDaysInMonth() + ";
  5173. case "L" :
  5174. return "(this.isLeapYear() ? 1 : 0) + ";
  5175. case "o" :
  5176. return "(this.getFullYear() + (this.getWeekOfYear() == 1 && this.getMonth() > 0 ? +1 : (this.getWeekOfYear() >= 52 && this.getMonth() < 11 ? -1 : 0))) + ";
  5177. case "Y" :
  5178. return "this.getFullYear() + ";
  5179. case "y" :
  5180. return "('' + this.getFullYear()).substring(2, 4) + ";
  5181. case "a" :
  5182. return "(this.getHours() < 12 ? 'am' : 'pm') + ";
  5183. case "A" :
  5184. return "(this.getHours() < 12 ? 'AM' : 'PM') + ";
  5185. case "g" :
  5186. return "((this.getHours() % 12) ? this.getHours() % 12 : 12) + ";
  5187. case "G" :
  5188. return "this.getHours() + ";
  5189. case "h" :
  5190. return "String.leftPad((this.getHours() % 12) ? this.getHours() % 12 : 12, 2, '0') + ";
  5191. case "H" :
  5192. return "String.leftPad(this.getHours(), 2, '0') + ";
  5193. case "i" :
  5194. return "String.leftPad(this.getMinutes(), 2, '0') + ";
  5195. case "s" :
  5196. return "String.leftPad(this.getSeconds(), 2, '0') + ";
  5197. case "u" :
  5198. return "String.leftPad(this.getMilliseconds(), 3, '0') + ";
  5199. case "O" :
  5200. return "this.getGMTOffset() + ";
  5201. case "P" :
  5202. return "this.getGMTOffset(true) + ";
  5203. case "T" :
  5204. return "this.getTimezone() + ";
  5205. case "Z" :
  5206. return "(this.getTimezoneOffset() * -60) + ";
  5207. case "c" :
  5208. for (var F = Date.getFormatCode, G = "Y-m-dTH:i:sP", C = "", B = 0, A = G.length; B < A; ++B) {
  5209. var E = G.charAt(B);
  5210. C += E == "T" ? "'T' + " : F(E)
  5211. }
  5212. return C;
  5213. case "U" :
  5214. return "Math.round(this.getTime() / 1000) + ";
  5215. default :
  5216. return "'" + String.escape(D) + "' + "
  5217. }
  5218. };
  5219. Date.parseDate = function(A, C) {
  5220. if (Date.parseFunctions[C] == null) {
  5221. Date.createParser(C)
  5222. }
  5223. var B = Date.parseFunctions[C];
  5224. return Date[B](A)
  5225. };
  5226. Date.createParser = function(format) {
  5227. var funcName = "parse" + Date.parseFunctions.count++;
  5228. var regexNum = Date.parseRegexes.length;
  5229. var currentGroup = 1;
  5230. Date.parseFunctions[format] = funcName;
  5231. var code = "Date."
  5232. + funcName
  5233. + " = function(input){\n"
  5234. + "var y = -1, m = -1, d = -1, h = -1, i = -1, s = -1, ms = -1, o, z, u, v;\n"
  5235. + "input = String(input);var d = new Date();\n"
  5236. + "y = d.getFullYear();\n" + "m = d.getMonth();\n"
  5237. + "d = d.getDate();\n"
  5238. + "var results = input.match(Date.parseRegexes[" + regexNum
  5239. + "]);\n" + "if (results && results.length > 0) {";
  5240. var regex = "";
  5241. var special = false;
  5242. var ch = "";
  5243. for (var i = 0; i < format.length; ++i) {
  5244. ch = format.charAt(i);
  5245. if (!special && ch == "\\") {
  5246. special = true
  5247. } else {
  5248. if (special) {
  5249. special = false;
  5250. regex += String.escape(ch)
  5251. } else {
  5252. var obj = Date.formatCodeToRegex(ch, currentGroup);
  5253. currentGroup += obj.g;
  5254. regex += obj.s;
  5255. if (obj.g && obj.c) {
  5256. code += obj.c
  5257. }
  5258. }
  5259. }
  5260. }
  5261. code += "if (u)\n"
  5262. + "{v = new Date(u * 1000);}"
  5263. + "else if (y >= 0 && m >= 0 && d > 0 && h >= 0 && i >= 0 && s >= 0 && ms >= 0)\n"
  5264. + "{v = new Date(y, m, d, h, i, s, ms);}\n"
  5265. + "else if (y >= 0 && m >= 0 && d > 0 && h >= 0 && i >= 0 && s >= 0)\n"
  5266. + "{v = new Date(y, m, d, h, i, s);}\n"
  5267. + "else if (y >= 0 && m >= 0 && d > 0 && h >= 0 && i >= 0)\n"
  5268. + "{v = new Date(y, m, d, h, i);}\n"
  5269. + "else if (y >= 0 && m >= 0 && d > 0 && h >= 0)\n"
  5270. + "{v = new Date(y, m, d, h);}\n"
  5271. + "else if (y >= 0 && m >= 0 && d > 0)\n"
  5272. + "{v = new Date(y, m, d);}\n"
  5273. + "else if (y >= 0 && m >= 0)\n"
  5274. + "{v = new Date(y, m);}\n"
  5275. + "else if (y >= 0)\n"
  5276. + "{v = new Date(y);}\n"
  5277. + "}return (v && (z || o))?\n"
  5278. + " (z ? v.add(Date.SECOND, (v.getTimezoneOffset() * 60) + (z*1)) :\n"
  5279. + " v.add(Date.HOUR, (v.getGMTOffset() / 100) + (o / -100))) : v\n"
  5280. + ";}";
  5281. Date.parseRegexes[regexNum] = new RegExp("^" + regex + "$", "i");
  5282. eval(code)
  5283. };
  5284. Date.formatCodeToRegex = function(G, F) {
  5285. switch (G) {
  5286. case "d" :
  5287. return {
  5288. g : 1,
  5289. c : "d = parseInt(results[" + F + "], 10);\n",
  5290. s : "(\\d{2})"
  5291. };
  5292. case "D" :
  5293. for (var C = [], E = 0; E < 7; C.push(Date.getShortDayName(E)), ++E) {
  5294. }
  5295. return {
  5296. g : 0,
  5297. c : null,
  5298. s : "(?:" + C.join("|") + ")"
  5299. };
  5300. case "j" :
  5301. return {
  5302. g : 1,
  5303. c : "d = parseInt(results[" + F + "], 10);\n",
  5304. s : "(\\d{1,2})"
  5305. };
  5306. case "l" :
  5307. return {
  5308. g : 0,
  5309. c : null,
  5310. s : "(?:" + Date.dayNames.join("|") + ")"
  5311. };
  5312. case "N" :
  5313. return {
  5314. g : 0,
  5315. c : null,
  5316. s : "[1-7]"
  5317. };
  5318. case "S" :
  5319. return {
  5320. g : 0,
  5321. c : null,
  5322. s : "(?:st|nd|rd|th)"
  5323. };
  5324. case "w" :
  5325. return {
  5326. g : 0,
  5327. c : null,
  5328. s : "[0-6]"
  5329. };
  5330. case "z" :
  5331. return {
  5332. g : 0,
  5333. c : null,
  5334. s : "(?:\\d{1,3}"
  5335. };
  5336. case "W" :
  5337. return {
  5338. g : 0,
  5339. c : null,
  5340. s : "(?:\\d{2})"
  5341. };
  5342. case "F" :
  5343. return {
  5344. g : 1,
  5345. c : "m = parseInt(Date.getMonthNumber(results[" + F
  5346. + "]), 10);\n",
  5347. s : "(" + Date.monthNames.join("|") + ")"
  5348. };
  5349. case "m" :
  5350. return {
  5351. g : 1,
  5352. c : "m = parseInt(results[" + F + "], 10) - 1;\n",
  5353. s : "(\\d{2})"
  5354. };
  5355. case "M" :
  5356. for (var C = [], E = 0; E < 12; C.push(Date.getShortMonthName(E)), ++E) {
  5357. }
  5358. return {
  5359. g : 1,
  5360. c : "m = parseInt(Date.getMonthNumber(results[" + F
  5361. + "]), 10);\n",
  5362. s : "(" + C.join("|") + ")"
  5363. };
  5364. case "n" :
  5365. return {
  5366. g : 1,
  5367. c : "m = parseInt(results[" + F + "], 10) - 1;\n",
  5368. s : "(\\d{1,2})"
  5369. };
  5370. case "t" :
  5371. return {
  5372. g : 0,
  5373. c : null,
  5374. s : "(?:\\d{2})"
  5375. };
  5376. case "L" :
  5377. return {
  5378. g : 0,
  5379. c : null,
  5380. s : "(?:1|0)"
  5381. };
  5382. case "o" :
  5383. case "Y" :
  5384. return {
  5385. g : 1,
  5386. c : "y = parseInt(results[" + F + "], 10);\n",
  5387. s : "(\\d{4})"
  5388. };
  5389. case "y" :
  5390. return {
  5391. g : 1,
  5392. c : "var ty = parseInt(results[" + F + "], 10);\n"
  5393. + "y = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n",
  5394. s : "(\\d{1,2})"
  5395. };
  5396. case "a" :
  5397. return {
  5398. g : 1,
  5399. c : "if (results[" + F + "] == 'am') {\n"
  5400. + "if (h == 12) { h = 0; }\n"
  5401. + "} else { if (h < 12) { h += 12; }}",
  5402. s : "(am|pm)"
  5403. };
  5404. case "A" :
  5405. return {
  5406. g : 1,
  5407. c : "if (results[" + F + "] == 'AM') {\n"
  5408. + "if (h == 12) { h = 0; }\n"
  5409. + "} else { if (h < 12) { h += 12; }}",
  5410. s : "(AM|PM)"
  5411. };
  5412. case "g" :
  5413. case "G" :
  5414. return {
  5415. g : 1,
  5416. c : "h = parseInt(results[" + F + "], 10);\n",
  5417. s : "(\\d{1,2})"
  5418. };
  5419. case "h" :
  5420. case "H" :
  5421. return {
  5422. g : 1,
  5423. c : "h = parseInt(results[" + F + "], 10);\n",
  5424. s : "(\\d{2})"
  5425. };
  5426. case "i" :
  5427. return {
  5428. g : 1,
  5429. c : "i = parseInt(results[" + F + "], 10);\n",
  5430. s : "(\\d{2})"
  5431. };
  5432. case "s" :
  5433. return {
  5434. g : 1,
  5435. c : "s = parseInt(results[" + F + "], 10);\n",
  5436. s : "(\\d{2})"
  5437. };
  5438. case "u" :
  5439. return {
  5440. g : 1,
  5441. c : "ms = parseInt(results[" + F + "], 10);\n",
  5442. s : "(\\d{3})"
  5443. };
  5444. case "O" :
  5445. return {
  5446. g : 1,
  5447. c : [
  5448. "o = results[",
  5449. F,
  5450. "];\n",
  5451. "var sn = o.substring(0,1);\n",
  5452. "var hr = o.substring(1,3)*1 + Math.floor(o.substring(3,5) / 60);\n",
  5453. "var mn = o.substring(3,5) % 60;\n",
  5454. "o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))?\n",
  5455. " (sn + String.leftPad(hr, 2, '0') + String.leftPad(mn, 2, '0')) : null;\n"]
  5456. .join(""),
  5457. s : "([+-]\\d{4})"
  5458. };
  5459. case "P" :
  5460. return {
  5461. g : 1,
  5462. c : [
  5463. "o = results[",
  5464. F,
  5465. "];\n",
  5466. "var sn = o.substring(0,1);\n",
  5467. "var hr = o.substring(1,3)*1 + Math.floor(o.substring(4,6) / 60);\n",
  5468. "var mn = o.substring(4,6) % 60;\n",
  5469. "o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))?\n",
  5470. " (sn + String.leftPad(hr, 2, '0') + String.leftPad(mn, 2, '0')) : null;\n"]
  5471. .join(""),
  5472. s : "([+-]\\d{2}:\\d{2})"
  5473. };
  5474. case "T" :
  5475. return {
  5476. g : 0,
  5477. c : null,
  5478. s : "[A-Z]{1,4}"
  5479. };
  5480. case "Z" :
  5481. return {
  5482. g : 1,
  5483. c : "z = results[" + F + "] * 1;\n"
  5484. + "z = (-43200 <= z && z <= 50400)? z : null;\n",
  5485. s : "([+-]?\\d{1,5})"
  5486. };
  5487. case "c" :
  5488. var H = Date.formatCodeToRegex, D = [];
  5489. var A = [H("Y", 1), H("m", 2), H("d", 3), H("h", 4), H("i", 5),
  5490. H("s", 6), H("P", 7)];
  5491. for (var E = 0, B = A.length; E < B; ++E) {
  5492. D.push(A[E].c)
  5493. }
  5494. return {
  5495. g : 1,
  5496. c : D.join(""),
  5497. s : A[0].s + "-" + A[1].s + "-" + A[2].s + "T" + A[3].s + ":"
  5498. + A[4].s + ":" + A[5].s + A[6].s
  5499. };
  5500. case "U" :
  5501. return {
  5502. g : 1,
  5503. c : "u = parseInt(results[" + F + "], 10);\n",
  5504. s : "(-?\\d+)"
  5505. };
  5506. default :
  5507. return {
  5508. g : 0,
  5509. c : null,
  5510. s : Ext.escapeRe(G)
  5511. }
  5512. }
  5513. };
  5514. Date.prototype.getTimezone = function() {
  5515. return this.toString().replace(
  5516. /^.* (?:\((.*)\)|([A-Z]{1,4})(?:[\-+][0-9]{4})?(?: -?\d+)?)$/,
  5517. "$1$2").replace(/[^A-Z]/g, "")
  5518. };
  5519. Date.prototype.getGMTOffset = function(A) {
  5520. return (this.getTimezoneOffset() > 0 ? "-" : "+")
  5521. + String.leftPad(Math
  5522. .abs(Math.floor(this.getTimezoneOffset() / 60)), 2,
  5523. "0") + (A ? ":" : "")
  5524. + String.leftPad(this.getTimezoneOffset() % 60, 2, "0")
  5525. };
  5526. Date.prototype.getDayOfYear = function() {
  5527. var A = 0;
  5528. Date.daysInMonth[1] = this.isLeapYear() ? 29 : 28;
  5529. for (var B = 0; B < this.getMonth(); ++B) {
  5530. A += Date.daysInMonth[B]
  5531. }
  5532. return A + this.getDate() - 1
  5533. };
  5534. Date.prototype.getWeekOfYear = function() {
  5535. var B = 86400000;
  5536. var C = 7 * B;
  5537. var D = Date.UTC(this.getFullYear(), this.getMonth(), this.getDate() + 3)
  5538. / B;
  5539. var A = Math.floor(D / 7);
  5540. var E = new Date(A * C).getUTCFullYear();
  5541. return A - Math.floor(Date.UTC(E, 0, 7) / C) + 1
  5542. };
  5543. Date.prototype.isLeapYear = function() {
  5544. var A = this.getFullYear();
  5545. return !!((A & 3) == 0 && (A % 100 || (A % 400 == 0 && A)))
  5546. };
  5547. Date.prototype.getFirstDayOfMonth = function() {
  5548. var A = (this.getDay() - (this.getDate() - 1)) % 7;
  5549. return (A < 0) ? (A + 7) : A
  5550. };
  5551. Date.prototype.getLastDayOfMonth = function() {
  5552. var A = (this.getDay() + (Date.daysInMonth[this.getMonth()] - this
  5553. .getDate()))
  5554. % 7;
  5555. return (A < 0) ? (A + 7) : A
  5556. };
  5557. Date.prototype.getFirstDateOfMonth = function() {
  5558. return new Date(this.getFullYear(), this.getMonth(), 1)
  5559. };
  5560. Date.prototype.getLastDateOfMonth = function() {
  5561. return new Date(this.getFullYear(), this.getMonth(), this.getDaysInMonth())
  5562. };
  5563. Date.prototype.getDaysInMonth = function() {
  5564. Date.daysInMonth[1] = this.isLeapYear() ? 29 : 28;
  5565. return Date.daysInMonth[this.getMonth()]
  5566. };
  5567. Date.prototype.getSuffix = function() {
  5568. switch (this.getDate()) {
  5569. case 1 :
  5570. case 21 :
  5571. case 31 :
  5572. return "st";
  5573. case 2 :
  5574. case 22 :
  5575. return "nd";
  5576. case 3 :
  5577. case 23 :
  5578. return "rd";
  5579. default :
  5580. return "th"
  5581. }
  5582. };
  5583. Date.daysInMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
  5584. Date.monthNames = ["January", "February", "March", "April", "May", "June",
  5585. "July", "August", "September", "October", "November", "December"];
  5586. Date.getShortMonthName = function(A) {
  5587. return Date.monthNames[A].substring(0, 3)
  5588. };
  5589. Date.dayNames = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday",
  5590. "Friday", "Saturday"];
  5591. Date.getShortDayName = function(A) {
  5592. return Date.dayNames[A].substring(0, 3)
  5593. };
  5594. Date.y2kYear = 50;
  5595. Date.monthNumbers = {
  5596. Jan : 0,
  5597. Feb : 1,
  5598. Mar : 2,
  5599. Apr : 3,
  5600. May : 4,
  5601. Jun : 5,
  5602. Jul : 6,
  5603. Aug : 7,
  5604. Sep : 8,
  5605. Oct : 9,
  5606. Nov : 10,
  5607. Dec : 11
  5608. };
  5609. Date.getMonthNumber = function(A) {
  5610. return Date.monthNumbers[A.substring(0, 1).toUpperCase()
  5611. + A.substring(1, 3).toLowerCase()]
  5612. };
  5613. Date.prototype.clone = function() {
  5614. return new Date(this.getTime())
  5615. };
  5616. Date.prototype.clearTime = function(A) {
  5617. if (A) {
  5618. return this.clone().clearTime()
  5619. }
  5620. this.setHours(0);
  5621. this.setMinutes(0);
  5622. this.setSeconds(0);
  5623. this.setMilliseconds(0);
  5624. return this
  5625. };
  5626. if (Ext.isSafari) {
  5627. Date.brokenSetMonth = Date.prototype.setMonth;
  5628. Date.prototype.setMonth = function(A) {
  5629. if (A <= -1) {
  5630. var D = Math.ceil(-A);
  5631. var C = Math.ceil(D / 12);
  5632. var B = (D % 12) ? 12 - D % 12 : 0;
  5633. this.setFullYear(this.getFullYear() - C);
  5634. return Date.brokenSetMonth.call(this, B)
  5635. } else {
  5636. return Date.brokenSetMonth.apply(this, arguments)
  5637. }
  5638. }
  5639. }
  5640. Date.MILLI = "ms";
  5641. Date.SECOND = "s";
  5642. Date.MINUTE = "mi";
  5643. Date.HOUR = "h";
  5644. Date.DAY = "d";
  5645. Date.MONTH = "mo";
  5646. Date.YEAR = "y";
  5647. Date.prototype.add = function(B, C) {
  5648. var D = this.clone();
  5649. if (!B || C === 0) {
  5650. return D
  5651. }
  5652. switch (B.toLowerCase()) {
  5653. case Date.MILLI :
  5654. D.setMilliseconds(this.getMilliseconds() + C);
  5655. break;
  5656. case Date.SECOND :
  5657. D.setSeconds(this.getSeconds() + C);
  5658. break;
  5659. case Date.MINUTE :
  5660. D.setMinutes(this.getMinutes() + C);
  5661. break;
  5662. case Date.HOUR :
  5663. D.setHours(this.getHours() + C);
  5664. break;
  5665. case Date.DAY :
  5666. D.setDate(this.getDate() + C);
  5667. break;
  5668. case Date.MONTH :
  5669. var A = this.getDate();
  5670. if (A > 28) {
  5671. A = Math.min(A, this.getFirstDateOfMonth().add("mo", C)
  5672. .getLastDateOfMonth().getDate())
  5673. }
  5674. D.setDate(A);
  5675. D.setMonth(this.getMonth() + C);
  5676. break;
  5677. case Date.YEAR :
  5678. D.setFullYear(this.getFullYear() + C);
  5679. break
  5680. }
  5681. return D
  5682. };
  5683. Date.prototype.between = function(C, A) {
  5684. var B = this.getTime();
  5685. return C.getTime() <= B && B <= A.getTime()
  5686. };
  5687. Ext.util.DelayedTask = function(E, D, A) {
  5688. var G = null, F, B;
  5689. var C = function() {
  5690. var H = new Date().getTime();
  5691. if (H - B >= F) {
  5692. clearInterval(G);
  5693. G = null;
  5694. E.apply(D, A || [])
  5695. }
  5696. };
  5697. this.delay = function(I, K, J, H) {
  5698. if (G && I != F) {
  5699. this.cancel()
  5700. }
  5701. F = I;
  5702. B = new Date().getTime();
  5703. E = K || E;
  5704. D = J || D;
  5705. A = H || A;
  5706. if (!G) {
  5707. G = setInterval(C, F)
  5708. }
  5709. };
  5710. this.cancel = function() {
  5711. if (G) {
  5712. clearInterval(G);
  5713. G = null
  5714. }
  5715. }
  5716. };
  5717. Ext.util.TaskRunner = function(E) {
  5718. E = E || 10;
  5719. var F = [], A = [];
  5720. var B = 0;
  5721. var G = false;
  5722. var D = function() {
  5723. G = false;
  5724. clearInterval(B);
  5725. B = 0
  5726. };
  5727. var H = function() {
  5728. if (!G) {
  5729. G = true;
  5730. B = setInterval(I, E)
  5731. }
  5732. };
  5733. var C = function(J) {
  5734. A.push(J);
  5735. if (J.onStop) {
  5736. J.onStop.apply(J.scope || J)
  5737. }
  5738. };
  5739. var I = function() {
  5740. if (A.length > 0) {
  5741. for (var O = 0, K = A.length; O < K; O++) {
  5742. F.remove(A[O])
  5743. }
  5744. A = [];
  5745. if (F.length < 1) {
  5746. D();
  5747. return
  5748. }
  5749. }
  5750. var M = new Date().getTime();
  5751. for (var O = 0, K = F.length; O < K; ++O) {
  5752. var N = F[O];
  5753. var J = M - N.taskRunTime;
  5754. if (N.interval <= J) {
  5755. var L = N.run.apply(N.scope || N, N.args || [++N.taskRunCount]);
  5756. N.taskRunTime = M;
  5757. if (L === false || N.taskRunCount === N.repeat) {
  5758. C(N);
  5759. return
  5760. }
  5761. }
  5762. if (N.duration && N.duration <= (M - N.taskStartTime)) {
  5763. C(N)
  5764. }
  5765. }
  5766. };
  5767. this.start = function(J) {
  5768. F.push(J);
  5769. J.taskStartTime = new Date().getTime();
  5770. J.taskRunTime = 0;
  5771. J.taskRunCount = 0;
  5772. H();
  5773. return J
  5774. };
  5775. this.stop = function(J) {
  5776. C(J);
  5777. return J
  5778. };
  5779. this.stopAll = function() {
  5780. D();
  5781. for (var K = 0, J = F.length; K < J; K++) {
  5782. if (F[K].onStop) {
  5783. F[K].onStop()
  5784. }
  5785. }
  5786. F = [];
  5787. A = []
  5788. }
  5789. };
  5790. Ext.TaskMgr = new Ext.util.TaskRunner();
  5791. Ext.util.MixedCollection = function(B, A) {
  5792. this.items = [];
  5793. this.map = {};
  5794. this.keys = [];
  5795. this.length = 0;
  5796. this.addEvents("clear", "add", "replace", "remove", "sort");
  5797. this.allowFunctions = B === true;
  5798. if (A) {
  5799. this.getKey = A
  5800. }
  5801. Ext.util.MixedCollection.superclass.constructor.call(this)
  5802. };
  5803. Ext.extend(Ext.util.MixedCollection, Ext.util.Observable, {
  5804. allowFunctions : false,
  5805. add : function(B, C) {
  5806. if (arguments.length == 1) {
  5807. C = arguments[0];
  5808. B = this.getKey(C)
  5809. }
  5810. if (typeof B == "undefined" || B === null) {
  5811. this.length++;
  5812. this.items.push(C);
  5813. this.keys.push(null)
  5814. } else {
  5815. var A = this.map[B];
  5816. if (A) {
  5817. return this.replace(B, C)
  5818. }
  5819. this.length++;
  5820. this.items.push(C);
  5821. this.map[B] = C;
  5822. this.keys.push(B)
  5823. }
  5824. this.fireEvent("add", this.length - 1, C, B);
  5825. return C
  5826. },
  5827. getKey : function(A) {
  5828. return A.id
  5829. },
  5830. replace : function(C, D) {
  5831. if (arguments.length == 1) {
  5832. D = arguments[0];
  5833. C = this.getKey(D)
  5834. }
  5835. var A = this.item(C);
  5836. if (typeof C == "undefined" || C === null || typeof A == "undefined") {
  5837. return this.add(C, D)
  5838. }
  5839. var B = this.indexOfKey(C);
  5840. this.items[B] = D;
  5841. this.map[C] = D;
  5842. this.fireEvent("replace", C, A, D);
  5843. return D
  5844. },
  5845. addAll : function(E) {
  5846. if (arguments.length > 1 || Ext.isArray(E)) {
  5847. var B = arguments.length > 1 ? arguments : E;
  5848. for (var D = 0, A = B.length; D < A; D++) {
  5849. this.add(B[D])
  5850. }
  5851. } else {
  5852. for (var C in E) {
  5853. if (this.allowFunctions || typeof E[C] != "function") {
  5854. this.add(C, E[C])
  5855. }
  5856. }
  5857. }
  5858. },
  5859. each : function(E, D) {
  5860. var B = [].concat(this.items);
  5861. for (var C = 0, A = B.length; C < A; C++) {
  5862. if (E.call(D || B[C], B[C], C, A) === false) {
  5863. break
  5864. }
  5865. }
  5866. },
  5867. eachKey : function(D, C) {
  5868. for (var B = 0, A = this.keys.length; B < A; B++) {
  5869. D.call(C || window, this.keys[B], this.items[B], B, A)
  5870. }
  5871. },
  5872. find : function(D, C) {
  5873. for (var B = 0, A = this.items.length; B < A; B++) {
  5874. if (D.call(C || window, this.items[B], this.keys[B])) {
  5875. return this.items[B]
  5876. }
  5877. }
  5878. return null
  5879. },
  5880. insert : function(A, B, C) {
  5881. if (arguments.length == 2) {
  5882. C = arguments[1];
  5883. B = this.getKey(C)
  5884. }
  5885. if (A >= this.length) {
  5886. return this.add(B, C)
  5887. }
  5888. this.length++;
  5889. this.items.splice(A, 0, C);
  5890. if (typeof B != "undefined" && B != null) {
  5891. this.map[B] = C
  5892. }
  5893. this.keys.splice(A, 0, B);
  5894. this.fireEvent("add", A, C, B);
  5895. return C
  5896. },
  5897. remove : function(A) {
  5898. return this.removeAt(this.indexOf(A))
  5899. },
  5900. removeAt : function(A) {
  5901. if (A < this.length && A >= 0) {
  5902. this.length--;
  5903. var C = this.items[A];
  5904. this.items.splice(A, 1);
  5905. var B = this.keys[A];
  5906. if (typeof B != "undefined") {
  5907. delete this.map[B]
  5908. }
  5909. this.keys.splice(A, 1);
  5910. this.fireEvent("remove", C, B);
  5911. return C
  5912. }
  5913. return false
  5914. },
  5915. removeKey : function(A) {
  5916. return this.removeAt(this.indexOfKey(A))
  5917. },
  5918. getCount : function() {
  5919. return this.length
  5920. },
  5921. indexOf : function(A) {
  5922. return this.items.indexOf(A)
  5923. },
  5924. indexOfKey : function(A) {
  5925. return this.keys.indexOf(A)
  5926. },
  5927. item : function(A) {
  5928. var B = typeof this.map[A] != "undefined" ? this.map[A] : this.items[A];
  5929. return typeof B != "function" || this.allowFunctions ? B : null
  5930. },
  5931. itemAt : function(A) {
  5932. return this.items[A]
  5933. },
  5934. key : function(A) {
  5935. return this.map[A]
  5936. },
  5937. contains : function(A) {
  5938. return this.indexOf(A) != -1
  5939. },
  5940. containsKey : function(A) {
  5941. return typeof this.map[A] != "undefined"
  5942. },
  5943. clear : function() {
  5944. this.length = 0;
  5945. this.items = [];
  5946. this.keys = [];
  5947. this.map = {};
  5948. this.fireEvent("clear")
  5949. },
  5950. first : function() {
  5951. return this.items[0]
  5952. },
  5953. last : function() {
  5954. return this.items[this.length - 1]
  5955. },
  5956. _sort : function(I, A, H) {
  5957. var C = String(A).toUpperCase() == "DESC" ? -1 : 1;
  5958. H = H || function(K, J) {
  5959. return K - J
  5960. };
  5961. var G = [], B = this.keys, F = this.items;
  5962. for (var D = 0, E = F.length; D < E; D++) {
  5963. G[G.length] = {
  5964. key : B[D],
  5965. value : F[D],
  5966. index : D
  5967. }
  5968. }
  5969. G.sort(function(K, J) {
  5970. var L = H(K[I], J[I]) * C;
  5971. if (L == 0) {
  5972. L = (K.index < J.index ? -1 : 1)
  5973. }
  5974. return L
  5975. });
  5976. for (var D = 0, E = G.length; D < E; D++) {
  5977. F[D] = G[D].value;
  5978. B[D] = G[D].key
  5979. }
  5980. this.fireEvent("sort", this)
  5981. },
  5982. sort : function(A, B) {
  5983. this._sort("value", A, B)
  5984. },
  5985. keySort : function(A, B) {
  5986. this._sort("key", A, B || function(D, C) {
  5987. return String(D).toUpperCase() - String(C).toUpperCase()
  5988. })
  5989. },
  5990. getRange : function(E, A) {
  5991. var B = this.items;
  5992. if (B.length < 1) {
  5993. return []
  5994. }
  5995. E = E || 0;
  5996. A = Math.min(typeof A == "undefined" ? this.length - 1 : A, this.length
  5997. - 1);
  5998. var D = [];
  5999. if (E <= A) {
  6000. for (var C = E; C <= A; C++) {
  6001. D[D.length] = B[C]
  6002. }
  6003. } else {
  6004. for (var C = E; C >= A; C--) {
  6005. D[D.length] = B[C]
  6006. }
  6007. }
  6008. return D
  6009. },
  6010. filter : function(C, B, D, A) {
  6011. if (Ext.isEmpty(B, false)) {
  6012. return this.clone()
  6013. }
  6014. B = this.createValueMatcher(B, D, A);
  6015. return this.filterBy(function(E) {
  6016. return E && B.test(E[C])
  6017. })
  6018. },
  6019. filterBy : function(F, E) {
  6020. var G = new Ext.util.MixedCollection();
  6021. G.getKey = this.getKey;
  6022. var B = this.keys, D = this.items;
  6023. for (var C = 0, A = D.length; C < A; C++) {
  6024. if (F.call(E || this, D[C], B[C])) {
  6025. G.add(B[C], D[C])
  6026. }
  6027. }
  6028. return G
  6029. },
  6030. findIndex : function(C, B, E, D, A) {
  6031. if (Ext.isEmpty(B, false)) {
  6032. return -1
  6033. }
  6034. B = this.createValueMatcher(B, D, A);
  6035. return this.findIndexBy(function(F) {
  6036. return F && B.test(F[C])
  6037. }, null, E)
  6038. },
  6039. findIndexBy : function(F, E, G) {
  6040. var B = this.keys, D = this.items;
  6041. for (var C = (G || 0), A = D.length; C < A; C++) {
  6042. if (F.call(E || this, D[C], B[C])) {
  6043. return C
  6044. }
  6045. }
  6046. if (typeof G == "number" && G > 0) {
  6047. for (var C = 0; C < G; C++) {
  6048. if (F.call(E || this, D[C], B[C])) {
  6049. return C
  6050. }
  6051. }
  6052. }
  6053. return -1
  6054. },
  6055. createValueMatcher : function(B, C, A) {
  6056. if (!B.exec) {
  6057. B = String(B);
  6058. B = new RegExp((C === true ? "" : "^") + Ext.escapeRe(B), A
  6059. ? ""
  6060. : "i")
  6061. }
  6062. return B
  6063. },
  6064. clone : function() {
  6065. var E = new Ext.util.MixedCollection();
  6066. var B = this.keys, D = this.items;
  6067. for (var C = 0, A = D.length; C < A; C++) {
  6068. E.add(B[C], D[C])
  6069. }
  6070. E.getKey = this.getKey;
  6071. return E
  6072. }
  6073. });
  6074. Ext.util.MixedCollection.prototype.get = Ext.util.MixedCollection.prototype.item;
  6075. Ext.util.JSON = new (function() {
  6076. var useHasOwn = {}.hasOwnProperty ? true : false;
  6077. var pad = function(n) {
  6078. return n < 10 ? "0" + n : n
  6079. };
  6080. var m = {
  6081. "\b" : "\\b",
  6082. "\t" : "\\t",
  6083. "\n" : "\\n",
  6084. "\f" : "\\f",
  6085. "\r" : "\\r",
  6086. "\"" : "\\\"",
  6087. "\\" : "\\\\"
  6088. };
  6089. var encodeString = function(s) {
  6090. if (/["\\\x00-\x1f]/.test(s)) {
  6091. return "\"" + s.replace(/([\x00-\x1f\\"])/g, function(a, b) {
  6092. var c = m[b];
  6093. if (c) {
  6094. return c
  6095. }
  6096. c = b.charCodeAt();
  6097. return "\\u00" + Math.floor(c / 16).toString(16)
  6098. + (c % 16).toString(16)
  6099. }) + "\""
  6100. }
  6101. return "\"" + s + "\""
  6102. };
  6103. var encodeArray = function(o) {
  6104. var a = ["["], b, i, l = o.length, v;
  6105. for (i = 0; i < l; i += 1) {
  6106. v = o[i];
  6107. switch (typeof v) {
  6108. case "undefined" :
  6109. case "function" :
  6110. case "unknown" :
  6111. break;
  6112. default :
  6113. if (b) {
  6114. a.push(",")
  6115. }
  6116. a.push(v === null ? "null" : Ext.util.JSON.encode(v));
  6117. b = true
  6118. }
  6119. }
  6120. a.push("]");
  6121. return a.join("")
  6122. };
  6123. var encodeDate = function(o) {
  6124. return "\"" + o.getFullYear() + "-" + pad(o.getMonth() + 1) + "-"
  6125. + pad(o.getDate()) + "T" + pad(o.getHours()) + ":"
  6126. + pad(o.getMinutes()) + ":" + pad(o.getSeconds()) + "\""
  6127. };
  6128. this.encode = function(o) {
  6129. if (typeof o == "undefined" || o === null) {
  6130. return "null"
  6131. } else {
  6132. if (Ext.isArray(o)) {
  6133. return encodeArray(o)
  6134. } else {
  6135. if (Ext.isDate(o)) {
  6136. return encodeDate(o)
  6137. } else {
  6138. if (typeof o == "string") {
  6139. return encodeString(o)
  6140. } else {
  6141. if (typeof o == "number") {
  6142. return isFinite(o) ? String(o) : "null"
  6143. } else {
  6144. if (typeof o == "boolean") {
  6145. return String(o)
  6146. } else {
  6147. var a = ["{"], b, i, v;
  6148. for (i in o) {
  6149. if (!useHasOwn || o.hasOwnProperty(i)) {
  6150. v = o[i];
  6151. switch (typeof v) {
  6152. case "undefined" :
  6153. case "function" :
  6154. case "unknown" :
  6155. break;
  6156. default :
  6157. if (b) {
  6158. a.push(",")
  6159. }
  6160. a
  6161. .push(
  6162. this.encode(i),
  6163. ":",
  6164. v === null
  6165. ? "null"
  6166. : this
  6167. .encode(v));
  6168. b = true
  6169. }
  6170. }
  6171. }
  6172. a.push("}");
  6173. return a.join("")
  6174. }
  6175. }
  6176. }
  6177. }
  6178. }
  6179. }
  6180. };
  6181. this.decode = function(json) {
  6182. return eval("(" + json + ")")
  6183. }
  6184. })();
  6185. Ext.encode = Ext.util.JSON.encode;
  6186. Ext.decode = Ext.util.JSON.decode;
  6187. Ext.util.Format = function() {
  6188. var trimRe = /^\s+|\s+$/g;
  6189. return {
  6190. ellipsis : function(value, len) {
  6191. if (value && value.length > len) {
  6192. return value.substr(0, len - 3) + "..."
  6193. }
  6194. return value
  6195. },
  6196. undef : function(value) {
  6197. return value !== undefined ? value : ""
  6198. },
  6199. defaultValue : function(value, defaultValue) {
  6200. return value !== undefined && value !== "" ? value : defaultValue
  6201. },
  6202. htmlEncode : function(value) {
  6203. return !value ? value : String(value).replace(/&/g, "&amp;")
  6204. .replace(/>/g, "&gt;").replace(/</g, "&lt;").replace(/"/g,
  6205. "&quot;")
  6206. },
  6207. htmlDecode : function(value) {
  6208. return !value ? value : String(value).replace(/&amp;/g, "&")
  6209. .replace(/&gt;/g, ">").replace(/&lt;/g, "<").replace(
  6210. /&quot;/g, "\"")
  6211. },
  6212. trim : function(value) {
  6213. return String(value).replace(trimRe, "")
  6214. },
  6215. substr : function(value, start, length) {
  6216. return String(value).substr(start, length)
  6217. },
  6218. lowercase : function(value) {
  6219. return String(value).toLowerCase()
  6220. },
  6221. uppercase : function(value) {
  6222. return String(value).toUpperCase()
  6223. },
  6224. capitalize : function(value) {
  6225. return !value ? value : value.charAt(0).toUpperCase()
  6226. + value.substr(1).toLowerCase()
  6227. },
  6228. call : function(value, fn) {
  6229. if (arguments.length > 2) {
  6230. var args = Array.prototype.slice.call(arguments, 2);
  6231. args.unshift(value);
  6232. return eval(fn).apply(window, args)
  6233. } else {
  6234. return eval(fn).call(window, value)
  6235. }
  6236. },
  6237. usMoney : function(v) {
  6238. v = (Math.round((v - 0) * 100)) / 100;
  6239. v = (v == Math.floor(v)) ? v + ".00" : ((v * 10 == Math.floor(v
  6240. * 10)) ? v + "0" : v);
  6241. v = String(v);
  6242. var ps = v.split(".");
  6243. var whole = ps[0];
  6244. var sub = ps[1] ? "." + ps[1] : ".00";
  6245. var r = /(\d+)(\d{3})/;
  6246. while (r.test(whole)) {
  6247. whole = whole.replace(r, "$1" + "," + "$2")
  6248. }
  6249. v = whole + sub;
  6250. if (v.charAt(0) == "-") {
  6251. return "-$" + v.substr(1)
  6252. }
  6253. return "$" + v
  6254. },
  6255. date : function(v, format) {
  6256. if (!v) {
  6257. return ""
  6258. }
  6259. if (!Ext.isDate(v)) {
  6260. v = new Date(Date.parse(v))
  6261. }
  6262. return v.dateFormat(format || "m/d/Y")
  6263. },
  6264. dateRenderer : function(format) {
  6265. return function(v) {
  6266. return Ext.util.Format.date(v, format)
  6267. }
  6268. },
  6269. stripTagsRE : /<\/?[^>]+>/gi,
  6270. stripTags : function(v) {
  6271. return !v ? v : String(v).replace(this.stripTagsRE, "")
  6272. },
  6273. stripScriptsRe : /(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/ig,
  6274. stripScripts : function(v) {
  6275. return !v ? v : String(v).replace(this.stripScriptsRe, "")
  6276. },
  6277. fileSize : function(size) {
  6278. if (size < 1024) {
  6279. return size + " bytes"
  6280. } else {
  6281. if (size < 1048576) {
  6282. return (Math.round(((size * 10) / 1024)) / 10) + " KB"
  6283. } else {
  6284. return (Math.round(((size * 10) / 1048576)) / 10) + " MB"
  6285. }
  6286. }
  6287. },
  6288. math : function() {
  6289. var fns = {};
  6290. return function(v, a) {
  6291. if (!fns[a]) {
  6292. fns[a] = new Function("v", "return v " + a + ";")
  6293. }
  6294. return fns[a](v)
  6295. }
  6296. }()
  6297. }
  6298. }();
  6299. Ext.XTemplate = function() {
  6300. Ext.XTemplate.superclass.constructor.apply(this, arguments);
  6301. var P = this.html;
  6302. P = ["<tpl>", P, "</tpl>"].join("");
  6303. var O = /<tpl\b[^>]*>((?:(?=([^<]+))\2|<(?!tpl\b[^>]*>))*?)<\/tpl>/;
  6304. var N = /^<tpl\b[^>]*?for="(.*?)"/;
  6305. var L = /^<tpl\b[^>]*?if="(.*?)"/;
  6306. var J = /^<tpl\b[^>]*?exec="(.*?)"/;
  6307. var C, B = 0;
  6308. var G = [];
  6309. while (C = P.match(O)) {
  6310. var M = C[0].match(N);
  6311. var K = C[0].match(L);
  6312. var I = C[0].match(J);
  6313. var E = null, H = null, D = null;
  6314. var A = M && M[1] ? M[1] : "";
  6315. if (K) {
  6316. E = K && K[1] ? K[1] : null;
  6317. if (E) {
  6318. H = new Function("values", "parent", "xindex", "xcount",
  6319. "with(values){ return "
  6320. + (Ext.util.Format.htmlDecode(E)) + "; }")
  6321. }
  6322. }
  6323. if (I) {
  6324. E = I && I[1] ? I[1] : null;
  6325. if (E) {
  6326. D = new Function("values", "parent", "xindex", "xcount",
  6327. "with(values){ " + (Ext.util.Format.htmlDecode(E))
  6328. + "; }")
  6329. }
  6330. }
  6331. if (A) {
  6332. switch (A) {
  6333. case "." :
  6334. A = new Function("values", "parent",
  6335. "with(values){ return values; }");
  6336. break;
  6337. case ".." :
  6338. A = new Function("values", "parent",
  6339. "with(values){ return parent; }");
  6340. break;
  6341. default :
  6342. A = new Function("values", "parent",
  6343. "with(values){ return " + A + "; }")
  6344. }
  6345. }
  6346. G.push({
  6347. id : B,
  6348. target : A,
  6349. exec : D,
  6350. test : H,
  6351. body : C[1] || ""
  6352. });
  6353. P = P.replace(C[0], "{xtpl" + B + "}");
  6354. ++B
  6355. }
  6356. for (var F = G.length - 1; F >= 0; --F) {
  6357. this.compileTpl(G[F])
  6358. }
  6359. this.master = G[G.length - 1];
  6360. this.tpls = G
  6361. };
  6362. Ext.extend(Ext.XTemplate, Ext.Template, {
  6363. re : /\{([\w-\.\#]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?(\s?[\+\-\*\\]\s?[\d\.\+\-\*\\\(\)]+)?\}/g,
  6364. codeRe : /\{\[((?:\\\]|.|\n)*?)\]\}/g,
  6365. applySubTemplate : function(A, H, G, D, C) {
  6366. var J = this.tpls[A];
  6367. if (J.test && !J.test.call(this, H, G, D, C)) {
  6368. return ""
  6369. }
  6370. if (J.exec && J.exec.call(this, H, G, D, C)) {
  6371. return ""
  6372. }
  6373. var I = J.target ? J.target.call(this, H, G) : H;
  6374. G = J.target ? H : G;
  6375. if (J.target && Ext.isArray(I)) {
  6376. var B = [];
  6377. for (var E = 0, F = I.length; E < F; E++) {
  6378. B[B.length] = J.compiled.call(this, I[E], G, E + 1, F)
  6379. }
  6380. return B.join("")
  6381. }
  6382. return J.compiled.call(this, I, G, D, C)
  6383. },
  6384. compileTpl : function(tpl) {
  6385. var fm = Ext.util.Format;
  6386. var useF = this.disableFormats !== true;
  6387. var sep = Ext.isGecko ? "+" : ",";
  6388. var fn = function(m, name, format, args, math) {
  6389. if (name.substr(0, 4) == "xtpl") {
  6390. return "'" + sep + "this.applySubTemplate(" + name.substr(4)
  6391. + ", values, parent, xindex, xcount)" + sep + "'"
  6392. }
  6393. var v;
  6394. if (name === ".") {
  6395. v = "values"
  6396. } else {
  6397. if (name === "#") {
  6398. v = "xindex"
  6399. } else {
  6400. if (name.indexOf(".") != -1) {
  6401. v = name
  6402. } else {
  6403. v = "values['" + name + "']"
  6404. }
  6405. }
  6406. }
  6407. if (math) {
  6408. v = "(" + v + math + ")"
  6409. }
  6410. if (format && useF) {
  6411. args = args ? "," + args : "";
  6412. if (format.substr(0, 5) != "this.") {
  6413. format = "fm." + format + "("
  6414. } else {
  6415. format = "this.call(\"" + format.substr(5) + "\", ";
  6416. args = ", values"
  6417. }
  6418. } else {
  6419. args = "";
  6420. format = "(" + v + " === undefined ? '' : "
  6421. }
  6422. return "'" + sep + format + v + args + ")" + sep + "'"
  6423. };
  6424. var codeFn = function(m, code) {
  6425. return "'" + sep + "(" + code + ")" + sep + "'"
  6426. };
  6427. var body;
  6428. if (Ext.isGecko) {
  6429. body = "tpl.compiled = function(values, parent, xindex, xcount){ return '"
  6430. + tpl.body.replace(/(\r\n|\n)/g, "\\n")
  6431. .replace(/'/g, "\\'").replace(this.re, fn).replace(
  6432. this.codeRe, codeFn) + "';};"
  6433. } else {
  6434. body = ["tpl.compiled = function(values, parent, xindex, xcount){ return ['"];
  6435. body.push(tpl.body.replace(/(\r\n|\n)/g, "\\n")
  6436. .replace(/'/g, "\\'").replace(this.re, fn).replace(
  6437. this.codeRe, codeFn));
  6438. body.push("'].join('');};");
  6439. body = body.join("")
  6440. }
  6441. eval(body);
  6442. return this
  6443. },
  6444. apply : function(A) {
  6445. return this.master.compiled.call(this, A, {}, 1, 1)
  6446. },
  6447. applyTemplate : function(A) {
  6448. return this.master.compiled.call(this, A, {}, 1, 1)
  6449. },
  6450. compile : function() {
  6451. return this
  6452. }
  6453. });
  6454. Ext.XTemplate.from = function(A) {
  6455. A = Ext.getDom(A);
  6456. return new Ext.XTemplate(A.value || A.innerHTML)
  6457. };
  6458. Ext.util.CSS = function() {
  6459. var D = null;
  6460. var C = document;
  6461. var B = /(-[a-z])/gi;
  6462. var A = function(E, F) {
  6463. return F.charAt(1).toUpperCase()
  6464. };
  6465. return {
  6466. createStyleSheet : function(G, J) {
  6467. var F;
  6468. var E = C.getElementsByTagName("head")[0];
  6469. var I = C.createElement("style");
  6470. I.setAttribute("type", "text/css");
  6471. if (J) {
  6472. I.setAttribute("id", J)
  6473. }
  6474. if (Ext.isIE) {
  6475. E.appendChild(I);
  6476. F = I.styleSheet;
  6477. F.cssText = G
  6478. } else {
  6479. try {
  6480. I.appendChild(C.createTextNode(G))
  6481. } catch (H) {
  6482. I.cssText = G
  6483. }
  6484. E.appendChild(I);
  6485. F = I.styleSheet
  6486. ? I.styleSheet
  6487. : (I.sheet || C.styleSheets[C.styleSheets.length - 1])
  6488. }
  6489. this.cacheStyleSheet(F);
  6490. return F
  6491. },
  6492. removeStyleSheet : function(F) {
  6493. var E = C.getElementById(F);
  6494. if (E) {
  6495. E.parentNode.removeChild(E)
  6496. }
  6497. },
  6498. swapStyleSheet : function(G, E) {
  6499. this.removeStyleSheet(G);
  6500. var F = C.createElement("link");
  6501. F.setAttribute("rel", "stylesheet");
  6502. F.setAttribute("type", "text/css");
  6503. F.setAttribute("id", G);
  6504. F.setAttribute("href", E);
  6505. C.getElementsByTagName("head")[0].appendChild(F)
  6506. },
  6507. refreshCache : function() {
  6508. return this.getRules(true)
  6509. },
  6510. cacheStyleSheet : function(F) {
  6511. if (!D) {
  6512. D = {}
  6513. }
  6514. try {
  6515. var H = F.cssRules || F.rules;
  6516. for (var E = H.length - 1; E >= 0; --E) {
  6517. D[H[E].selectorText] = H[E]
  6518. }
  6519. } catch (G) {
  6520. }
  6521. },
  6522. getRules : function(F) {
  6523. if (D == null || F) {
  6524. D = {};
  6525. var H = C.styleSheets;
  6526. for (var G = 0, E = H.length; G < E; G++) {
  6527. try {
  6528. this.cacheStyleSheet(H[G])
  6529. } catch (I) {
  6530. }
  6531. }
  6532. }
  6533. return D
  6534. },
  6535. getRule : function(E, G) {
  6536. var F = this.getRules(G);
  6537. if (!Ext.isArray(E)) {
  6538. return F[E]
  6539. }
  6540. for (var H = 0; H < E.length; H++) {
  6541. if (F[E[H]]) {
  6542. return F[E[H]]
  6543. }
  6544. }
  6545. return null
  6546. },
  6547. updateRule : function(E, H, G) {
  6548. if (!Ext.isArray(E)) {
  6549. var I = this.getRule(E);
  6550. if (I) {
  6551. I.style[H.replace(B, A)] = G;
  6552. return true
  6553. }
  6554. } else {
  6555. for (var F = 0; F < E.length; F++) {
  6556. if (this.updateRule(E[F], H, G)) {
  6557. return true
  6558. }
  6559. }
  6560. }
  6561. return false
  6562. }
  6563. }
  6564. }();
  6565. Ext.util.ClickRepeater = function(B, A) {
  6566. this.el = Ext.get(B);
  6567. this.el.unselectable();
  6568. Ext.apply(this, A);
  6569. this.addEvents("mousedown", "click", "mouseup");
  6570. this.el.on("mousedown", this.handleMouseDown, this);
  6571. if (this.preventDefault || this.stopDefault) {
  6572. this.el.on("click", function(C) {
  6573. if (this.preventDefault) {
  6574. C.preventDefault()
  6575. }
  6576. if (this.stopDefault) {
  6577. C.stopEvent()
  6578. }
  6579. }, this)
  6580. }
  6581. if (this.handler) {
  6582. this.on("click", this.handler, this.scope || this)
  6583. }
  6584. Ext.util.ClickRepeater.superclass.constructor.call(this)
  6585. };
  6586. Ext.extend(Ext.util.ClickRepeater, Ext.util.Observable, {
  6587. interval : 20,
  6588. delay : 250,
  6589. preventDefault : true,
  6590. stopDefault : false,
  6591. timer : 0,
  6592. handleMouseDown : function() {
  6593. clearTimeout(this.timer);
  6594. this.el.blur();
  6595. if (this.pressClass) {
  6596. this.el.addClass(this.pressClass)
  6597. }
  6598. this.mousedownTime = new Date();
  6599. Ext.getDoc().on("mouseup", this.handleMouseUp, this);
  6600. this.el.on("mouseout", this.handleMouseOut, this);
  6601. this.fireEvent("mousedown", this);
  6602. this.fireEvent("click", this);
  6603. if (this.accelerate) {
  6604. this.delay = 400
  6605. }
  6606. this.timer = this.click
  6607. .defer(this.delay || this.interval, this)
  6608. },
  6609. click : function() {
  6610. this.fireEvent("click", this);
  6611. this.timer = this.click
  6612. .defer( this.accelerate ? this.easeOutExpo(
  6613. this.mousedownTime.getElapsed(), 400,
  6614. -390, 12000) : this.interval, this)
  6615. },
  6616. easeOutExpo : function(B, A, D, C) {
  6617. return (B == C) ? A + D : D * (-Math.pow(2, -10 * B / C) + 1)
  6618. + A
  6619. },
  6620. handleMouseOut : function() {
  6621. clearTimeout(this.timer);
  6622. if (this.pressClass) {
  6623. this.el.removeClass(this.pressClass)
  6624. }
  6625. this.el.on("mouseover", this.handleMouseReturn, this)
  6626. },
  6627. handleMouseReturn : function() {
  6628. this.el.un("mouseover", this.handleMouseReturn);
  6629. if (this.pressClass) {
  6630. this.el.addClass(this.pressClass)
  6631. }
  6632. this.click()
  6633. },
  6634. handleMouseUp : function() {
  6635. clearTimeout(this.timer);
  6636. this.el.un("mouseover", this.handleMouseReturn);
  6637. this.el.un("mouseout", this.handleMouseOut);
  6638. Ext.getDoc().un("mouseup", this.handleMouseUp);
  6639. this.el.removeClass(this.pressClass);
  6640. this.fireEvent("mouseup", this)
  6641. }
  6642. });
  6643. Ext.KeyNav = function(B, A) {
  6644. this.el = Ext.get(B);
  6645. Ext.apply(this, A);
  6646. if (!this.disabled) {
  6647. this.disabled = true;
  6648. this.enable()
  6649. }
  6650. };
  6651. Ext.KeyNav.prototype = {
  6652. disabled : false,
  6653. defaultEventAction : "stopEvent",
  6654. forceKeyDown : false,
  6655. prepareEvent : function(C) {
  6656. var A = C.getKey();
  6657. var B = this.keyToHandler[A];
  6658. if (Ext.isSafari && B && A >= 37 && A <= 40) {
  6659. C.stopEvent()
  6660. }
  6661. },
  6662. relay : function(C) {
  6663. var A = C.getKey();
  6664. var B = this.keyToHandler[A];
  6665. if (B && this[B]) {
  6666. if (this.doRelay(C, this[B], B) !== true) {
  6667. C[this.defaultEventAction]()
  6668. }
  6669. }
  6670. },
  6671. doRelay : function(C, B, A) {
  6672. return B.call(this.scope || this, C)
  6673. },
  6674. enter : false,
  6675. left : false,
  6676. right : false,
  6677. up : false,
  6678. down : false,
  6679. tab : false,
  6680. esc : false,
  6681. pageUp : false,
  6682. pageDown : false,
  6683. del : false,
  6684. home : false,
  6685. end : false,
  6686. keyToHandler : {
  6687. 37 : "left",
  6688. 39 : "right",
  6689. 38 : "up",
  6690. 40 : "down",
  6691. 33 : "pageUp",
  6692. 34 : "pageDown",
  6693. 46 : "del",
  6694. 36 : "home",
  6695. 35 : "end",
  6696. 13 : "enter",
  6697. 27 : "esc",
  6698. 9 : "tab"
  6699. },
  6700. enable : function() {
  6701. if (this.disabled) {
  6702. if (this.forceKeyDown || Ext.isIE || Ext.isAir) {
  6703. this.el.on("keydown", this.relay, this)
  6704. } else {
  6705. this.el.on("keydown", this.prepareEvent, this);
  6706. this.el.on("keypress", this.relay, this)
  6707. }
  6708. this.disabled = false
  6709. }
  6710. },
  6711. disable : function() {
  6712. if (!this.disabled) {
  6713. if (this.forceKeyDown || Ext.isIE || Ext.isAir) {
  6714. this.el.un("keydown", this.relay)
  6715. } else {
  6716. this.el.un("keydown", this.prepareEvent);
  6717. this.el.un("keypress", this.relay)
  6718. }
  6719. this.disabled = true
  6720. }
  6721. }
  6722. };
  6723. Ext.KeyMap = function(C, B, A) {
  6724. this.el = Ext.get(C);
  6725. this.eventName = A || "keydown";
  6726. this.bindings = [];
  6727. if (B) {
  6728. this.addBinding(B)
  6729. }
  6730. this.enable()
  6731. };
  6732. Ext.KeyMap.prototype = {
  6733. stopEvent : false,
  6734. addBinding : function(D) {
  6735. if (Ext.isArray(D)) {
  6736. for (var F = 0, H = D.length; F < H; F++) {
  6737. this.addBinding(D[F])
  6738. }
  6739. return
  6740. }
  6741. var N = D.key, C = D.shift, A = D.ctrl, G = D.alt, J = D.fn
  6742. || D.handler, M = D.scope;
  6743. if (typeof N == "string") {
  6744. var K = [];
  6745. var I = N.toUpperCase();
  6746. for (var E = 0, H = I.length; E < H; E++) {
  6747. K.push(I.charCodeAt(E))
  6748. }
  6749. N = K
  6750. }
  6751. var B = Ext.isArray(N);
  6752. var L = function(R) {
  6753. if ((!C || R.shiftKey) && (!A || R.ctrlKey) && (!G || R.altKey)) {
  6754. var P = R.getKey();
  6755. if (B) {
  6756. for (var Q = 0, O = N.length; Q < O; Q++) {
  6757. if (N[Q] == P) {
  6758. if (this.stopEvent) {
  6759. R.stopEvent()
  6760. }
  6761. J.call(M || window, P, R);
  6762. return
  6763. }
  6764. }
  6765. } else {
  6766. if (P == N) {
  6767. if (this.stopEvent) {
  6768. R.stopEvent()
  6769. }
  6770. J.call(M || window, P, R)
  6771. }
  6772. }
  6773. }
  6774. };
  6775. this.bindings.push(L)
  6776. },
  6777. on : function(B, D, C) {
  6778. var G, A, E, F;
  6779. if (typeof B == "object" && !Ext.isArray(B)) {
  6780. G = B.key;
  6781. A = B.shift;
  6782. E = B.ctrl;
  6783. F = B.alt
  6784. } else {
  6785. G = B
  6786. }
  6787. this.addBinding({
  6788. key : G,
  6789. shift : A,
  6790. ctrl : E,
  6791. alt : F,
  6792. fn : D,
  6793. scope : C
  6794. })
  6795. },
  6796. handleKeyDown : function(D) {
  6797. if (this.enabled) {
  6798. var B = this.bindings;
  6799. for (var C = 0, A = B.length; C < A; C++) {
  6800. B[C].call(this, D)
  6801. }
  6802. }
  6803. },
  6804. isEnabled : function() {
  6805. return this.enabled
  6806. },
  6807. enable : function() {
  6808. if (!this.enabled) {
  6809. this.el.on(this.eventName, this.handleKeyDown, this);
  6810. this.enabled = true
  6811. }
  6812. },
  6813. disable : function() {
  6814. if (this.enabled) {
  6815. this.el.removeListener(this.eventName, this.handleKeyDown, this);
  6816. this.enabled = false
  6817. }
  6818. }
  6819. };
  6820. Ext.util.TextMetrics = function() {
  6821. var A;
  6822. return {
  6823. measure : function(B, C, D) {
  6824. if (!A) {
  6825. A = Ext.util.TextMetrics.Instance(B, D)
  6826. }
  6827. A.bind(B);
  6828. A.setFixedWidth(D || "auto");
  6829. return A.getSize(C)
  6830. },
  6831. createInstance : function(B, C) {
  6832. return Ext.util.TextMetrics.Instance(B, C)
  6833. }
  6834. }
  6835. }();
  6836. Ext.util.TextMetrics.Instance = function(B, D) {
  6837. var C = new Ext.Element(document.createElement("div"));
  6838. document.body.appendChild(C.dom);
  6839. C.position("absolute");
  6840. C.setLeftTop(-1000, -1000);
  6841. C.hide();
  6842. if (D) {
  6843. C.setWidth(D)
  6844. }
  6845. var A = {
  6846. getSize : function(F) {
  6847. C.update(F);
  6848. var E = C.getSize();
  6849. C.update("");
  6850. return E
  6851. },
  6852. bind : function(E) {
  6853. C.setStyle(Ext.fly(E).getStyles("font-size", "font-style",
  6854. "font-weight", "font-family", "line-height"))
  6855. },
  6856. setFixedWidth : function(E) {
  6857. C.setWidth(E)
  6858. },
  6859. getWidth : function(E) {
  6860. C.dom.style.width = "auto";
  6861. return this.getSize(E).width
  6862. },
  6863. getHeight : function(E) {
  6864. return this.getSize(E).height
  6865. }
  6866. };
  6867. A.bind(B);
  6868. return A
  6869. };
  6870. Ext.Element.measureText = Ext.util.TextMetrics.measure;
  6871. (function() {
  6872. var A = Ext.EventManager;
  6873. var B = Ext.lib.Dom;
  6874. Ext.dd.DragDrop = function(E, C, D) {
  6875. if (E) {
  6876. this.init(E, C, D)
  6877. }
  6878. };
  6879. Ext.dd.DragDrop.prototype = {
  6880. id : null,
  6881. config : null,
  6882. dragElId : null,
  6883. handleElId : null,
  6884. invalidHandleTypes : null,
  6885. invalidHandleIds : null,
  6886. invalidHandleClasses : null,
  6887. startPageX : 0,
  6888. startPageY : 0,
  6889. groups : null,
  6890. locked : false,
  6891. lock : function() {
  6892. this.locked = true
  6893. },
  6894. unlock : function() {
  6895. this.locked = false
  6896. },
  6897. isTarget : true,
  6898. padding : null,
  6899. _domRef : null,
  6900. __ygDragDrop : true,
  6901. constrainX : false,
  6902. constrainY : false,
  6903. minX : 0,
  6904. maxX : 0,
  6905. minY : 0,
  6906. maxY : 0,
  6907. maintainOffset : false,
  6908. xTicks : null,
  6909. yTicks : null,
  6910. primaryButtonOnly : true,
  6911. available : false,
  6912. hasOuterHandles : false,
  6913. b4StartDrag : function(C, D) {
  6914. },
  6915. startDrag : function(C, D) {
  6916. },
  6917. b4Drag : function(C) {
  6918. },
  6919. onDrag : function(C) {
  6920. },
  6921. onDragEnter : function(C, D) {
  6922. },
  6923. b4DragOver : function(C) {
  6924. },
  6925. onDragOver : function(C, D) {
  6926. },
  6927. b4DragOut : function(C) {
  6928. },
  6929. onDragOut : function(C, D) {
  6930. },
  6931. b4DragDrop : function(C) {
  6932. },
  6933. onDragDrop : function(C, D) {
  6934. },
  6935. onInvalidDrop : function(C) {
  6936. },
  6937. b4EndDrag : function(C) {
  6938. },
  6939. endDrag : function(C) {
  6940. },
  6941. b4MouseDown : function(C) {
  6942. },
  6943. onMouseDown : function(C) {
  6944. },
  6945. onMouseUp : function(C) {
  6946. },
  6947. onAvailable : function() {
  6948. },
  6949. defaultPadding : {
  6950. left : 0,
  6951. right : 0,
  6952. top : 0,
  6953. bottom : 0
  6954. },
  6955. constrainTo : function(H, F, M) {
  6956. if (typeof F == "number") {
  6957. F = {
  6958. left : F,
  6959. right : F,
  6960. top : F,
  6961. bottom : F
  6962. }
  6963. }
  6964. F = F || this.defaultPadding;
  6965. var J = Ext.get(this.getEl()).getBox();
  6966. var C = Ext.get(H);
  6967. var L = C.getScroll();
  6968. var I, D = C.dom;
  6969. if (D == document.body) {
  6970. I = {
  6971. x : L.left,
  6972. y : L.top,
  6973. width : Ext.lib.Dom.getViewWidth(),
  6974. height : Ext.lib.Dom.getViewHeight()
  6975. }
  6976. } else {
  6977. var K = C.getXY();
  6978. I = {
  6979. x : K[0] + L.left,
  6980. y : K[1] + L.top,
  6981. width : D.clientWidth,
  6982. height : D.clientHeight
  6983. }
  6984. }
  6985. var G = J.y - I.y;
  6986. var E = J.x - I.x;
  6987. this.resetConstraints();
  6988. this.setXConstraint(E - (F.left || 0), I.width - E - J.width
  6989. - (F.right || 0), this.xTickSize);
  6990. this.setYConstraint(G - (F.top || 0), I.height - G - J.height
  6991. - (F.bottom || 0), this.yTickSize)
  6992. },
  6993. getEl : function() {
  6994. if (!this._domRef) {
  6995. this._domRef = Ext.getDom(this.id)
  6996. }
  6997. return this._domRef
  6998. },
  6999. getDragEl : function() {
  7000. return Ext.getDom(this.dragElId)
  7001. },
  7002. init : function(E, C, D) {
  7003. this.initTarget(E, C, D);
  7004. A.on(this.id, "mousedown", this.handleMouseDown, this)
  7005. },
  7006. initTarget : function(E, C, D) {
  7007. this.config = D || {};
  7008. this.DDM = Ext.dd.DDM;
  7009. this.groups = {};
  7010. if (typeof E !== "string") {
  7011. E = Ext.id(E)
  7012. }
  7013. this.id = E;
  7014. this.addToGroup((C) ? C : "default");
  7015. this.handleElId = E;
  7016. this.setDragElId(E);
  7017. this.invalidHandleTypes = {
  7018. A : "A"
  7019. };
  7020. this.invalidHandleIds = {};
  7021. this.invalidHandleClasses = [];
  7022. this.applyConfig();
  7023. this.handleOnAvailable()
  7024. },
  7025. applyConfig : function() {
  7026. this.padding = this.config.padding || [0, 0, 0, 0];
  7027. this.isTarget = (this.config.isTarget !== false);
  7028. this.maintainOffset = (this.config.maintainOffset);
  7029. this.primaryButtonOnly = (this.config.primaryButtonOnly !== false)
  7030. },
  7031. handleOnAvailable : function() {
  7032. this.available = true;
  7033. this.resetConstraints();
  7034. this.onAvailable()
  7035. },
  7036. setPadding : function(E, C, F, D) {
  7037. if (!C && 0 !== C) {
  7038. this.padding = [E, E, E, E]
  7039. } else {
  7040. if (!F && 0 !== F) {
  7041. this.padding = [E, C, E, C]
  7042. } else {
  7043. this.padding = [E, C, F, D]
  7044. }
  7045. }
  7046. },
  7047. setInitPosition : function(F, E) {
  7048. var G = this.getEl();
  7049. if (!this.DDM.verifyEl(G)) {
  7050. return
  7051. }
  7052. var D = F || 0;
  7053. var C = E || 0;
  7054. var H = B.getXY(G);
  7055. this.initPageX = H[0] - D;
  7056. this.initPageY = H[1] - C;
  7057. this.lastPageX = H[0];
  7058. this.lastPageY = H[1];
  7059. this.setStartPosition(H)
  7060. },
  7061. setStartPosition : function(D) {
  7062. var C = D || B.getXY(this.getEl());
  7063. this.deltaSetXY = null;
  7064. this.startPageX = C[0];
  7065. this.startPageY = C[1]
  7066. },
  7067. addToGroup : function(C) {
  7068. this.groups[C] = true;
  7069. this.DDM.regDragDrop(this, C)
  7070. },
  7071. removeFromGroup : function(C) {
  7072. if (this.groups[C]) {
  7073. delete this.groups[C]
  7074. }
  7075. this.DDM.removeDDFromGroup(this, C)
  7076. },
  7077. setDragElId : function(C) {
  7078. this.dragElId = C
  7079. },
  7080. setHandleElId : function(C) {
  7081. if (typeof C !== "string") {
  7082. C = Ext.id(C)
  7083. }
  7084. this.handleElId = C;
  7085. this.DDM.regHandle(this.id, C)
  7086. },
  7087. setOuterHandleElId : function(C) {
  7088. if (typeof C !== "string") {
  7089. C = Ext.id(C)
  7090. }
  7091. A.on(C, "mousedown", this.handleMouseDown, this);
  7092. this.setHandleElId(C);
  7093. this.hasOuterHandles = true
  7094. },
  7095. unreg : function() {
  7096. A.un(this.id, "mousedown", this.handleMouseDown);
  7097. this._domRef = null;
  7098. this.DDM._remove(this)
  7099. },
  7100. destroy : function() {
  7101. this.unreg()
  7102. },
  7103. isLocked : function() {
  7104. return (this.DDM.isLocked() || this.locked)
  7105. },
  7106. handleMouseDown : function(E, D) {
  7107. if (this.primaryButtonOnly && E.button != 0) {
  7108. return
  7109. }
  7110. if (this.isLocked()) {
  7111. return
  7112. }
  7113. this.DDM.refreshCache(this.groups);
  7114. var C = new Ext.lib.Point(Ext.lib.Event.getPageX(E), Ext.lib.Event
  7115. .getPageY(E));
  7116. if (!this.hasOuterHandles && !this.DDM.isOverTarget(C, this)) {
  7117. } else {
  7118. if (this.clickValidator(E)) {
  7119. this.setStartPosition();
  7120. this.b4MouseDown(E);
  7121. this.onMouseDown(E);
  7122. this.DDM.handleMouseDown(E, this);
  7123. this.DDM.stopEvent(E)
  7124. } else {
  7125. }
  7126. }
  7127. },
  7128. clickValidator : function(D) {
  7129. var C = D.getTarget();
  7130. return (this.isValidHandleChild(C) && (this.id == this.handleElId || this.DDM
  7131. .handleWasClicked(C, this.id)))
  7132. },
  7133. addInvalidHandleType : function(C) {
  7134. var D = C.toUpperCase();
  7135. this.invalidHandleTypes[D] = D
  7136. },
  7137. addInvalidHandleId : function(C) {
  7138. if (typeof C !== "string") {
  7139. C = Ext.id(C)
  7140. }
  7141. this.invalidHandleIds[C] = C
  7142. },
  7143. addInvalidHandleClass : function(C) {
  7144. this.invalidHandleClasses.push(C)
  7145. },
  7146. removeInvalidHandleType : function(C) {
  7147. var D = C.toUpperCase();
  7148. delete this.invalidHandleTypes[D]
  7149. },
  7150. removeInvalidHandleId : function(C) {
  7151. if (typeof C !== "string") {
  7152. C = Ext.id(C)
  7153. }
  7154. delete this.invalidHandleIds[C]
  7155. },
  7156. removeInvalidHandleClass : function(D) {
  7157. for (var E = 0, C = this.invalidHandleClasses.length; E < C; ++E) {
  7158. if (this.invalidHandleClasses[E] == D) {
  7159. delete this.invalidHandleClasses[E]
  7160. }
  7161. }
  7162. },
  7163. isValidHandleChild : function(F) {
  7164. var E = true;
  7165. var H;
  7166. try {
  7167. H = F.nodeName.toUpperCase()
  7168. } catch (G) {
  7169. H = F.nodeName
  7170. }
  7171. E = E && !this.invalidHandleTypes[H];
  7172. E = E && !this.invalidHandleIds[F.id];
  7173. for (var D = 0, C = this.invalidHandleClasses.length; E && D < C; ++D) {
  7174. E = !B.hasClass(F, this.invalidHandleClasses[D])
  7175. }
  7176. return E
  7177. },
  7178. setXTicks : function(F, C) {
  7179. this.xTicks = [];
  7180. this.xTickSize = C;
  7181. var E = {};
  7182. for (var D = this.initPageX; D >= this.minX; D = D - C) {
  7183. if (!E[D]) {
  7184. this.xTicks[this.xTicks.length] = D;
  7185. E[D] = true
  7186. }
  7187. }
  7188. for (D = this.initPageX; D <= this.maxX; D = D + C) {
  7189. if (!E[D]) {
  7190. this.xTicks[this.xTicks.length] = D;
  7191. E[D] = true
  7192. }
  7193. }
  7194. this.xTicks.sort(this.DDM.numericSort)
  7195. },
  7196. setYTicks : function(F, C) {
  7197. this.yTicks = [];
  7198. this.yTickSize = C;
  7199. var E = {};
  7200. for (var D = this.initPageY; D >= this.minY; D = D - C) {
  7201. if (!E[D]) {
  7202. this.yTicks[this.yTicks.length] = D;
  7203. E[D] = true
  7204. }
  7205. }
  7206. for (D = this.initPageY; D <= this.maxY; D = D + C) {
  7207. if (!E[D]) {
  7208. this.yTicks[this.yTicks.length] = D;
  7209. E[D] = true
  7210. }
  7211. }
  7212. this.yTicks.sort(this.DDM.numericSort)
  7213. },
  7214. setXConstraint : function(E, D, C) {
  7215. this.leftConstraint = E;
  7216. this.rightConstraint = D;
  7217. this.minX = this.initPageX - E;
  7218. this.maxX = this.initPageX + D;
  7219. if (C) {
  7220. this.setXTicks(this.initPageX, C)
  7221. }
  7222. this.constrainX = true
  7223. },
  7224. clearConstraints : function() {
  7225. this.constrainX = false;
  7226. this.constrainY = false;
  7227. this.clearTicks()
  7228. },
  7229. clearTicks : function() {
  7230. this.xTicks = null;
  7231. this.yTicks = null;
  7232. this.xTickSize = 0;
  7233. this.yTickSize = 0
  7234. },
  7235. setYConstraint : function(C, E, D) {
  7236. this.topConstraint = C;
  7237. this.bottomConstraint = E;
  7238. this.minY = this.initPageY - C;
  7239. this.maxY = this.initPageY + E;
  7240. if (D) {
  7241. this.setYTicks(this.initPageY, D)
  7242. }
  7243. this.constrainY = true
  7244. },
  7245. resetConstraints : function() {
  7246. if (this.initPageX || this.initPageX === 0) {
  7247. var D = (this.maintainOffset)
  7248. ? this.lastPageX - this.initPageX
  7249. : 0;
  7250. var C = (this.maintainOffset)
  7251. ? this.lastPageY - this.initPageY
  7252. : 0;
  7253. this.setInitPosition(D, C)
  7254. } else {
  7255. this.setInitPosition()
  7256. }
  7257. if (this.constrainX) {
  7258. this.setXConstraint(this.leftConstraint, this.rightConstraint,
  7259. this.xTickSize)
  7260. }
  7261. if (this.constrainY) {
  7262. this.setYConstraint(this.topConstraint, this.bottomConstraint,
  7263. this.yTickSize)
  7264. }
  7265. },
  7266. getTick : function(I, F) {
  7267. if (!F) {
  7268. return I
  7269. } else {
  7270. if (F[0] >= I) {
  7271. return F[0]
  7272. } else {
  7273. for (var D = 0, C = F.length; D < C; ++D) {
  7274. var E = D + 1;
  7275. if (F[E] && F[E] >= I) {
  7276. var H = I - F[D];
  7277. var G = F[E] - I;
  7278. return (G > H) ? F[D] : F[E]
  7279. }
  7280. }
  7281. return F[F.length - 1]
  7282. }
  7283. }
  7284. },
  7285. toString : function() {
  7286. return ("DragDrop " + this.id)
  7287. }
  7288. }
  7289. })();
  7290. if (!Ext.dd.DragDropMgr) {
  7291. Ext.dd.DragDropMgr = function() {
  7292. var A = Ext.EventManager;
  7293. return {
  7294. ids : {},
  7295. handleIds : {},
  7296. dragCurrent : null,
  7297. dragOvers : {},
  7298. deltaX : 0,
  7299. deltaY : 0,
  7300. preventDefault : true,
  7301. stopPropagation : true,
  7302. initalized : false,
  7303. locked : false,
  7304. init : function() {
  7305. this.initialized = true
  7306. },
  7307. POINT : 0,
  7308. INTERSECT : 1,
  7309. mode : 0,
  7310. _execOnAll : function(D, C) {
  7311. for (var E in this.ids) {
  7312. for (var B in this.ids[E]) {
  7313. var F = this.ids[E][B];
  7314. if (!this.isTypeOfDD(F)) {
  7315. continue
  7316. }
  7317. F[D].apply(F, C)
  7318. }
  7319. }
  7320. },
  7321. _onLoad : function() {
  7322. this.init();
  7323. A.on(document, "mouseup", this.handleMouseUp, this, true);
  7324. A.on(document, "mousemove", this.handleMouseMove, this, true);
  7325. A.on(window, "unload", this._onUnload, this, true);
  7326. A.on(window, "resize", this._onResize, this, true)
  7327. },
  7328. _onResize : function(B) {
  7329. this._execOnAll("resetConstraints", [])
  7330. },
  7331. lock : function() {
  7332. this.locked = true
  7333. },
  7334. unlock : function() {
  7335. this.locked = false
  7336. },
  7337. isLocked : function() {
  7338. return this.locked
  7339. },
  7340. locationCache : {},
  7341. useCache : true,
  7342. clickPixelThresh : 3,
  7343. clickTimeThresh : 350,
  7344. dragThreshMet : false,
  7345. clickTimeout : null,
  7346. startX : 0,
  7347. startY : 0,
  7348. regDragDrop : function(C, B) {
  7349. if (!this.initialized) {
  7350. this.init()
  7351. }
  7352. if (!this.ids[B]) {
  7353. this.ids[B] = {}
  7354. }
  7355. this.ids[B][C.id] = C
  7356. },
  7357. removeDDFromGroup : function(D, B) {
  7358. if (!this.ids[B]) {
  7359. this.ids[B] = {}
  7360. }
  7361. var C = this.ids[B];
  7362. if (C && C[D.id]) {
  7363. delete C[D.id]
  7364. }
  7365. },
  7366. _remove : function(C) {
  7367. for (var B in C.groups) {
  7368. if (B && this.ids[B][C.id]) {
  7369. delete this.ids[B][C.id]
  7370. }
  7371. }
  7372. delete this.handleIds[C.id]
  7373. },
  7374. regHandle : function(C, B) {
  7375. if (!this.handleIds[C]) {
  7376. this.handleIds[C] = {}
  7377. }
  7378. this.handleIds[C][B] = B
  7379. },
  7380. isDragDrop : function(B) {
  7381. return (this.getDDById(B)) ? true : false
  7382. },
  7383. getRelated : function(F, C) {
  7384. var E = [];
  7385. for (var D in F.groups) {
  7386. for (j in this.ids[D]) {
  7387. var B = this.ids[D][j];
  7388. if (!this.isTypeOfDD(B)) {
  7389. continue
  7390. }
  7391. if (!C || B.isTarget) {
  7392. E[E.length] = B
  7393. }
  7394. }
  7395. }
  7396. return E
  7397. },
  7398. isLegalTarget : function(F, E) {
  7399. var C = this.getRelated(F, true);
  7400. for (var D = 0, B = C.length; D < B; ++D) {
  7401. if (C[D].id == E.id) {
  7402. return true
  7403. }
  7404. }
  7405. return false
  7406. },
  7407. isTypeOfDD : function(B) {
  7408. return (B && B.__ygDragDrop)
  7409. },
  7410. isHandle : function(C, B) {
  7411. return (this.handleIds[C] && this.handleIds[C][B])
  7412. },
  7413. getDDById : function(C) {
  7414. for (var B in this.ids) {
  7415. if (this.ids[B][C]) {
  7416. return this.ids[B][C]
  7417. }
  7418. }
  7419. return null
  7420. },
  7421. handleMouseDown : function(D, C) {
  7422. if (Ext.QuickTips) {
  7423. Ext.QuickTips.disable()
  7424. }
  7425. this.currentTarget = D.getTarget();
  7426. this.dragCurrent = C;
  7427. var B = C.getEl();
  7428. this.startX = D.getPageX();
  7429. this.startY = D.getPageY();
  7430. this.deltaX = this.startX - B.offsetLeft;
  7431. this.deltaY = this.startY - B.offsetTop;
  7432. this.dragThreshMet = false;
  7433. this.clickTimeout = setTimeout(function() {
  7434. var E = Ext.dd.DDM;
  7435. E.startDrag(E.startX, E.startY)
  7436. }, this.clickTimeThresh)
  7437. },
  7438. startDrag : function(B, C) {
  7439. clearTimeout(this.clickTimeout);
  7440. if (this.dragCurrent) {
  7441. this.dragCurrent.b4StartDrag(B, C);
  7442. this.dragCurrent.startDrag(B, C)
  7443. }
  7444. this.dragThreshMet = true
  7445. },
  7446. handleMouseUp : function(B) {
  7447. if (Ext.QuickTips) {
  7448. Ext.QuickTips.enable()
  7449. }
  7450. if (!this.dragCurrent) {
  7451. return
  7452. }
  7453. clearTimeout(this.clickTimeout);
  7454. if (this.dragThreshMet) {
  7455. this.fireEvents(B, true)
  7456. } else {
  7457. }
  7458. this.stopDrag(B);
  7459. this.stopEvent(B)
  7460. },
  7461. stopEvent : function(B) {
  7462. if (this.stopPropagation) {
  7463. B.stopPropagation()
  7464. }
  7465. if (this.preventDefault) {
  7466. B.preventDefault()
  7467. }
  7468. },
  7469. stopDrag : function(B) {
  7470. if (this.dragCurrent) {
  7471. if (this.dragThreshMet) {
  7472. this.dragCurrent.b4EndDrag(B);
  7473. this.dragCurrent.endDrag(B)
  7474. }
  7475. this.dragCurrent.onMouseUp(B)
  7476. }
  7477. this.dragCurrent = null;
  7478. this.dragOvers = {}
  7479. },
  7480. handleMouseMove : function(D) {
  7481. if (!this.dragCurrent) {
  7482. return true
  7483. }
  7484. if (Ext.isIE
  7485. && (D.button !== 0 && D.button !== 1 && D.button !== 2)) {
  7486. this.stopEvent(D);
  7487. return this.handleMouseUp(D)
  7488. }
  7489. if (!this.dragThreshMet) {
  7490. var C = Math.abs(this.startX - D.getPageX());
  7491. var B = Math.abs(this.startY - D.getPageY());
  7492. if (C > this.clickPixelThresh || B > this.clickPixelThresh) {
  7493. this.startDrag(this.startX, this.startY)
  7494. }
  7495. }
  7496. if (this.dragThreshMet) {
  7497. this.dragCurrent.b4Drag(D);
  7498. this.dragCurrent.onDrag(D);
  7499. if (!this.dragCurrent.moveOnly) {
  7500. this.fireEvents(D, false)
  7501. }
  7502. }
  7503. this.stopEvent(D);
  7504. return true
  7505. },
  7506. fireEvents : function(K, L) {
  7507. var N = this.dragCurrent;
  7508. if (!N || N.isLocked()) {
  7509. return
  7510. }
  7511. var O = K.getPoint();
  7512. var B = [];
  7513. var E = [];
  7514. var I = [];
  7515. var G = [];
  7516. var D = [];
  7517. for (var F in this.dragOvers) {
  7518. var C = this.dragOvers[F];
  7519. if (!this.isTypeOfDD(C)) {
  7520. continue
  7521. }
  7522. if (!this.isOverTarget(O, C, this.mode)) {
  7523. E.push(C)
  7524. }
  7525. B[F] = true;
  7526. delete this.dragOvers[F]
  7527. }
  7528. for (var M in N.groups) {
  7529. if ("string" != typeof M) {
  7530. continue
  7531. }
  7532. for (F in this.ids[M]) {
  7533. var H = this.ids[M][F];
  7534. if (!this.isTypeOfDD(H)) {
  7535. continue
  7536. }
  7537. if (H.isTarget && !H.isLocked() && H != N) {
  7538. if (this.isOverTarget(O, H, this.mode)) {
  7539. if (L) {
  7540. G.push(H)
  7541. } else {
  7542. if (!B[H.id]) {
  7543. D.push(H)
  7544. } else {
  7545. I.push(H)
  7546. }
  7547. this.dragOvers[H.id] = H
  7548. }
  7549. }
  7550. }
  7551. }
  7552. }
  7553. if (this.mode) {
  7554. if (E.length) {
  7555. N.b4DragOut(K, E);
  7556. N.onDragOut(K, E)
  7557. }
  7558. if (D.length) {
  7559. N.onDragEnter(K, D)
  7560. }
  7561. if (I.length) {
  7562. N.b4DragOver(K, I);
  7563. N.onDragOver(K, I)
  7564. }
  7565. if (G.length) {
  7566. N.b4DragDrop(K, G);
  7567. N.onDragDrop(K, G)
  7568. }
  7569. } else {
  7570. var J = 0;
  7571. for (F = 0, J = E.length; F < J; ++F) {
  7572. N.b4DragOut(K, E[F].id);
  7573. N.onDragOut(K, E[F].id)
  7574. }
  7575. for (F = 0, J = D.length; F < J; ++F) {
  7576. N.onDragEnter(K, D[F].id)
  7577. }
  7578. for (F = 0, J = I.length; F < J; ++F) {
  7579. N.b4DragOver(K, I[F].id);
  7580. N.onDragOver(K, I[F].id)
  7581. }
  7582. for (F = 0, J = G.length; F < J; ++F) {
  7583. N.b4DragDrop(K, G[F].id);
  7584. N.onDragDrop(K, G[F].id)
  7585. }
  7586. }
  7587. if (L && !G.length) {
  7588. N.onInvalidDrop(K)
  7589. }
  7590. },
  7591. getBestMatch : function(D) {
  7592. var F = null;
  7593. var C = D.length;
  7594. if (C == 1) {
  7595. F = D[0]
  7596. } else {
  7597. for (var E = 0; E < C; ++E) {
  7598. var B = D[E];
  7599. if (B.cursorIsOver) {
  7600. F = B;
  7601. break
  7602. } else {
  7603. if (!F || F.overlap.getArea() < B.overlap.getArea()) {
  7604. F = B
  7605. }
  7606. }
  7607. }
  7608. }
  7609. return F
  7610. },
  7611. refreshCache : function(C) {
  7612. for (var B in C) {
  7613. if ("string" != typeof B) {
  7614. continue
  7615. }
  7616. for (var D in this.ids[B]) {
  7617. var E = this.ids[B][D];
  7618. if (this.isTypeOfDD(E)) {
  7619. var F = this.getLocation(E);
  7620. if (F) {
  7621. this.locationCache[E.id] = F
  7622. } else {
  7623. delete this.locationCache[E.id]
  7624. }
  7625. }
  7626. }
  7627. }
  7628. },
  7629. verifyEl : function(C) {
  7630. if (C) {
  7631. var B;
  7632. if (Ext.isIE) {
  7633. try {
  7634. B = C.offsetParent
  7635. } catch (D) {
  7636. }
  7637. } else {
  7638. B = C.offsetParent
  7639. }
  7640. if (B) {
  7641. return true
  7642. }
  7643. }
  7644. return false
  7645. },
  7646. getLocation : function(G) {
  7647. if (!this.isTypeOfDD(G)) {
  7648. return null
  7649. }
  7650. var E = G.getEl(), J, D, C, L, K, M, B, I, F;
  7651. try {
  7652. J = Ext.lib.Dom.getXY(E)
  7653. } catch (H) {
  7654. }
  7655. if (!J) {
  7656. return null
  7657. }
  7658. D = J[0];
  7659. C = D + E.offsetWidth;
  7660. L = J[1];
  7661. K = L + E.offsetHeight;
  7662. M = L - G.padding[0];
  7663. B = C + G.padding[1];
  7664. I = K + G.padding[2];
  7665. F = D - G.padding[3];
  7666. return new Ext.lib.Region(M, B, I, F)
  7667. },
  7668. isOverTarget : function(J, B, D) {
  7669. var F = this.locationCache[B.id];
  7670. if (!F || !this.useCache) {
  7671. F = this.getLocation(B);
  7672. this.locationCache[B.id] = F
  7673. }
  7674. if (!F) {
  7675. return false
  7676. }
  7677. B.cursorIsOver = F.contains(J);
  7678. var I = this.dragCurrent;
  7679. if (!I || !I.getTargetCoord
  7680. || (!D && !I.constrainX && !I.constrainY)) {
  7681. return B.cursorIsOver
  7682. }
  7683. B.overlap = null;
  7684. var G = I.getTargetCoord(J.x, J.y);
  7685. var C = I.getDragEl();
  7686. var E = new Ext.lib.Region(G.y, G.x + C.offsetWidth, G.y
  7687. + C.offsetHeight, G.x);
  7688. var H = E.intersect(F);
  7689. if (H) {
  7690. B.overlap = H;
  7691. return (D) ? true : B.cursorIsOver
  7692. } else {
  7693. return false
  7694. }
  7695. },
  7696. _onUnload : function(C, B) {
  7697. Ext.dd.DragDropMgr.unregAll()
  7698. },
  7699. unregAll : function() {
  7700. if (this.dragCurrent) {
  7701. this.stopDrag();
  7702. this.dragCurrent = null
  7703. }
  7704. this._execOnAll("unreg", []);
  7705. for (var B in this.elementCache) {
  7706. delete this.elementCache[B]
  7707. }
  7708. this.elementCache = {};
  7709. this.ids = {}
  7710. },
  7711. elementCache : {},
  7712. getElWrapper : function(C) {
  7713. var B = this.elementCache[C];
  7714. if (!B || !B.el) {
  7715. B = this.elementCache[C] = new this.ElementWrapper(Ext
  7716. .getDom(C))
  7717. }
  7718. return B
  7719. },
  7720. getElement : function(B) {
  7721. return Ext.getDom(B)
  7722. },
  7723. getCss : function(C) {
  7724. var B = Ext.getDom(C);
  7725. return (B) ? B.style : null
  7726. },
  7727. ElementWrapper : function(B) {
  7728. this.el = B || null;
  7729. this.id = this.el && B.id;
  7730. this.css = this.el && B.style
  7731. },
  7732. getPosX : function(B) {
  7733. return Ext.lib.Dom.getX(B)
  7734. },
  7735. getPosY : function(B) {
  7736. return Ext.lib.Dom.getY(B)
  7737. },
  7738. swapNode : function(D, B) {
  7739. if (D.swapNode) {
  7740. D.swapNode(B)
  7741. } else {
  7742. var E = B.parentNode;
  7743. var C = B.nextSibling;
  7744. if (C == D) {
  7745. E.insertBefore(D, B)
  7746. } else {
  7747. if (B == D.nextSibling) {
  7748. E.insertBefore(B, D)
  7749. } else {
  7750. D.parentNode.replaceChild(B, D);
  7751. E.insertBefore(D, C)
  7752. }
  7753. }
  7754. }
  7755. },
  7756. getScroll : function() {
  7757. var D, B, E = document.documentElement, C = document.body;
  7758. if (E && (E.scrollTop || E.scrollLeft)) {
  7759. D = E.scrollTop;
  7760. B = E.scrollLeft
  7761. } else {
  7762. if (C) {
  7763. D = C.scrollTop;
  7764. B = C.scrollLeft
  7765. } else {
  7766. }
  7767. }
  7768. return {
  7769. top : D,
  7770. left : B
  7771. }
  7772. },
  7773. getStyle : function(C, B) {
  7774. return Ext.fly(C).getStyle(B)
  7775. },
  7776. getScrollTop : function() {
  7777. return this.getScroll().top
  7778. },
  7779. getScrollLeft : function() {
  7780. return this.getScroll().left
  7781. },
  7782. moveToEl : function(B, D) {
  7783. var C = Ext.lib.Dom.getXY(D);
  7784. Ext.lib.Dom.setXY(B, C)
  7785. },
  7786. numericSort : function(C, B) {
  7787. return (C - B)
  7788. },
  7789. _timeoutCount : 0,
  7790. _addListeners : function() {
  7791. var B = Ext.dd.DDM;
  7792. if (Ext.lib.Event && document) {
  7793. B._onLoad()
  7794. } else {
  7795. if (B._timeoutCount > 2000) {
  7796. } else {
  7797. setTimeout(B._addListeners, 10);
  7798. if (document && document.body) {
  7799. B._timeoutCount += 1
  7800. }
  7801. }
  7802. }
  7803. },
  7804. handleWasClicked : function(B, D) {
  7805. if (this.isHandle(D, B.id)) {
  7806. return true
  7807. } else {
  7808. var C = B.parentNode;
  7809. while (C) {
  7810. if (this.isHandle(D, C.id)) {
  7811. return true
  7812. } else {
  7813. C = C.parentNode
  7814. }
  7815. }
  7816. }
  7817. return false
  7818. }
  7819. }
  7820. }();
  7821. Ext.dd.DDM = Ext.dd.DragDropMgr;
  7822. Ext.dd.DDM._addListeners()
  7823. }
  7824. Ext.dd.DD = function(C, A, B) {
  7825. if (C) {
  7826. this.init(C, A, B)
  7827. }
  7828. };
  7829. Ext.extend(Ext.dd.DD, Ext.dd.DragDrop, {
  7830. scroll : true,
  7831. autoOffset : function(C, B) {
  7832. var A = C - this.startPageX;
  7833. var D = B - this.startPageY;
  7834. this.setDelta(A, D)
  7835. },
  7836. setDelta : function(B, A) {
  7837. this.deltaX = B;
  7838. this.deltaY = A
  7839. },
  7840. setDragElPos : function(C, B) {
  7841. var A = this.getDragEl();
  7842. this.alignElWithMouse(A, C, B)
  7843. },
  7844. alignElWithMouse : function(C, G, F) {
  7845. var E = this.getTargetCoord(G, F);
  7846. var B = C.dom ? C : Ext.fly(C, "_dd");
  7847. if (!this.deltaSetXY) {
  7848. var H = [E.x, E.y];
  7849. B.setXY(H);
  7850. var D = B.getLeft(true);
  7851. var A = B.getTop(true);
  7852. this.deltaSetXY = [D - E.x, A - E.y]
  7853. } else {
  7854. B.setLeftTop(E.x + this.deltaSetXY[0], E.y
  7855. + this.deltaSetXY[1])
  7856. }
  7857. this.cachePosition(E.x, E.y);
  7858. this.autoScroll(E.x, E.y, C.offsetHeight, C.offsetWidth);
  7859. return E
  7860. },
  7861. cachePosition : function(B, A) {
  7862. if (B) {
  7863. this.lastPageX = B;
  7864. this.lastPageY = A
  7865. } else {
  7866. var C = Ext.lib.Dom.getXY(this.getEl());
  7867. this.lastPageX = C[0];
  7868. this.lastPageY = C[1]
  7869. }
  7870. },
  7871. autoScroll : function(J, I, E, K) {
  7872. if (this.scroll) {
  7873. var L = Ext.lib.Dom.getViewHeight();
  7874. var B = Ext.lib.Dom.getViewWidth();
  7875. var N = this.DDM.getScrollTop();
  7876. var D = this.DDM.getScrollLeft();
  7877. var H = E + I;
  7878. var M = K + J;
  7879. var G = (L + N - I - this.deltaY);
  7880. var F = (B + D - J - this.deltaX);
  7881. var C = 40;
  7882. var A = (document.all) ? 80 : 30;
  7883. if (H > L && G < C) {
  7884. window.scrollTo(D, N + A)
  7885. }
  7886. if (I < N && N > 0 && I - N < C) {
  7887. window.scrollTo(D, N - A)
  7888. }
  7889. if (M > B && F < C) {
  7890. window.scrollTo(D + A, N)
  7891. }
  7892. if (J < D && D > 0 && J - D < C) {
  7893. window.scrollTo(D - A, N)
  7894. }
  7895. }
  7896. },
  7897. getTargetCoord : function(C, B) {
  7898. var A = C - this.deltaX;
  7899. var D = B - this.deltaY;
  7900. if (this.constrainX) {
  7901. if (A < this.minX) {
  7902. A = this.minX
  7903. }
  7904. if (A > this.maxX) {
  7905. A = this.maxX
  7906. }
  7907. }
  7908. if (this.constrainY) {
  7909. if (D < this.minY) {
  7910. D = this.minY
  7911. }
  7912. if (D > this.maxY) {
  7913. D = this.maxY
  7914. }
  7915. }
  7916. A = this.getTick(A, this.xTicks);
  7917. D = this.getTick(D, this.yTicks);
  7918. return {
  7919. x : A,
  7920. y : D
  7921. }
  7922. },
  7923. applyConfig : function() {
  7924. Ext.dd.DD.superclass.applyConfig.call(this);
  7925. this.scroll = (this.config.scroll !== false)
  7926. },
  7927. b4MouseDown : function(A) {
  7928. this.autoOffset(A.getPageX(), A.getPageY())
  7929. },
  7930. b4Drag : function(A) {
  7931. this.setDragElPos(A.getPageX(), A.getPageY())
  7932. },
  7933. toString : function() {
  7934. return ("DD " + this.id)
  7935. }
  7936. });
  7937. Ext.dd.DDProxy = function(C, A, B) {
  7938. if (C) {
  7939. this.init(C, A, B);
  7940. this.initFrame()
  7941. }
  7942. };
  7943. Ext.dd.DDProxy.dragElId = "ygddfdiv";
  7944. Ext.extend(Ext.dd.DDProxy, Ext.dd.DD, {
  7945. resizeFrame : true,
  7946. centerFrame : false,
  7947. createFrame : function() {
  7948. var B = this;
  7949. var A = document.body;
  7950. if (!A || !A.firstChild) {
  7951. setTimeout(function() {
  7952. B.createFrame()
  7953. }, 50);
  7954. return
  7955. }
  7956. var D = this.getDragEl();
  7957. if (!D) {
  7958. D = document.createElement("div");
  7959. D.id = this.dragElId;
  7960. var C = D.style;
  7961. C.position = "absolute";
  7962. C.visibility = "hidden";
  7963. C.cursor = "move";
  7964. C.border = "2px solid #aaa";
  7965. C.zIndex = 999;
  7966. A.insertBefore(D, A.firstChild)
  7967. }
  7968. },
  7969. initFrame : function() {
  7970. this.createFrame()
  7971. },
  7972. applyConfig : function() {
  7973. Ext.dd.DDProxy.superclass.applyConfig.call(this);
  7974. this.resizeFrame = (this.config.resizeFrame !== false);
  7975. this.centerFrame = (this.config.centerFrame);
  7976. this.setDragElId(this.config.dragElId
  7977. || Ext.dd.DDProxy.dragElId)
  7978. },
  7979. showFrame : function(E, D) {
  7980. var C = this.getEl();
  7981. var A = this.getDragEl();
  7982. var B = A.style;
  7983. this._resizeProxy();
  7984. if (this.centerFrame) {
  7985. this.setDelta(Math.round(parseInt(B.width, 10) / 2), Math
  7986. .round(parseInt(B.height, 10) / 2))
  7987. }
  7988. this.setDragElPos(E, D);
  7989. Ext.fly(A).show()
  7990. },
  7991. _resizeProxy : function() {
  7992. if (this.resizeFrame) {
  7993. var A = this.getEl();
  7994. Ext.fly(this.getDragEl()).setSize(A.offsetWidth,
  7995. A.offsetHeight)
  7996. }
  7997. },
  7998. b4MouseDown : function(B) {
  7999. var A = B.getPageX();
  8000. var C = B.getPageY();
  8001. this.autoOffset(A, C);
  8002. this.setDragElPos(A, C)
  8003. },
  8004. b4StartDrag : function(A, B) {
  8005. this.showFrame(A, B)
  8006. },
  8007. b4EndDrag : function(A) {
  8008. Ext.fly(this.getDragEl()).hide()
  8009. },
  8010. endDrag : function(C) {
  8011. var B = this.getEl();
  8012. var A = this.getDragEl();
  8013. A.style.visibility = "";
  8014. this.beforeMove();
  8015. B.style.visibility = "hidden";
  8016. Ext.dd.DDM.moveToEl(B, A);
  8017. A.style.visibility = "hidden";
  8018. B.style.visibility = "";
  8019. this.afterDrag()
  8020. },
  8021. beforeMove : function() {
  8022. },
  8023. afterDrag : function() {
  8024. },
  8025. toString : function() {
  8026. return ("DDProxy " + this.id)
  8027. }
  8028. });
  8029. Ext.dd.DDTarget = function(C, A, B) {
  8030. if (C) {
  8031. this.initTarget(C, A, B)
  8032. }
  8033. };
  8034. Ext.extend(Ext.dd.DDTarget, Ext.dd.DragDrop, {
  8035. toString : function() {
  8036. return ("DDTarget " + this.id)
  8037. }
  8038. });
  8039. Ext.dd.DragTracker = function(A) {
  8040. Ext.apply(this, A);
  8041. this.addEvents("mousedown", "mouseup", "mousemove", "dragstart", "dragend",
  8042. "drag");
  8043. this.dragRegion = new Ext.lib.Region(0, 0, 0, 0);
  8044. if (this.el) {
  8045. this.initEl(this.el)
  8046. }
  8047. };
  8048. Ext.extend(Ext.dd.DragTracker, Ext.util.Observable, {
  8049. active : false,
  8050. tolerance : 5,
  8051. autoStart : false,
  8052. initEl : function(A) {
  8053. this.el = Ext.get(A);
  8054. A.on("mousedown", this.onMouseDown, this, this.delegate ? {
  8055. delegate : this.delegate
  8056. } : undefined)
  8057. },
  8058. destroy : function() {
  8059. this.el.un("mousedown", this.onMouseDown, this)
  8060. },
  8061. onMouseDown : function(C, B) {
  8062. if (this.fireEvent("mousedown", this, C) !== false
  8063. && this.onBeforeStart(C) !== false) {
  8064. this.startXY = this.lastXY = C.getXY();
  8065. this.dragTarget = this.delegate ? B : this.el.dom;
  8066. C.preventDefault();
  8067. var A = Ext.getDoc();
  8068. A.on("mouseup", this.onMouseUp, this);
  8069. A.on("mousemove", this.onMouseMove, this);
  8070. A.on("selectstart", this.stopSelect, this);
  8071. if (this.autoStart) {
  8072. this.timer = this.triggerStart
  8073. .defer( this.autoStart === true
  8074. ? 1000
  8075. : this.autoStart, this)
  8076. }
  8077. }
  8078. },
  8079. onMouseMove : function(D, C) {
  8080. D.preventDefault();
  8081. var B = D.getXY(), A = this.startXY;
  8082. this.lastXY = B;
  8083. if (!this.active) {
  8084. if (Math.abs(A[0] - B[0]) > this.tolerance
  8085. || Math.abs(A[1] - B[1]) > this.tolerance) {
  8086. this.triggerStart()
  8087. } else {
  8088. return
  8089. }
  8090. }
  8091. this.fireEvent("mousemove", this, D);
  8092. this.onDrag(D);
  8093. this.fireEvent("drag", this, D)
  8094. },
  8095. onMouseUp : function(B) {
  8096. var A = Ext.getDoc();
  8097. A.un("mousemove", this.onMouseMove, this);
  8098. A.un("mouseup", this.onMouseUp, this);
  8099. A.un("selectstart", this.stopSelect, this);
  8100. B.preventDefault();
  8101. this.clearStart();
  8102. this.active = false;
  8103. delete this.elRegion;
  8104. this.fireEvent("mouseup", this, B);
  8105. this.onEnd(B);
  8106. this.fireEvent("dragend", this, B)
  8107. },
  8108. triggerStart : function(A) {
  8109. this.clearStart();
  8110. this.active = true;
  8111. this.onStart(this.startXY);
  8112. this.fireEvent("dragstart", this, this.startXY)
  8113. },
  8114. clearStart : function() {
  8115. if (this.timer) {
  8116. clearTimeout(this.timer);
  8117. delete this.timer
  8118. }
  8119. },
  8120. stopSelect : function(A) {
  8121. A.stopEvent();
  8122. return false
  8123. },
  8124. onBeforeStart : function(A) {
  8125. },
  8126. onStart : function(A) {
  8127. },
  8128. onDrag : function(A) {
  8129. },
  8130. onEnd : function(A) {
  8131. },
  8132. getDragTarget : function() {
  8133. return this.dragTarget
  8134. },
  8135. getDragCt : function() {
  8136. return this.el
  8137. },
  8138. getXY : function(A) {
  8139. return A
  8140. ? this.constrainModes[A].call(this, this.lastXY)
  8141. : this.lastXY
  8142. },
  8143. getOffset : function(C) {
  8144. var B = this.getXY(C);
  8145. var A = this.startXY;
  8146. return [A[0] - B[0], A[1] - B[1]]
  8147. },
  8148. constrainModes : {
  8149. "point" : function(B) {
  8150. if (!this.elRegion) {
  8151. this.elRegion = this.getDragCt().getRegion()
  8152. }
  8153. var A = this.dragRegion;
  8154. A.left = B[0];
  8155. A.top = B[1];
  8156. A.right = B[0];
  8157. A.bottom = B[1];
  8158. A.constrainTo(this.elRegion);
  8159. return [A.left, A.top]
  8160. }
  8161. }
  8162. });
  8163. Ext.dd.ScrollManager = function() {
  8164. var C = Ext.dd.DragDropMgr;
  8165. var E = {};
  8166. var B = null;
  8167. var H = {};
  8168. var G = function(K) {
  8169. B = null;
  8170. A()
  8171. };
  8172. var I = function() {
  8173. if (C.dragCurrent) {
  8174. C.refreshCache(C.dragCurrent.groups)
  8175. }
  8176. };
  8177. var D = function() {
  8178. if (C.dragCurrent) {
  8179. var K = Ext.dd.ScrollManager;
  8180. var L = H.el.ddScrollConfig
  8181. ? H.el.ddScrollConfig.increment
  8182. : K.increment;
  8183. if (!K.animate) {
  8184. if (H.el.scroll(H.dir, L)) {
  8185. I()
  8186. }
  8187. } else {
  8188. H.el.scroll(H.dir, L, true, K.animDuration, I)
  8189. }
  8190. }
  8191. };
  8192. var A = function() {
  8193. if (H.id) {
  8194. clearInterval(H.id)
  8195. }
  8196. H.id = 0;
  8197. H.el = null;
  8198. H.dir = ""
  8199. };
  8200. var F = function(L, K) {
  8201. A();
  8202. H.el = L;
  8203. H.dir = K;
  8204. H.id = setInterval(D, Ext.dd.ScrollManager.frequency)
  8205. };
  8206. var J = function(N, P) {
  8207. if (P || !C.dragCurrent) {
  8208. return
  8209. }
  8210. var Q = Ext.dd.ScrollManager;
  8211. if (!B || B != C.dragCurrent) {
  8212. B = C.dragCurrent;
  8213. Q.refreshCache()
  8214. }
  8215. var R = Ext.lib.Event.getXY(N);
  8216. var S = new Ext.lib.Point(R[0], R[1]);
  8217. for (var L in E) {
  8218. var M = E[L], K = M._region;
  8219. var O = M.ddScrollConfig ? M.ddScrollConfig : Q;
  8220. if (K && K.contains(S) && M.isScrollable()) {
  8221. if (K.bottom - S.y <= O.vthresh) {
  8222. if (H.el != M) {
  8223. F(M, "down")
  8224. }
  8225. return
  8226. } else {
  8227. if (K.right - S.x <= O.hthresh) {
  8228. if (H.el != M) {
  8229. F(M, "left")
  8230. }
  8231. return
  8232. } else {
  8233. if (S.y - K.top <= O.vthresh) {
  8234. if (H.el != M) {
  8235. F(M, "up")
  8236. }
  8237. return
  8238. } else {
  8239. if (S.x - K.left <= O.hthresh) {
  8240. if (H.el != M) {
  8241. F(M, "right")
  8242. }
  8243. return
  8244. }
  8245. }
  8246. }
  8247. }
  8248. }
  8249. }
  8250. A()
  8251. };
  8252. C.fireEvents = C.fireEvents.createSequence(J, C);
  8253. C.stopDrag = C.stopDrag.createSequence(G, C);
  8254. return {
  8255. register : function(M) {
  8256. if (Ext.isArray(M)) {
  8257. for (var L = 0, K = M.length; L < K; L++) {
  8258. this.register(M[L])
  8259. }
  8260. } else {
  8261. M = Ext.get(M);
  8262. E[M.id] = M
  8263. }
  8264. },
  8265. unregister : function(M) {
  8266. if (Ext.isArray(M)) {
  8267. for (var L = 0, K = M.length; L < K; L++) {
  8268. this.unregister(M[L])
  8269. }
  8270. } else {
  8271. M = Ext.get(M);
  8272. delete E[M.id]
  8273. }
  8274. },
  8275. vthresh : 25,
  8276. hthresh : 25,
  8277. increment : 100,
  8278. frequency : 500,
  8279. animate : true,
  8280. animDuration : 0.4,
  8281. refreshCache : function() {
  8282. for (var K in E) {
  8283. if (typeof E[K] == "object") {
  8284. E[K]._region = E[K].getRegion()
  8285. }
  8286. }
  8287. }
  8288. }
  8289. }();
  8290. Ext.dd.Registry = function() {
  8291. var D = {};
  8292. var B = {};
  8293. var A = 0;
  8294. var C = function(F, E) {
  8295. if (typeof F == "string") {
  8296. return F
  8297. }
  8298. var G = F.id;
  8299. if (!G && E !== false) {
  8300. G = "extdd-" + (++A);
  8301. F.id = G
  8302. }
  8303. return G
  8304. };
  8305. return {
  8306. register : function(H, I) {
  8307. I = I || {};
  8308. if (typeof H == "string") {
  8309. H = document.getElementById(H)
  8310. }
  8311. I.ddel = H;
  8312. D[C(H)] = I;
  8313. if (I.isHandle !== false) {
  8314. B[I.ddel.id] = I
  8315. }
  8316. if (I.handles) {
  8317. var G = I.handles;
  8318. for (var F = 0, E = G.length; F < E; F++) {
  8319. B[C(G[F])] = I
  8320. }
  8321. }
  8322. },
  8323. unregister : function(H) {
  8324. var J = C(H, false);
  8325. var I = D[J];
  8326. if (I) {
  8327. delete D[J];
  8328. if (I.handles) {
  8329. var G = I.handles;
  8330. for (var F = 0, E = G.length; F < E; F++) {
  8331. delete B[C(G[F], false)]
  8332. }
  8333. }
  8334. }
  8335. },
  8336. getHandle : function(E) {
  8337. if (typeof E != "string") {
  8338. E = E.id
  8339. }
  8340. return B[E]
  8341. },
  8342. getHandleFromEvent : function(F) {
  8343. var E = Ext.lib.Event.getTarget(F);
  8344. return E ? B[E.id] : null
  8345. },
  8346. getTarget : function(E) {
  8347. if (typeof E != "string") {
  8348. E = E.id
  8349. }
  8350. return D[E]
  8351. },
  8352. getTargetFromEvent : function(F) {
  8353. var E = Ext.lib.Event.getTarget(F);
  8354. return E ? D[E.id] || B[E.id] : null
  8355. }
  8356. }
  8357. }();
  8358. Ext.dd.StatusProxy = function(A) {
  8359. Ext.apply(this, A);
  8360. this.id = this.id || Ext.id();
  8361. this.el = new Ext.Layer({
  8362. dh : {
  8363. id : this.id,
  8364. tag : "div",
  8365. cls : "x-dd-drag-proxy " + this.dropNotAllowed,
  8366. children : [{
  8367. tag : "div",
  8368. cls : "x-dd-drop-icon"
  8369. }, {
  8370. tag : "div",
  8371. cls : "x-dd-drag-ghost"
  8372. }]
  8373. },
  8374. shadow : !A || A.shadow !== false
  8375. });
  8376. this.ghost = Ext.get(this.el.dom.childNodes[1]);
  8377. this.dropStatus = this.dropNotAllowed
  8378. };
  8379. Ext.dd.StatusProxy.prototype = {
  8380. dropAllowed : "x-dd-drop-ok",
  8381. dropNotAllowed : "x-dd-drop-nodrop",
  8382. setStatus : function(A) {
  8383. A = A || this.dropNotAllowed;
  8384. if (this.dropStatus != A) {
  8385. this.el.replaceClass(this.dropStatus, A);
  8386. this.dropStatus = A
  8387. }
  8388. },
  8389. reset : function(A) {
  8390. this.el.dom.className = "x-dd-drag-proxy " + this.dropNotAllowed;
  8391. this.dropStatus = this.dropNotAllowed;
  8392. if (A) {
  8393. this.ghost.update("")
  8394. }
  8395. },
  8396. update : function(A) {
  8397. if (typeof A == "string") {
  8398. this.ghost.update(A)
  8399. } else {
  8400. this.ghost.update("");
  8401. A.style.margin = "0";
  8402. this.ghost.dom.appendChild(A)
  8403. }
  8404. },
  8405. getEl : function() {
  8406. return this.el
  8407. },
  8408. getGhost : function() {
  8409. return this.ghost
  8410. },
  8411. hide : function(A) {
  8412. this.el.hide();
  8413. if (A) {
  8414. this.reset(true)
  8415. }
  8416. },
  8417. stop : function() {
  8418. if (this.anim && this.anim.isAnimated && this.anim.isAnimated()) {
  8419. this.anim.stop()
  8420. }
  8421. },
  8422. show : function() {
  8423. this.el.show()
  8424. },
  8425. sync : function() {
  8426. this.el.sync()
  8427. },
  8428. repair : function(B, C, A) {
  8429. this.callback = C;
  8430. this.scope = A;
  8431. if (B && this.animRepair !== false) {
  8432. this.el.addClass("x-dd-drag-repair");
  8433. this.el.hideUnders(true);
  8434. this.anim = this.el.shift({
  8435. duration : this.repairDuration || 0.5,
  8436. easing : "easeOut",
  8437. xy : B,
  8438. stopFx : true,
  8439. callback : this.afterRepair,
  8440. scope : this
  8441. })
  8442. } else {
  8443. this.afterRepair()
  8444. }
  8445. },
  8446. afterRepair : function() {
  8447. this.hide(true);
  8448. if (typeof this.callback == "function") {
  8449. this.callback.call(this.scope || this)
  8450. }
  8451. this.callback = null;
  8452. this.scope = null
  8453. }
  8454. };
  8455. Ext.dd.DragSource = function(B, A) {
  8456. this.el = Ext.get(B);
  8457. if (!this.dragData) {
  8458. this.dragData = {}
  8459. }
  8460. Ext.apply(this, A);
  8461. if (!this.proxy) {
  8462. this.proxy = new Ext.dd.StatusProxy()
  8463. }
  8464. Ext.dd.DragSource.superclass.constructor.call(this, this.el.dom,
  8465. this.ddGroup || this.group, {
  8466. dragElId : this.proxy.id,
  8467. resizeFrame : false,
  8468. isTarget : false,
  8469. scroll : this.scroll === true
  8470. });
  8471. this.dragging = false
  8472. };
  8473. Ext.extend(Ext.dd.DragSource, Ext.dd.DDProxy, {
  8474. dropAllowed : "x-dd-drop-ok",
  8475. dropNotAllowed : "x-dd-drop-nodrop",
  8476. getDragData : function(A) {
  8477. return this.dragData
  8478. },
  8479. onDragEnter : function(C, D) {
  8480. var B = Ext.dd.DragDropMgr.getDDById(D);
  8481. this.cachedTarget = B;
  8482. if (this.beforeDragEnter(B, C, D) !== false) {
  8483. if (B.isNotifyTarget) {
  8484. var A = B.notifyEnter(this, C, this.dragData);
  8485. this.proxy.setStatus(A)
  8486. } else {
  8487. this.proxy.setStatus(this.dropAllowed)
  8488. }
  8489. if (this.afterDragEnter) {
  8490. this.afterDragEnter(B, C, D)
  8491. }
  8492. }
  8493. },
  8494. beforeDragEnter : function(B, A, C) {
  8495. return true
  8496. },
  8497. alignElWithMouse : function() {
  8498. Ext.dd.DragSource.superclass.alignElWithMouse.apply(this,
  8499. arguments);
  8500. this.proxy.sync()
  8501. },
  8502. onDragOver : function(C, D) {
  8503. var B = this.cachedTarget || Ext.dd.DragDropMgr.getDDById(D);
  8504. if (this.beforeDragOver(B, C, D) !== false) {
  8505. if (B.isNotifyTarget) {
  8506. var A = B.notifyOver(this, C, this.dragData);
  8507. this.proxy.setStatus(A)
  8508. }
  8509. if (this.afterDragOver) {
  8510. this.afterDragOver(B, C, D)
  8511. }
  8512. }
  8513. },
  8514. beforeDragOver : function(B, A, C) {
  8515. return true
  8516. },
  8517. onDragOut : function(B, C) {
  8518. var A = this.cachedTarget || Ext.dd.DragDropMgr.getDDById(C);
  8519. if (this.beforeDragOut(A, B, C) !== false) {
  8520. if (A.isNotifyTarget) {
  8521. A.notifyOut(this, B, this.dragData)
  8522. }
  8523. this.proxy.reset();
  8524. if (this.afterDragOut) {
  8525. this.afterDragOut(A, B, C)
  8526. }
  8527. }
  8528. this.cachedTarget = null
  8529. },
  8530. beforeDragOut : function(B, A, C) {
  8531. return true
  8532. },
  8533. onDragDrop : function(B, C) {
  8534. var A = this.cachedTarget || Ext.dd.DragDropMgr.getDDById(C);
  8535. if (this.beforeDragDrop(A, B, C) !== false) {
  8536. if (A.isNotifyTarget) {
  8537. if (A.notifyDrop(this, B, this.dragData)) {
  8538. this.onValidDrop(A, B, C)
  8539. } else {
  8540. this.onInvalidDrop(A, B, C)
  8541. }
  8542. } else {
  8543. this.onValidDrop(A, B, C)
  8544. }
  8545. if (this.afterDragDrop) {
  8546. this.afterDragDrop(A, B, C)
  8547. }
  8548. }
  8549. delete this.cachedTarget
  8550. },
  8551. beforeDragDrop : function(B, A, C) {
  8552. return true
  8553. },
  8554. onValidDrop : function(B, A, C) {
  8555. this.hideProxy();
  8556. if (this.afterValidDrop) {
  8557. this.afterValidDrop(B, A, C)
  8558. }
  8559. },
  8560. getRepairXY : function(B, A) {
  8561. return this.el.getXY()
  8562. },
  8563. onInvalidDrop : function(B, A, C) {
  8564. this.beforeInvalidDrop(B, A, C);
  8565. if (this.cachedTarget) {
  8566. if (this.cachedTarget.isNotifyTarget) {
  8567. this.cachedTarget.notifyOut(this, A, this.dragData)
  8568. }
  8569. this.cacheTarget = null
  8570. }
  8571. this.proxy.repair(this.getRepairXY(A, this.dragData),
  8572. this.afterRepair, this);
  8573. if (this.afterInvalidDrop) {
  8574. this.afterInvalidDrop(A, C)
  8575. }
  8576. },
  8577. afterRepair : function() {
  8578. if (Ext.enableFx) {
  8579. this.el.highlight(this.hlColor || "c3daf9")
  8580. }
  8581. this.dragging = false
  8582. },
  8583. beforeInvalidDrop : function(B, A, C) {
  8584. return true
  8585. },
  8586. handleMouseDown : function(B) {
  8587. if (this.dragging) {
  8588. return
  8589. }
  8590. var A = this.getDragData(B);
  8591. if (A && this.onBeforeDrag(A, B) !== false) {
  8592. this.dragData = A;
  8593. this.proxy.stop();
  8594. Ext.dd.DragSource.superclass.handleMouseDown.apply(this,
  8595. arguments)
  8596. }
  8597. },
  8598. onBeforeDrag : function(A, B) {
  8599. return true
  8600. },
  8601. onStartDrag : Ext.emptyFn,
  8602. startDrag : function(A, B) {
  8603. this.proxy.reset();
  8604. this.dragging = true;
  8605. this.proxy.update("");
  8606. this.onInitDrag(A, B);
  8607. this.proxy.show()
  8608. },
  8609. onInitDrag : function(A, C) {
  8610. var B = this.el.dom.cloneNode(true);
  8611. B.id = Ext.id();
  8612. this.proxy.update(B);
  8613. this.onStartDrag(A, C);
  8614. return true
  8615. },
  8616. getProxy : function() {
  8617. return this.proxy
  8618. },
  8619. hideProxy : function() {
  8620. this.proxy.hide();
  8621. this.proxy.reset(true);
  8622. this.dragging = false
  8623. },
  8624. triggerCacheRefresh : function() {
  8625. Ext.dd.DDM.refreshCache(this.groups)
  8626. },
  8627. b4EndDrag : function(A) {
  8628. },
  8629. endDrag : function(A) {
  8630. this.onEndDrag(this.dragData, A)
  8631. },
  8632. onEndDrag : function(A, B) {
  8633. },
  8634. autoOffset : function(A, B) {
  8635. this.setDelta(-12, -20)
  8636. }
  8637. });
  8638. Ext.dd.DropTarget = function(B, A) {
  8639. this.el = Ext.get(B);
  8640. Ext.apply(this, A);
  8641. if (this.containerScroll) {
  8642. Ext.dd.ScrollManager.register(this.el)
  8643. }
  8644. Ext.dd.DropTarget.superclass.constructor.call(this, this.el.dom,
  8645. this.ddGroup || this.group, {
  8646. isTarget : true
  8647. })
  8648. };
  8649. Ext.extend(Ext.dd.DropTarget, Ext.dd.DDTarget, {
  8650. dropAllowed : "x-dd-drop-ok",
  8651. dropNotAllowed : "x-dd-drop-nodrop",
  8652. isTarget : true,
  8653. isNotifyTarget : true,
  8654. notifyEnter : function(A, C, B) {
  8655. if (this.overClass) {
  8656. this.el.addClass(this.overClass)
  8657. }
  8658. return this.dropAllowed
  8659. },
  8660. notifyOver : function(A, C, B) {
  8661. return this.dropAllowed
  8662. },
  8663. notifyOut : function(A, C, B) {
  8664. if (this.overClass) {
  8665. this.el.removeClass(this.overClass)
  8666. }
  8667. },
  8668. notifyDrop : function(A, C, B) {
  8669. return false
  8670. }
  8671. });
  8672. Ext.dd.DragZone = function(B, A) {
  8673. Ext.dd.DragZone.superclass.constructor.call(this, B, A);
  8674. if (this.containerScroll) {
  8675. Ext.dd.ScrollManager.register(this.el)
  8676. }
  8677. };
  8678. Ext.extend(Ext.dd.DragZone, Ext.dd.DragSource, {
  8679. getDragData : function(A) {
  8680. return Ext.dd.Registry.getHandleFromEvent(A)
  8681. },
  8682. onInitDrag : function(A, B) {
  8683. this.proxy.update(this.dragData.ddel.cloneNode(true));
  8684. this.onStartDrag(A, B);
  8685. return true
  8686. },
  8687. afterRepair : function() {
  8688. if (Ext.enableFx) {
  8689. Ext.Element.fly(this.dragData.ddel).highlight(this.hlColor
  8690. || "c3daf9")
  8691. }
  8692. this.dragging = false
  8693. },
  8694. getRepairXY : function(A) {
  8695. return Ext.Element.fly(this.dragData.ddel).getXY()
  8696. }
  8697. });
  8698. Ext.dd.DropZone = function(B, A) {
  8699. Ext.dd.DropZone.superclass.constructor.call(this, B, A)
  8700. };
  8701. Ext.extend(Ext.dd.DropZone, Ext.dd.DropTarget, {
  8702. getTargetFromEvent : function(A) {
  8703. return Ext.dd.Registry.getTargetFromEvent(A)
  8704. },
  8705. onNodeEnter : function(D, A, C, B) {
  8706. },
  8707. onNodeOver : function(D, A, C, B) {
  8708. return this.dropAllowed
  8709. },
  8710. onNodeOut : function(D, A, C, B) {
  8711. },
  8712. onNodeDrop : function(D, A, C, B) {
  8713. return false
  8714. },
  8715. onContainerOver : function(A, C, B) {
  8716. return this.dropNotAllowed
  8717. },
  8718. onContainerDrop : function(A, C, B) {
  8719. return false
  8720. },
  8721. notifyEnter : function(A, C, B) {
  8722. return this.dropNotAllowed
  8723. },
  8724. notifyOver : function(A, C, B) {
  8725. var D = this.getTargetFromEvent(C);
  8726. if (!D) {
  8727. if (this.lastOverNode) {
  8728. this.onNodeOut(this.lastOverNode, A, C, B);
  8729. this.lastOverNode = null
  8730. }
  8731. return this.onContainerOver(A, C, B)
  8732. }
  8733. if (this.lastOverNode != D) {
  8734. if (this.lastOverNode) {
  8735. this.onNodeOut(this.lastOverNode, A, C, B)
  8736. }
  8737. this.onNodeEnter(D, A, C, B);
  8738. this.lastOverNode = D
  8739. }
  8740. return this.onNodeOver(D, A, C, B)
  8741. },
  8742. notifyOut : function(A, C, B) {
  8743. if (this.lastOverNode) {
  8744. this.onNodeOut(this.lastOverNode, A, C, B);
  8745. this.lastOverNode = null
  8746. }
  8747. },
  8748. notifyDrop : function(A, C, B) {
  8749. if (this.lastOverNode) {
  8750. this.onNodeOut(this.lastOverNode, A, C, B);
  8751. this.lastOverNode = null
  8752. }
  8753. var D = this.getTargetFromEvent(C);
  8754. return D ? this.onNodeDrop(D, A, C, B) : this.onContainerDrop(
  8755. A, C, B)
  8756. },
  8757. triggerCacheRefresh : function() {
  8758. Ext.dd.DDM.refreshCache(this.groups)
  8759. }
  8760. });
  8761. Ext.data.SortTypes = {
  8762. none : function(A) {
  8763. return A
  8764. },
  8765. stripTagsRE : /<\/?[^>]+>/gi,
  8766. asText : function(A) {
  8767. return String(A).replace(this.stripTagsRE, "")
  8768. },
  8769. asUCText : function(A) {
  8770. return String(A).toUpperCase().replace(this.stripTagsRE, "")
  8771. },
  8772. asUCString : function(A) {
  8773. return String(A).toUpperCase()
  8774. },
  8775. asDate : function(A) {
  8776. if (!A) {
  8777. return 0
  8778. }
  8779. if (Ext.isDate(A)) {
  8780. return A.getTime()
  8781. }
  8782. return Date.parse(String(A))
  8783. },
  8784. asFloat : function(A) {
  8785. var B = parseFloat(String(A).replace(/,/g, ""));
  8786. if (isNaN(B)) {
  8787. B = 0
  8788. }
  8789. return B
  8790. },
  8791. asInt : function(A) {
  8792. var B = parseInt(String(A).replace(/,/g, ""));
  8793. if (isNaN(B)) {
  8794. B = 0
  8795. }
  8796. return B
  8797. }
  8798. };
  8799. Ext.data.Record = function(A, B) {
  8800. this.id = (B || B === 0) ? B : ++Ext.data.Record.AUTO_ID;
  8801. this.data = A
  8802. };
  8803. Ext.data.Record.create = function(E) {
  8804. var C = Ext.extend(Ext.data.Record, {});
  8805. var D = C.prototype;
  8806. D.fields = new Ext.util.MixedCollection(false, function(F) {
  8807. return F.name
  8808. });
  8809. for (var B = 0, A = E.length; B < A; B++) {
  8810. D.fields.add(new Ext.data.Field(E[B]))
  8811. }
  8812. C.getField = function(F) {
  8813. return D.fields.get(F)
  8814. };
  8815. return C
  8816. };
  8817. Ext.data.Record.AUTO_ID = 1000;
  8818. Ext.data.Record.EDIT = "edit";
  8819. Ext.data.Record.REJECT = "reject";
  8820. Ext.data.Record.COMMIT = "commit";
  8821. Ext.data.Record.prototype = {
  8822. dirty : false,
  8823. editing : false,
  8824. error : null,
  8825. modified : null,
  8826. join : function(A) {
  8827. this.store = A
  8828. },
  8829. set : function(A, B) {
  8830. if (String(this.data[A]) == String(B)) {
  8831. return
  8832. }
  8833. this.dirty = true;
  8834. if (!this.modified) {
  8835. this.modified = {}
  8836. }
  8837. if (typeof this.modified[A] == "undefined") {
  8838. this.modified[A] = this.data[A]
  8839. }
  8840. this.data[A] = B;
  8841. if (!this.editing && this.store) {
  8842. this.store.afterEdit(this)
  8843. }
  8844. },
  8845. get : function(A) {
  8846. return this.data[A]
  8847. },
  8848. beginEdit : function() {
  8849. this.editing = true;
  8850. this.modified = {}
  8851. },
  8852. cancelEdit : function() {
  8853. this.editing = false;
  8854. delete this.modified
  8855. },
  8856. endEdit : function() {
  8857. this.editing = false;
  8858. if (this.dirty && this.store) {
  8859. this.store.afterEdit(this)
  8860. }
  8861. },
  8862. reject : function(B) {
  8863. var A = this.modified;
  8864. for (var C in A) {
  8865. if (typeof A[C] != "function") {
  8866. this.data[C] = A[C]
  8867. }
  8868. }
  8869. this.dirty = false;
  8870. delete this.modified;
  8871. this.editing = false;
  8872. if (this.store && B !== true) {
  8873. this.store.afterReject(this)
  8874. }
  8875. },
  8876. commit : function(A) {
  8877. this.dirty = false;
  8878. delete this.modified;
  8879. this.editing = false;
  8880. if (this.store && A !== true) {
  8881. this.store.afterCommit(this)
  8882. }
  8883. },
  8884. getChanges : function() {
  8885. var A = this.modified, B = {};
  8886. for (var C in A) {
  8887. if (A.hasOwnProperty(C)) {
  8888. B[C] = this.data[C]
  8889. }
  8890. }
  8891. return B
  8892. },
  8893. hasError : function() {
  8894. return this.error != null
  8895. },
  8896. clearError : function() {
  8897. this.error = null
  8898. },
  8899. copy : function(A) {
  8900. return new this.constructor(Ext.apply({}, this.data), A || this.id)
  8901. },
  8902. isModified : function(A) {
  8903. return this.modified && this.modified.hasOwnProperty(A)
  8904. }
  8905. };
  8906. Ext.StoreMgr = Ext.apply(new Ext.util.MixedCollection(), {
  8907. register : function() {
  8908. for (var A = 0, B; B = arguments[A]; A++) {
  8909. this.add(B)
  8910. }
  8911. },
  8912. unregister : function() {
  8913. for (var A = 0, B; B = arguments[A]; A++) {
  8914. this.remove(this.lookup(B))
  8915. }
  8916. },
  8917. lookup : function(A) {
  8918. return typeof A == "object" ? A : this.get(A)
  8919. },
  8920. getKey : function(A) {
  8921. return A.storeId || A.id
  8922. }
  8923. });
  8924. Ext.data.Store = function(A) {
  8925. this.data = new Ext.util.MixedCollection(false);
  8926. this.data.getKey = function(B) {
  8927. return B.id
  8928. };
  8929. this.baseParams = {};
  8930. this.paramNames = {
  8931. "start" : "start",
  8932. "limit" : "limit",
  8933. "sort" : "sort",
  8934. "dir" : "dir"
  8935. };
  8936. if (A && A.data) {
  8937. this.inlineData = A.data;
  8938. delete A.data
  8939. }
  8940. Ext.apply(this, A);
  8941. if (this.url && !this.proxy) {
  8942. this.proxy = new Ext.data.HttpProxy({
  8943. url : this.url
  8944. })
  8945. }
  8946. if (this.reader) {
  8947. if (!this.recordType) {
  8948. this.recordType = this.reader.recordType
  8949. }
  8950. if (this.reader.onMetaChange) {
  8951. this.reader.onMetaChange = this.onMetaChange.createDelegate(this)
  8952. }
  8953. }
  8954. if (this.recordType) {
  8955. this.fields = this.recordType.prototype.fields
  8956. }
  8957. this.modified = [];
  8958. this.addEvents("datachanged", "metachange", "add", "remove", "update",
  8959. "clear", "beforeload", "load", "loadexception");
  8960. if (this.proxy) {
  8961. this.relayEvents(this.proxy, ["loadexception"])
  8962. }
  8963. this.sortToggle = {};
  8964. if (this.sortInfo) {
  8965. this.setDefaultSort(this.sortInfo.field, this.sortInfo.direction)
  8966. }
  8967. Ext.data.Store.superclass.constructor.call(this);
  8968. if (this.storeId || this.id) {
  8969. Ext.StoreMgr.register(this)
  8970. }
  8971. if (this.inlineData) {
  8972. this.loadData(this.inlineData);
  8973. delete this.inlineData
  8974. } else {
  8975. if (this.autoLoad) {
  8976. this.load.defer(10, this, [typeof this.autoLoad == "object"
  8977. ? this.autoLoad
  8978. : undefined])
  8979. }
  8980. }
  8981. };
  8982. Ext.extend(Ext.data.Store, Ext.util.Observable, {
  8983. remoteSort : false,
  8984. pruneModifiedRecords : false,
  8985. lastOptions : null,
  8986. destroy : function() {
  8987. if (this.id) {
  8988. Ext.StoreMgr.unregister(this)
  8989. }
  8990. this.data = null;
  8991. this.purgeListeners()
  8992. },
  8993. add : function(B) {
  8994. B = [].concat(B);
  8995. if (B.length < 1) {
  8996. return
  8997. }
  8998. for (var D = 0, A = B.length; D < A; D++) {
  8999. B[D].join(this)
  9000. }
  9001. var C = this.data.length;
  9002. this.data.addAll(B);
  9003. if (this.snapshot) {
  9004. this.snapshot.addAll(B)
  9005. }
  9006. this.fireEvent("add", this, B, C)
  9007. },
  9008. addSorted : function(A) {
  9009. var B = this.findInsertIndex(A);
  9010. this.insert(B, A)
  9011. },
  9012. remove : function(A) {
  9013. var B = this.data.indexOf(A);
  9014. this.data.removeAt(B);
  9015. if (this.pruneModifiedRecords) {
  9016. this.modified.remove(A)
  9017. }
  9018. if (this.snapshot) {
  9019. this.snapshot.remove(A)
  9020. }
  9021. this.fireEvent("remove", this, A, B)
  9022. },
  9023. removeAll : function() {
  9024. this.data.clear();
  9025. if (this.snapshot) {
  9026. this.snapshot.clear()
  9027. }
  9028. if (this.pruneModifiedRecords) {
  9029. this.modified = []
  9030. }
  9031. this.fireEvent("clear", this)
  9032. },
  9033. insert : function(C, B) {
  9034. B = [].concat(B);
  9035. for (var D = 0, A = B.length; D < A; D++) {
  9036. this.data.insert(C, B[D]);
  9037. B[D].join(this)
  9038. }
  9039. this.fireEvent("add", this, B, C)
  9040. },
  9041. indexOf : function(A) {
  9042. return this.data.indexOf(A)
  9043. },
  9044. indexOfId : function(A) {
  9045. return this.data.indexOfKey(A)
  9046. },
  9047. getById : function(A) {
  9048. return this.data.key(A)
  9049. },
  9050. getAt : function(A) {
  9051. return this.data.itemAt(A)
  9052. },
  9053. getRange : function(B, A) {
  9054. return this.data.getRange(B, A)
  9055. },
  9056. storeOptions : function(A) {
  9057. A = Ext.apply({}, A);
  9058. delete A.callback;
  9059. delete A.scope;
  9060. this.lastOptions = A
  9061. },
  9062. load : function(B) {
  9063. B = B || {};
  9064. if (this.fireEvent("beforeload", this, B) !== false) {
  9065. this.storeOptions(B);
  9066. var C = Ext.apply(B.params || {}, this.baseParams);
  9067. if (this.sortInfo && this.remoteSort) {
  9068. var A = this.paramNames;
  9069. C[A["sort"]] = this.sortInfo.field;
  9070. C[A["dir"]] = this.sortInfo.direction
  9071. }
  9072. this.proxy.load(C, this.reader, this.loadRecords, this, B);
  9073. return true
  9074. } else {
  9075. return false
  9076. }
  9077. },
  9078. reload : function(A) {
  9079. this.load(Ext.applyIf(A || {}, this.lastOptions))
  9080. },
  9081. loadRecords : function(G, B, F) {
  9082. if (!G || F === false) {
  9083. if (F !== false) {
  9084. this.fireEvent("load", this, [], B)
  9085. }
  9086. if (B.callback) {
  9087. B.callback.call(B.scope || this, [], B, false)
  9088. }
  9089. return
  9090. }
  9091. var E = G.records, D = G.totalRecords || E.length;
  9092. if (!B || B.add !== true) {
  9093. if (this.pruneModifiedRecords) {
  9094. this.modified = []
  9095. }
  9096. for (var C = 0, A = E.length; C < A; C++) {
  9097. E[C].join(this)
  9098. }
  9099. if (this.snapshot) {
  9100. this.data = this.snapshot;
  9101. delete this.snapshot
  9102. }
  9103. this.data.clear();
  9104. this.data.addAll(E);
  9105. this.totalLength = D;
  9106. this.applySort();
  9107. this.fireEvent("datachanged", this)
  9108. } else {
  9109. this.totalLength = Math.max(D, this.data.length + E.length);
  9110. this.add(E)
  9111. }
  9112. this.fireEvent("load", this, E, B);
  9113. if (B.callback) {
  9114. B.callback.call(B.scope || this, E, B, true)
  9115. }
  9116. },
  9117. loadData : function(C, A) {
  9118. var B = this.reader.readRecords(C);
  9119. this.loadRecords(B, {
  9120. add : A
  9121. }, true)
  9122. },
  9123. getCount : function() {
  9124. return this.data.length || 0
  9125. },
  9126. getTotalCount : function() {
  9127. return this.totalLength || 0
  9128. },
  9129. getSortState : function() {
  9130. return this.sortInfo
  9131. },
  9132. applySort : function() {
  9133. if (this.sortInfo && !this.remoteSort) {
  9134. var A = this.sortInfo, B = A.field;
  9135. this.sortData(B, A.direction)
  9136. }
  9137. },
  9138. sortData : function(C, D) {
  9139. D = D || "ASC";
  9140. var A = this.fields.get(C).sortType;
  9141. var B = function(F, E) {
  9142. var H = A(F.data[C]), G = A(E.data[C]);
  9143. return H > G ? 1 : (H < G ? -1 : 0)
  9144. };
  9145. this.data.sort(D, B);
  9146. if (this.snapshot && this.snapshot != this.data) {
  9147. this.snapshot.sort(D, B)
  9148. }
  9149. },
  9150. setDefaultSort : function(B, A) {
  9151. A = A ? A.toUpperCase() : "ASC";
  9152. this.sortInfo = {
  9153. field : B,
  9154. direction : A
  9155. };
  9156. this.sortToggle[B] = A
  9157. },
  9158. sort : function(E, C) {
  9159. var D = this.fields.get(E);
  9160. if (!D) {
  9161. return false
  9162. }
  9163. if (!C) {
  9164. if (this.sortInfo && this.sortInfo.field == D.name) {
  9165. C = (this.sortToggle[D.name] || "ASC").toggle("ASC",
  9166. "DESC")
  9167. } else {
  9168. C = D.sortDir
  9169. }
  9170. }
  9171. var B = (this.sortToggle) ? this.sortToggle[D.name] : null;
  9172. var A = (this.sortInfo) ? this.sortInfo : null;
  9173. this.sortToggle[D.name] = C;
  9174. this.sortInfo = {
  9175. field : D.name,
  9176. direction : C
  9177. };
  9178. if (!this.remoteSort) {
  9179. this.applySort();
  9180. this.fireEvent("datachanged", this)
  9181. } else {
  9182. if (!this.load(this.lastOptions)) {
  9183. if (B) {
  9184. this.sortToggle[D.name] = B
  9185. }
  9186. if (A) {
  9187. this.sortInfo = A
  9188. }
  9189. }
  9190. }
  9191. },
  9192. each : function(B, A) {
  9193. this.data.each(B, A)
  9194. },
  9195. getModifiedRecords : function() {
  9196. return this.modified
  9197. },
  9198. createFilterFn : function(C, B, D, A) {
  9199. if (Ext.isEmpty(B, false)) {
  9200. return false
  9201. }
  9202. B = this.data.createValueMatcher(B, D, A);
  9203. return function(E) {
  9204. return B.test(E.data[C])
  9205. }
  9206. },
  9207. sum : function(E, F, A) {
  9208. var C = this.data.items, B = 0;
  9209. F = F || 0;
  9210. A = (A || A === 0) ? A : C.length - 1;
  9211. for (var D = F; D <= A; D++) {
  9212. B += (C[D].data[E] || 0)
  9213. }
  9214. return B
  9215. },
  9216. filter : function(D, C, E, A) {
  9217. var B = this.createFilterFn(D, C, E, A);
  9218. return B ? this.filterBy(B) : this.clearFilter()
  9219. },
  9220. filterBy : function(B, A) {
  9221. this.snapshot = this.snapshot || this.data;
  9222. this.data = this.queryBy(B, A || this);
  9223. this.fireEvent("datachanged", this)
  9224. },
  9225. query : function(D, C, E, A) {
  9226. var B = this.createFilterFn(D, C, E, A);
  9227. return B ? this.queryBy(B) : this.data.clone()
  9228. },
  9229. queryBy : function(B, A) {
  9230. var C = this.snapshot || this.data;
  9231. return C.filterBy(B, A || this)
  9232. },
  9233. find : function(D, C, F, E, A) {
  9234. var B = this.createFilterFn(D, C, E, A);
  9235. return B ? this.data.findIndexBy(B, null, F) : -1
  9236. },
  9237. findBy : function(B, A, C) {
  9238. return this.data.findIndexBy(B, A, C)
  9239. },
  9240. collect : function(G, H, B) {
  9241. var F = (B === true && this.snapshot)
  9242. ? this.snapshot.items
  9243. : this.data.items;
  9244. var I, J, A = [], C = {};
  9245. for (var D = 0, E = F.length; D < E; D++) {
  9246. I = F[D].data[G];
  9247. J = String(I);
  9248. if ((H || !Ext.isEmpty(I)) && !C[J]) {
  9249. C[J] = true;
  9250. A[A.length] = I
  9251. }
  9252. }
  9253. return A
  9254. },
  9255. clearFilter : function(A) {
  9256. if (this.isFiltered()) {
  9257. this.data = this.snapshot;
  9258. delete this.snapshot;
  9259. if (A !== true) {
  9260. this.fireEvent("datachanged", this)
  9261. }
  9262. }
  9263. },
  9264. isFiltered : function() {
  9265. return this.snapshot && this.snapshot != this.data
  9266. },
  9267. afterEdit : function(A) {
  9268. if (this.modified.indexOf(A) == -1) {
  9269. this.modified.push(A)
  9270. }
  9271. this.fireEvent("update", this, A, Ext.data.Record.EDIT)
  9272. },
  9273. afterReject : function(A) {
  9274. this.modified.remove(A);
  9275. this.fireEvent("update", this, A, Ext.data.Record.REJECT)
  9276. },
  9277. afterCommit : function(A) {
  9278. this.modified.remove(A);
  9279. this.fireEvent("update", this, A, Ext.data.Record.COMMIT)
  9280. },
  9281. commitChanges : function() {
  9282. var B = this.modified.slice(0);
  9283. this.modified = [];
  9284. for (var C = 0, A = B.length; C < A; C++) {
  9285. B[C].commit()
  9286. }
  9287. },
  9288. rejectChanges : function() {
  9289. var B = this.modified.slice(0);
  9290. this.modified = [];
  9291. for (var C = 0, A = B.length; C < A; C++) {
  9292. B[C].reject()
  9293. }
  9294. },
  9295. onMetaChange : function(B, A, C) {
  9296. this.recordType = A;
  9297. this.fields = A.prototype.fields;
  9298. delete this.snapshot;
  9299. this.sortInfo = B.sortInfo;
  9300. this.modified = [];
  9301. this.fireEvent("metachange", this, this.reader.meta)
  9302. },
  9303. findInsertIndex : function(A) {
  9304. this.suspendEvents();
  9305. var C = this.data.clone();
  9306. this.data.add(A);
  9307. this.applySort();
  9308. var B = this.data.indexOf(A);
  9309. this.data = C;
  9310. this.resumeEvents();
  9311. return B
  9312. }
  9313. });
  9314. Ext.data.SimpleStore = function(A) {
  9315. Ext.data.SimpleStore.superclass.constructor.call(this, Ext.apply(A, {
  9316. reader : new Ext.data.ArrayReader({
  9317. id : A.id
  9318. }, Ext.data.Record.create(A.fields))
  9319. }))
  9320. };
  9321. Ext.extend(Ext.data.SimpleStore, Ext.data.Store, {
  9322. loadData : function(E, B) {
  9323. if (this.expandData === true) {
  9324. var D = [];
  9325. for (var C = 0, A = E.length; C < A; C++) {
  9326. D[D.length] = [E[C]]
  9327. }
  9328. E = D
  9329. }
  9330. Ext.data.SimpleStore.superclass.loadData.call(this, E, B)
  9331. }
  9332. });
  9333. Ext.data.JsonStore = function(A) {
  9334. Ext.data.JsonStore.superclass.constructor.call(this, Ext.apply(A, {
  9335. proxy : !A.data ? new Ext.data.HttpProxy({
  9336. url : A.url
  9337. }) : undefined,
  9338. reader : new Ext.data.JsonReader(A, A.fields)
  9339. }))
  9340. };
  9341. Ext.extend(Ext.data.JsonStore, Ext.data.Store);
  9342. Ext.data.Field = function(D) {
  9343. if (typeof D == "string") {
  9344. D = {
  9345. name : D
  9346. }
  9347. }
  9348. Ext.apply(this, D);
  9349. if (!this.type) {
  9350. this.type = "auto"
  9351. }
  9352. var C = Ext.data.SortTypes;
  9353. if (typeof this.sortType == "string") {
  9354. this.sortType = C[this.sortType]
  9355. }
  9356. if (!this.sortType) {
  9357. switch (this.type) {
  9358. case "string" :
  9359. this.sortType = C.asUCString;
  9360. break;
  9361. case "date" :
  9362. this.sortType = C.asDate;
  9363. break;
  9364. default :
  9365. this.sortType = C.none
  9366. }
  9367. }
  9368. var E = /[\$,%]/g;
  9369. if (!this.convert) {
  9370. var B, A = this.dateFormat;
  9371. switch (this.type) {
  9372. case "" :
  9373. case "auto" :
  9374. case undefined :
  9375. B = function(F) {
  9376. return F
  9377. };
  9378. break;
  9379. case "string" :
  9380. B = function(F) {
  9381. return (F === undefined || F === null) ? "" : String(F)
  9382. };
  9383. break;
  9384. case "int" :
  9385. B = function(F) {
  9386. return F !== undefined && F !== null && F !== ""
  9387. ? parseInt(String(F).replace(E, ""), 10)
  9388. : ""
  9389. };
  9390. break;
  9391. case "float" :
  9392. B = function(F) {
  9393. return F !== undefined && F !== null && F !== ""
  9394. ? parseFloat(String(F).replace(E, ""), 10)
  9395. : ""
  9396. };
  9397. break;
  9398. case "bool" :
  9399. case "boolean" :
  9400. B = function(F) {
  9401. return F === true || F === "true" || F == 1
  9402. };
  9403. break;
  9404. case "date" :
  9405. B = function(G) {
  9406. if (!G) {
  9407. return ""
  9408. }
  9409. if (Ext.isDate(G)) {
  9410. return G
  9411. }
  9412. if (A) {
  9413. if (A == "timestamp") {
  9414. return new Date(G * 1000)
  9415. }
  9416. if (A == "time") {
  9417. return new Date(parseInt(G, 10))
  9418. }
  9419. return Date.parseDate(G, A)
  9420. }
  9421. var F = Date.parse(G);
  9422. return F ? new Date(F) : null
  9423. };
  9424. break
  9425. }
  9426. this.convert = B
  9427. }
  9428. };
  9429. Ext.data.Field.prototype = {
  9430. dateFormat : null,
  9431. defaultValue : "",
  9432. mapping : null,
  9433. sortType : null,
  9434. sortDir : "ASC"
  9435. };
  9436. Ext.data.DataReader = function(A, B) {
  9437. this.meta = A;
  9438. this.recordType = Ext.isArray(B) ? Ext.data.Record.create(B) : B
  9439. };
  9440. Ext.data.DataReader.prototype = {};
  9441. Ext.data.DataProxy = function() {
  9442. this.addEvents("beforeload", "load", "loadexception");
  9443. Ext.data.DataProxy.superclass.constructor.call(this)
  9444. };
  9445. Ext.extend(Ext.data.DataProxy, Ext.util.Observable);
  9446. Ext.data.MemoryProxy = function(A) {
  9447. Ext.data.MemoryProxy.superclass.constructor.call(this);
  9448. this.data = A
  9449. };
  9450. Ext.extend(Ext.data.MemoryProxy, Ext.data.DataProxy, {
  9451. load : function(F, C, G, D, B) {
  9452. F = F || {};
  9453. var A;
  9454. try {
  9455. A = C.readRecords(this.data)
  9456. } catch (E) {
  9457. this.fireEvent("loadexception", this, B, null, E);
  9458. G.call(D, null, B, false);
  9459. return
  9460. }
  9461. G.call(D, A, B, true)
  9462. },
  9463. update : function(B, A) {
  9464. }
  9465. });
  9466. Ext.data.HttpProxy = function(A) {
  9467. Ext.data.HttpProxy.superclass.constructor.call(this);
  9468. this.conn = A;
  9469. this.useAjax = !A || !A.events
  9470. };
  9471. Ext.extend(Ext.data.HttpProxy, Ext.data.DataProxy, {
  9472. getConnection : function() {
  9473. return this.useAjax ? Ext.Ajax : this.conn
  9474. },
  9475. load : function(E, B, F, C, A) {
  9476. if (this.fireEvent("beforeload", this, E) !== false) {
  9477. var D = {
  9478. params : E || {},
  9479. request : {
  9480. callback : F,
  9481. scope : C,
  9482. arg : A
  9483. },
  9484. reader : B,
  9485. callback : this.loadResponse,
  9486. scope : this
  9487. };
  9488. if (this.useAjax) {
  9489. Ext.applyIf(D, this.conn);
  9490. if (this.activeRequest) {
  9491. Ext.Ajax.abort(this.activeRequest)
  9492. }
  9493. this.activeRequest = Ext.Ajax.request(D)
  9494. } else {
  9495. this.conn.request(D)
  9496. }
  9497. } else {
  9498. F.call(C || this, null, A, false)
  9499. }
  9500. },
  9501. loadResponse : function(E, D, B) {
  9502. delete this.activeRequest;
  9503. if (!D) {
  9504. this.fireEvent("loadexception", this, E, B);
  9505. E.request.callback.call(E.request.scope, null,
  9506. E.request.arg, false);
  9507. return
  9508. }
  9509. var A;
  9510. try {
  9511. A = E.reader.read(B)
  9512. } catch (C) {
  9513. this.fireEvent("loadexception", this, E, B, C);
  9514. E.request.callback.call(E.request.scope, null,
  9515. E.request.arg, false);
  9516. return
  9517. }
  9518. this.fireEvent("load", this, E, E.request.arg);
  9519. E.request.callback
  9520. .call(E.request.scope, A, E.request.arg, true)
  9521. },
  9522. update : function(A) {
  9523. },
  9524. updateResponse : function(A) {
  9525. }
  9526. });
  9527. Ext.data.ScriptTagProxy = function(A) {
  9528. Ext.data.ScriptTagProxy.superclass.constructor.call(this);
  9529. Ext.apply(this, A);
  9530. this.head = document.getElementsByTagName("head")[0]
  9531. };
  9532. Ext.data.ScriptTagProxy.TRANS_ID = 1000;
  9533. Ext.extend(Ext.data.ScriptTagProxy, Ext.data.DataProxy, {
  9534. timeout : 30000,
  9535. callbackParam : "callback",
  9536. nocache : true,
  9537. load : function(E, F, H, I, J) {
  9538. if (this.fireEvent("beforeload", this, E) !== false) {
  9539. var C = Ext.urlEncode(Ext.apply(E, this.extraParams));
  9540. var B = this.url;
  9541. B += (B.indexOf("?") != -1 ? "&" : "?") + C;
  9542. if (this.nocache) {
  9543. B += "&_dc=" + (new Date().getTime())
  9544. }
  9545. var A = ++Ext.data.ScriptTagProxy.TRANS_ID;
  9546. var K = {
  9547. id : A,
  9548. cb : "stcCallback" + A,
  9549. scriptId : "stcScript" + A,
  9550. params : E,
  9551. arg : J,
  9552. url : B,
  9553. callback : H,
  9554. scope : I,
  9555. reader : F
  9556. };
  9557. var D = this;
  9558. window[K.cb] = function(L) {
  9559. D.handleResponse(L, K)
  9560. };
  9561. B += String.format("&{0}={1}", this.callbackParam, K.cb);
  9562. if (this.autoAbort !== false) {
  9563. this.abort()
  9564. }
  9565. K.timeoutId = this.handleFailure.defer(this.timeout, this,
  9566. [K]);
  9567. var G = document.createElement("script");
  9568. G.setAttribute("src", B);
  9569. G.setAttribute("type", "text/javascript");
  9570. G.setAttribute("id", K.scriptId);
  9571. this.head.appendChild(G);
  9572. this.trans = K
  9573. } else {
  9574. H.call(I || this, null, J, false)
  9575. }
  9576. },
  9577. isLoading : function() {
  9578. return this.trans ? true : false
  9579. },
  9580. abort : function() {
  9581. if (this.isLoading()) {
  9582. this.destroyTrans(this.trans)
  9583. }
  9584. },
  9585. destroyTrans : function(B, A) {
  9586. this.head.removeChild(document.getElementById(B.scriptId));
  9587. clearTimeout(B.timeoutId);
  9588. if (A) {
  9589. window[B.cb] = undefined;
  9590. try {
  9591. delete window[B.cb]
  9592. } catch (C) {
  9593. }
  9594. } else {
  9595. window[B.cb] = function() {
  9596. window[B.cb] = undefined;
  9597. try {
  9598. delete window[B.cb]
  9599. } catch (D) {
  9600. }
  9601. }
  9602. }
  9603. },
  9604. handleResponse : function(D, B) {
  9605. this.trans = false;
  9606. this.destroyTrans(B, true);
  9607. var A;
  9608. try {
  9609. A = B.reader.readRecords(D)
  9610. } catch (C) {
  9611. this.fireEvent("loadexception", this, D, B.arg, C);
  9612. B.callback.call(B.scope || window, null, B.arg, false);
  9613. return
  9614. }
  9615. this.fireEvent("load", this, D, B.arg);
  9616. B.callback.call(B.scope || window, A, B.arg, true)
  9617. },
  9618. handleFailure : function(A) {
  9619. this.trans = false;
  9620. this.destroyTrans(A, false);
  9621. this.fireEvent("loadexception", this, null, A.arg);
  9622. A.callback.call(A.scope || window, null, A.arg, false)
  9623. }
  9624. });
  9625. Ext.data.JsonReader = function(A, B) {
  9626. A = A || {};
  9627. Ext.data.JsonReader.superclass.constructor.call(this, A, B || A.fields)
  9628. };
  9629. Ext.extend(Ext.data.JsonReader, Ext.data.DataReader, {
  9630. read : function(response) {
  9631. var json = response.responseText;
  9632. var o = eval("(" + json + ")");
  9633. if (!o) {
  9634. throw {
  9635. message : "JsonReader.read: Json object not found"
  9636. }
  9637. }
  9638. if (o.metaData) {
  9639. delete this.ef;
  9640. this.meta = o.metaData;
  9641. this.recordType = Ext.data.Record.create(o.metaData.fields);
  9642. this.onMetaChange(this.meta, this.recordType, o)
  9643. }
  9644. return this.readRecords(o)
  9645. },
  9646. onMetaChange : function(A, C, B) {
  9647. },
  9648. simpleAccess : function(B, A) {
  9649. return B[A]
  9650. },
  9651. getJsonAccessor : function() {
  9652. var A = /[\[\.]/;
  9653. return function(C) {
  9654. try {
  9655. return (A.test(C))
  9656. ? new Function("obj", "return obj." + C)
  9657. : function(D) {
  9658. return D[C]
  9659. }
  9660. } catch (B) {
  9661. }
  9662. return Ext.emptyFn
  9663. }
  9664. }(),
  9665. readRecords : function(K) {
  9666. this.jsonData = K;
  9667. var H = this.meta, A = this.recordType, R = A.prototype.fields, F = R.items, E = R.length;
  9668. if (!this.ef) {
  9669. if (H.totalProperty) {
  9670. this.getTotal = this.getJsonAccessor(H.totalProperty)
  9671. }
  9672. if (H.successProperty) {
  9673. this.getSuccess = this.getJsonAccessor(H.successProperty)
  9674. }
  9675. this.getRoot = H.root ? this.getJsonAccessor(H.root) : function(U) {
  9676. return U
  9677. };
  9678. if (H.id) {
  9679. var Q = this.getJsonAccessor(H.id);
  9680. this.getId = function(V) {
  9681. var U = Q(V);
  9682. return (U === undefined || U === "") ? null : U
  9683. }
  9684. } else {
  9685. this.getId = function() {
  9686. return null
  9687. }
  9688. }
  9689. this.ef = [];
  9690. for (var O = 0; O < E; O++) {
  9691. R = F[O];
  9692. var T = (R.mapping !== undefined && R.mapping !== null)
  9693. ? R.mapping
  9694. : R.name;
  9695. this.ef[O] = this.getJsonAccessor(T)
  9696. }
  9697. }
  9698. var M = this.getRoot(K), S = M.length, I = S, D = true;
  9699. if (H.totalProperty) {
  9700. var G = parseInt(this.getTotal(K), 10);
  9701. if (!isNaN(G)) {
  9702. I = G
  9703. }
  9704. }
  9705. if (H.successProperty) {
  9706. var G = this.getSuccess(K);
  9707. if (G === false || G === "false") {
  9708. D = false
  9709. }
  9710. }
  9711. var P = [];
  9712. for (var O = 0; O < S; O++) {
  9713. var L = M[O];
  9714. var B = {};
  9715. var J = this.getId(L);
  9716. for (var N = 0; N < E; N++) {
  9717. R = F[N];
  9718. var G = this.ef[N](L);
  9719. B[R.name] = R
  9720. .convert((G !== undefined) ? G : R.defaultValue, L)
  9721. }
  9722. var C = new A(B, J);
  9723. C.json = L;
  9724. P[O] = C
  9725. }
  9726. return {
  9727. success : D,
  9728. records : P,
  9729. totalRecords : I
  9730. }
  9731. }
  9732. });
  9733. Ext.data.XmlReader = function(A, B) {
  9734. A = A || {};
  9735. Ext.data.XmlReader.superclass.constructor.call(this, A, B || A.fields)
  9736. };
  9737. Ext.extend(Ext.data.XmlReader, Ext.data.DataReader, {
  9738. read : function(A) {
  9739. var B = A.responseXML;
  9740. if (!B) {
  9741. throw {
  9742. message : "XmlReader.read: XML Document not available"
  9743. }
  9744. }
  9745. return this.readRecords(B)
  9746. },
  9747. readRecords : function(T) {
  9748. this.xmlData = T;
  9749. var N = T.documentElement || T;
  9750. var I = Ext.DomQuery;
  9751. var B = this.recordType, L = B.prototype.fields;
  9752. var D = this.meta.id;
  9753. var G = 0, E = true;
  9754. if (this.meta.totalRecords) {
  9755. G = I.selectNumber(this.meta.totalRecords, N, 0)
  9756. }
  9757. if (this.meta.success) {
  9758. var K = I.selectValue(this.meta.success, N, true);
  9759. E = K !== false && K !== "false"
  9760. }
  9761. var Q = [];
  9762. var U = I.select(this.meta.record, N);
  9763. for (var P = 0, R = U.length; P < R; P++) {
  9764. var M = U[P];
  9765. var A = {};
  9766. var J = D ? I.selectValue(D, M) : undefined;
  9767. for (var O = 0, H = L.length; O < H; O++) {
  9768. var S = L.items[O];
  9769. var F = I.selectValue(S.mapping || S.name, M,
  9770. S.defaultValue);
  9771. F = S.convert(F, M);
  9772. A[S.name] = F
  9773. }
  9774. var C = new B(A, J);
  9775. C.node = M;
  9776. Q[Q.length] = C
  9777. }
  9778. return {
  9779. success : E,
  9780. records : Q,
  9781. totalRecords : G || Q.length
  9782. }
  9783. }
  9784. });
  9785. Ext.data.ArrayReader = Ext.extend(Ext.data.JsonReader, {
  9786. readRecords : function(C) {
  9787. var B = this.meta ? this.meta.id : null;
  9788. var G = this.recordType, K = G.prototype.fields;
  9789. var E = [];
  9790. var M = C;
  9791. for (var I = 0; I < M.length; I++) {
  9792. var D = M[I];
  9793. var O = {};
  9794. var A = ((B || B === 0) && D[B] !== undefined
  9795. && D[B] !== "" ? D[B] : null);
  9796. for (var H = 0, P = K.length; H < P; H++) {
  9797. var L = K.items[H];
  9798. var F = L.mapping !== undefined && L.mapping !== null
  9799. ? L.mapping
  9800. : H;
  9801. var N = D[F] !== undefined ? D[F] : L.defaultValue;
  9802. N = L.convert(N, D);
  9803. O[L.name] = N
  9804. }
  9805. var J = new G(O, A);
  9806. J.json = D;
  9807. E[E.length] = J
  9808. }
  9809. return {
  9810. records : E,
  9811. totalRecords : E.length
  9812. }
  9813. }
  9814. });
  9815. Ext.data.Tree = function(A) {
  9816. this.nodeHash = {};
  9817. this.root = null;
  9818. if (A) {
  9819. this.setRootNode(A)
  9820. }
  9821. this.addEvents("append", "remove", "move", "insert", "beforeappend",
  9822. "beforeremove", "beforemove", "beforeinsert");
  9823. Ext.data.Tree.superclass.constructor.call(this)
  9824. };
  9825. Ext.extend(Ext.data.Tree, Ext.util.Observable, {
  9826. pathSeparator : "/",
  9827. proxyNodeEvent : function() {
  9828. return this.fireEvent.apply(this, arguments)
  9829. },
  9830. getRootNode : function() {
  9831. return this.root
  9832. },
  9833. setRootNode : function(A) {
  9834. this.root = A;
  9835. A.ownerTree = this;
  9836. A.isRoot = true;
  9837. this.registerNode(A);
  9838. return A
  9839. },
  9840. getNodeById : function(A) {
  9841. return this.nodeHash[A]
  9842. },
  9843. registerNode : function(A) {
  9844. this.nodeHash[A.id] = A
  9845. },
  9846. unregisterNode : function(A) {
  9847. delete this.nodeHash[A.id]
  9848. },
  9849. toString : function() {
  9850. return "[Tree" + (this.id ? " " + this.id : "") + "]"
  9851. }
  9852. });
  9853. Ext.data.Node = function(A) {
  9854. this.attributes = A || {};
  9855. this.leaf = this.attributes.leaf;
  9856. this.id = this.attributes.id;
  9857. if (!this.id) {
  9858. this.id = Ext.id(null, "ynode-");
  9859. this.attributes.id = this.id
  9860. }
  9861. this.childNodes = [];
  9862. if (!this.childNodes.indexOf) {
  9863. this.childNodes.indexOf = function(D) {
  9864. for (var C = 0, B = this.length; C < B; C++) {
  9865. if (this[C] == D) {
  9866. return C
  9867. }
  9868. }
  9869. return -1
  9870. }
  9871. }
  9872. this.parentNode = null;
  9873. this.firstChild = null;
  9874. this.lastChild = null;
  9875. this.previousSibling = null;
  9876. this.nextSibling = null;
  9877. this.addEvents({
  9878. "append" : true,
  9879. "remove" : true,
  9880. "move" : true,
  9881. "insert" : true,
  9882. "beforeappend" : true,
  9883. "beforeremove" : true,
  9884. "beforemove" : true,
  9885. "beforeinsert" : true
  9886. });
  9887. this.listeners = this.attributes.listeners;
  9888. Ext.data.Node.superclass.constructor.call(this)
  9889. };
  9890. Ext.extend(Ext.data.Node, Ext.util.Observable, {
  9891. fireEvent : function(B) {
  9892. if (Ext.data.Node.superclass.fireEvent.apply(this, arguments) === false) {
  9893. return false
  9894. }
  9895. var A = this.getOwnerTree();
  9896. if (A) {
  9897. if (A.proxyNodeEvent.apply(A, arguments) === false) {
  9898. return false
  9899. }
  9900. }
  9901. return true
  9902. },
  9903. isLeaf : function() {
  9904. return this.leaf === true
  9905. },
  9906. setFirstChild : function(A) {
  9907. this.firstChild = A
  9908. },
  9909. setLastChild : function(A) {
  9910. this.lastChild = A
  9911. },
  9912. isLast : function() {
  9913. return (!this.parentNode ? true : this.parentNode.lastChild == this)
  9914. },
  9915. isFirst : function() {
  9916. return (!this.parentNode ? true : this.parentNode.firstChild == this)
  9917. },
  9918. hasChildNodes : function() {
  9919. return !this.isLeaf() && this.childNodes.length > 0
  9920. },
  9921. appendChild : function(E) {
  9922. var F = false;
  9923. if (Ext.isArray(E)) {
  9924. F = E
  9925. } else {
  9926. if (arguments.length > 1) {
  9927. F = arguments
  9928. }
  9929. }
  9930. if (F) {
  9931. for (var D = 0, A = F.length; D < A; D++) {
  9932. this.appendChild(F[D])
  9933. }
  9934. } else {
  9935. if (this.fireEvent("beforeappend", this.ownerTree, this, E) === false) {
  9936. return false
  9937. }
  9938. var B = this.childNodes.length;
  9939. var C = E.parentNode;
  9940. if (C) {
  9941. if (E.fireEvent("beforemove", E.getOwnerTree(), E, C, this, B) === false) {
  9942. return false
  9943. }
  9944. C.removeChild(E)
  9945. }
  9946. B = this.childNodes.length;
  9947. if (B == 0) {
  9948. this.setFirstChild(E)
  9949. }
  9950. this.childNodes.push(E);
  9951. E.parentNode = this;
  9952. var G = this.childNodes[B - 1];
  9953. if (G) {
  9954. E.previousSibling = G;
  9955. G.nextSibling = E
  9956. } else {
  9957. E.previousSibling = null
  9958. }
  9959. E.nextSibling = null;
  9960. this.setLastChild(E);
  9961. E.setOwnerTree(this.getOwnerTree());
  9962. this.fireEvent("append", this.ownerTree, this, E, B);
  9963. if (C) {
  9964. E.fireEvent("move", this.ownerTree, E, C, this, B)
  9965. }
  9966. return E
  9967. }
  9968. },
  9969. removeChild : function(B) {
  9970. var A = this.childNodes.indexOf(B);
  9971. if (A == -1) {
  9972. return false
  9973. }
  9974. if (this.fireEvent("beforeremove", this.ownerTree, this, B) === false) {
  9975. return false
  9976. }
  9977. this.childNodes.splice(A, 1);
  9978. if (B.previousSibling) {
  9979. B.previousSibling.nextSibling = B.nextSibling
  9980. }
  9981. if (B.nextSibling) {
  9982. B.nextSibling.previousSibling = B.previousSibling
  9983. }
  9984. if (this.firstChild == B) {
  9985. this.setFirstChild(B.nextSibling)
  9986. }
  9987. if (this.lastChild == B) {
  9988. this.setLastChild(B.previousSibling)
  9989. }
  9990. B.setOwnerTree(null);
  9991. B.parentNode = null;
  9992. B.previousSibling = null;
  9993. B.nextSibling = null;
  9994. this.fireEvent("remove", this.ownerTree, this, B);
  9995. return B
  9996. },
  9997. insertBefore : function(D, A) {
  9998. if (!A) {
  9999. return this.appendChild(D)
  10000. }
  10001. if (D == A) {
  10002. return false
  10003. }
  10004. if (this.fireEvent("beforeinsert", this.ownerTree, this, D, A) === false) {
  10005. return false
  10006. }
  10007. var B = this.childNodes.indexOf(A);
  10008. var C = D.parentNode;
  10009. var E = B;
  10010. if (C == this && this.childNodes.indexOf(D) < B) {
  10011. E--
  10012. }
  10013. if (C) {
  10014. if (D.fireEvent("beforemove", D.getOwnerTree(), D, C, this, B, A) === false) {
  10015. return false
  10016. }
  10017. C.removeChild(D)
  10018. }
  10019. if (E == 0) {
  10020. this.setFirstChild(D)
  10021. }
  10022. this.childNodes.splice(E, 0, D);
  10023. D.parentNode = this;
  10024. var F = this.childNodes[E - 1];
  10025. if (F) {
  10026. D.previousSibling = F;
  10027. F.nextSibling = D
  10028. } else {
  10029. D.previousSibling = null
  10030. }
  10031. D.nextSibling = A;
  10032. A.previousSibling = D;
  10033. D.setOwnerTree(this.getOwnerTree());
  10034. this.fireEvent("insert", this.ownerTree, this, D, A);
  10035. if (C) {
  10036. D.fireEvent("move", this.ownerTree, D, C, this, E, A)
  10037. }
  10038. return D
  10039. },
  10040. remove : function() {
  10041. this.parentNode.removeChild(this);
  10042. return this
  10043. },
  10044. item : function(A) {
  10045. return this.childNodes[A]
  10046. },
  10047. replaceChild : function(A, B) {
  10048. this.insertBefore(A, B);
  10049. this.removeChild(B);
  10050. return B
  10051. },
  10052. indexOf : function(A) {
  10053. return this.childNodes.indexOf(A)
  10054. },
  10055. getOwnerTree : function() {
  10056. if (!this.ownerTree) {
  10057. var A = this;
  10058. while (A) {
  10059. if (A.ownerTree) {
  10060. this.ownerTree = A.ownerTree;
  10061. break
  10062. }
  10063. A = A.parentNode
  10064. }
  10065. }
  10066. return this.ownerTree
  10067. },
  10068. getDepth : function() {
  10069. var B = 0;
  10070. var A = this;
  10071. while (A.parentNode) {
  10072. ++B;
  10073. A = A.parentNode
  10074. }
  10075. return B
  10076. },
  10077. setOwnerTree : function(B) {
  10078. if (B != this.ownerTree) {
  10079. if (this.ownerTree) {
  10080. this.ownerTree.unregisterNode(this)
  10081. }
  10082. this.ownerTree = B;
  10083. var D = this.childNodes;
  10084. for (var C = 0, A = D.length; C < A; C++) {
  10085. D[C].setOwnerTree(B)
  10086. }
  10087. if (B) {
  10088. B.registerNode(this)
  10089. }
  10090. }
  10091. },
  10092. getPath : function(B) {
  10093. B = B || "id";
  10094. var D = this.parentNode;
  10095. var A = [this.attributes[B]];
  10096. while (D) {
  10097. A.unshift(D.attributes[B]);
  10098. D = D.parentNode
  10099. }
  10100. var C = this.getOwnerTree().pathSeparator;
  10101. return C + A.join(C)
  10102. },
  10103. bubble : function(C, B, A) {
  10104. var D = this;
  10105. while (D) {
  10106. if (C.apply(B || D, A || [D]) === false) {
  10107. break
  10108. }
  10109. D = D.parentNode
  10110. }
  10111. },
  10112. cascade : function(F, E, B) {
  10113. if (F.apply(E || this, B || [this]) !== false) {
  10114. var D = this.childNodes;
  10115. for (var C = 0, A = D.length; C < A; C++) {
  10116. D[C].cascade(F, E, B)
  10117. }
  10118. }
  10119. },
  10120. eachChild : function(F, E, B) {
  10121. var D = this.childNodes;
  10122. for (var C = 0, A = D.length; C < A; C++) {
  10123. if (F.apply(E || this, B || [D[C]]) === false) {
  10124. break
  10125. }
  10126. }
  10127. },
  10128. findChild : function(D, E) {
  10129. var C = this.childNodes;
  10130. for (var B = 0, A = C.length; B < A; B++) {
  10131. if (C[B].attributes[D] == E) {
  10132. return C[B]
  10133. }
  10134. }
  10135. return null
  10136. },
  10137. findChildBy : function(E, D) {
  10138. var C = this.childNodes;
  10139. for (var B = 0, A = C.length; B < A; B++) {
  10140. if (E.call(D || C[B], C[B]) === true) {
  10141. return C[B]
  10142. }
  10143. }
  10144. return null
  10145. },
  10146. sort : function(E, D) {
  10147. var C = this.childNodes;
  10148. var A = C.length;
  10149. if (A > 0) {
  10150. var F = D ? function() {
  10151. E.apply(D, arguments)
  10152. } : E;
  10153. C.sort(F);
  10154. for (var B = 0; B < A; B++) {
  10155. var G = C[B];
  10156. G.previousSibling = C[B - 1];
  10157. G.nextSibling = C[B + 1];
  10158. if (B == 0) {
  10159. this.setFirstChild(G)
  10160. }
  10161. if (B == A - 1) {
  10162. this.setLastChild(G)
  10163. }
  10164. }
  10165. }
  10166. },
  10167. contains : function(A) {
  10168. return A.isAncestor(this)
  10169. },
  10170. isAncestor : function(A) {
  10171. var B = this.parentNode;
  10172. while (B) {
  10173. if (B == A) {
  10174. return true
  10175. }
  10176. B = B.parentNode
  10177. }
  10178. return false
  10179. },
  10180. toString : function() {
  10181. return "[Node" + (this.id ? " " + this.id : "") + "]"
  10182. }
  10183. });
  10184. Ext.data.GroupingStore = Ext.extend(Ext.data.Store, {
  10185. remoteGroup : false,
  10186. groupOnSort : false,
  10187. clearGrouping : function() {
  10188. this.groupField = false;
  10189. if (this.remoteGroup) {
  10190. if (this.baseParams) {
  10191. delete this.baseParams.groupBy
  10192. }
  10193. this.reload()
  10194. } else {
  10195. this.applySort();
  10196. this.fireEvent("datachanged", this)
  10197. }
  10198. },
  10199. groupBy : function(C, B) {
  10200. if (this.groupField == C && !B) {
  10201. return
  10202. }
  10203. this.groupField = C;
  10204. if (this.remoteGroup) {
  10205. if (!this.baseParams) {
  10206. this.baseParams = {}
  10207. }
  10208. this.baseParams["groupBy"] = C
  10209. }
  10210. if (this.groupOnSort) {
  10211. this.sort(C);
  10212. return
  10213. }
  10214. if (this.remoteGroup) {
  10215. this.reload()
  10216. } else {
  10217. var A = this.sortInfo || {};
  10218. if (A.field != C) {
  10219. this.applySort()
  10220. } else {
  10221. this.sortData(C)
  10222. }
  10223. this.fireEvent("datachanged", this)
  10224. }
  10225. },
  10226. applySort : function() {
  10227. Ext.data.GroupingStore.superclass.applySort.call(this);
  10228. if (!this.groupOnSort && !this.remoteGroup) {
  10229. var A = this.getGroupState();
  10230. if (A && A != this.sortInfo.field) {
  10231. this.sortData(this.groupField)
  10232. }
  10233. }
  10234. },
  10235. applyGrouping : function(A) {
  10236. if (this.groupField !== false) {
  10237. this.groupBy(this.groupField, true);
  10238. return true
  10239. } else {
  10240. if (A === true) {
  10241. this.fireEvent("datachanged", this)
  10242. }
  10243. return false
  10244. }
  10245. },
  10246. getGroupState : function() {
  10247. return this.groupOnSort && this.groupField !== false
  10248. ? (this.sortInfo ? this.sortInfo.field : undefined)
  10249. : this.groupField
  10250. }
  10251. });
  10252. Ext.ComponentMgr = function() {
  10253. var B = new Ext.util.MixedCollection();
  10254. var A = {};
  10255. return {
  10256. register : function(C) {
  10257. B.add(C)
  10258. },
  10259. unregister : function(C) {
  10260. B.remove(C)
  10261. },
  10262. get : function(C) {
  10263. return B.get(C)
  10264. },
  10265. onAvailable : function(E, D, C) {
  10266. B.on("add", function(F, G) {
  10267. if (G.id == E) {
  10268. D.call(C || G, G);
  10269. B.un("add", D, C)
  10270. }
  10271. })
  10272. },
  10273. all : B,
  10274. registerType : function(D, C) {
  10275. A[D] = C;
  10276. C.xtype = D
  10277. },
  10278. create : function(C, D) {
  10279. return new A[C.xtype || D](C)
  10280. }
  10281. }
  10282. }();
  10283. Ext.reg = Ext.ComponentMgr.registerType;
  10284. Ext.Component = function(B) {
  10285. B = B || {};
  10286. if (B.initialConfig) {
  10287. if (B.isAction) {
  10288. this.baseAction = B
  10289. }
  10290. B = B.initialConfig
  10291. } else {
  10292. if (B.tagName || B.dom || typeof B == "string") {
  10293. B = {
  10294. applyTo : B,
  10295. id : B.id || B
  10296. }
  10297. }
  10298. }
  10299. this.initialConfig = B;
  10300. Ext.apply(this, B);
  10301. this.addEvents("disable", "enable", "beforeshow", "show", "beforehide",
  10302. "hide", "beforerender", "render", "beforedestroy", "destroy",
  10303. "beforestaterestore", "staterestore", "beforestatesave",
  10304. "statesave");
  10305. this.getId();
  10306. Ext.ComponentMgr.register(this);
  10307. Ext.Component.superclass.constructor.call(this);
  10308. if (this.baseAction) {
  10309. this.baseAction.addComponent(this)
  10310. }
  10311. this.initComponent();
  10312. if (this.plugins) {
  10313. if (Ext.isArray(this.plugins)) {
  10314. for (var C = 0, A = this.plugins.length; C < A; C++) {
  10315. this.plugins[C].init(this)
  10316. }
  10317. } else {
  10318. this.plugins.init(this)
  10319. }
  10320. }
  10321. if (this.stateful !== false) {
  10322. this.initState(B)
  10323. }
  10324. if (this.applyTo) {
  10325. this.applyToMarkup(this.applyTo);
  10326. delete this.applyTo
  10327. } else {
  10328. if (this.renderTo) {
  10329. this.render(this.renderTo);
  10330. delete this.renderTo
  10331. }
  10332. }
  10333. };
  10334. Ext.Component.AUTO_ID = 1000;
  10335. Ext.extend(Ext.Component, Ext.util.Observable, {
  10336. disabledClass : "x-item-disabled",
  10337. allowDomMove : true,
  10338. autoShow : false,
  10339. hideMode : "display",
  10340. hideParent : false,
  10341. hidden : false,
  10342. disabled : false,
  10343. rendered : false,
  10344. ctype : "Ext.Component",
  10345. actionMode : "el",
  10346. getActionEl : function() {
  10347. return this[this.actionMode]
  10348. },
  10349. initComponent : Ext.emptyFn,
  10350. render : function(B, A) {
  10351. if (!this.rendered
  10352. && this.fireEvent("beforerender", this) !== false) {
  10353. if (!B && this.el) {
  10354. this.el = Ext.get(this.el);
  10355. B = this.el.dom.parentNode;
  10356. this.allowDomMove = false
  10357. }
  10358. this.container = Ext.get(B);
  10359. if (this.ctCls) {
  10360. this.container.addClass(this.ctCls)
  10361. }
  10362. this.rendered = true;
  10363. if (A !== undefined) {
  10364. if (typeof A == "number") {
  10365. A = this.container.dom.childNodes[A]
  10366. } else {
  10367. A = Ext.getDom(A)
  10368. }
  10369. }
  10370. this.onRender(this.container, A || null);
  10371. if (this.autoShow) {
  10372. this.el.removeClass(["x-hidden",
  10373. "x-hide-" + this.hideMode])
  10374. }
  10375. if (this.cls) {
  10376. this.el.addClass(this.cls);
  10377. delete this.cls
  10378. }
  10379. if (this.style) {
  10380. this.el.applyStyles(this.style);
  10381. delete this.style
  10382. }
  10383. this.fireEvent("render", this);
  10384. this.afterRender(this.container);
  10385. if (this.hidden) {
  10386. this.hide()
  10387. }
  10388. if (this.disabled) {
  10389. this.disable()
  10390. }
  10391. this.initStateEvents()
  10392. }
  10393. return this
  10394. },
  10395. initState : function(A) {
  10396. if (Ext.state.Manager) {
  10397. var B = Ext.state.Manager.get(this.stateId || this.id);
  10398. if (B) {
  10399. if (this.fireEvent("beforestaterestore", this, B) !== false) {
  10400. this.applyState(B);
  10401. this.fireEvent("staterestore", this, B)
  10402. }
  10403. }
  10404. }
  10405. },
  10406. initStateEvents : function() {
  10407. if (this.stateEvents) {
  10408. for (var A = 0, B; B = this.stateEvents[A]; A++) {
  10409. this.on(B, this.saveState, this, {
  10410. delay : 100
  10411. })
  10412. }
  10413. }
  10414. },
  10415. applyState : function(B, A) {
  10416. if (B) {
  10417. Ext.apply(this, B)
  10418. }
  10419. },
  10420. getState : function() {
  10421. return null
  10422. },
  10423. saveState : function() {
  10424. if (Ext.state.Manager) {
  10425. var A = this.getState();
  10426. if (this.fireEvent("beforestatesave", this, A) !== false) {
  10427. Ext.state.Manager.set(this.stateId || this.id, A);
  10428. this.fireEvent("statesave", this, A)
  10429. }
  10430. }
  10431. },
  10432. applyToMarkup : function(A) {
  10433. this.allowDomMove = false;
  10434. this.el = Ext.get(A);
  10435. this.render(this.el.dom.parentNode)
  10436. },
  10437. addClass : function(A) {
  10438. if (this.el) {
  10439. this.el.addClass(A)
  10440. } else {
  10441. this.cls = this.cls ? this.cls + " " + A : A
  10442. }
  10443. },
  10444. removeClass : function(A) {
  10445. if (this.el) {
  10446. this.el.removeClass(A)
  10447. } else {
  10448. if (this.cls) {
  10449. this.cls = this.cls.split(" ").remove(A).join(" ")
  10450. }
  10451. }
  10452. },
  10453. onRender : function(B, A) {
  10454. if (this.autoEl) {
  10455. if (typeof this.autoEl == "string") {
  10456. this.el = document.createElement(this.autoEl)
  10457. } else {
  10458. var C = document.createElement("div");
  10459. Ext.DomHelper.overwrite(C, this.autoEl);
  10460. this.el = C.firstChild
  10461. }
  10462. if (!this.el.id) {
  10463. this.el.id = this.getId()
  10464. }
  10465. }
  10466. if (this.el) {
  10467. this.el = Ext.get(this.el);
  10468. if (this.allowDomMove !== false) {
  10469. B.dom.insertBefore(this.el.dom, A)
  10470. }
  10471. }
  10472. },
  10473. getAutoCreate : function() {
  10474. var A = typeof this.autoCreate == "object"
  10475. ? this.autoCreate
  10476. : Ext.apply({}, this.defaultAutoCreate);
  10477. if (this.id && !A.id) {
  10478. A.id = this.id
  10479. }
  10480. return A
  10481. },
  10482. afterRender : Ext.emptyFn,
  10483. destroy : function() {
  10484. if (this.fireEvent("beforedestroy", this) !== false) {
  10485. this.beforeDestroy();
  10486. if (this.rendered) {
  10487. this.el.removeAllListeners();
  10488. this.el.remove();
  10489. if (this.actionMode == "container") {
  10490. this.container.remove()
  10491. }
  10492. }
  10493. this.onDestroy();
  10494. Ext.ComponentMgr.unregister(this);
  10495. this.fireEvent("destroy", this);
  10496. this.purgeListeners()
  10497. }
  10498. },
  10499. beforeDestroy : Ext.emptyFn,
  10500. onDestroy : Ext.emptyFn,
  10501. getEl : function() {
  10502. return this.el
  10503. },
  10504. getId : function() {
  10505. return this.id
  10506. || (this.id = "ext-comp-" + (++Ext.Component.AUTO_ID))
  10507. },
  10508. getItemId : function() {
  10509. return this.itemId || this.getId()
  10510. },
  10511. focus : function(B, A) {
  10512. if (A) {
  10513. this.focus.defer(typeof A == "number" ? A : 10, this, [B,
  10514. false]);
  10515. return
  10516. }
  10517. if (this.rendered) {
  10518. this.el.focus();
  10519. if (B === true) {
  10520. this.el.dom.select()
  10521. }
  10522. }
  10523. return this
  10524. },
  10525. blur : function() {
  10526. if (this.rendered) {
  10527. this.el.blur()
  10528. }
  10529. return this
  10530. },
  10531. disable : function() {
  10532. if (this.rendered) {
  10533. this.onDisable()
  10534. }
  10535. this.disabled = true;
  10536. this.fireEvent("disable", this);
  10537. return this
  10538. },
  10539. onDisable : function() {
  10540. this.getActionEl().addClass(this.disabledClass);
  10541. this.el.dom.disabled = true
  10542. },
  10543. enable : function() {
  10544. if (this.rendered) {
  10545. this.onEnable()
  10546. }
  10547. this.disabled = false;
  10548. this.fireEvent("enable", this);
  10549. return this
  10550. },
  10551. onEnable : function() {
  10552. this.getActionEl().removeClass(this.disabledClass);
  10553. this.el.dom.disabled = false
  10554. },
  10555. setDisabled : function(A) {
  10556. this[A ? "disable" : "enable"]()
  10557. },
  10558. show : function() {
  10559. if (this.fireEvent("beforeshow", this) !== false) {
  10560. this.hidden = false;
  10561. if (this.autoRender) {
  10562. this.render(typeof this.autoRender == "boolean" ? Ext
  10563. .getBody() : this.autoRender)
  10564. }
  10565. if (this.rendered) {
  10566. this.onShow()
  10567. }
  10568. this.fireEvent("show", this)
  10569. }
  10570. return this
  10571. },
  10572. onShow : function() {
  10573. if (this.hideParent) {
  10574. this.container.removeClass("x-hide-" + this.hideMode)
  10575. } else {
  10576. this.getActionEl().removeClass("x-hide-" + this.hideMode)
  10577. }
  10578. },
  10579. hide : function() {
  10580. if (this.fireEvent("beforehide", this) !== false) {
  10581. this.hidden = true;
  10582. if (this.rendered) {
  10583. this.onHide()
  10584. }
  10585. this.fireEvent("hide", this)
  10586. }
  10587. return this
  10588. },
  10589. onHide : function() {
  10590. if (this.hideParent) {
  10591. this.container.addClass("x-hide-" + this.hideMode)
  10592. } else {
  10593. this.getActionEl().addClass("x-hide-" + this.hideMode)
  10594. }
  10595. },
  10596. setVisible : function(A) {
  10597. if (A) {
  10598. this.show()
  10599. } else {
  10600. this.hide()
  10601. }
  10602. return this
  10603. },
  10604. isVisible : function() {
  10605. return this.rendered && this.getActionEl().isVisible()
  10606. },
  10607. cloneConfig : function(B) {
  10608. B = B || {};
  10609. var C = B.id || Ext.id();
  10610. var A = Ext.applyIf(B, this.initialConfig);
  10611. A.id = C;
  10612. return new this.constructor(A)
  10613. },
  10614. getXType : function() {
  10615. return this.constructor.xtype
  10616. },
  10617. isXType : function(B, A) {
  10618. return !A ? ("/" + this.getXTypes() + "/").indexOf("/" + B
  10619. + "/") != -1 : this.constructor.xtype == B
  10620. },
  10621. getXTypes : function() {
  10622. var A = this.constructor;
  10623. if (!A.xtypes) {
  10624. var C = [], B = this;
  10625. while (B && B.constructor.xtype) {
  10626. C.unshift(B.constructor.xtype);
  10627. B = B.constructor.superclass
  10628. }
  10629. A.xtypeChain = C;
  10630. A.xtypes = C.join("/")
  10631. }
  10632. return A.xtypes
  10633. },
  10634. findParentBy : function(A) {
  10635. for (var B = this.ownerCt; (B != null) && !A(B, this); B = B.ownerCt) {
  10636. }
  10637. return B || null
  10638. },
  10639. findParentByType : function(A) {
  10640. return typeof A == "function" ? this.findParentBy(function(B) {
  10641. return B.constructor === A
  10642. }) : this.findParentBy(function(B) {
  10643. return B.constructor.xtype === A
  10644. })
  10645. }
  10646. });
  10647. Ext.reg("component", Ext.Component);
  10648. Ext.Action = function(A) {
  10649. this.initialConfig = A;
  10650. this.items = []
  10651. };
  10652. Ext.Action.prototype = {
  10653. isAction : true,
  10654. setText : function(A) {
  10655. this.initialConfig.text = A;
  10656. this.callEach("setText", [A])
  10657. },
  10658. getText : function() {
  10659. return this.initialConfig.text
  10660. },
  10661. setIconClass : function(A) {
  10662. this.initialConfig.iconCls = A;
  10663. this.callEach("setIconClass", [A])
  10664. },
  10665. getIconClass : function() {
  10666. return this.initialConfig.iconCls
  10667. },
  10668. setDisabled : function(A) {
  10669. this.initialConfig.disabled = A;
  10670. this.callEach("setDisabled", [A])
  10671. },
  10672. enable : function() {
  10673. this.setDisabled(false)
  10674. },
  10675. disable : function() {
  10676. this.setDisabled(true)
  10677. },
  10678. isDisabled : function() {
  10679. return this.initialConfig.disabled
  10680. },
  10681. setHidden : function(A) {
  10682. this.initialConfig.hidden = A;
  10683. this.callEach("setVisible", [!A])
  10684. },
  10685. show : function() {
  10686. this.setHidden(false)
  10687. },
  10688. hide : function() {
  10689. this.setHidden(true)
  10690. },
  10691. isHidden : function() {
  10692. return this.initialConfig.hidden
  10693. },
  10694. setHandler : function(B, A) {
  10695. this.initialConfig.handler = B;
  10696. this.initialConfig.scope = A;
  10697. this.callEach("setHandler", [B, A])
  10698. },
  10699. each : function(B, A) {
  10700. Ext.each(this.items, B, A)
  10701. },
  10702. callEach : function(E, B) {
  10703. var D = this.items;
  10704. for (var C = 0, A = D.length; C < A; C++) {
  10705. D[C][E].apply(D[C], B)
  10706. }
  10707. },
  10708. addComponent : function(A) {
  10709. this.items.push(A);
  10710. A.on("destroy", this.removeComponent, this)
  10711. },
  10712. removeComponent : function(A) {
  10713. this.items.remove(A)
  10714. },
  10715. execute : function() {
  10716. this.initialConfig.handler.apply(this.initialConfig.scope || window,
  10717. arguments)
  10718. }
  10719. };
  10720. (function() {
  10721. Ext.Layer = function(D, C) {
  10722. D = D || {};
  10723. var E = Ext.DomHelper;
  10724. var G = D.parentEl, F = G ? Ext.getDom(G) : document.body;
  10725. if (C) {
  10726. this.dom = Ext.getDom(C)
  10727. }
  10728. if (!this.dom) {
  10729. var H = D.dh || {
  10730. tag : "div",
  10731. cls : "x-layer"
  10732. };
  10733. this.dom = E.append(F, H)
  10734. }
  10735. if (D.cls) {
  10736. this.addClass(D.cls)
  10737. }
  10738. this.constrain = D.constrain !== false;
  10739. this.visibilityMode = Ext.Element.VISIBILITY;
  10740. if (D.id) {
  10741. this.id = this.dom.id = D.id
  10742. } else {
  10743. this.id = Ext.id(this.dom)
  10744. }
  10745. this.zindex = D.zindex || this.getZIndex();
  10746. this.position("absolute", this.zindex);
  10747. if (D.shadow) {
  10748. this.shadowOffset = D.shadowOffset || 4;
  10749. this.shadow = new Ext.Shadow({
  10750. offset : this.shadowOffset,
  10751. mode : D.shadow
  10752. })
  10753. } else {
  10754. this.shadowOffset = 0
  10755. }
  10756. this.useShim = D.shim !== false && Ext.useShims;
  10757. this.useDisplay = D.useDisplay;
  10758. this.hide()
  10759. };
  10760. var A = Ext.Element.prototype;
  10761. var B = [];
  10762. Ext.extend(Ext.Layer, Ext.Element, {
  10763. getZIndex : function() {
  10764. return this.zindex || parseInt(this.getStyle("z-index"), 10)
  10765. || 11000
  10766. },
  10767. getShim : function() {
  10768. if (!this.useShim) {
  10769. return null
  10770. }
  10771. if (this.shim) {
  10772. return this.shim
  10773. }
  10774. var D = B.shift();
  10775. if (!D) {
  10776. D = this.createShim();
  10777. D.enableDisplayMode("block");
  10778. D.dom.style.display = "none";
  10779. D.dom.style.visibility = "visible"
  10780. }
  10781. var C = this.dom.parentNode;
  10782. if (D.dom.parentNode != C) {
  10783. C.insertBefore(D.dom, this.dom)
  10784. }
  10785. D.setStyle("z-index", this.getZIndex() - 2);
  10786. this.shim = D;
  10787. return D
  10788. },
  10789. hideShim : function() {
  10790. if (this.shim) {
  10791. this.shim.setDisplayed(false);
  10792. B.push(this.shim);
  10793. delete this.shim
  10794. }
  10795. },
  10796. disableShadow : function() {
  10797. if (this.shadow) {
  10798. this.shadowDisabled = true;
  10799. this.shadow.hide();
  10800. this.lastShadowOffset = this.shadowOffset;
  10801. this.shadowOffset = 0
  10802. }
  10803. },
  10804. enableShadow : function(C) {
  10805. if (this.shadow) {
  10806. this.shadowDisabled = false;
  10807. this.shadowOffset = this.lastShadowOffset;
  10808. delete this.lastShadowOffset;
  10809. if (C) {
  10810. this.sync(true)
  10811. }
  10812. }
  10813. },
  10814. sync : function(C) {
  10815. var I = this.shadow;
  10816. if (!this.updating && this.isVisible() && (I || this.useShim)) {
  10817. var F = this.getShim();
  10818. var H = this.getWidth(), E = this.getHeight();
  10819. var D = this.getLeft(true), J = this.getTop(true);
  10820. if (I && !this.shadowDisabled) {
  10821. if (C && !I.isVisible()) {
  10822. I.show(this)
  10823. } else {
  10824. I.realign(D, J, H, E)
  10825. }
  10826. if (F) {
  10827. if (C) {
  10828. F.show()
  10829. }
  10830. var G = I.adjusts, K = F.dom.style;
  10831. K.left = (Math.min(D, D + G.l)) + "px";
  10832. K.top = (Math.min(J, J + G.t)) + "px";
  10833. K.width = (H + G.w) + "px";
  10834. K.height = (E + G.h) + "px"
  10835. }
  10836. } else {
  10837. if (F) {
  10838. if (C) {
  10839. F.show()
  10840. }
  10841. F.setSize(H, E);
  10842. F.setLeftTop(D, J)
  10843. }
  10844. }
  10845. }
  10846. },
  10847. destroy : function() {
  10848. this.hideShim();
  10849. if (this.shadow) {
  10850. this.shadow.hide()
  10851. }
  10852. this.removeAllListeners();
  10853. Ext.removeNode(this.dom);
  10854. Ext.Element.uncache(this.id)
  10855. },
  10856. remove : function() {
  10857. this.destroy()
  10858. },
  10859. beginUpdate : function() {
  10860. this.updating = true
  10861. },
  10862. endUpdate : function() {
  10863. this.updating = false;
  10864. this.sync(true)
  10865. },
  10866. hideUnders : function(C) {
  10867. if (this.shadow) {
  10868. this.shadow.hide()
  10869. }
  10870. this.hideShim()
  10871. },
  10872. constrainXY : function() {
  10873. if (this.constrain) {
  10874. var G = Ext.lib.Dom.getViewWidth(), C = Ext.lib.Dom
  10875. .getViewHeight();
  10876. var L = Ext.getDoc().getScroll();
  10877. var K = this.getXY();
  10878. var H = K[0], F = K[1];
  10879. var I = this.dom.offsetWidth + this.shadowOffset, D = this.dom.offsetHeight
  10880. + this.shadowOffset;
  10881. var E = false;
  10882. if ((H + I) > G + L.left) {
  10883. H = G - I - this.shadowOffset;
  10884. E = true
  10885. }
  10886. if ((F + D) > C + L.top) {
  10887. F = C - D - this.shadowOffset;
  10888. E = true
  10889. }
  10890. if (H < L.left) {
  10891. H = L.left;
  10892. E = true
  10893. }
  10894. if (F < L.top) {
  10895. F = L.top;
  10896. E = true
  10897. }
  10898. if (E) {
  10899. if (this.avoidY) {
  10900. var J = this.avoidY;
  10901. if (F <= J && (F + D) >= J) {
  10902. F = J - D - 5
  10903. }
  10904. }
  10905. K = [H, F];
  10906. this.storeXY(K);
  10907. A.setXY.call(this, K);
  10908. this.sync()
  10909. }
  10910. }
  10911. },
  10912. isVisible : function() {
  10913. return this.visible
  10914. },
  10915. showAction : function() {
  10916. this.visible = true;
  10917. if (this.useDisplay === true) {
  10918. this.setDisplayed("")
  10919. } else {
  10920. if (this.lastXY) {
  10921. A.setXY.call(this, this.lastXY)
  10922. } else {
  10923. if (this.lastLT) {
  10924. A.setLeftTop.call(this, this.lastLT[0], this.lastLT[1])
  10925. }
  10926. }
  10927. }
  10928. },
  10929. hideAction : function() {
  10930. this.visible = false;
  10931. if (this.useDisplay === true) {
  10932. this.setDisplayed(false)
  10933. } else {
  10934. this.setLeftTop(-10000, -10000)
  10935. }
  10936. },
  10937. setVisible : function(E, D, G, H, F) {
  10938. if (E) {
  10939. this.showAction()
  10940. }
  10941. if (D && E) {
  10942. var C = function() {
  10943. this.sync(true);
  10944. if (H) {
  10945. H()
  10946. }
  10947. }.createDelegate(this);
  10948. A.setVisible.call(this, true, true, G, C, F)
  10949. } else {
  10950. if (!E) {
  10951. this.hideUnders(true)
  10952. }
  10953. var C = H;
  10954. if (D) {
  10955. C = function() {
  10956. this.hideAction();
  10957. if (H) {
  10958. H()
  10959. }
  10960. }.createDelegate(this)
  10961. }
  10962. A.setVisible.call(this, E, D, G, C, F);
  10963. if (E) {
  10964. this.sync(true)
  10965. } else {
  10966. if (!D) {
  10967. this.hideAction()
  10968. }
  10969. }
  10970. }
  10971. },
  10972. storeXY : function(C) {
  10973. delete this.lastLT;
  10974. this.lastXY = C
  10975. },
  10976. storeLeftTop : function(D, C) {
  10977. delete this.lastXY;
  10978. this.lastLT = [D, C]
  10979. },
  10980. beforeFx : function() {
  10981. this.beforeAction();
  10982. return Ext.Layer.superclass.beforeFx.apply(this, arguments)
  10983. },
  10984. afterFx : function() {
  10985. Ext.Layer.superclass.afterFx.apply(this, arguments);
  10986. this.sync(this.isVisible())
  10987. },
  10988. beforeAction : function() {
  10989. if (!this.updating && this.shadow) {
  10990. this.shadow.hide()
  10991. }
  10992. },
  10993. setLeft : function(C) {
  10994. this.storeLeftTop(C, this.getTop(true));
  10995. A.setLeft.apply(this, arguments);
  10996. this.sync()
  10997. },
  10998. setTop : function(C) {
  10999. this.storeLeftTop(this.getLeft(true), C);
  11000. A.setTop.apply(this, arguments);
  11001. this.sync()
  11002. },
  11003. setLeftTop : function(D, C) {
  11004. this.storeLeftTop(D, C);
  11005. A.setLeftTop.apply(this, arguments);
  11006. this.sync()
  11007. },
  11008. setXY : function(F, D, G, H, E) {
  11009. this.fixDisplay();
  11010. this.beforeAction();
  11011. this.storeXY(F);
  11012. var C = this.createCB(H);
  11013. A.setXY.call(this, F, D, G, C, E);
  11014. if (!D) {
  11015. C()
  11016. }
  11017. },
  11018. createCB : function(D) {
  11019. var C = this;
  11020. return function() {
  11021. C.constrainXY();
  11022. C.sync(true);
  11023. if (D) {
  11024. D()
  11025. }
  11026. }
  11027. },
  11028. setX : function(C, D, F, G, E) {
  11029. this.setXY([C, this.getY()], D, F, G, E)
  11030. },
  11031. setY : function(G, C, E, F, D) {
  11032. this.setXY([this.getX(), G], C, E, F, D)
  11033. },
  11034. setSize : function(E, F, D, H, I, G) {
  11035. this.beforeAction();
  11036. var C = this.createCB(I);
  11037. A.setSize.call(this, E, F, D, H, C, G);
  11038. if (!D) {
  11039. C()
  11040. }
  11041. },
  11042. setWidth : function(E, D, G, H, F) {
  11043. this.beforeAction();
  11044. var C = this.createCB(H);
  11045. A.setWidth.call(this, E, D, G, C, F);
  11046. if (!D) {
  11047. C()
  11048. }
  11049. },
  11050. setHeight : function(E, D, G, H, F) {
  11051. this.beforeAction();
  11052. var C = this.createCB(H);
  11053. A.setHeight.call(this, E, D, G, C, F);
  11054. if (!D) {
  11055. C()
  11056. }
  11057. },
  11058. setBounds : function(J, H, K, D, I, F, G, E) {
  11059. this.beforeAction();
  11060. var C = this.createCB(G);
  11061. if (!I) {
  11062. this.storeXY([J, H]);
  11063. A.setXY.call(this, [J, H]);
  11064. A.setSize.call(this, K, D, I, F, C, E);
  11065. C()
  11066. } else {
  11067. A.setBounds.call(this, J, H, K, D, I, F, C, E)
  11068. }
  11069. return this
  11070. },
  11071. setZIndex : function(C) {
  11072. this.zindex = C;
  11073. this.setStyle("z-index", C + 2);
  11074. if (this.shadow) {
  11075. this.shadow.setZIndex(C + 1)
  11076. }
  11077. if (this.shim) {
  11078. this.shim.setStyle("z-index", C)
  11079. }
  11080. }
  11081. })
  11082. })();
  11083. Ext.Shadow = function(C) {
  11084. Ext.apply(this, C);
  11085. if (typeof this.mode != "string") {
  11086. this.mode = this.defaultMode
  11087. }
  11088. var D = this.offset, B = {
  11089. h : 0
  11090. };
  11091. var A = Math.floor(this.offset / 2);
  11092. switch (this.mode.toLowerCase()) {
  11093. case "drop" :
  11094. B.w = 0;
  11095. B.l = B.t = D;
  11096. B.t -= 1;
  11097. if (Ext.isIE) {
  11098. B.l -= this.offset + A;
  11099. B.t -= this.offset + A;
  11100. B.w -= A;
  11101. B.h -= A;
  11102. B.t += 1
  11103. }
  11104. break;
  11105. case "sides" :
  11106. B.w = (D * 2);
  11107. B.l = -D;
  11108. B.t = D - 1;
  11109. if (Ext.isIE) {
  11110. B.l -= (this.offset - A);
  11111. B.t -= this.offset + A;
  11112. B.l += 1;
  11113. B.w -= (this.offset - A) * 2;
  11114. B.w -= A + 1;
  11115. B.h -= 1
  11116. }
  11117. break;
  11118. case "frame" :
  11119. B.w = B.h = (D * 2);
  11120. B.l = B.t = -D;
  11121. B.t += 1;
  11122. B.h -= 2;
  11123. if (Ext.isIE) {
  11124. B.l -= (this.offset - A);
  11125. B.t -= (this.offset - A);
  11126. B.l += 1;
  11127. B.w -= (this.offset + A + 1);
  11128. B.h -= (this.offset + A);
  11129. B.h += 1
  11130. }
  11131. break
  11132. }
  11133. this.adjusts = B
  11134. };
  11135. Ext.Shadow.prototype = {
  11136. offset : 4,
  11137. defaultMode : "drop",
  11138. show : function(A) {
  11139. A = Ext.get(A);
  11140. if (!this.el) {
  11141. this.el = Ext.Shadow.Pool.pull();
  11142. if (this.el.dom.nextSibling != A.dom) {
  11143. this.el.insertBefore(A)
  11144. }
  11145. }
  11146. this.el.setStyle("z-index", this.zIndex
  11147. || parseInt(A.getStyle("z-index"), 10) - 1);
  11148. if (Ext.isIE) {
  11149. this.el.dom.style.filter = "progid:DXImageTransform.Microsoft.alpha(opacity=50) progid:DXImageTransform.Microsoft.Blur(pixelradius="
  11150. + (this.offset) + ")"
  11151. }
  11152. this.realign(A.getLeft(true), A.getTop(true), A.getWidth(), A
  11153. .getHeight());
  11154. this.el.dom.style.display = "block"
  11155. },
  11156. isVisible : function() {
  11157. return this.el ? true : false
  11158. },
  11159. realign : function(A, M, L, D) {
  11160. if (!this.el) {
  11161. return
  11162. }
  11163. var I = this.adjusts, G = this.el.dom, N = G.style;
  11164. var E = 0;
  11165. N.left = (A + I.l) + "px";
  11166. N.top = (M + I.t) + "px";
  11167. var K = (L + I.w), C = (D + I.h), F = K + "px", J = C + "px";
  11168. if (N.width != F || N.height != J) {
  11169. N.width = F;
  11170. N.height = J;
  11171. if (!Ext.isIE) {
  11172. var H = G.childNodes;
  11173. var B = Math.max(0, (K - 12)) + "px";
  11174. H[0].childNodes[1].style.width = B;
  11175. H[1].childNodes[1].style.width = B;
  11176. H[2].childNodes[1].style.width = B;
  11177. H[1].style.height = Math.max(0, (C - 12)) + "px"
  11178. }
  11179. }
  11180. },
  11181. hide : function() {
  11182. if (this.el) {
  11183. this.el.dom.style.display = "none";
  11184. Ext.Shadow.Pool.push(this.el);
  11185. delete this.el
  11186. }
  11187. },
  11188. setZIndex : function(A) {
  11189. this.zIndex = A;
  11190. if (this.el) {
  11191. this.el.setStyle("z-index", A)
  11192. }
  11193. }
  11194. };
  11195. Ext.Shadow.Pool = function() {
  11196. var B = [];
  11197. var A = Ext.isIE
  11198. ? "<div class=\"x-ie-shadow\"></div>"
  11199. : "<div class=\"x-shadow\"><div class=\"xst\"><div class=\"xstl\"></div><div class=\"xstc\"></div><div class=\"xstr\"></div></div><div class=\"xsc\"><div class=\"xsml\"></div><div class=\"xsmc\"></div><div class=\"xsmr\"></div></div><div class=\"xsb\"><div class=\"xsbl\"></div><div class=\"xsbc\"></div><div class=\"xsbr\"></div></div></div>";
  11200. return {
  11201. pull : function() {
  11202. var C = B.shift();
  11203. if (!C) {
  11204. C = Ext.get(Ext.DomHelper.insertHtml("beforeBegin",
  11205. document.body.firstChild, A));
  11206. C.autoBoxAdjust = false
  11207. }
  11208. return C
  11209. },
  11210. push : function(C) {
  11211. B.push(C)
  11212. }
  11213. }
  11214. }();
  11215. Ext.BoxComponent = Ext.extend(Ext.Component, {
  11216. initComponent : function() {
  11217. Ext.BoxComponent.superclass.initComponent.call(this);
  11218. this.addEvents("resize", "move")
  11219. },
  11220. boxReady : false,
  11221. deferHeight : false,
  11222. setSize : function(B, D) {
  11223. if (typeof B == "object") {
  11224. D = B.height;
  11225. B = B.width
  11226. }
  11227. if (!this.boxReady) {
  11228. this.width = B;
  11229. this.height = D;
  11230. return this
  11231. }
  11232. if (this.lastSize && this.lastSize.width == B
  11233. && this.lastSize.height == D) {
  11234. return this
  11235. }
  11236. this.lastSize = {
  11237. width : B,
  11238. height : D
  11239. };
  11240. var C = this.adjustSize(B, D);
  11241. var F = C.width, A = C.height;
  11242. if (F !== undefined || A !== undefined) {
  11243. var E = this.getResizeEl();
  11244. if (!this.deferHeight && F !== undefined && A !== undefined) {
  11245. E.setSize(F, A)
  11246. } else {
  11247. if (!this.deferHeight && A !== undefined) {
  11248. E.setHeight(A)
  11249. } else {
  11250. if (F !== undefined) {
  11251. E.setWidth(F)
  11252. }
  11253. }
  11254. }
  11255. this.onResize(F, A, B, D);
  11256. this.fireEvent("resize", this, F, A, B, D)
  11257. }
  11258. return this
  11259. },
  11260. setWidth : function(A) {
  11261. return this.setSize(A)
  11262. },
  11263. setHeight : function(A) {
  11264. return this.setSize(undefined, A)
  11265. },
  11266. getSize : function() {
  11267. return this.el.getSize()
  11268. },
  11269. getPosition : function(A) {
  11270. if (A === true) {
  11271. return [this.el.getLeft(true), this.el.getTop(true)]
  11272. }
  11273. return this.xy || this.el.getXY()
  11274. },
  11275. getBox : function(A) {
  11276. var B = this.el.getSize();
  11277. if (A === true) {
  11278. B.x = this.el.getLeft(true);
  11279. B.y = this.el.getTop(true)
  11280. } else {
  11281. var C = this.xy || this.el.getXY();
  11282. B.x = C[0];
  11283. B.y = C[1]
  11284. }
  11285. return B
  11286. },
  11287. updateBox : function(A) {
  11288. this.setSize(A.width, A.height);
  11289. this.setPagePosition(A.x, A.y);
  11290. return this
  11291. },
  11292. getResizeEl : function() {
  11293. return this.resizeEl || this.el
  11294. },
  11295. getPositionEl : function() {
  11296. return this.positionEl || this.el
  11297. },
  11298. setPosition : function(A, F) {
  11299. if (A && typeof A[1] == "number") {
  11300. F = A[1];
  11301. A = A[0]
  11302. }
  11303. this.x = A;
  11304. this.y = F;
  11305. if (!this.boxReady) {
  11306. return this
  11307. }
  11308. var B = this.adjustPosition(A, F);
  11309. var E = B.x, D = B.y;
  11310. var C = this.getPositionEl();
  11311. if (E !== undefined || D !== undefined) {
  11312. if (E !== undefined && D !== undefined) {
  11313. C.setLeftTop(E, D)
  11314. } else {
  11315. if (E !== undefined) {
  11316. C.setLeft(E)
  11317. } else {
  11318. if (D !== undefined) {
  11319. C.setTop(D)
  11320. }
  11321. }
  11322. }
  11323. this.onPosition(E, D);
  11324. this.fireEvent("move", this, E, D)
  11325. }
  11326. return this
  11327. },
  11328. setPagePosition : function(A, C) {
  11329. if (A && typeof A[1] == "number") {
  11330. C = A[1];
  11331. A = A[0]
  11332. }
  11333. this.pageX = A;
  11334. this.pageY = C;
  11335. if (!this.boxReady) {
  11336. return
  11337. }
  11338. if (A === undefined || C === undefined) {
  11339. return
  11340. }
  11341. var B = this.el.translatePoints(A, C);
  11342. this.setPosition(B.left, B.top);
  11343. return this
  11344. },
  11345. onRender : function(B, A) {
  11346. Ext.BoxComponent.superclass.onRender.call(this, B, A);
  11347. if (this.resizeEl) {
  11348. this.resizeEl = Ext.get(this.resizeEl)
  11349. }
  11350. if (this.positionEl) {
  11351. this.positionEl = Ext.get(this.positionEl)
  11352. }
  11353. },
  11354. afterRender : function() {
  11355. Ext.BoxComponent.superclass.afterRender.call(this);
  11356. this.boxReady = true;
  11357. this.setSize(this.width, this.height);
  11358. if (this.x || this.y) {
  11359. this.setPosition(this.x, this.y)
  11360. } else {
  11361. if (this.pageX || this.pageY) {
  11362. this.setPagePosition(this.pageX, this.pageY)
  11363. }
  11364. }
  11365. },
  11366. syncSize : function() {
  11367. delete this.lastSize;
  11368. this.setSize(this.autoWidth ? undefined : this.el.getWidth(),
  11369. this.autoHeight ? undefined : this.el.getHeight());
  11370. return this
  11371. },
  11372. onResize : function(D, B, A, C) {
  11373. },
  11374. onPosition : function(A, B) {
  11375. },
  11376. adjustSize : function(A, B) {
  11377. if (this.autoWidth) {
  11378. A = "auto"
  11379. }
  11380. if (this.autoHeight) {
  11381. B = "auto"
  11382. }
  11383. return {
  11384. width : A,
  11385. height : B
  11386. }
  11387. },
  11388. adjustPosition : function(A, B) {
  11389. return {
  11390. x : A,
  11391. y : B
  11392. }
  11393. }
  11394. });
  11395. Ext.reg("box", Ext.BoxComponent);
  11396. Ext.SplitBar = function(C, E, B, D, A) {
  11397. this.el = Ext.get(C, true);
  11398. this.el.dom.unselectable = "on";
  11399. this.resizingEl = Ext.get(E, true);
  11400. this.orientation = B || Ext.SplitBar.HORIZONTAL;
  11401. this.minSize = 0;
  11402. this.maxSize = 2000;
  11403. this.animate = false;
  11404. this.useShim = false;
  11405. this.shim = null;
  11406. if (!A) {
  11407. this.proxy = Ext.SplitBar.createProxy(this.orientation)
  11408. } else {
  11409. this.proxy = Ext.get(A).dom
  11410. }
  11411. this.dd = new Ext.dd.DDProxy(this.el.dom.id, "XSplitBars", {
  11412. dragElId : this.proxy.id
  11413. });
  11414. this.dd.b4StartDrag = this.onStartProxyDrag.createDelegate(this);
  11415. this.dd.endDrag = this.onEndProxyDrag.createDelegate(this);
  11416. this.dragSpecs = {};
  11417. this.adapter = new Ext.SplitBar.BasicLayoutAdapter();
  11418. this.adapter.init(this);
  11419. if (this.orientation == Ext.SplitBar.HORIZONTAL) {
  11420. this.placement = D
  11421. || (this.el.getX() > this.resizingEl.getX()
  11422. ? Ext.SplitBar.LEFT
  11423. : Ext.SplitBar.RIGHT);
  11424. this.el.addClass("x-splitbar-h")
  11425. } else {
  11426. this.placement = D
  11427. || (this.el.getY() > this.resizingEl.getY()
  11428. ? Ext.SplitBar.TOP
  11429. : Ext.SplitBar.BOTTOM);
  11430. this.el.addClass("x-splitbar-v")
  11431. }
  11432. this.addEvents("resize", "moved", "beforeresize", "beforeapply");
  11433. Ext.SplitBar.superclass.constructor.call(this)
  11434. };
  11435. Ext.extend(Ext.SplitBar, Ext.util.Observable, {
  11436. onStartProxyDrag : function(A, E) {
  11437. this.fireEvent("beforeresize", this);
  11438. this.overlay = Ext.DomHelper.append(document.body, {
  11439. cls : "x-drag-overlay",
  11440. html : "&#160;"
  11441. }, true);
  11442. this.overlay.unselectable();
  11443. this.overlay.setSize(Ext.lib.Dom.getViewWidth(true),
  11444. Ext.lib.Dom.getViewHeight(true));
  11445. this.overlay.show();
  11446. Ext.get(this.proxy).setDisplayed("block");
  11447. var C = this.adapter.getElementSize(this);
  11448. this.activeMinSize = this.getMinimumSize();
  11449. this.activeMaxSize = this.getMaximumSize();
  11450. var D = C - this.activeMinSize;
  11451. var B = Math.max(this.activeMaxSize - C, 0);
  11452. if (this.orientation == Ext.SplitBar.HORIZONTAL) {
  11453. this.dd.resetConstraints();
  11454. this.dd.setXConstraint(this.placement == Ext.SplitBar.LEFT
  11455. ? D
  11456. : B, this.placement == Ext.SplitBar.LEFT
  11457. ? B
  11458. : D);
  11459. this.dd.setYConstraint(0, 0)
  11460. } else {
  11461. this.dd.resetConstraints();
  11462. this.dd.setXConstraint(0, 0);
  11463. this.dd.setYConstraint(this.placement == Ext.SplitBar.TOP
  11464. ? D
  11465. : B, this.placement == Ext.SplitBar.TOP
  11466. ? B
  11467. : D)
  11468. }
  11469. this.dragSpecs.startSize = C;
  11470. this.dragSpecs.startPoint = [A, E];
  11471. Ext.dd.DDProxy.prototype.b4StartDrag.call(this.dd, A, E)
  11472. },
  11473. onEndProxyDrag : function(C) {
  11474. Ext.get(this.proxy).setDisplayed(false);
  11475. var B = Ext.lib.Event.getXY(C);
  11476. if (this.overlay) {
  11477. this.overlay.remove();
  11478. delete this.overlay
  11479. }
  11480. var A;
  11481. if (this.orientation == Ext.SplitBar.HORIZONTAL) {
  11482. A = this.dragSpecs.startSize
  11483. + (this.placement == Ext.SplitBar.LEFT
  11484. ? B[0] - this.dragSpecs.startPoint[0]
  11485. : this.dragSpecs.startPoint[0] - B[0])
  11486. } else {
  11487. A = this.dragSpecs.startSize
  11488. + (this.placement == Ext.SplitBar.TOP
  11489. ? B[1] - this.dragSpecs.startPoint[1]
  11490. : this.dragSpecs.startPoint[1] - B[1])
  11491. }
  11492. A = Math.min(Math.max(A, this.activeMinSize),
  11493. this.activeMaxSize);
  11494. if (A != this.dragSpecs.startSize) {
  11495. if (this.fireEvent("beforeapply", this, A) !== false) {
  11496. this.adapter.setElementSize(this, A);
  11497. this.fireEvent("moved", this, A);
  11498. this.fireEvent("resize", this, A)
  11499. }
  11500. }
  11501. },
  11502. getAdapter : function() {
  11503. return this.adapter
  11504. },
  11505. setAdapter : function(A) {
  11506. this.adapter = A;
  11507. this.adapter.init(this)
  11508. },
  11509. getMinimumSize : function() {
  11510. return this.minSize
  11511. },
  11512. setMinimumSize : function(A) {
  11513. this.minSize = A
  11514. },
  11515. getMaximumSize : function() {
  11516. return this.maxSize
  11517. },
  11518. setMaximumSize : function(A) {
  11519. this.maxSize = A
  11520. },
  11521. setCurrentSize : function(B) {
  11522. var A = this.animate;
  11523. this.animate = false;
  11524. this.adapter.setElementSize(this, B);
  11525. this.animate = A
  11526. },
  11527. destroy : function(A) {
  11528. if (this.shim) {
  11529. this.shim.remove()
  11530. }
  11531. this.dd.unreg();
  11532. Ext.removeNode(this.proxy);
  11533. if (A) {
  11534. this.el.remove()
  11535. }
  11536. }
  11537. });
  11538. Ext.SplitBar.createProxy = function(B) {
  11539. var C = new Ext.Element(document.createElement("div"));
  11540. C.unselectable();
  11541. var A = "x-splitbar-proxy";
  11542. C.addClass(A + " " + (B == Ext.SplitBar.HORIZONTAL ? A + "-h" : A + "-v"));
  11543. document.body.appendChild(C.dom);
  11544. return C.dom
  11545. };
  11546. Ext.SplitBar.BasicLayoutAdapter = function() {
  11547. };
  11548. Ext.SplitBar.BasicLayoutAdapter.prototype = {
  11549. init : function(A) {
  11550. },
  11551. getElementSize : function(A) {
  11552. if (A.orientation == Ext.SplitBar.HORIZONTAL) {
  11553. return A.resizingEl.getWidth()
  11554. } else {
  11555. return A.resizingEl.getHeight()
  11556. }
  11557. },
  11558. setElementSize : function(B, A, C) {
  11559. if (B.orientation == Ext.SplitBar.HORIZONTAL) {
  11560. if (!B.animate) {
  11561. B.resizingEl.setWidth(A);
  11562. if (C) {
  11563. C(B, A)
  11564. }
  11565. } else {
  11566. B.resizingEl.setWidth(A, true, 0.1, C, "easeOut")
  11567. }
  11568. } else {
  11569. if (!B.animate) {
  11570. B.resizingEl.setHeight(A);
  11571. if (C) {
  11572. C(B, A)
  11573. }
  11574. } else {
  11575. B.resizingEl.setHeight(A, true, 0.1, C, "easeOut")
  11576. }
  11577. }
  11578. }
  11579. };
  11580. Ext.SplitBar.AbsoluteLayoutAdapter = function(A) {
  11581. this.basic = new Ext.SplitBar.BasicLayoutAdapter();
  11582. this.container = Ext.get(A)
  11583. };
  11584. Ext.SplitBar.AbsoluteLayoutAdapter.prototype = {
  11585. init : function(A) {
  11586. this.basic.init(A)
  11587. },
  11588. getElementSize : function(A) {
  11589. return this.basic.getElementSize(A)
  11590. },
  11591. setElementSize : function(B, A, C) {
  11592. this.basic.setElementSize(B, A, this.moveSplitter.createDelegate(this,
  11593. [B]))
  11594. },
  11595. moveSplitter : function(A) {
  11596. var B = Ext.SplitBar;
  11597. switch (A.placement) {
  11598. case B.LEFT :
  11599. A.el.setX(A.resizingEl.getRight());
  11600. break;
  11601. case B.RIGHT :
  11602. A.el.setStyle("right",
  11603. (this.container.getWidth() - A.resizingEl.getLeft())
  11604. + "px");
  11605. break;
  11606. case B.TOP :
  11607. A.el.setY(A.resizingEl.getBottom());
  11608. break;
  11609. case B.BOTTOM :
  11610. A.el.setY(A.resizingEl.getTop() - A.el.getHeight());
  11611. break
  11612. }
  11613. }
  11614. };
  11615. Ext.SplitBar.VERTICAL = 1;
  11616. Ext.SplitBar.HORIZONTAL = 2;
  11617. Ext.SplitBar.LEFT = 1;
  11618. Ext.SplitBar.RIGHT = 2;
  11619. Ext.SplitBar.TOP = 3;
  11620. Ext.SplitBar.BOTTOM = 4;
  11621. Ext.Container = Ext.extend(Ext.BoxComponent, {
  11622. autoDestroy : true,
  11623. defaultType : "panel",
  11624. initComponent : function() {
  11625. Ext.Container.superclass.initComponent.call(this);
  11626. this.addEvents("afterlayout", "beforeadd", "beforeremove",
  11627. "add", "remove");
  11628. var A = this.items;
  11629. if (A) {
  11630. delete this.items;
  11631. if (Ext.isArray(A)) {
  11632. this.add.apply(this, A)
  11633. } else {
  11634. this.add(A)
  11635. }
  11636. }
  11637. },
  11638. initItems : function() {
  11639. if (!this.items) {
  11640. this.items = new Ext.util.MixedCollection(false,
  11641. this.getComponentId);
  11642. this.getLayout()
  11643. }
  11644. },
  11645. setLayout : function(A) {
  11646. if (this.layout && this.layout != A) {
  11647. this.layout.setContainer(null)
  11648. }
  11649. this.initItems();
  11650. this.layout = A;
  11651. A.setContainer(this)
  11652. },
  11653. render : function() {
  11654. Ext.Container.superclass.render.apply(this, arguments);
  11655. if (this.layout) {
  11656. if (typeof this.layout == "string") {
  11657. this.layout = new Ext.Container.LAYOUTS[this.layout
  11658. .toLowerCase()](this.layoutConfig)
  11659. }
  11660. this.setLayout(this.layout);
  11661. if (this.activeItem !== undefined) {
  11662. var A = this.activeItem;
  11663. delete this.activeItem;
  11664. this.layout.setActiveItem(A);
  11665. return
  11666. }
  11667. }
  11668. if (!this.ownerCt) {
  11669. this.doLayout()
  11670. }
  11671. if (this.monitorResize === true) {
  11672. Ext.EventManager.onWindowResize(this.doLayout, this,
  11673. [false])
  11674. }
  11675. },
  11676. getLayoutTarget : function() {
  11677. return this.el
  11678. },
  11679. getComponentId : function(A) {
  11680. return A.itemId || A.id
  11681. },
  11682. add : function(C) {
  11683. if (!this.items) {
  11684. this.initItems()
  11685. }
  11686. var B = arguments, A = B.length;
  11687. if (A > 1) {
  11688. for (var D = 0; D < A; D++) {
  11689. this.add(B[D])
  11690. }
  11691. return
  11692. }
  11693. var F = this.lookupComponent(this.applyDefaults(C));
  11694. var E = this.items.length;
  11695. if (this.fireEvent("beforeadd", this, F, E) !== false
  11696. && this.onBeforeAdd(F) !== false) {
  11697. this.items.add(F);
  11698. F.ownerCt = this;
  11699. this.fireEvent("add", this, F, E)
  11700. }
  11701. return F
  11702. },
  11703. insert : function(D, C) {
  11704. if (!this.items) {
  11705. this.initItems()
  11706. }
  11707. var B = arguments, A = B.length;
  11708. if (A > 2) {
  11709. for (var E = A - 1; E >= 1; --E) {
  11710. this.insert(D, B[E])
  11711. }
  11712. return
  11713. }
  11714. var F = this.lookupComponent(this.applyDefaults(C));
  11715. if (F.ownerCt == this && this.items.indexOf(F) < D) {
  11716. --D
  11717. }
  11718. if (this.fireEvent("beforeadd", this, F, D) !== false
  11719. && this.onBeforeAdd(F) !== false) {
  11720. this.items.insert(D, F);
  11721. F.ownerCt = this;
  11722. this.fireEvent("add", this, F, D)
  11723. }
  11724. return F
  11725. },
  11726. applyDefaults : function(A) {
  11727. if (this.defaults) {
  11728. if (typeof A == "string") {
  11729. A = Ext.ComponentMgr.get(A);
  11730. Ext.apply(A, this.defaults)
  11731. } else {
  11732. if (!A.events) {
  11733. Ext.applyIf(A, this.defaults)
  11734. } else {
  11735. Ext.apply(A, this.defaults)
  11736. }
  11737. }
  11738. }
  11739. return A
  11740. },
  11741. onBeforeAdd : function(A) {
  11742. if (A.ownerCt) {
  11743. A.ownerCt.remove(A, false)
  11744. }
  11745. if (this.hideBorders === true) {
  11746. A.border = (A.border === true)
  11747. }
  11748. },
  11749. remove : function(A, B) {
  11750. var C = this.getComponent(A);
  11751. if (C && this.fireEvent("beforeremove", this, C) !== false) {
  11752. this.items.remove(C);
  11753. delete C.ownerCt;
  11754. if (B === true || (B !== false && this.autoDestroy)) {
  11755. C.destroy()
  11756. }
  11757. if (this.layout && this.layout.activeItem == C) {
  11758. delete this.layout.activeItem
  11759. }
  11760. this.fireEvent("remove", this, C)
  11761. }
  11762. return C
  11763. },
  11764. getComponent : function(A) {
  11765. if (typeof A == "object") {
  11766. return A
  11767. }
  11768. return this.items.get(A)
  11769. },
  11770. lookupComponent : function(A) {
  11771. if (typeof A == "string") {
  11772. return Ext.ComponentMgr.get(A)
  11773. } else {
  11774. if (!A.events) {
  11775. return this.createComponent(A)
  11776. }
  11777. }
  11778. return A
  11779. },
  11780. createComponent : function(A) {
  11781. return Ext.ComponentMgr.create(A, this.defaultType)
  11782. },
  11783. doLayout : function(D) {
  11784. if (this.rendered && this.layout) {
  11785. this.layout.layout()
  11786. }
  11787. if (D !== false && this.items) {
  11788. var C = this.items.items;
  11789. for (var B = 0, A = C.length; B < A; B++) {
  11790. var E = C[B];
  11791. if (E.doLayout) {
  11792. E.doLayout()
  11793. }
  11794. }
  11795. }
  11796. },
  11797. getLayout : function() {
  11798. if (!this.layout) {
  11799. var A = new Ext.layout.ContainerLayout(this.layoutConfig);
  11800. this.setLayout(A)
  11801. }
  11802. return this.layout
  11803. },
  11804. onDestroy : function() {
  11805. if (this.items) {
  11806. var C = this.items.items;
  11807. for (var B = 0, A = C.length; B < A; B++) {
  11808. Ext.destroy(C[B])
  11809. }
  11810. }
  11811. if (this.monitorResize) {
  11812. Ext.EventManager.removeResizeListener(this.doLayout, this)
  11813. }
  11814. Ext.Container.superclass.onDestroy.call(this)
  11815. },
  11816. bubble : function(C, B, A) {
  11817. var D = this;
  11818. while (D) {
  11819. if (C.apply(B || D, A || [D]) === false) {
  11820. break
  11821. }
  11822. D = D.ownerCt
  11823. }
  11824. },
  11825. cascade : function(F, E, B) {
  11826. if (F.apply(E || this, B || [this]) !== false) {
  11827. if (this.items) {
  11828. var D = this.items.items;
  11829. for (var C = 0, A = D.length; C < A; C++) {
  11830. if (D[C].cascade) {
  11831. D[C].cascade(F, E, B)
  11832. } else {
  11833. F.apply(E || this, B || [D[C]])
  11834. }
  11835. }
  11836. }
  11837. }
  11838. },
  11839. findById : function(C) {
  11840. var A, B = this;
  11841. this.cascade(function(D) {
  11842. if (B != D && D.id === C) {
  11843. A = D;
  11844. return false
  11845. }
  11846. });
  11847. return A || null
  11848. },
  11849. findByType : function(A) {
  11850. return typeof A == "function" ? this.findBy(function(B) {
  11851. return B.constructor === A
  11852. }) : this.findBy(function(B) {
  11853. return B.constructor.xtype === A
  11854. })
  11855. },
  11856. find : function(B, A) {
  11857. return this.findBy(function(C) {
  11858. return C[B] === A
  11859. })
  11860. },
  11861. findBy : function(D, C) {
  11862. var A = [], B = this;
  11863. this.cascade(function(E) {
  11864. if (B != E && D.call(C || E, E, B) === true) {
  11865. A.push(E)
  11866. }
  11867. });
  11868. return A
  11869. }
  11870. });
  11871. Ext.Container.LAYOUTS = {};
  11872. Ext.reg("container", Ext.Container);
  11873. Ext.layout.ContainerLayout = function(A) {
  11874. Ext.apply(this, A)
  11875. };
  11876. Ext.layout.ContainerLayout.prototype = {
  11877. monitorResize : false,
  11878. activeItem : null,
  11879. layout : function() {
  11880. var A = this.container.getLayoutTarget();
  11881. this.onLayout(this.container, A);
  11882. this.container.fireEvent("afterlayout", this.container, this)
  11883. },
  11884. onLayout : function(A, B) {
  11885. this.renderAll(A, B)
  11886. },
  11887. isValidParent : function(C, B) {
  11888. var A = C.getPositionEl ? C.getPositionEl() : C.getEl();
  11889. return A.dom.parentNode == B.dom
  11890. },
  11891. renderAll : function(D, E) {
  11892. var B = D.items.items;
  11893. for (var C = 0, A = B.length; C < A; C++) {
  11894. var F = B[C];
  11895. if (F && (!F.rendered || !this.isValidParent(F, E))) {
  11896. this.renderItem(F, C, E)
  11897. }
  11898. }
  11899. },
  11900. renderItem : function(D, A, C) {
  11901. if (D && !D.rendered) {
  11902. D.render(C, A);
  11903. if (this.extraCls) {
  11904. var B = D.getPositionEl ? D.getPositionEl() : D;
  11905. B.addClass(this.extraCls)
  11906. }
  11907. if (this.renderHidden && D != this.activeItem) {
  11908. D.hide()
  11909. }
  11910. } else {
  11911. if (D && !this.isValidParent(D, C)) {
  11912. if (this.extraCls) {
  11913. D.addClass(this.extraCls)
  11914. }
  11915. if (typeof A == "number") {
  11916. A = C.dom.childNodes[A]
  11917. }
  11918. C.dom.insertBefore(D.getEl().dom, A || null);
  11919. if (this.renderHidden && D != this.activeItem) {
  11920. D.hide()
  11921. }
  11922. }
  11923. }
  11924. },
  11925. onResize : function() {
  11926. if (this.container.collapsed) {
  11927. return
  11928. }
  11929. var A = this.container.bufferResize;
  11930. if (A) {
  11931. if (!this.resizeTask) {
  11932. this.resizeTask = new Ext.util.DelayedTask(this.layout, this);
  11933. this.resizeBuffer = typeof A == "number" ? A : 100
  11934. }
  11935. this.resizeTask.delay(this.resizeBuffer)
  11936. } else {
  11937. this.layout()
  11938. }
  11939. },
  11940. setContainer : function(A) {
  11941. if (this.monitorResize && A != this.container) {
  11942. if (this.container) {
  11943. this.container.un("resize", this.onResize, this)
  11944. }
  11945. if (A) {
  11946. A.on("resize", this.onResize, this)
  11947. }
  11948. }
  11949. this.container = A
  11950. },
  11951. parseMargins : function(B) {
  11952. var C = B.split(" ");
  11953. var A = C.length;
  11954. if (A == 1) {
  11955. C[1] = C[0];
  11956. C[2] = C[0];
  11957. C[3] = C[0]
  11958. }
  11959. if (A == 2) {
  11960. C[2] = C[0];
  11961. C[3] = C[1]
  11962. }
  11963. return {
  11964. top : parseInt(C[0], 10) || 0,
  11965. right : parseInt(C[1], 10) || 0,
  11966. bottom : parseInt(C[2], 10) || 0,
  11967. left : parseInt(C[3], 10) || 0
  11968. }
  11969. }
  11970. };
  11971. Ext.Container.LAYOUTS["auto"] = Ext.layout.ContainerLayout;
  11972. Ext.layout.FitLayout = Ext.extend(Ext.layout.ContainerLayout, {
  11973. monitorResize : true,
  11974. onLayout : function(A, B) {
  11975. Ext.layout.FitLayout.superclass.onLayout.call(this, A, B);
  11976. if (!this.container.collapsed) {
  11977. this.setItemSize(this.activeItem || A.items.itemAt(0), B
  11978. .getStyleSize())
  11979. }
  11980. },
  11981. setItemSize : function(B, A) {
  11982. if (B && A.height > 0) {
  11983. B.setSize(A)
  11984. }
  11985. }
  11986. });
  11987. Ext.Container.LAYOUTS["fit"] = Ext.layout.FitLayout;
  11988. Ext.layout.CardLayout = Ext.extend(Ext.layout.FitLayout, {
  11989. deferredRender : false,
  11990. renderHidden : true,
  11991. setActiveItem : function(A) {
  11992. A = this.container.getComponent(A);
  11993. if (this.activeItem != A) {
  11994. if (this.activeItem) {
  11995. this.activeItem.hide()
  11996. }
  11997. this.activeItem = A;
  11998. A.show();
  11999. this.layout()
  12000. }
  12001. },
  12002. renderAll : function(A, B) {
  12003. if (this.deferredRender) {
  12004. this.renderItem(this.activeItem, undefined, B)
  12005. } else {
  12006. Ext.layout.CardLayout.superclass.renderAll.call(this, A, B)
  12007. }
  12008. }
  12009. });
  12010. Ext.Container.LAYOUTS["card"] = Ext.layout.CardLayout;
  12011. Ext.layout.AnchorLayout = Ext.extend(Ext.layout.ContainerLayout, {
  12012. monitorResize : true,
  12013. getAnchorViewSize : function(A, B) {
  12014. return B.dom == document.body ? B.getViewSize() : B.getStyleSize()
  12015. },
  12016. onLayout : function(F, I) {
  12017. Ext.layout.AnchorLayout.superclass.onLayout.call(this, F, I);
  12018. var O = this.getAnchorViewSize(F, I);
  12019. var M = O.width, E = O.height;
  12020. if (M < 20 || E < 20) {
  12021. return
  12022. }
  12023. var B, K;
  12024. if (F.anchorSize) {
  12025. if (typeof F.anchorSize == "number") {
  12026. B = F.anchorSize
  12027. } else {
  12028. B = F.anchorSize.width;
  12029. K = F.anchorSize.height
  12030. }
  12031. } else {
  12032. B = F.initialConfig.width;
  12033. K = F.initialConfig.height
  12034. }
  12035. var H = F.items.items, G = H.length, D, J, L, C, A;
  12036. for (D = 0; D < G; D++) {
  12037. J = H[D];
  12038. if (J.anchor) {
  12039. L = J.anchorSpec;
  12040. if (!L) {
  12041. var N = J.anchor.split(" ");
  12042. J.anchorSpec = L = {
  12043. right : this
  12044. .parseAnchor(N[0], J.initialConfig.width, B),
  12045. bottom : this.parseAnchor(N[1], J.initialConfig.height,
  12046. K)
  12047. }
  12048. }
  12049. C = L.right ? this.adjustWidthAnchor(L.right(M), J) : undefined;
  12050. A = L.bottom
  12051. ? this.adjustHeightAnchor(L.bottom(E), J)
  12052. : undefined;
  12053. if (C || A) {
  12054. J.setSize(C || undefined, A || undefined)
  12055. }
  12056. }
  12057. }
  12058. },
  12059. parseAnchor : function(B, F, A) {
  12060. if (B && B != "none") {
  12061. var D;
  12062. if (/^(r|right|b|bottom)$/i.test(B)) {
  12063. var E = A - F;
  12064. return function(G) {
  12065. if (G !== D) {
  12066. D = G;
  12067. return G - E
  12068. }
  12069. }
  12070. } else {
  12071. if (B.indexOf("%") != -1) {
  12072. var C = parseFloat(B.replace("%", "")) * 0.01;
  12073. return function(G) {
  12074. if (G !== D) {
  12075. D = G;
  12076. return Math.floor(G * C)
  12077. }
  12078. }
  12079. } else {
  12080. B = parseInt(B, 10);
  12081. if (!isNaN(B)) {
  12082. return function(G) {
  12083. if (G !== D) {
  12084. D = G;
  12085. return G + B
  12086. }
  12087. }
  12088. }
  12089. }
  12090. }
  12091. }
  12092. return false
  12093. },
  12094. adjustWidthAnchor : function(B, A) {
  12095. return B
  12096. },
  12097. adjustHeightAnchor : function(B, A) {
  12098. return B
  12099. }
  12100. });
  12101. Ext.Container.LAYOUTS["anchor"] = Ext.layout.AnchorLayout;
  12102. Ext.layout.ColumnLayout = Ext.extend(Ext.layout.ContainerLayout, {
  12103. monitorResize : true,
  12104. extraCls : "x-column",
  12105. scrollOffset : 0,
  12106. isValidParent : function(B, A) {
  12107. return B.getEl().dom.parentNode == this.innerCt.dom
  12108. },
  12109. onLayout : function(C, F) {
  12110. var D = C.items.items, E = D.length, G, A;
  12111. if (!this.innerCt) {
  12112. F.addClass("x-column-layout-ct");
  12113. this.innerCt = F.createChild({
  12114. cls : "x-column-inner"
  12115. });
  12116. this.innerCt.createChild({
  12117. cls : "x-clear"
  12118. })
  12119. }
  12120. this.renderAll(C, this.innerCt);
  12121. var J = F.getViewSize();
  12122. if (J.width < 1 && J.height < 1) {
  12123. return
  12124. }
  12125. var H = J.width - F.getPadding("lr") - this.scrollOffset, B = J.height
  12126. - F.getPadding("tb"), I = H;
  12127. this.innerCt.setWidth(H);
  12128. for (A = 0; A < E; A++) {
  12129. G = D[A];
  12130. if (!G.columnWidth) {
  12131. I -= (G.getSize().width + G.getEl().getMargins("lr"))
  12132. }
  12133. }
  12134. I = I < 0 ? 0 : I;
  12135. for (A = 0; A < E; A++) {
  12136. G = D[A];
  12137. if (G.columnWidth) {
  12138. G.setSize(Math.floor(G.columnWidth * I)
  12139. - G.getEl().getMargins("lr"))
  12140. }
  12141. }
  12142. }
  12143. });
  12144. Ext.Container.LAYOUTS["column"] = Ext.layout.ColumnLayout;
  12145. Ext.layout.BorderLayout = Ext.extend(Ext.layout.ContainerLayout, {
  12146. monitorResize : true,
  12147. rendered : false,
  12148. onLayout : function(B, X) {
  12149. var C;
  12150. if (!this.rendered) {
  12151. X.position();
  12152. X.addClass("x-border-layout-ct");
  12153. var M = B.items.items;
  12154. C = [];
  12155. for (var Q = 0, R = M.length; Q < R; Q++) {
  12156. var U = M[Q];
  12157. var F = U.region;
  12158. if (U.collapsed) {
  12159. C.push(U)
  12160. }
  12161. U.collapsed = false;
  12162. if (!U.rendered) {
  12163. U.cls = U.cls
  12164. ? U.cls + " x-border-panel"
  12165. : "x-border-panel";
  12166. U.render(X, Q)
  12167. }
  12168. this[F] = F != "center" && U.split
  12169. ? new Ext.layout.BorderLayout.SplitRegion(this,
  12170. U.initialConfig, F)
  12171. : new Ext.layout.BorderLayout.Region(this,
  12172. U.initialConfig, F);
  12173. this[F].render(X, U)
  12174. }
  12175. this.rendered = true
  12176. }
  12177. var L = X.getViewSize();
  12178. if (L.width < 20 || L.height < 20) {
  12179. if (C) {
  12180. this.restoreCollapsed = C
  12181. }
  12182. return
  12183. } else {
  12184. if (this.restoreCollapsed) {
  12185. C = this.restoreCollapsed;
  12186. delete this.restoreCollapsed
  12187. }
  12188. }
  12189. var J = L.width, S = L.height;
  12190. var I = J, P = S, G = 0, H = 0;
  12191. var N = this.north, K = this.south, E = this.west, T = this.east, U = this.center;
  12192. if (!U) {
  12193. throw "No center region defined in BorderLayout " + B.id
  12194. }
  12195. if (N && N.isVisible()) {
  12196. var W = N.getSize();
  12197. var O = N.getMargins();
  12198. W.width = J - (O.left + O.right);
  12199. W.x = O.left;
  12200. W.y = O.top;
  12201. G = W.height + W.y + O.bottom;
  12202. P -= G;
  12203. N.applyLayout(W)
  12204. }
  12205. if (K && K.isVisible()) {
  12206. var W = K.getSize();
  12207. var O = K.getMargins();
  12208. W.width = J - (O.left + O.right);
  12209. W.x = O.left;
  12210. var V = (W.height + O.top + O.bottom);
  12211. W.y = S - V + O.top;
  12212. P -= V;
  12213. K.applyLayout(W)
  12214. }
  12215. if (E && E.isVisible()) {
  12216. var W = E.getSize();
  12217. var O = E.getMargins();
  12218. W.height = P - (O.top + O.bottom);
  12219. W.x = O.left;
  12220. W.y = G + O.top;
  12221. var A = (W.width + O.left + O.right);
  12222. H += A;
  12223. I -= A;
  12224. E.applyLayout(W)
  12225. }
  12226. if (T && T.isVisible()) {
  12227. var W = T.getSize();
  12228. var O = T.getMargins();
  12229. W.height = P - (O.top + O.bottom);
  12230. var A = (W.width + O.left + O.right);
  12231. W.x = J - A + O.left;
  12232. W.y = G + O.top;
  12233. I -= A;
  12234. T.applyLayout(W)
  12235. }
  12236. var O = U.getMargins();
  12237. var D = {
  12238. x : H + O.left,
  12239. y : G + O.top,
  12240. width : I - (O.left + O.right),
  12241. height : P - (O.top + O.bottom)
  12242. };
  12243. U.applyLayout(D);
  12244. if (C) {
  12245. for (var Q = 0, R = C.length; Q < R; Q++) {
  12246. C[Q].collapse(false)
  12247. }
  12248. }
  12249. if (Ext.isIE && Ext.isStrict) {
  12250. X.repaint()
  12251. }
  12252. }
  12253. });
  12254. Ext.layout.BorderLayout.Region = function(B, A, C) {
  12255. Ext.apply(this, A);
  12256. this.layout = B;
  12257. this.position = C;
  12258. this.state = {};
  12259. if (typeof this.margins == "string") {
  12260. this.margins = this.layout.parseMargins(this.margins)
  12261. }
  12262. this.margins = Ext.applyIf(this.margins || {}, this.defaultMargins);
  12263. if (this.collapsible) {
  12264. if (typeof this.cmargins == "string") {
  12265. this.cmargins = this.layout.parseMargins(this.cmargins)
  12266. }
  12267. if (this.collapseMode == "mini" && !this.cmargins) {
  12268. this.cmargins = {
  12269. left : 0,
  12270. top : 0,
  12271. right : 0,
  12272. bottom : 0
  12273. }
  12274. } else {
  12275. this.cmargins = Ext.applyIf(this.cmargins || {}, C == "north"
  12276. || C == "south"
  12277. ? this.defaultNSCMargins
  12278. : this.defaultEWCMargins)
  12279. }
  12280. }
  12281. };
  12282. Ext.layout.BorderLayout.Region.prototype = {
  12283. collapsible : false,
  12284. split : false,
  12285. floatable : true,
  12286. minWidth : 50,
  12287. minHeight : 50,
  12288. defaultMargins : {
  12289. left : 0,
  12290. top : 0,
  12291. right : 0,
  12292. bottom : 0
  12293. },
  12294. defaultNSCMargins : {
  12295. left : 5,
  12296. top : 5,
  12297. right : 5,
  12298. bottom : 5
  12299. },
  12300. defaultEWCMargins : {
  12301. left : 5,
  12302. top : 0,
  12303. right : 5,
  12304. bottom : 0
  12305. },
  12306. isCollapsed : false,
  12307. render : function(B, C) {
  12308. this.panel = C;
  12309. C.el.enableDisplayMode();
  12310. this.targetEl = B;
  12311. this.el = C.el;
  12312. var A = C.getState, D = this.position;
  12313. C.getState = function() {
  12314. return Ext.apply(A.call(C) || {}, this.state)
  12315. }.createDelegate(this);
  12316. if (D != "center") {
  12317. C.allowQueuedExpand = false;
  12318. C.on({
  12319. beforecollapse : this.beforeCollapse,
  12320. collapse : this.onCollapse,
  12321. beforeexpand : this.beforeExpand,
  12322. expand : this.onExpand,
  12323. hide : this.onHide,
  12324. show : this.onShow,
  12325. scope : this
  12326. });
  12327. if (this.collapsible) {
  12328. C.collapseEl = "el";
  12329. C.slideAnchor = this.getSlideAnchor()
  12330. }
  12331. if (C.tools && C.tools.toggle) {
  12332. C.tools.toggle.addClass("x-tool-collapse-" + D);
  12333. C.tools.toggle.addClassOnOver("x-tool-collapse-" + D + "-over")
  12334. }
  12335. }
  12336. },
  12337. getCollapsedEl : function() {
  12338. if (!this.collapsedEl) {
  12339. if (!this.toolTemplate) {
  12340. var B = new Ext.Template("<div class=\"x-tool x-tool-{id}\">&#160;</div>");
  12341. B.disableFormats = true;
  12342. B.compile();
  12343. Ext.layout.BorderLayout.Region.prototype.toolTemplate = B
  12344. }
  12345. this.collapsedEl = this.targetEl.createChild({
  12346. cls : "x-layout-collapsed x-layout-collapsed-"
  12347. + this.position,
  12348. id : this.panel.id + "-xcollapsed"
  12349. });
  12350. this.collapsedEl.enableDisplayMode("block");
  12351. if (this.collapseMode == "mini") {
  12352. this.collapsedEl.addClass("x-layout-cmini-" + this.position);
  12353. this.miniCollapsedEl = this.collapsedEl.createChild({
  12354. cls : "x-layout-mini x-layout-mini-"
  12355. + this.position,
  12356. html : "&#160;"
  12357. });
  12358. this.miniCollapsedEl.addClassOnOver("x-layout-mini-over");
  12359. this.collapsedEl.addClassOnOver("x-layout-collapsed-over");
  12360. this.collapsedEl.on("click", this.onExpandClick, this, {
  12361. stopEvent : true
  12362. })
  12363. } else {
  12364. var A = this.toolTemplate.append(this.collapsedEl.dom, {
  12365. id : "expand-" + this.position
  12366. }, true);
  12367. A.addClassOnOver("x-tool-expand-" + this.position + "-over");
  12368. A.on("click", this.onExpandClick, this, {
  12369. stopEvent : true
  12370. });
  12371. if (this.floatable !== false) {
  12372. this.collapsedEl.addClassOnOver("x-layout-collapsed-over");
  12373. this.collapsedEl.on("click", this.collapseClick, this)
  12374. }
  12375. }
  12376. }
  12377. return this.collapsedEl
  12378. },
  12379. onExpandClick : function(A) {
  12380. if (this.isSlid) {
  12381. this.afterSlideIn();
  12382. this.panel.expand(false)
  12383. } else {
  12384. this.panel.expand()
  12385. }
  12386. },
  12387. onCollapseClick : function(A) {
  12388. this.panel.collapse()
  12389. },
  12390. beforeCollapse : function(B, A) {
  12391. this.lastAnim = A;
  12392. if (this.splitEl) {
  12393. this.splitEl.hide()
  12394. }
  12395. this.getCollapsedEl().show();
  12396. this.panel.el.setStyle("z-index", 100);
  12397. this.isCollapsed = true;
  12398. this.layout.layout()
  12399. },
  12400. onCollapse : function(A) {
  12401. this.panel.el.setStyle("z-index", 1);
  12402. if (this.lastAnim === false || this.panel.animCollapse === false) {
  12403. this.getCollapsedEl().dom.style.visibility = "visible"
  12404. } else {
  12405. this.getCollapsedEl().slideIn(this.panel.slideAnchor, {
  12406. duration : 0.2
  12407. })
  12408. }
  12409. this.state.collapsed = true;
  12410. this.panel.saveState()
  12411. },
  12412. beforeExpand : function(A) {
  12413. var B = this.getCollapsedEl();
  12414. this.el.show();
  12415. if (this.position == "east" || this.position == "west") {
  12416. this.panel.setSize(undefined, B.getHeight())
  12417. } else {
  12418. this.panel.setSize(B.getWidth(), undefined)
  12419. }
  12420. B.hide();
  12421. B.dom.style.visibility = "hidden";
  12422. this.panel.el.setStyle("z-index", 100)
  12423. },
  12424. onExpand : function() {
  12425. this.isCollapsed = false;
  12426. if (this.splitEl) {
  12427. this.splitEl.show()
  12428. }
  12429. this.layout.layout();
  12430. this.panel.el.setStyle("z-index", 1);
  12431. this.state.collapsed = false;
  12432. this.panel.saveState()
  12433. },
  12434. collapseClick : function(A) {
  12435. if (this.isSlid) {
  12436. A.stopPropagation();
  12437. this.slideIn()
  12438. } else {
  12439. A.stopPropagation();
  12440. this.slideOut()
  12441. }
  12442. },
  12443. onHide : function() {
  12444. if (this.isCollapsed) {
  12445. this.getCollapsedEl().hide()
  12446. } else {
  12447. if (this.splitEl) {
  12448. this.splitEl.hide()
  12449. }
  12450. }
  12451. },
  12452. onShow : function() {
  12453. if (this.isCollapsed) {
  12454. this.getCollapsedEl().show()
  12455. } else {
  12456. if (this.splitEl) {
  12457. this.splitEl.show()
  12458. }
  12459. }
  12460. },
  12461. isVisible : function() {
  12462. return !this.panel.hidden
  12463. },
  12464. getMargins : function() {
  12465. return this.isCollapsed && this.cmargins ? this.cmargins : this.margins
  12466. },
  12467. getSize : function() {
  12468. return this.isCollapsed ? this.getCollapsedEl().getSize() : this.panel
  12469. .getSize()
  12470. },
  12471. setPanel : function(A) {
  12472. this.panel = A
  12473. },
  12474. getMinWidth : function() {
  12475. return this.minWidth
  12476. },
  12477. getMinHeight : function() {
  12478. return this.minHeight
  12479. },
  12480. applyLayoutCollapsed : function(A) {
  12481. var B = this.getCollapsedEl();
  12482. B.setLeftTop(A.x, A.y);
  12483. B.setSize(A.width, A.height)
  12484. },
  12485. applyLayout : function(A) {
  12486. if (this.isCollapsed) {
  12487. this.applyLayoutCollapsed(A)
  12488. } else {
  12489. this.panel.setPosition(A.x, A.y);
  12490. this.panel.setSize(A.width, A.height)
  12491. }
  12492. },
  12493. beforeSlide : function() {
  12494. this.panel.beforeEffect()
  12495. },
  12496. afterSlide : function() {
  12497. this.panel.afterEffect()
  12498. },
  12499. initAutoHide : function() {
  12500. if (this.autoHide !== false) {
  12501. if (!this.autoHideHd) {
  12502. var A = new Ext.util.DelayedTask(this.slideIn, this);
  12503. this.autoHideHd = {
  12504. "mouseout" : function(B) {
  12505. if (!B.within(this.el, true)) {
  12506. A.delay(500)
  12507. }
  12508. },
  12509. "mouseover" : function(B) {
  12510. A.cancel()
  12511. },
  12512. scope : this
  12513. }
  12514. }
  12515. this.el.on(this.autoHideHd)
  12516. }
  12517. },
  12518. clearAutoHide : function() {
  12519. if (this.autoHide !== false) {
  12520. this.el.un("mouseout", this.autoHideHd.mouseout);
  12521. this.el.un("mouseover", this.autoHideHd.mouseover)
  12522. }
  12523. },
  12524. clearMonitor : function() {
  12525. Ext.getDoc().un("click", this.slideInIf, this)
  12526. },
  12527. slideOut : function() {
  12528. if (this.isSlid || this.el.hasActiveFx()) {
  12529. return
  12530. }
  12531. this.isSlid = true;
  12532. var A = this.panel.tools;
  12533. if (A && A.toggle) {
  12534. A.toggle.hide()
  12535. }
  12536. this.el.show();
  12537. if (this.position == "east" || this.position == "west") {
  12538. this.panel.setSize(undefined, this.collapsedEl.getHeight())
  12539. } else {
  12540. this.panel.setSize(this.collapsedEl.getWidth(), undefined)
  12541. }
  12542. this.restoreLT = [this.el.dom.style.left, this.el.dom.style.top];
  12543. this.el.alignTo(this.collapsedEl, this.getCollapseAnchor());
  12544. this.el.setStyle("z-index", 102);
  12545. if (this.animFloat !== false) {
  12546. this.beforeSlide();
  12547. this.el.slideIn(this.getSlideAnchor(), {
  12548. callback : function() {
  12549. this.afterSlide();
  12550. this.initAutoHide();
  12551. Ext.getDoc().on("click", this.slideInIf, this)
  12552. },
  12553. scope : this,
  12554. block : true
  12555. })
  12556. } else {
  12557. this.initAutoHide();
  12558. Ext.getDoc().on("click", this.slideInIf, this)
  12559. }
  12560. },
  12561. afterSlideIn : function() {
  12562. this.clearAutoHide();
  12563. this.isSlid = false;
  12564. this.clearMonitor();
  12565. this.el.setStyle("z-index", "");
  12566. this.el.dom.style.left = this.restoreLT[0];
  12567. this.el.dom.style.top = this.restoreLT[1];
  12568. var A = this.panel.tools;
  12569. if (A && A.toggle) {
  12570. A.toggle.show()
  12571. }
  12572. },
  12573. slideIn : function(A) {
  12574. if (!this.isSlid || this.el.hasActiveFx()) {
  12575. Ext.callback(A);
  12576. return
  12577. }
  12578. this.isSlid = false;
  12579. if (this.animFloat !== false) {
  12580. this.beforeSlide();
  12581. this.el.slideOut(this.getSlideAnchor(), {
  12582. callback : function() {
  12583. this.el.hide();
  12584. this.afterSlide();
  12585. this.afterSlideIn();
  12586. Ext.callback(A)
  12587. },
  12588. scope : this,
  12589. block : true
  12590. })
  12591. } else {
  12592. this.el.hide();
  12593. this.afterSlideIn()
  12594. }
  12595. },
  12596. slideInIf : function(A) {
  12597. if (!A.within(this.el)) {
  12598. this.slideIn()
  12599. }
  12600. },
  12601. anchors : {
  12602. "west" : "left",
  12603. "east" : "right",
  12604. "north" : "top",
  12605. "south" : "bottom"
  12606. },
  12607. sanchors : {
  12608. "west" : "l",
  12609. "east" : "r",
  12610. "north" : "t",
  12611. "south" : "b"
  12612. },
  12613. canchors : {
  12614. "west" : "tl-tr",
  12615. "east" : "tr-tl",
  12616. "north" : "tl-bl",
  12617. "south" : "bl-tl"
  12618. },
  12619. getAnchor : function() {
  12620. return this.anchors[this.position]
  12621. },
  12622. getCollapseAnchor : function() {
  12623. return this.canchors[this.position]
  12624. },
  12625. getSlideAnchor : function() {
  12626. return this.sanchors[this.position]
  12627. },
  12628. getAlignAdj : function() {
  12629. var A = this.cmargins;
  12630. switch (this.position) {
  12631. case "west" :
  12632. return [0, 0];
  12633. break;
  12634. case "east" :
  12635. return [0, 0];
  12636. break;
  12637. case "north" :
  12638. return [0, 0];
  12639. break;
  12640. case "south" :
  12641. return [0, 0];
  12642. break
  12643. }
  12644. },
  12645. getExpandAdj : function() {
  12646. var B = this.collapsedEl, A = this.cmargins;
  12647. switch (this.position) {
  12648. case "west" :
  12649. return [-(A.right + B.getWidth() + A.left), 0];
  12650. break;
  12651. case "east" :
  12652. return [A.right + B.getWidth() + A.left, 0];
  12653. break;
  12654. case "north" :
  12655. return [0, -(A.top + A.bottom + B.getHeight())];
  12656. break;
  12657. case "south" :
  12658. return [0, A.top + A.bottom + B.getHeight()];
  12659. break
  12660. }
  12661. }
  12662. };
  12663. Ext.layout.BorderLayout.SplitRegion = function(B, A, C) {
  12664. Ext.layout.BorderLayout.SplitRegion.superclass.constructor.call(this, B, A,
  12665. C);
  12666. this.applyLayout = this.applyFns[C]
  12667. };
  12668. Ext.extend(Ext.layout.BorderLayout.SplitRegion, Ext.layout.BorderLayout.Region,
  12669. {
  12670. splitTip : "Drag to resize.",
  12671. collapsibleSplitTip : "Drag to resize. Double click to hide.",
  12672. useSplitTips : false,
  12673. splitSettings : {
  12674. north : {
  12675. orientation : Ext.SplitBar.VERTICAL,
  12676. placement : Ext.SplitBar.TOP,
  12677. maxFn : "getVMaxSize",
  12678. minProp : "minHeight",
  12679. maxProp : "maxHeight"
  12680. },
  12681. south : {
  12682. orientation : Ext.SplitBar.VERTICAL,
  12683. placement : Ext.SplitBar.BOTTOM,
  12684. maxFn : "getVMaxSize",
  12685. minProp : "minHeight",
  12686. maxProp : "maxHeight"
  12687. },
  12688. east : {
  12689. orientation : Ext.SplitBar.HORIZONTAL,
  12690. placement : Ext.SplitBar.RIGHT,
  12691. maxFn : "getHMaxSize",
  12692. minProp : "minWidth",
  12693. maxProp : "maxWidth"
  12694. },
  12695. west : {
  12696. orientation : Ext.SplitBar.HORIZONTAL,
  12697. placement : Ext.SplitBar.LEFT,
  12698. maxFn : "getHMaxSize",
  12699. minProp : "minWidth",
  12700. maxProp : "maxWidth"
  12701. }
  12702. },
  12703. applyFns : {
  12704. west : function(C) {
  12705. if (this.isCollapsed) {
  12706. return this.applyLayoutCollapsed(C)
  12707. }
  12708. var D = this.splitEl.dom, B = D.style;
  12709. this.panel.setPosition(C.x, C.y);
  12710. var A = D.offsetWidth;
  12711. B.left = (C.x + C.width - A) + "px";
  12712. B.top = (C.y) + "px";
  12713. B.height = Math.max(0, C.height) + "px";
  12714. this.panel.setSize(C.width - A, C.height)
  12715. },
  12716. east : function(C) {
  12717. if (this.isCollapsed) {
  12718. return this.applyLayoutCollapsed(C)
  12719. }
  12720. var D = this.splitEl.dom, B = D.style;
  12721. var A = D.offsetWidth;
  12722. this.panel.setPosition(C.x + A, C.y);
  12723. B.left = (C.x) + "px";
  12724. B.top = (C.y) + "px";
  12725. B.height = Math.max(0, C.height) + "px";
  12726. this.panel.setSize(C.width - A, C.height)
  12727. },
  12728. north : function(C) {
  12729. if (this.isCollapsed) {
  12730. return this.applyLayoutCollapsed(C)
  12731. }
  12732. var D = this.splitEl.dom, B = D.style;
  12733. var A = D.offsetHeight;
  12734. this.panel.setPosition(C.x, C.y);
  12735. B.left = (C.x) + "px";
  12736. B.top = (C.y + C.height - A) + "px";
  12737. B.width = Math.max(0, C.width) + "px";
  12738. this.panel.setSize(C.width, C.height - A)
  12739. },
  12740. south : function(C) {
  12741. if (this.isCollapsed) {
  12742. return this.applyLayoutCollapsed(C)
  12743. }
  12744. var D = this.splitEl.dom, B = D.style;
  12745. var A = D.offsetHeight;
  12746. this.panel.setPosition(C.x, C.y + A);
  12747. B.left = (C.x) + "px";
  12748. B.top = (C.y) + "px";
  12749. B.width = Math.max(0, C.width) + "px";
  12750. this.panel.setSize(C.width, C.height - A)
  12751. }
  12752. },
  12753. render : function(A, C) {
  12754. Ext.layout.BorderLayout.SplitRegion.superclass.render.call(
  12755. this, A, C);
  12756. var D = this.position;
  12757. this.splitEl = A.createChild({
  12758. cls : "x-layout-split x-layout-split-" + D,
  12759. html : "&#160;",
  12760. id : this.panel.id + "-xsplit"
  12761. });
  12762. if (this.collapseMode == "mini") {
  12763. this.miniSplitEl = this.splitEl.createChild({
  12764. cls : "x-layout-mini x-layout-mini-" + D,
  12765. html : "&#160;"
  12766. });
  12767. this.miniSplitEl.addClassOnOver("x-layout-mini-over");
  12768. this.miniSplitEl.on("click", this.onCollapseClick, this, {
  12769. stopEvent : true
  12770. })
  12771. }
  12772. var B = this.splitSettings[D];
  12773. this.split = new Ext.SplitBar(this.splitEl.dom, C.el,
  12774. B.orientation);
  12775. this.split.placement = B.placement;
  12776. this.split.getMaximumSize = this[B.maxFn].createDelegate(this);
  12777. this.split.minSize = this.minSize || this[B.minProp];
  12778. this.split.on("beforeapply", this.onSplitMove, this);
  12779. this.split.useShim = this.useShim === true;
  12780. this.maxSize = this.maxSize || this[B.maxProp];
  12781. if (C.hidden) {
  12782. this.splitEl.hide()
  12783. }
  12784. if (this.useSplitTips) {
  12785. this.splitEl.dom.title = this.collapsible
  12786. ? this.collapsibleSplitTip
  12787. : this.splitTip
  12788. }
  12789. if (this.collapsible) {
  12790. this.splitEl.on("dblclick", this.onCollapseClick, this)
  12791. }
  12792. },
  12793. getSize : function() {
  12794. if (this.isCollapsed) {
  12795. return this.collapsedEl.getSize()
  12796. }
  12797. var A = this.panel.getSize();
  12798. if (this.position == "north" || this.position == "south") {
  12799. A.height += this.splitEl.dom.offsetHeight
  12800. } else {
  12801. A.width += this.splitEl.dom.offsetWidth
  12802. }
  12803. return A
  12804. },
  12805. getHMaxSize : function() {
  12806. var B = this.maxSize || 10000;
  12807. var A = this.layout.center;
  12808. return Math.min(B, (this.el.getWidth() + A.el.getWidth())
  12809. - A.getMinWidth())
  12810. },
  12811. getVMaxSize : function() {
  12812. var B = this.maxSize || 10000;
  12813. var A = this.layout.center;
  12814. return Math.min(B, (this.el.getHeight() + A.el.getHeight())
  12815. - A.getMinHeight())
  12816. },
  12817. onSplitMove : function(B, A) {
  12818. var C = this.panel.getSize();
  12819. this.lastSplitSize = A;
  12820. if (this.position == "north" || this.position == "south") {
  12821. this.panel.setSize(C.width, A);
  12822. this.state.height = A
  12823. } else {
  12824. this.panel.setSize(A, C.height);
  12825. this.state.width = A
  12826. }
  12827. this.layout.layout();
  12828. this.panel.saveState();
  12829. return false
  12830. },
  12831. getSplitBar : function() {
  12832. return this.split
  12833. }
  12834. });
  12835. Ext.Container.LAYOUTS["border"] = Ext.layout.BorderLayout;
  12836. Ext.layout.FormLayout = Ext.extend(Ext.layout.AnchorLayout, {
  12837. labelSeparator : ":",
  12838. getAnchorViewSize : function(A, B) {
  12839. return A.body.getStyleSize()
  12840. },
  12841. setContainer : function(B) {
  12842. Ext.layout.FormLayout.superclass.setContainer.call(this, B);
  12843. if (B.labelAlign) {
  12844. B.addClass("x-form-label-" + B.labelAlign)
  12845. }
  12846. if (B.hideLabels) {
  12847. this.labelStyle = "display:none";
  12848. this.elementStyle = "padding-left:0;";
  12849. this.labelAdjust = 0
  12850. } else {
  12851. this.labelSeparator = B.labelSeparator || this.labelSeparator;
  12852. B.labelWidth = B.labelWidth || 100;
  12853. if (typeof B.labelWidth == "number") {
  12854. var C = (typeof B.labelPad == "number" ? B.labelPad : 5);
  12855. this.labelAdjust = B.labelWidth + C;
  12856. this.labelStyle = "width:" + B.labelWidth + "px;";
  12857. this.elementStyle = "padding-left:" + (B.labelWidth + C) + "px"
  12858. }
  12859. if (B.labelAlign == "top") {
  12860. this.labelStyle = "width:auto;";
  12861. this.labelAdjust = 0;
  12862. this.elementStyle = "padding-left:0;"
  12863. }
  12864. }
  12865. if (!this.fieldTpl) {
  12866. var A = new Ext.Template(
  12867. "<div class=\"x-form-item {5}\" tabIndex=\"-1\">",
  12868. "<label for=\"{0}\" style=\"{2}\" class=\"x-form-item-label\">{1}{4}</label>",
  12869. "<div class=\"x-form-element\" id=\"x-form-el-{0}\" style=\"{3}\">",
  12870. "</div><div class=\"{6}\"></div>", "</div>");
  12871. A.disableFormats = true;
  12872. A.compile();
  12873. Ext.layout.FormLayout.prototype.fieldTpl = A
  12874. }
  12875. },
  12876. renderItem : function(D, A, C) {
  12877. if (D && !D.rendered && D.isFormField && D.inputType != "hidden") {
  12878. var B = [
  12879. D.id,
  12880. D.fieldLabel,
  12881. D.labelStyle || this.labelStyle || "",
  12882. this.elementStyle || "",
  12883. typeof D.labelSeparator == "undefined"
  12884. ? this.labelSeparator
  12885. : D.labelSeparator,
  12886. (D.itemCls || this.container.itemCls || "")
  12887. + (D.hideLabel ? " x-hide-label" : ""),
  12888. D.clearCls || "x-form-clear-left"];
  12889. if (typeof A == "number") {
  12890. A = C.dom.childNodes[A] || null
  12891. }
  12892. if (A) {
  12893. this.fieldTpl.insertBefore(A, B)
  12894. } else {
  12895. this.fieldTpl.append(C, B)
  12896. }
  12897. D.render("x-form-el-" + D.id)
  12898. } else {
  12899. Ext.layout.FormLayout.superclass.renderItem.apply(this, arguments)
  12900. }
  12901. },
  12902. adjustWidthAnchor : function(B, A) {
  12903. return B - (A.isFormField ? (A.hideLabel ? 0 : this.labelAdjust) : 0)
  12904. },
  12905. isValidParent : function(B, A) {
  12906. return true
  12907. }
  12908. });
  12909. Ext.Container.LAYOUTS["form"] = Ext.layout.FormLayout;
  12910. Ext.layout.Accordion = Ext.extend(Ext.layout.FitLayout, {
  12911. fill : true,
  12912. autoWidth : true,
  12913. titleCollapse : true,
  12914. hideCollapseTool : false,
  12915. collapseFirst : false,
  12916. animate : false,
  12917. sequence : false,
  12918. activeOnTop : false,
  12919. renderItem : function(A) {
  12920. if (this.animate === false) {
  12921. A.animCollapse = false
  12922. }
  12923. A.collapsible = true;
  12924. if (this.autoWidth) {
  12925. A.autoWidth = true
  12926. }
  12927. if (this.titleCollapse) {
  12928. A.titleCollapse = true
  12929. }
  12930. if (this.hideCollapseTool) {
  12931. A.hideCollapseTool = true
  12932. }
  12933. if (this.collapseFirst !== undefined) {
  12934. A.collapseFirst = this.collapseFirst
  12935. }
  12936. if (!this.activeItem && !A.collapsed) {
  12937. this.activeItem = A
  12938. } else {
  12939. if (this.activeItem) {
  12940. A.collapsed = true
  12941. }
  12942. }
  12943. Ext.layout.Accordion.superclass.renderItem.apply(this,
  12944. arguments);
  12945. A.header.addClass("x-accordion-hd");
  12946. A.on("beforeexpand", this.beforeExpand, this)
  12947. },
  12948. beforeExpand : function(C, B) {
  12949. var A = this.activeItem;
  12950. if (A) {
  12951. if (this.sequence) {
  12952. delete this.activeItem;
  12953. A.collapse({
  12954. callback : function() {
  12955. C.expand(B || true)
  12956. },
  12957. scope : this
  12958. });
  12959. return false
  12960. } else {
  12961. A.collapse(this.animate)
  12962. }
  12963. }
  12964. this.activeItem = C;
  12965. if (this.activeOnTop) {
  12966. C.el.dom.parentNode.insertBefore(C.el.dom,
  12967. C.el.dom.parentNode.firstChild)
  12968. }
  12969. this.layout()
  12970. },
  12971. setItemSize : function(F, E) {
  12972. if (this.fill && F) {
  12973. var B = this.container.items.items;
  12974. var D = 0;
  12975. for (var C = 0, A = B.length; C < A; C++) {
  12976. var G = B[C];
  12977. if (G != F) {
  12978. D += (G.getSize().height - G.bwrap.getHeight())
  12979. }
  12980. }
  12981. E.height -= D;
  12982. F.setSize(E)
  12983. }
  12984. }
  12985. });
  12986. Ext.Container.LAYOUTS["accordion"] = Ext.layout.Accordion;
  12987. Ext.layout.TableLayout = Ext.extend(Ext.layout.ContainerLayout, {
  12988. monitorResize : false,
  12989. setContainer : function(A) {
  12990. Ext.layout.TableLayout.superclass.setContainer.call(this, A);
  12991. this.currentRow = 0;
  12992. this.currentColumn = 0;
  12993. this.cells = []
  12994. },
  12995. onLayout : function(C, E) {
  12996. var D = C.items.items, A = D.length, F, B;
  12997. if (!this.table) {
  12998. E.addClass("x-table-layout-ct");
  12999. this.table = E.createChild({
  13000. tag : "table",
  13001. cls : "x-table-layout",
  13002. cellspacing : 0,
  13003. cn : {
  13004. tag : "tbody"
  13005. }
  13006. }, null, true);
  13007. this.renderAll(C, E)
  13008. }
  13009. },
  13010. getRow : function(A) {
  13011. var B = this.table.tBodies[0].childNodes[A];
  13012. if (!B) {
  13013. B = document.createElement("tr");
  13014. this.table.tBodies[0].appendChild(B)
  13015. }
  13016. return B
  13017. },
  13018. getNextCell : function(H) {
  13019. var A = this
  13020. .getNextNonSpan(this.currentColumn, this.currentRow);
  13021. var E = this.currentColumn = A[0], D = this.currentRow = A[1];
  13022. for (var G = D; G < D + (H.rowspan || 1); G++) {
  13023. if (!this.cells[G]) {
  13024. this.cells[G] = []
  13025. }
  13026. for (var C = E; C < E + (H.colspan || 1); C++) {
  13027. this.cells[G][C] = true
  13028. }
  13029. }
  13030. var F = document.createElement("td");
  13031. if (H.cellId) {
  13032. F.id = H.cellId
  13033. }
  13034. var B = "x-table-layout-cell";
  13035. if (H.cellCls) {
  13036. B += " " + H.cellCls
  13037. }
  13038. F.className = B;
  13039. if (H.colspan) {
  13040. F.colSpan = H.colspan
  13041. }
  13042. if (H.rowspan) {
  13043. F.rowSpan = H.rowspan
  13044. }
  13045. this.getRow(D).appendChild(F);
  13046. return F
  13047. },
  13048. getNextNonSpan : function(A, C) {
  13049. var B = this.columns;
  13050. while ((B && A >= B) || (this.cells[C] && this.cells[C][A])) {
  13051. if (B && A >= B) {
  13052. C++;
  13053. A = 0
  13054. } else {
  13055. A++
  13056. }
  13057. }
  13058. return [A, C]
  13059. },
  13060. renderItem : function(C, A, B) {
  13061. if (C && !C.rendered) {
  13062. C.render(this.getNextCell(C))
  13063. }
  13064. },
  13065. isValidParent : function(B, A) {
  13066. return true
  13067. }
  13068. });
  13069. Ext.Container.LAYOUTS["table"] = Ext.layout.TableLayout;
  13070. Ext.layout.AbsoluteLayout = Ext.extend(Ext.layout.AnchorLayout, {
  13071. extraCls : "x-abs-layout-item",
  13072. isForm : false,
  13073. setContainer : function(A) {
  13074. Ext.layout.AbsoluteLayout.superclass.setContainer.call(this, A);
  13075. if (A.isXType("form")) {
  13076. this.isForm = true
  13077. }
  13078. },
  13079. onLayout : function(A, B) {
  13080. if (this.isForm) {
  13081. A.body.position()
  13082. } else {
  13083. B.position()
  13084. }
  13085. Ext.layout.AbsoluteLayout.superclass.onLayout.call(this, A, B)
  13086. },
  13087. getAnchorViewSize : function(A, B) {
  13088. return this.isForm
  13089. ? A.body.getStyleSize()
  13090. : Ext.layout.AbsoluteLayout.superclass.getAnchorViewSize
  13091. .call(this, A, B)
  13092. },
  13093. isValidParent : function(B, A) {
  13094. return this.isForm
  13095. ? true
  13096. : Ext.layout.AbsoluteLayout.superclass.isValidParent
  13097. .call(this, B, A)
  13098. },
  13099. adjustWidthAnchor : function(B, A) {
  13100. return B ? B - A.getPosition(true)[0] : B
  13101. },
  13102. adjustHeightAnchor : function(B, A) {
  13103. return B ? B - A.getPosition(true)[1] : B
  13104. }
  13105. });
  13106. Ext.Container.LAYOUTS["absolute"] = Ext.layout.AbsoluteLayout;
  13107. Ext.Viewport = Ext.extend(Ext.Container, {
  13108. initComponent : function() {
  13109. Ext.Viewport.superclass.initComponent.call(this);
  13110. document.getElementsByTagName("html")[0].className += " x-viewport";
  13111. this.el = Ext.getBody();
  13112. this.el.setHeight = Ext.emptyFn;
  13113. this.el.setWidth = Ext.emptyFn;
  13114. this.el.setSize = Ext.emptyFn;
  13115. this.el.dom.scroll = "no";
  13116. this.allowDomMove = false;
  13117. this.autoWidth = true;
  13118. this.autoHeight = true;
  13119. Ext.EventManager.onWindowResize(this.fireResize, this);
  13120. this.renderTo = this.el
  13121. },
  13122. fireResize : function(A, B) {
  13123. this.fireEvent("resize", this, A, B, A, B)
  13124. }
  13125. });
  13126. Ext.reg("viewport", Ext.Viewport);
  13127. Ext.Panel = Ext.extend(Ext.Container, {
  13128. baseCls : "x-panel",
  13129. collapsedCls : "x-panel-collapsed",
  13130. maskDisabled : true,
  13131. animCollapse : Ext.enableFx,
  13132. headerAsText : true,
  13133. buttonAlign : "right",
  13134. collapsed : false,
  13135. collapseFirst : true,
  13136. minButtonWidth : 75,
  13137. elements : "body",
  13138. toolTarget : "header",
  13139. collapseEl : "bwrap",
  13140. slideAnchor : "t",
  13141. deferHeight : true,
  13142. expandDefaults : {
  13143. duration : 0.25
  13144. },
  13145. collapseDefaults : {
  13146. duration : 0.25
  13147. },
  13148. initComponent : function() {
  13149. Ext.Panel.superclass.initComponent.call(this);
  13150. this.addEvents("bodyresize", "titlechange", "collapse", "expand",
  13151. "beforecollapse", "beforeexpand", "beforeclose", "close",
  13152. "activate", "deactivate");
  13153. if (this.tbar) {
  13154. this.elements += ",tbar";
  13155. if (typeof this.tbar == "object") {
  13156. this.topToolbar = this.tbar
  13157. }
  13158. delete this.tbar
  13159. }
  13160. if (this.bbar) {
  13161. this.elements += ",bbar";
  13162. if (typeof this.bbar == "object") {
  13163. this.bottomToolbar = this.bbar
  13164. }
  13165. delete this.bbar
  13166. }
  13167. if (this.header === true) {
  13168. this.elements += ",header";
  13169. delete this.header
  13170. } else {
  13171. if (this.title && this.header !== false) {
  13172. this.elements += ",header"
  13173. }
  13174. }
  13175. if (this.footer === true) {
  13176. this.elements += ",footer";
  13177. delete this.footer
  13178. }
  13179. if (this.buttons) {
  13180. var C = this.buttons;
  13181. this.buttons = [];
  13182. for (var B = 0, A = C.length; B < A; B++) {
  13183. if (C[B].render) {
  13184. this.buttons.push(C[B])
  13185. } else {
  13186. this.addButton(C[B])
  13187. }
  13188. }
  13189. }
  13190. if (this.autoLoad) {
  13191. this.on("render", this.doAutoLoad, this, {
  13192. delay : 10
  13193. })
  13194. }
  13195. },
  13196. createElement : function(A, C) {
  13197. if (this[A]) {
  13198. C.appendChild(this[A].dom);
  13199. return
  13200. }
  13201. if (A === "bwrap" || this.elements.indexOf(A) != -1) {
  13202. if (this[A + "Cfg"]) {
  13203. this[A] = Ext.fly(C).createChild(this[A + "Cfg"])
  13204. } else {
  13205. var B = document.createElement("div");
  13206. B.className = this[A + "Cls"];
  13207. this[A] = Ext.get(C.appendChild(B))
  13208. }
  13209. }
  13210. },
  13211. onRender : function(H, G) {
  13212. Ext.Panel.superclass.onRender.call(this, H, G);
  13213. this.createClasses();
  13214. if (this.el) {
  13215. this.el.addClass(this.baseCls);
  13216. this.header = this.el.down("." + this.headerCls);
  13217. this.bwrap = this.el.down("." + this.bwrapCls);
  13218. var M = this.bwrap ? this.bwrap : this.el;
  13219. this.tbar = M.down("." + this.tbarCls);
  13220. this.body = M.down("." + this.bodyCls);
  13221. this.bbar = M.down("." + this.bbarCls);
  13222. this.footer = M.down("." + this.footerCls);
  13223. this.fromMarkup = true
  13224. } else {
  13225. this.el = H.createChild({
  13226. id : this.id,
  13227. cls : this.baseCls
  13228. }, G)
  13229. }
  13230. var A = this.el, K = A.dom;
  13231. if (this.cls) {
  13232. this.el.addClass(this.cls)
  13233. }
  13234. if (this.buttons) {
  13235. this.elements += ",footer"
  13236. }
  13237. if (this.frame) {
  13238. A.insertHtml("afterBegin", String.format(Ext.Element.boxMarkup,
  13239. this.baseCls));
  13240. this.createElement("header", K.firstChild.firstChild.firstChild);
  13241. this.createElement("bwrap", K);
  13242. var O = this.bwrap.dom;
  13243. var E = K.childNodes[1], B = K.childNodes[2];
  13244. O.appendChild(E);
  13245. O.appendChild(B);
  13246. var P = O.firstChild.firstChild.firstChild;
  13247. this.createElement("tbar", P);
  13248. this.createElement("body", P);
  13249. this.createElement("bbar", P);
  13250. this.createElement("footer", O.lastChild.firstChild.firstChild);
  13251. if (!this.footer) {
  13252. this.bwrap.dom.lastChild.className += " x-panel-nofooter"
  13253. }
  13254. } else {
  13255. this.createElement("header", K);
  13256. this.createElement("bwrap", K);
  13257. var O = this.bwrap.dom;
  13258. this.createElement("tbar", O);
  13259. this.createElement("body", O);
  13260. this.createElement("bbar", O);
  13261. this.createElement("footer", O);
  13262. if (!this.header) {
  13263. this.body.addClass(this.bodyCls + "-noheader");
  13264. if (this.tbar) {
  13265. this.tbar.addClass(this.tbarCls + "-noheader")
  13266. }
  13267. }
  13268. }
  13269. if (this.border === false) {
  13270. this.el.addClass(this.baseCls + "-noborder");
  13271. this.body.addClass(this.bodyCls + "-noborder");
  13272. if (this.header) {
  13273. this.header.addClass(this.headerCls + "-noborder")
  13274. }
  13275. if (this.footer) {
  13276. this.footer.addClass(this.footerCls + "-noborder")
  13277. }
  13278. if (this.tbar) {
  13279. this.tbar.addClass(this.tbarCls + "-noborder")
  13280. }
  13281. if (this.bbar) {
  13282. this.bbar.addClass(this.bbarCls + "-noborder")
  13283. }
  13284. }
  13285. if (this.bodyBorder === false) {
  13286. this.body.addClass(this.bodyCls + "-noborder")
  13287. }
  13288. if (this.bodyStyle) {
  13289. this.body.applyStyles(this.bodyStyle)
  13290. }
  13291. this.bwrap.enableDisplayMode("block");
  13292. if (this.header) {
  13293. this.header.unselectable();
  13294. if (this.headerAsText) {
  13295. this.header.dom.innerHTML = "<span class=\""
  13296. + this.headerTextCls + "\">"
  13297. + this.header.dom.innerHTML + "</span>";
  13298. if (this.iconCls) {
  13299. this.setIconClass(this.iconCls)
  13300. }
  13301. }
  13302. }
  13303. if (this.floating) {
  13304. this.makeFloating(this.floating)
  13305. }
  13306. if (this.collapsible) {
  13307. this.tools = this.tools ? this.tools.slice(0) : [];
  13308. if (!this.hideCollapseTool) {
  13309. this.tools[this.collapseFirst ? "unshift" : "push"]({
  13310. id : "toggle",
  13311. handler : this.toggleCollapse,
  13312. scope : this
  13313. })
  13314. }
  13315. if (this.titleCollapse && this.header) {
  13316. this.header.on("click", this.toggleCollapse, this);
  13317. this.header.setStyle("cursor", "pointer")
  13318. }
  13319. }
  13320. if (this.tools) {
  13321. var J = this.tools;
  13322. this.tools = {};
  13323. this.addTool.apply(this, J)
  13324. } else {
  13325. this.tools = {}
  13326. }
  13327. if (this.buttons && this.buttons.length > 0) {
  13328. var D = this.footer.createChild({
  13329. cls : "x-panel-btns-ct",
  13330. cn : {
  13331. cls : "x-panel-btns x-panel-btns-" + this.buttonAlign,
  13332. html : "<table cellspacing=\"0\"><tbody><tr></tr></tbody></table><div class=\"x-clear\"></div>"
  13333. }
  13334. }, null, true);
  13335. var L = D.getElementsByTagName("tr")[0];
  13336. for (var F = 0, I = this.buttons.length; F < I; F++) {
  13337. var N = this.buttons[F];
  13338. var C = document.createElement("td");
  13339. C.className = "x-panel-btn-td";
  13340. N.render(L.appendChild(C))
  13341. }
  13342. }
  13343. if (this.tbar && this.topToolbar) {
  13344. if (Ext.isArray(this.topToolbar)) {
  13345. this.topToolbar = new Ext.Toolbar(this.topToolbar)
  13346. }
  13347. this.topToolbar.render(this.tbar)
  13348. }
  13349. if (this.bbar && this.bottomToolbar) {
  13350. if (Ext.isArray(this.bottomToolbar)) {
  13351. this.bottomToolbar = new Ext.Toolbar(this.bottomToolbar)
  13352. }
  13353. this.bottomToolbar.render(this.bbar)
  13354. }
  13355. },
  13356. setIconClass : function(B) {
  13357. var A = this.iconCls;
  13358. this.iconCls = B;
  13359. if (this.rendered && this.header) {
  13360. if (this.frame) {
  13361. this.header.addClass("x-panel-icon");
  13362. this.header.replaceClass(A, this.iconCls)
  13363. } else {
  13364. var D = this.header.dom;
  13365. var C = D.firstChild
  13366. && String(D.firstChild.tagName).toLowerCase() == "img"
  13367. ? D.firstChild
  13368. : null;
  13369. if (C) {
  13370. Ext.fly(C).replaceClass(A, this.iconCls)
  13371. } else {
  13372. Ext.DomHelper.insertBefore(D.firstChild, {
  13373. tag : "img",
  13374. src : Ext.BLANK_IMAGE_URL,
  13375. cls : "x-panel-inline-icon " + this.iconCls
  13376. })
  13377. }
  13378. }
  13379. }
  13380. },
  13381. makeFloating : function(A) {
  13382. this.floating = true;
  13383. this.el = new Ext.Layer(typeof A == "object" ? A : {
  13384. shadow : this.shadow !== undefined ? this.shadow : "sides",
  13385. shadowOffset : this.shadowOffset,
  13386. constrain : false,
  13387. shim : this.shim === false ? false : undefined
  13388. }, this.el)
  13389. },
  13390. getTopToolbar : function() {
  13391. return this.topToolbar
  13392. },
  13393. getBottomToolbar : function() {
  13394. return this.bottomToolbar
  13395. },
  13396. addButton : function(A, D, C) {
  13397. var E = {
  13398. handler : D,
  13399. scope : C,
  13400. minWidth : this.minButtonWidth,
  13401. hideParent : true
  13402. };
  13403. if (typeof A == "string") {
  13404. E.text = A
  13405. } else {
  13406. Ext.apply(E, A)
  13407. }
  13408. var B = new Ext.Button(E);
  13409. B.ownerCt = this;
  13410. if (!this.buttons) {
  13411. this.buttons = []
  13412. }
  13413. this.buttons.push(B);
  13414. return B
  13415. },
  13416. addTool : function() {
  13417. if (!this[this.toolTarget]) {
  13418. return
  13419. }
  13420. if (!this.toolTemplate) {
  13421. var F = new Ext.Template("<div class=\"x-tool x-tool-{id}\">&#160;</div>");
  13422. F.disableFormats = true;
  13423. F.compile();
  13424. Ext.Panel.prototype.toolTemplate = F
  13425. }
  13426. for (var E = 0, C = arguments, B = C.length; E < B; E++) {
  13427. var A = C[E], G = "x-tool-" + A.id + "-over";
  13428. var D = this.toolTemplate.insertFirst(this[this.toolTarget], A,
  13429. true);
  13430. this.tools[A.id] = D;
  13431. D.enableDisplayMode("block");
  13432. D.on("click", this.createToolHandler(D, A, G, this));
  13433. if (A.on) {
  13434. D.on(A.on)
  13435. }
  13436. if (A.hidden) {
  13437. D.hide()
  13438. }
  13439. if (A.qtip) {
  13440. if (typeof A.qtip == "object") {
  13441. Ext.QuickTips.register(Ext.apply({
  13442. target : D.id
  13443. }, A.qtip))
  13444. } else {
  13445. D.dom.qtip = A.qtip
  13446. }
  13447. }
  13448. D.addClassOnOver(G)
  13449. }
  13450. },
  13451. onShow : function() {
  13452. if (this.floating) {
  13453. return this.el.show()
  13454. }
  13455. Ext.Panel.superclass.onShow.call(this)
  13456. },
  13457. onHide : function() {
  13458. if (this.floating) {
  13459. return this.el.hide()
  13460. }
  13461. Ext.Panel.superclass.onHide.call(this)
  13462. },
  13463. createToolHandler : function(C, A, D, B) {
  13464. return function(E) {
  13465. C.removeClass(D);
  13466. E.stopEvent();
  13467. if (A.handler) {
  13468. A.handler.call(A.scope || C, E, C, B)
  13469. }
  13470. }
  13471. },
  13472. afterRender : function() {
  13473. if (this.fromMarkup && this.height === undefined && !this.autoHeight) {
  13474. this.height = this.el.getHeight()
  13475. }
  13476. if (this.floating && !this.hidden && !this.initHidden) {
  13477. this.el.show()
  13478. }
  13479. if (this.title) {
  13480. this.setTitle(this.title)
  13481. }
  13482. this.setAutoScroll();
  13483. if (this.html) {
  13484. this.body.update(typeof this.html == "object" ? Ext.DomHelper
  13485. .markup(this.html) : this.html);
  13486. delete this.html
  13487. }
  13488. if (this.contentEl) {
  13489. var A = Ext.getDom(this.contentEl);
  13490. Ext.fly(A).removeClass(["x-hidden", "x-hide-display"]);
  13491. this.body.dom.appendChild(A)
  13492. }
  13493. if (this.collapsed) {
  13494. this.collapsed = false;
  13495. this.collapse(false)
  13496. }
  13497. Ext.Panel.superclass.afterRender.call(this);
  13498. this.initEvents()
  13499. },
  13500. setAutoScroll : function() {
  13501. if (this.rendered && this.autoScroll) {
  13502. this.body.setOverflow("auto")
  13503. }
  13504. },
  13505. getKeyMap : function() {
  13506. if (!this.keyMap) {
  13507. this.keyMap = new Ext.KeyMap(this.el, this.keys)
  13508. }
  13509. return this.keyMap
  13510. },
  13511. initEvents : function() {
  13512. if (this.keys) {
  13513. this.getKeyMap()
  13514. }
  13515. if (this.draggable) {
  13516. this.initDraggable()
  13517. }
  13518. },
  13519. initDraggable : function() {
  13520. this.dd = new Ext.Panel.DD(this, typeof this.draggable == "boolean"
  13521. ? null
  13522. : this.draggable)
  13523. },
  13524. beforeEffect : function() {
  13525. if (this.floating) {
  13526. this.el.beforeAction()
  13527. }
  13528. this.el.addClass("x-panel-animated")
  13529. },
  13530. afterEffect : function() {
  13531. this.syncShadow();
  13532. this.el.removeClass("x-panel-animated")
  13533. },
  13534. createEffect : function(B, A, C) {
  13535. var D = {
  13536. scope : C,
  13537. block : true
  13538. };
  13539. if (B === true) {
  13540. D.callback = A;
  13541. return D
  13542. } else {
  13543. if (!B.callback) {
  13544. D.callback = A
  13545. } else {
  13546. D.callback = function() {
  13547. A.call(C);
  13548. Ext.callback(B.callback, B.scope)
  13549. }
  13550. }
  13551. }
  13552. return Ext.applyIf(D, B)
  13553. },
  13554. collapse : function(B) {
  13555. if (this.collapsed || this.el.hasFxBlock()
  13556. || this.fireEvent("beforecollapse", this, B) === false) {
  13557. return
  13558. }
  13559. var A = B === true || (B !== false && this.animCollapse);
  13560. this.beforeEffect();
  13561. this.onCollapse(A, B);
  13562. return this
  13563. },
  13564. onCollapse : function(A, B) {
  13565. if (A) {
  13566. this[this.collapseEl].slideOut(this.slideAnchor, Ext.apply(this
  13567. .createEffect(B || true,
  13568. this.afterCollapse, this),
  13569. this.collapseDefaults))
  13570. } else {
  13571. this[this.collapseEl].hide();
  13572. this.afterCollapse()
  13573. }
  13574. },
  13575. afterCollapse : function() {
  13576. this.collapsed = true;
  13577. this.el.addClass(this.collapsedCls);
  13578. this.afterEffect();
  13579. this.fireEvent("collapse", this)
  13580. },
  13581. expand : function(B) {
  13582. if (!this.collapsed || this.el.hasFxBlock()
  13583. || this.fireEvent("beforeexpand", this, B) === false) {
  13584. return
  13585. }
  13586. var A = B === true || (B !== false && this.animCollapse);
  13587. this.el.removeClass(this.collapsedCls);
  13588. this.beforeEffect();
  13589. this.onExpand(A, B);
  13590. return this
  13591. },
  13592. onExpand : function(A, B) {
  13593. if (A) {
  13594. this[this.collapseEl].slideIn(this.slideAnchor, Ext.apply(this
  13595. .createEffect(B || true, this.afterExpand,
  13596. this), this.expandDefaults))
  13597. } else {
  13598. this[this.collapseEl].show();
  13599. this.afterExpand()
  13600. }
  13601. },
  13602. afterExpand : function() {
  13603. this.collapsed = false;
  13604. this.afterEffect();
  13605. this.fireEvent("expand", this)
  13606. },
  13607. toggleCollapse : function(A) {
  13608. this[this.collapsed ? "expand" : "collapse"](A);
  13609. return this
  13610. },
  13611. onDisable : function() {
  13612. if (this.rendered && this.maskDisabled) {
  13613. this.el.mask()
  13614. }
  13615. Ext.Panel.superclass.onDisable.call(this)
  13616. },
  13617. onEnable : function() {
  13618. if (this.rendered && this.maskDisabled) {
  13619. this.el.unmask()
  13620. }
  13621. Ext.Panel.superclass.onEnable.call(this)
  13622. },
  13623. onResize : function(A, B) {
  13624. if (A !== undefined || B !== undefined) {
  13625. if (!this.collapsed) {
  13626. if (typeof A == "number") {
  13627. this.body.setWidth(this.adjustBodyWidth(A
  13628. - this.getFrameWidth()))
  13629. } else {
  13630. if (A == "auto") {
  13631. this.body.setWidth(A)
  13632. }
  13633. }
  13634. if (typeof B == "number") {
  13635. this.body.setHeight(this.adjustBodyHeight(B
  13636. - this.getFrameHeight()))
  13637. } else {
  13638. if (B == "auto") {
  13639. this.body.setHeight(B)
  13640. }
  13641. }
  13642. } else {
  13643. this.queuedBodySize = {
  13644. width : A,
  13645. height : B
  13646. };
  13647. if (!this.queuedExpand && this.allowQueuedExpand !== false) {
  13648. this.queuedExpand = true;
  13649. this.on("expand", function() {
  13650. delete this.queuedExpand;
  13651. this.onResize(this.queuedBodySize.width,
  13652. this.queuedBodySize.height);
  13653. this.doLayout()
  13654. }, this, {
  13655. single : true
  13656. })
  13657. }
  13658. }
  13659. this.fireEvent("bodyresize", this, A, B)
  13660. }
  13661. this.syncShadow()
  13662. },
  13663. adjustBodyHeight : function(A) {
  13664. return A
  13665. },
  13666. adjustBodyWidth : function(A) {
  13667. return A
  13668. },
  13669. onPosition : function() {
  13670. this.syncShadow()
  13671. },
  13672. onDestroy : function() {
  13673. if (this.tools) {
  13674. for (var B in this.tools) {
  13675. Ext.destroy(this.tools[B])
  13676. }
  13677. }
  13678. if (this.buttons) {
  13679. for (var A in this.buttons) {
  13680. Ext.destroy(this.buttons[A])
  13681. }
  13682. }
  13683. Ext.destroy(this.topToolbar, this.bottomToolbar);
  13684. Ext.Panel.superclass.onDestroy.call(this)
  13685. },
  13686. getFrameWidth : function() {
  13687. var B = this.el.getFrameWidth("lr");
  13688. if (this.frame) {
  13689. var A = this.bwrap.dom.firstChild;
  13690. B += (Ext.fly(A).getFrameWidth("l") + Ext.fly(A.firstChild)
  13691. .getFrameWidth("r"));
  13692. var C = this.bwrap.dom.firstChild.firstChild.firstChild;
  13693. B += Ext.fly(C).getFrameWidth("lr")
  13694. }
  13695. return B
  13696. },
  13697. getFrameHeight : function() {
  13698. var A = this.el.getFrameWidth("tb");
  13699. A += (this.tbar ? this.tbar.getHeight() : 0)
  13700. + (this.bbar ? this.bbar.getHeight() : 0);
  13701. if (this.frame) {
  13702. var C = this.el.dom.firstChild;
  13703. var D = this.bwrap.dom.lastChild;
  13704. A += (C.offsetHeight + D.offsetHeight);
  13705. var B = this.bwrap.dom.firstChild.firstChild.firstChild;
  13706. A += Ext.fly(B).getFrameWidth("tb")
  13707. } else {
  13708. A += (this.header ? this.header.getHeight() : 0)
  13709. + (this.footer ? this.footer.getHeight() : 0)
  13710. }
  13711. return A
  13712. },
  13713. getInnerWidth : function() {
  13714. return this.getSize().width - this.getFrameWidth()
  13715. },
  13716. getInnerHeight : function() {
  13717. return this.getSize().height - this.getFrameHeight()
  13718. },
  13719. syncShadow : function() {
  13720. if (this.floating) {
  13721. this.el.sync(true)
  13722. }
  13723. },
  13724. getLayoutTarget : function() {
  13725. return this.body
  13726. },
  13727. setTitle : function(B, A) {
  13728. this.title = B;
  13729. if (this.header && this.headerAsText) {
  13730. this.header.child("span").update(B)
  13731. }
  13732. if (A) {
  13733. this.setIconClass(A)
  13734. }
  13735. this.fireEvent("titlechange", this, B);
  13736. return this
  13737. },
  13738. getUpdater : function() {
  13739. return this.body.getUpdater()
  13740. },
  13741. load : function() {
  13742. var A = this.body.getUpdater();
  13743. A.update.apply(A, arguments);
  13744. return this
  13745. },
  13746. beforeDestroy : function() {
  13747. Ext.Element.uncache(this.header, this.tbar, this.bbar, this.footer,
  13748. this.body)
  13749. },
  13750. createClasses : function() {
  13751. this.headerCls = this.baseCls + "-header";
  13752. this.headerTextCls = this.baseCls + "-header-text";
  13753. this.bwrapCls = this.baseCls + "-bwrap";
  13754. this.tbarCls = this.baseCls + "-tbar";
  13755. this.bodyCls = this.baseCls + "-body";
  13756. this.bbarCls = this.baseCls + "-bbar";
  13757. this.footerCls = this.baseCls + "-footer"
  13758. },
  13759. createGhost : function(A, E, B) {
  13760. var D = document.createElement("div");
  13761. D.className = "x-panel-ghost " + (A ? A : "");
  13762. if (this.header) {
  13763. D.appendChild(this.el.dom.firstChild.cloneNode(true))
  13764. }
  13765. Ext.fly(D.appendChild(document.createElement("ul")))
  13766. .setHeight(this.bwrap.getHeight());
  13767. D.style.width = this.el.dom.offsetWidth + "px";
  13768. if (!B) {
  13769. this.container.dom.appendChild(D)
  13770. } else {
  13771. Ext.getDom(B).appendChild(D)
  13772. }
  13773. if (E !== false && this.el.useShim !== false) {
  13774. var C = new Ext.Layer({
  13775. shadow : false,
  13776. useDisplay : true,
  13777. constrain : false
  13778. }, D);
  13779. C.show();
  13780. return C
  13781. } else {
  13782. return new Ext.Element(D)
  13783. }
  13784. },
  13785. doAutoLoad : function() {
  13786. this.body.load(typeof this.autoLoad == "object" ? this.autoLoad : {
  13787. url : this.autoLoad
  13788. })
  13789. }
  13790. });
  13791. Ext.reg("panel", Ext.Panel);
  13792. Ext.Window = Ext.extend(Ext.Panel, {
  13793. baseCls : "x-window",
  13794. resizable : true,
  13795. draggable : true,
  13796. closable : true,
  13797. constrain : false,
  13798. constrainHeader : false,
  13799. plain : false,
  13800. minimizable : false,
  13801. maximizable : false,
  13802. minHeight : 100,
  13803. minWidth : 200,
  13804. expandOnShow : true,
  13805. closeAction : "close",
  13806. collapsible : false,
  13807. initHidden : true,
  13808. monitorResize : true,
  13809. elements : "header,body",
  13810. frame : true,
  13811. floating : true,
  13812. initComponent : function() {
  13813. Ext.Window.superclass.initComponent.call(this);
  13814. this.addEvents("resize", "maximize", "minimize", "restore")
  13815. },
  13816. getState : function() {
  13817. return Ext.apply(Ext.Window.superclass.getState.call(this)
  13818. || {}, this.getBox())
  13819. },
  13820. onRender : function(B, A) {
  13821. Ext.Window.superclass.onRender.call(this, B, A);
  13822. if (this.plain) {
  13823. this.el.addClass("x-window-plain")
  13824. }
  13825. this.focusEl = this.el.createChild({
  13826. tag : "a",
  13827. href : "#",
  13828. cls : "x-dlg-focus",
  13829. tabIndex : "-1",
  13830. html : "&#160;"
  13831. });
  13832. this.focusEl.swallowEvent("click", true);
  13833. this.proxy = this.el.createProxy("x-window-proxy");
  13834. this.proxy.enableDisplayMode("block");
  13835. if (this.modal) {
  13836. this.mask = this.container.createChild({
  13837. cls : "ext-el-mask"
  13838. }, this.el.dom);
  13839. this.mask.enableDisplayMode("block");
  13840. this.mask.hide()
  13841. }
  13842. },
  13843. initEvents : function() {
  13844. Ext.Window.superclass.initEvents.call(this);
  13845. if (this.animateTarget) {
  13846. this.setAnimateTarget(this.animateTarget)
  13847. }
  13848. if (this.resizable) {
  13849. this.resizer = new Ext.Resizable(this.el, {
  13850. minWidth : this.minWidth,
  13851. minHeight : this.minHeight,
  13852. handles : this.resizeHandles || "all",
  13853. pinned : true,
  13854. resizeElement : this.resizerAction
  13855. });
  13856. this.resizer.window = this;
  13857. this.resizer.on("beforeresize", this.beforeResize, this)
  13858. }
  13859. if (this.draggable) {
  13860. this.header.addClass("x-window-draggable")
  13861. }
  13862. this.initTools();
  13863. this.el.on("mousedown", this.toFront, this);
  13864. this.manager = this.manager || Ext.WindowMgr;
  13865. this.manager.register(this);
  13866. this.hidden = true;
  13867. if (this.maximized) {
  13868. this.maximized = false;
  13869. this.maximize()
  13870. }
  13871. if (this.closable) {
  13872. var A = this.getKeyMap();
  13873. A.on(27, this.onEsc, this);
  13874. A.disable()
  13875. }
  13876. },
  13877. initDraggable : function() {
  13878. this.dd = new Ext.Window.DD(this)
  13879. },
  13880. onEsc : function() {
  13881. this[this.closeAction]()
  13882. },
  13883. beforeDestroy : function() {
  13884. Ext.destroy(this.resizer, this.dd, this.proxy, this.mask);
  13885. Ext.Window.superclass.beforeDestroy.call(this)
  13886. },
  13887. onDestroy : function() {
  13888. if (this.manager) {
  13889. this.manager.unregister(this)
  13890. }
  13891. Ext.Window.superclass.onDestroy.call(this)
  13892. },
  13893. initTools : function() {
  13894. if (this.minimizable) {
  13895. this.addTool({
  13896. id : "minimize",
  13897. handler : this.minimize
  13898. .createDelegate(this, [])
  13899. })
  13900. }
  13901. if (this.maximizable) {
  13902. this.addTool({
  13903. id : "maximize",
  13904. handler : this.maximize
  13905. .createDelegate(this, [])
  13906. });
  13907. this.addTool({
  13908. id : "restore",
  13909. handler : this.restore.createDelegate(this, []),
  13910. hidden : true
  13911. });
  13912. this.header.on("dblclick", this.toggleMaximize, this)
  13913. }
  13914. if (this.closable) {
  13915. this.addTool({
  13916. id : "close",
  13917. handler : this[this.closeAction]
  13918. .createDelegate(this, [])
  13919. })
  13920. }
  13921. },
  13922. resizerAction : function() {
  13923. var A = this.proxy.getBox();
  13924. this.proxy.hide();
  13925. this.window.handleResize(A);
  13926. return A
  13927. },
  13928. beforeResize : function() {
  13929. this.resizer.minHeight = Math.max(this.minHeight, this
  13930. .getFrameHeight()
  13931. + 40);
  13932. this.resizer.minWidth = Math.max(this.minWidth, this
  13933. .getFrameWidth()
  13934. + 40);
  13935. this.resizeBox = this.el.getBox()
  13936. },
  13937. updateHandles : function() {
  13938. if (Ext.isIE && this.resizer) {
  13939. this.resizer.syncHandleHeight();
  13940. this.el.repaint()
  13941. }
  13942. },
  13943. handleResize : function(B) {
  13944. var A = this.resizeBox;
  13945. if (A.x != B.x || A.y != B.y) {
  13946. this.updateBox(B)
  13947. } else {
  13948. this.setSize(B)
  13949. }
  13950. this.focus();
  13951. this.updateHandles();
  13952. this.saveState();
  13953. this.fireEvent("resize", this, B.width, B.height)
  13954. },
  13955. focus : function() {
  13956. var C = this.focusEl, A = this.defaultButton, B = typeof A;
  13957. if (B != "undefined") {
  13958. if (B == "number") {
  13959. C = this.buttons[A]
  13960. } else {
  13961. if (B == "string") {
  13962. C = Ext.getCmp(A)
  13963. } else {
  13964. C = A
  13965. }
  13966. }
  13967. }
  13968. C.focus.defer(10, C)
  13969. },
  13970. setAnimateTarget : function(A) {
  13971. A = Ext.get(A);
  13972. this.animateTarget = A
  13973. },
  13974. beforeShow : function() {
  13975. delete this.el.lastXY;
  13976. delete this.el.lastLT;
  13977. if (this.x === undefined || this.y === undefined) {
  13978. var A = this.el.getAlignToXY(this.container, "c-c");
  13979. var B = this.el.translatePoints(A[0], A[1]);
  13980. this.x = this.x === undefined ? B.left : this.x;
  13981. this.y = this.y === undefined ? B.top : this.y
  13982. }
  13983. this.el.setLeftTop(this.x, this.y);
  13984. if (this.expandOnShow) {
  13985. this.expand(false)
  13986. }
  13987. if (this.modal) {
  13988. Ext.getBody().addClass("x-body-masked");
  13989. this.mask.setSize(Ext.lib.Dom.getViewWidth(true),
  13990. Ext.lib.Dom.getViewHeight(true));
  13991. this.mask.show()
  13992. }
  13993. },
  13994. show : function(C, A, B) {
  13995. if (!this.rendered) {
  13996. this.render(Ext.getBody())
  13997. }
  13998. if (this.hidden === false) {
  13999. this.toFront();
  14000. return
  14001. }
  14002. if (this.fireEvent("beforeshow", this) === false) {
  14003. return
  14004. }
  14005. if (A) {
  14006. this.on("show", A, B, {
  14007. single : true
  14008. })
  14009. }
  14010. this.hidden = false;
  14011. if (C !== undefined) {
  14012. this.setAnimateTarget(C)
  14013. }
  14014. this.beforeShow();
  14015. if (this.animateTarget) {
  14016. this.animShow()
  14017. } else {
  14018. this.afterShow()
  14019. }
  14020. },
  14021. afterShow : function() {
  14022. this.proxy.hide();
  14023. this.el.setStyle("display", "block");
  14024. this.el.show();
  14025. if (this.maximized) {
  14026. this.fitContainer()
  14027. }
  14028. if (Ext.isMac && Ext.isGecko) {
  14029. this.cascade(this.setAutoScroll)
  14030. }
  14031. if (this.monitorResize || this.modal || this.constrain
  14032. || this.constrainHeader) {
  14033. Ext.EventManager.onWindowResize(this.onWindowResize, this)
  14034. }
  14035. this.doConstrain();
  14036. if (this.layout) {
  14037. this.doLayout()
  14038. }
  14039. if (this.keyMap) {
  14040. this.keyMap.enable()
  14041. }
  14042. this.toFront();
  14043. this.updateHandles();
  14044. this.fireEvent("show", this)
  14045. },
  14046. animShow : function() {
  14047. this.proxy.show();
  14048. this.proxy.setBox(this.animateTarget.getBox());
  14049. this.proxy.setOpacity(0);
  14050. var A = this.getBox(false);
  14051. A.callback = this.afterShow;
  14052. A.scope = this;
  14053. A.duration = 0.25;
  14054. A.easing = "easeNone";
  14055. A.opacity = 0.5;
  14056. A.block = true;
  14057. this.el.setStyle("display", "none");
  14058. this.proxy.shift(A)
  14059. },
  14060. hide : function(C, A, B) {
  14061. if (this.hidden || this.fireEvent("beforehide", this) === false) {
  14062. return
  14063. }
  14064. if (A) {
  14065. this.on("hide", A, B, {
  14066. single : true
  14067. })
  14068. }
  14069. this.hidden = true;
  14070. if (C !== undefined) {
  14071. this.setAnimateTarget(C)
  14072. }
  14073. if (this.animateTarget) {
  14074. this.animHide()
  14075. } else {
  14076. this.el.hide();
  14077. this.afterHide()
  14078. }
  14079. },
  14080. afterHide : function() {
  14081. this.proxy.hide();
  14082. if (this.monitorResize || this.modal || this.constrain
  14083. || this.constrainHeader) {
  14084. Ext.EventManager.removeResizeListener(this.onWindowResize,
  14085. this)
  14086. }
  14087. if (this.modal) {
  14088. this.mask.hide();
  14089. Ext.getBody().removeClass("x-body-masked")
  14090. }
  14091. if (this.keyMap) {
  14092. this.keyMap.disable()
  14093. }
  14094. this.fireEvent("hide", this)
  14095. },
  14096. animHide : function() {
  14097. this.proxy.setOpacity(0.5);
  14098. this.proxy.show();
  14099. var B = this.getBox(false);
  14100. this.proxy.setBox(B);
  14101. this.el.hide();
  14102. var A = this.animateTarget.getBox();
  14103. A.callback = this.afterHide;
  14104. A.scope = this;
  14105. A.duration = 0.25;
  14106. A.easing = "easeNone";
  14107. A.block = true;
  14108. A.opacity = 0;
  14109. this.proxy.shift(A)
  14110. },
  14111. onWindowResize : function() {
  14112. if (this.maximized) {
  14113. this.fitContainer()
  14114. }
  14115. if (this.modal) {
  14116. this.mask.setSize("100%", "100%");
  14117. var A = this.mask.dom.offsetHeight;
  14118. this.mask.setSize(Ext.lib.Dom.getViewWidth(true),
  14119. Ext.lib.Dom.getViewHeight(true))
  14120. }
  14121. this.doConstrain()
  14122. },
  14123. doConstrain : function() {
  14124. if (this.constrain || this.constrainHeader) {
  14125. var B;
  14126. if (this.constrain) {
  14127. B = {
  14128. right : this.el.shadowOffset,
  14129. left : this.el.shadowOffset,
  14130. bottom : this.el.shadowOffset
  14131. }
  14132. } else {
  14133. var A = this.getSize();
  14134. B = {
  14135. right : -(A.width - 100),
  14136. bottom : -(A.height - 25)
  14137. }
  14138. }
  14139. var C = this.el.getConstrainToXY(this.container, true, B);
  14140. if (C) {
  14141. this.setPosition(C[0], C[1])
  14142. }
  14143. }
  14144. },
  14145. ghost : function(A) {
  14146. var C = this.createGhost(A);
  14147. var B = this.getBox(true);
  14148. C.setLeftTop(B.x, B.y);
  14149. C.setWidth(B.width);
  14150. this.el.hide();
  14151. this.activeGhost = C;
  14152. return C
  14153. },
  14154. unghost : function(B, A) {
  14155. if (B !== false) {
  14156. this.el.show();
  14157. this.focus();
  14158. if (Ext.isMac && Ext.isGecko) {
  14159. this.cascade(this.setAutoScroll)
  14160. }
  14161. }
  14162. if (A !== false) {
  14163. this.setPosition(this.activeGhost.getLeft(true),
  14164. this.activeGhost.getTop(true))
  14165. }
  14166. this.activeGhost.hide();
  14167. this.activeGhost.remove();
  14168. delete this.activeGhost
  14169. },
  14170. minimize : function() {
  14171. this.fireEvent("minimize", this)
  14172. },
  14173. close : function() {
  14174. if (this.fireEvent("beforeclose", this) !== false) {
  14175. this.hide(null, function() {
  14176. this.fireEvent("close", this);
  14177. this.destroy()
  14178. }, this)
  14179. }
  14180. },
  14181. maximize : function() {
  14182. if (!this.maximized) {
  14183. this.expand(false);
  14184. this.restoreSize = this.getSize();
  14185. this.restorePos = this.getPosition(true);
  14186. this.tools.maximize.hide();
  14187. this.tools.restore.show();
  14188. this.maximized = true;
  14189. this.el.disableShadow();
  14190. if (this.dd) {
  14191. this.dd.lock()
  14192. }
  14193. if (this.collapsible) {
  14194. this.tools.toggle.hide()
  14195. }
  14196. this.el.addClass("x-window-maximized");
  14197. this.container.addClass("x-window-maximized-ct");
  14198. this.setPosition(0, 0);
  14199. this.fitContainer();
  14200. this.fireEvent("maximize", this)
  14201. }
  14202. },
  14203. restore : function() {
  14204. if (this.maximized) {
  14205. this.el.removeClass("x-window-maximized");
  14206. this.tools.restore.hide();
  14207. this.tools.maximize.show();
  14208. this.setPosition(this.restorePos[0], this.restorePos[1]);
  14209. this.setSize(this.restoreSize.width,
  14210. this.restoreSize.height);
  14211. delete this.restorePos;
  14212. delete this.restoreSize;
  14213. this.maximized = false;
  14214. this.el.enableShadow(true);
  14215. if (this.dd) {
  14216. this.dd.unlock()
  14217. }
  14218. if (this.collapsible) {
  14219. this.tools.toggle.show()
  14220. }
  14221. this.container.removeClass("x-window-maximized-ct");
  14222. this.doConstrain();
  14223. this.fireEvent("restore", this)
  14224. }
  14225. },
  14226. toggleMaximize : function() {
  14227. this[this.maximized ? "restore" : "maximize"]()
  14228. },
  14229. fitContainer : function() {
  14230. var A = this.container.getViewSize();
  14231. this.setSize(A.width, A.height)
  14232. },
  14233. setZIndex : function(A) {
  14234. if (this.modal) {
  14235. this.mask.setStyle("z-index", A)
  14236. }
  14237. this.el.setZIndex(++A);
  14238. A += 5;
  14239. if (this.resizer) {
  14240. this.resizer.proxy.setStyle("z-index", ++A)
  14241. }
  14242. this.lastZIndex = A
  14243. },
  14244. alignTo : function(B, A, C) {
  14245. var D = this.el.getAlignToXY(B, A, C);
  14246. this.setPagePosition(D[0], D[1]);
  14247. return this
  14248. },
  14249. anchorTo : function(C, G, D, B, F) {
  14250. var E = function() {
  14251. this.alignTo(C, G, D)
  14252. };
  14253. Ext.EventManager.onWindowResize(E, this);
  14254. var A = typeof B;
  14255. if (A != "undefined") {
  14256. Ext.EventManager.on(window, "scroll", E, this, {
  14257. buffer : A == "number" ? B : 50
  14258. })
  14259. }
  14260. E.call(this);
  14261. this[F] = E;
  14262. return this
  14263. },
  14264. toFront : function() {
  14265. if (this.manager.bringToFront(this)) {
  14266. this.focus()
  14267. }
  14268. return this
  14269. },
  14270. setActive : function(A) {
  14271. if (A) {
  14272. if (!this.maximized) {
  14273. this.el.enableShadow(true)
  14274. }
  14275. this.fireEvent("activate", this)
  14276. } else {
  14277. this.el.disableShadow();
  14278. this.fireEvent("deactivate", this)
  14279. }
  14280. },
  14281. toBack : function() {
  14282. this.manager.sendToBack(this);
  14283. return this
  14284. },
  14285. center : function() {
  14286. var A = this.el.getAlignToXY(this.container, "c-c");
  14287. this.setPagePosition(A[0], A[1]);
  14288. return this
  14289. }
  14290. });
  14291. Ext.reg("window", Ext.Window);
  14292. Ext.Window.DD = function(A) {
  14293. this.win = A;
  14294. Ext.Window.DD.superclass.constructor
  14295. .call(this, A.el.id, "WindowDD-" + A.id);
  14296. this.setHandleElId(A.header.id);
  14297. this.scroll = false
  14298. };
  14299. Ext.extend(Ext.Window.DD, Ext.dd.DD, {
  14300. moveOnly : true,
  14301. headerOffsets : [100, 25],
  14302. startDrag : function() {
  14303. var A = this.win;
  14304. this.proxy = A.ghost();
  14305. if (A.constrain !== false) {
  14306. var C = A.el.shadowOffset;
  14307. this.constrainTo(A.container, {
  14308. right : C,
  14309. left : C,
  14310. bottom : C
  14311. })
  14312. } else {
  14313. if (A.constrainHeader !== false) {
  14314. var B = this.proxy.getSize();
  14315. this.constrainTo(A.container, {
  14316. right : -(B.width - this.headerOffsets[0]),
  14317. bottom : -(B.height - this.headerOffsets[1])
  14318. })
  14319. }
  14320. }
  14321. },
  14322. b4Drag : Ext.emptyFn,
  14323. onDrag : function(A) {
  14324. this.alignElWithMouse(this.proxy, A.getPageX(), A.getPageY())
  14325. },
  14326. endDrag : function(A) {
  14327. this.win.unghost();
  14328. this.win.saveState()
  14329. }
  14330. });
  14331. Ext.WindowGroup = function() {
  14332. var F = {};
  14333. var D = [];
  14334. var E = null;
  14335. var C = function(I, H) {
  14336. return (!I._lastAccess || I._lastAccess < H._lastAccess) ? -1 : 1
  14337. };
  14338. var G = function() {
  14339. var J = D, H = J.length;
  14340. if (H > 0) {
  14341. J.sort(C);
  14342. var I = J[0].manager.zseed;
  14343. for (var K = 0; K < H; K++) {
  14344. var L = J[K];
  14345. if (L && !L.hidden) {
  14346. L.setZIndex(I + (K * 10))
  14347. }
  14348. }
  14349. }
  14350. A()
  14351. };
  14352. var B = function(H) {
  14353. if (H != E) {
  14354. if (E) {
  14355. E.setActive(false)
  14356. }
  14357. E = H;
  14358. if (H) {
  14359. H.setActive(true)
  14360. }
  14361. }
  14362. };
  14363. var A = function() {
  14364. for (var H = D.length - 1; H >= 0; --H) {
  14365. if (!D[H].hidden) {
  14366. B(D[H]);
  14367. return
  14368. }
  14369. }
  14370. B(null)
  14371. };
  14372. return {
  14373. zseed : 9000,
  14374. register : function(H) {
  14375. F[H.id] = H;
  14376. D.push(H);
  14377. H.on("hide", A)
  14378. },
  14379. unregister : function(H) {
  14380. delete F[H.id];
  14381. H.un("hide", A);
  14382. D.remove(H)
  14383. },
  14384. get : function(H) {
  14385. return typeof H == "object" ? H : F[H]
  14386. },
  14387. bringToFront : function(H) {
  14388. H = this.get(H);
  14389. if (H != E) {
  14390. H._lastAccess = new Date().getTime();
  14391. G();
  14392. return true
  14393. }
  14394. return false
  14395. },
  14396. sendToBack : function(H) {
  14397. H = this.get(H);
  14398. H._lastAccess = -(new Date().getTime());
  14399. G();
  14400. return H
  14401. },
  14402. hideAll : function() {
  14403. for (var H in F) {
  14404. if (F[H] && typeof F[H] != "function" && F[H].isVisible()) {
  14405. F[H].hide()
  14406. }
  14407. }
  14408. },
  14409. getActive : function() {
  14410. return E
  14411. },
  14412. getBy : function(J, I) {
  14413. var K = [];
  14414. for (var H = D.length - 1; H >= 0; --H) {
  14415. var L = D[H];
  14416. if (J.call(I || L, L) !== false) {
  14417. K.push(L)
  14418. }
  14419. }
  14420. return K
  14421. },
  14422. each : function(I, H) {
  14423. for (var J in F) {
  14424. if (F[J] && typeof F[J] != "function") {
  14425. if (I.call(H || F[J], F[J]) === false) {
  14426. return
  14427. }
  14428. }
  14429. }
  14430. }
  14431. }
  14432. };
  14433. Ext.WindowMgr = new Ext.WindowGroup();
  14434. Ext.dd.PanelProxy = function(A, B) {
  14435. this.panel = A;
  14436. this.id = this.panel.id + "-ddproxy";
  14437. Ext.apply(this, B)
  14438. };
  14439. Ext.dd.PanelProxy.prototype = {
  14440. insertProxy : true,
  14441. setStatus : Ext.emptyFn,
  14442. reset : Ext.emptyFn,
  14443. update : Ext.emptyFn,
  14444. stop : Ext.emptyFn,
  14445. sync : Ext.emptyFn,
  14446. getEl : function() {
  14447. return this.ghost
  14448. },
  14449. getGhost : function() {
  14450. return this.ghost
  14451. },
  14452. getProxy : function() {
  14453. return this.proxy
  14454. },
  14455. hide : function() {
  14456. if (this.ghost) {
  14457. if (this.proxy) {
  14458. this.proxy.remove();
  14459. delete this.proxy
  14460. }
  14461. this.panel.el.dom.style.display = "";
  14462. this.ghost.remove();
  14463. delete this.ghost
  14464. }
  14465. },
  14466. show : function() {
  14467. if (!this.ghost) {
  14468. this.ghost = this.panel.createGhost(undefined, undefined, Ext
  14469. .getBody());
  14470. this.ghost.setXY(this.panel.el.getXY());
  14471. if (this.insertProxy) {
  14472. this.proxy = this.panel.el.insertSibling({
  14473. cls : "x-panel-dd-spacer"
  14474. });
  14475. this.proxy.setSize(this.panel.getSize())
  14476. }
  14477. this.panel.el.dom.style.display = "none"
  14478. }
  14479. },
  14480. repair : function(B, C, A) {
  14481. this.hide();
  14482. if (typeof C == "function") {
  14483. C.call(A || this)
  14484. }
  14485. },
  14486. moveProxy : function(A, B) {
  14487. if (this.proxy) {
  14488. A.insertBefore(this.proxy.dom, B)
  14489. }
  14490. }
  14491. };
  14492. Ext.Panel.DD = function(B, A) {
  14493. this.panel = B;
  14494. this.dragData = {
  14495. panel : B
  14496. };
  14497. this.proxy = new Ext.dd.PanelProxy(B, A);
  14498. Ext.Panel.DD.superclass.constructor.call(this, B.el, A);
  14499. this.setHandleElId(B.header.id);
  14500. B.header.setStyle("cursor", "move");
  14501. this.scroll = false
  14502. };
  14503. Ext.extend(Ext.Panel.DD, Ext.dd.DragSource, {
  14504. showFrame : Ext.emptyFn,
  14505. startDrag : Ext.emptyFn,
  14506. b4StartDrag : function(A, B) {
  14507. this.proxy.show()
  14508. },
  14509. b4MouseDown : function(B) {
  14510. var A = B.getPageX();
  14511. var C = B.getPageY();
  14512. this.autoOffset(A, C)
  14513. },
  14514. onInitDrag : function(A, B) {
  14515. this.onStartDrag(A, B);
  14516. return true
  14517. },
  14518. createFrame : Ext.emptyFn,
  14519. getDragEl : function(A) {
  14520. return this.proxy.ghost.dom
  14521. },
  14522. endDrag : function(A) {
  14523. this.proxy.hide();
  14524. this.panel.saveState()
  14525. },
  14526. autoOffset : function(A, B) {
  14527. A -= this.startPageX;
  14528. B -= this.startPageY;
  14529. this.setDelta(A, B)
  14530. }
  14531. });
  14532. Ext.state.Provider = function() {
  14533. this.addEvents("statechange");
  14534. this.state = {};
  14535. Ext.state.Provider.superclass.constructor.call(this)
  14536. };
  14537. Ext.extend(Ext.state.Provider, Ext.util.Observable, {
  14538. get : function(B, A) {
  14539. return typeof this.state[B] == "undefined" ? A : this.state[B]
  14540. },
  14541. clear : function(A) {
  14542. delete this.state[A];
  14543. this.fireEvent("statechange", this, A, null)
  14544. },
  14545. set : function(A, B) {
  14546. this.state[A] = B;
  14547. this.fireEvent("statechange", this, A, B)
  14548. },
  14549. decodeValue : function(A) {
  14550. var J = /^(a|n|d|b|s|o)\:(.*)$/;
  14551. var C = J.exec(unescape(A));
  14552. if (!C || !C[1]) {
  14553. return
  14554. }
  14555. var F = C[1];
  14556. var H = C[2];
  14557. switch (F) {
  14558. case "n" :
  14559. return parseFloat(H);
  14560. case "d" :
  14561. return new Date(Date.parse(H));
  14562. case "b" :
  14563. return (H == "1");
  14564. case "a" :
  14565. var G = [];
  14566. var I = H.split("^");
  14567. for (var B = 0, D = I.length; B < D; B++) {
  14568. G.push(this.decodeValue(I[B]))
  14569. }
  14570. return G;
  14571. case "o" :
  14572. var G = {};
  14573. var I = H.split("^");
  14574. for (var B = 0, D = I.length; B < D; B++) {
  14575. var E = I[B].split("=");
  14576. G[E[0]] = this.decodeValue(E[1])
  14577. }
  14578. return G;
  14579. default :
  14580. return H
  14581. }
  14582. },
  14583. encodeValue : function(C) {
  14584. var B;
  14585. if (typeof C == "number") {
  14586. B = "n:" + C
  14587. } else {
  14588. if (typeof C == "boolean") {
  14589. B = "b:" + (C ? "1" : "0")
  14590. } else {
  14591. if (Ext.isDate(C)) {
  14592. B = "d:" + C.toGMTString()
  14593. } else {
  14594. if (Ext.isArray(C)) {
  14595. var F = "";
  14596. for (var E = 0, A = C.length; E < A; E++) {
  14597. F += this.encodeValue(C[E]);
  14598. if (E != A - 1) {
  14599. F += "^"
  14600. }
  14601. }
  14602. B = "a:" + F
  14603. } else {
  14604. if (typeof C == "object") {
  14605. var F = "";
  14606. for (var D in C) {
  14607. if (typeof C[D] != "function"
  14608. && C[D] !== undefined) {
  14609. F += D + "="
  14610. + this.encodeValue(C[D])
  14611. + "^"
  14612. }
  14613. }
  14614. B = "o:" + F.substring(0, F.length - 1)
  14615. } else {
  14616. B = "s:" + C
  14617. }
  14618. }
  14619. }
  14620. }
  14621. }
  14622. return escape(B)
  14623. }
  14624. });
  14625. Ext.state.Manager = function() {
  14626. var A = new Ext.state.Provider();
  14627. return {
  14628. setProvider : function(B) {
  14629. A = B
  14630. },
  14631. get : function(C, B) {
  14632. return A.get(C, B)
  14633. },
  14634. set : function(B, C) {
  14635. A.set(B, C)
  14636. },
  14637. clear : function(B) {
  14638. A.clear(B)
  14639. },
  14640. getProvider : function() {
  14641. return A
  14642. }
  14643. }
  14644. }();
  14645. Ext.state.CookieProvider = function(A) {
  14646. Ext.state.CookieProvider.superclass.constructor.call(this);
  14647. this.path = "/";
  14648. this.expires = new Date(new Date().getTime() + (1000 * 60 * 60 * 24 * 7));
  14649. this.domain = null;
  14650. this.secure = false;
  14651. Ext.apply(this, A);
  14652. this.state = this.readCookies()
  14653. };
  14654. Ext.extend(Ext.state.CookieProvider, Ext.state.Provider, {
  14655. set : function(A, B) {
  14656. if (typeof B == "undefined" || B === null) {
  14657. this.clear(A);
  14658. return
  14659. }
  14660. this.setCookie(A, B);
  14661. Ext.state.CookieProvider.superclass.set.call(this, A, B)
  14662. },
  14663. clear : function(A) {
  14664. this.clearCookie(A);
  14665. Ext.state.CookieProvider.superclass.clear.call(this, A)
  14666. },
  14667. readCookies : function() {
  14668. var C = {};
  14669. var F = document.cookie + ";";
  14670. var B = /\s?(.*?)=(.*?);/g;
  14671. var E;
  14672. while ((E = B.exec(F)) != null) {
  14673. var A = E[1];
  14674. var D = E[2];
  14675. if (A && A.substring(0, 3) == "ys-") {
  14676. C[A.substr(3)] = this.decodeValue(D)
  14677. }
  14678. }
  14679. return C
  14680. },
  14681. setCookie : function(A, B) {
  14682. document.cookie = "ys-"
  14683. + A
  14684. + "="
  14685. + this.encodeValue(B)
  14686. + ((this.expires == null)
  14687. ? ""
  14688. : ("; expires=" + this.expires.toGMTString()))
  14689. + ((this.path == null) ? "" : ("; path=" + this.path))
  14690. + ((this.domain == null)
  14691. ? ""
  14692. : ("; domain=" + this.domain))
  14693. + ((this.secure == true) ? "; secure" : "")
  14694. },
  14695. clearCookie : function(A) {
  14696. document.cookie = "ys-"
  14697. + A
  14698. + "=null; expires=Thu, 01-Jan-70 00:00:01 GMT"
  14699. + ((this.path == null) ? "" : ("; path=" + this.path))
  14700. + ((this.domain == null)
  14701. ? ""
  14702. : ("; domain=" + this.domain))
  14703. + ((this.secure == true) ? "; secure" : "")
  14704. }
  14705. });
  14706. Ext.DataView = Ext.extend(Ext.BoxComponent, {
  14707. selectedClass : "x-view-selected",
  14708. emptyText : "",
  14709. last : false,
  14710. initComponent : function() {
  14711. Ext.DataView.superclass.initComponent.call(this);
  14712. if (typeof this.tpl == "string") {
  14713. this.tpl = new Ext.XTemplate(this.tpl)
  14714. }
  14715. this.addEvents("beforeclick", "click", "containerclick",
  14716. "dblclick", "contextmenu", "selectionchange",
  14717. "beforeselect");
  14718. this.all = new Ext.CompositeElementLite();
  14719. this.selected = new Ext.CompositeElementLite()
  14720. },
  14721. onRender : function() {
  14722. if (!this.el) {
  14723. this.el = document.createElement("div")
  14724. }
  14725. Ext.DataView.superclass.onRender.apply(this, arguments)
  14726. },
  14727. afterRender : function() {
  14728. Ext.DataView.superclass.afterRender.call(this);
  14729. this.el.on({
  14730. "click" : this.onClick,
  14731. "dblclick" : this.onDblClick,
  14732. "contextmenu" : this.onContextMenu,
  14733. scope : this
  14734. });
  14735. if (this.overClass) {
  14736. this.el.on({
  14737. "mouseover" : this.onMouseOver,
  14738. "mouseout" : this.onMouseOut,
  14739. scope : this
  14740. })
  14741. }
  14742. if (this.store) {
  14743. this.setStore(this.store, true)
  14744. }
  14745. },
  14746. refresh : function() {
  14747. this.clearSelections(false, true);
  14748. this.el.update("");
  14749. var B = [];
  14750. var A = this.store.getRange();
  14751. if (A.length < 1) {
  14752. this.el.update(this.emptyText);
  14753. this.all.clear();
  14754. return
  14755. }
  14756. this.tpl.overwrite(this.el, this.collectData(A, 0));
  14757. this.all.fill(Ext.query(this.itemSelector, this.el.dom));
  14758. this.updateIndexes(0)
  14759. },
  14760. prepareData : function(A) {
  14761. return A
  14762. },
  14763. collectData : function(B, E) {
  14764. var D = [];
  14765. for (var C = 0, A = B.length; C < A; C++) {
  14766. D[D.length] = this.prepareData(B[C].data, E + C, B[C])
  14767. }
  14768. return D
  14769. },
  14770. bufferRender : function(A) {
  14771. var B = document.createElement("div");
  14772. this.tpl.overwrite(B, this.collectData(A));
  14773. return Ext.query(this.itemSelector, B)
  14774. },
  14775. onUpdate : function(F, A) {
  14776. var B = this.store.indexOf(A);
  14777. var E = this.isSelected(B);
  14778. var C = this.all.elements[B];
  14779. var D = this.bufferRender([A], B)[0];
  14780. this.all.replaceElement(B, D, true);
  14781. if (E) {
  14782. this.selected.replaceElement(C, D);
  14783. this.all.item(B).addClass(this.selectedClass)
  14784. }
  14785. this.updateIndexes(B, B)
  14786. },
  14787. onAdd : function(D, B, C) {
  14788. if (this.all.getCount() == 0) {
  14789. this.refresh();
  14790. return
  14791. }
  14792. var A = this.bufferRender(B, C), E;
  14793. if (C < this.all.getCount()) {
  14794. E = this.all.item(C).insertSibling(A, "before", true);
  14795. this.all.elements.splice(C, 0, E)
  14796. } else {
  14797. E = this.all.last().insertSibling(A, "after", true);
  14798. this.all.elements.push(E)
  14799. }
  14800. this.updateIndexes(C)
  14801. },
  14802. onRemove : function(C, A, B) {
  14803. this.deselect(B);
  14804. this.all.removeElement(B, true);
  14805. this.updateIndexes(B)
  14806. },
  14807. refreshNode : function(A) {
  14808. this.onUpdate(this.store, this.store.getAt(A))
  14809. },
  14810. updateIndexes : function(D, C) {
  14811. var B = this.all.elements;
  14812. D = D || 0;
  14813. C = C || ((C === 0) ? 0 : (B.length - 1));
  14814. for (var A = D; A <= C; A++) {
  14815. B[A].viewIndex = A
  14816. }
  14817. },
  14818. setStore : function(A, B) {
  14819. if (!B && this.store) {
  14820. this.store.un("beforeload", this.onBeforeLoad, this);
  14821. this.store.un("datachanged", this.refresh, this);
  14822. this.store.un("add", this.onAdd, this);
  14823. this.store.un("remove", this.onRemove, this);
  14824. this.store.un("update", this.onUpdate, this);
  14825. this.store.un("clear", this.refresh, this)
  14826. }
  14827. if (A) {
  14828. A = Ext.StoreMgr.lookup(A);
  14829. A.on("beforeload", this.onBeforeLoad, this);
  14830. A.on("datachanged", this.refresh, this);
  14831. A.on("add", this.onAdd, this);
  14832. A.on("remove", this.onRemove, this);
  14833. A.on("update", this.onUpdate, this);
  14834. A.on("clear", this.refresh, this)
  14835. }
  14836. this.store = A;
  14837. if (A) {
  14838. this.refresh()
  14839. }
  14840. },
  14841. findItemFromChild : function(A) {
  14842. return Ext.fly(A).findParent(this.itemSelector, this.el)
  14843. },
  14844. onClick : function(C) {
  14845. var B = C.getTarget(this.itemSelector, this.el);
  14846. if (B) {
  14847. var A = this.indexOf(B);
  14848. if (this.onItemClick(B, A, C) !== false) {
  14849. this.fireEvent("click", this, A, B, C)
  14850. }
  14851. } else {
  14852. if (this.fireEvent("containerclick", this, C) !== false) {
  14853. this.clearSelections()
  14854. }
  14855. }
  14856. },
  14857. onContextMenu : function(B) {
  14858. var A = B.getTarget(this.itemSelector, this.el);
  14859. if (A) {
  14860. this.fireEvent("contextmenu", this, this.indexOf(A), A, B)
  14861. }
  14862. },
  14863. onDblClick : function(B) {
  14864. var A = B.getTarget(this.itemSelector, this.el);
  14865. if (A) {
  14866. this.fireEvent("dblclick", this, this.indexOf(A), A, B)
  14867. }
  14868. },
  14869. onMouseOver : function(B) {
  14870. var A = B.getTarget(this.itemSelector, this.el);
  14871. if (A && A !== this.lastItem) {
  14872. this.lastItem = A;
  14873. Ext.fly(A).addClass(this.overClass)
  14874. }
  14875. },
  14876. onMouseOut : function(A) {
  14877. if (this.lastItem) {
  14878. if (!A.within(this.lastItem, true)) {
  14879. Ext.fly(this.lastItem).removeClass(this.overClass);
  14880. delete this.lastItem
  14881. }
  14882. }
  14883. },
  14884. onItemClick : function(B, A, C) {
  14885. if (this.fireEvent("beforeclick", this, A, B, C) === false) {
  14886. return false
  14887. }
  14888. if (this.multiSelect) {
  14889. this.doMultiSelection(B, A, C);
  14890. C.preventDefault()
  14891. } else {
  14892. if (this.singleSelect) {
  14893. this.doSingleSelection(B, A, C);
  14894. C.preventDefault()
  14895. }
  14896. }
  14897. return true
  14898. },
  14899. doSingleSelection : function(B, A, C) {
  14900. if (C.ctrlKey && this.isSelected(A)) {
  14901. this.deselect(A)
  14902. } else {
  14903. this.select(A, false)
  14904. }
  14905. },
  14906. doMultiSelection : function(C, A, D) {
  14907. if (D.shiftKey && this.last !== false) {
  14908. var B = this.last;
  14909. this.selectRange(B, A, D.ctrlKey);
  14910. this.last = B
  14911. } else {
  14912. if ((D.ctrlKey || this.simpleSelect) && this.isSelected(A)) {
  14913. this.deselect(A)
  14914. } else {
  14915. this.select(A, D.ctrlKey || D.shiftKey
  14916. || this.simpleSelect)
  14917. }
  14918. }
  14919. },
  14920. getSelectionCount : function() {
  14921. return this.selected.getCount()
  14922. },
  14923. getSelectedNodes : function() {
  14924. return this.selected.elements
  14925. },
  14926. getSelectedIndexes : function() {
  14927. var B = [], D = this.selected.elements;
  14928. for (var C = 0, A = D.length; C < A; C++) {
  14929. B.push(D[C].viewIndex)
  14930. }
  14931. return B
  14932. },
  14933. getSelectedRecords : function() {
  14934. var D = [], C = this.selected.elements;
  14935. for (var B = 0, A = C.length; B < A; B++) {
  14936. D[D.length] = this.store.getAt(C[B].viewIndex)
  14937. }
  14938. return D
  14939. },
  14940. getRecords : function(B) {
  14941. var E = [], D = B;
  14942. for (var C = 0, A = D.length; C < A; C++) {
  14943. E[E.length] = this.store.getAt(D[C].viewIndex)
  14944. }
  14945. return E
  14946. },
  14947. getRecord : function(A) {
  14948. return this.store.getAt(A.viewIndex)
  14949. },
  14950. clearSelections : function(A, B) {
  14951. if (this.multiSelect || this.singleSelect) {
  14952. if (!B) {
  14953. this.selected.removeClass(this.selectedClass)
  14954. }
  14955. this.selected.clear();
  14956. this.last = false;
  14957. if (!A) {
  14958. this.fireEvent("selectionchange", this,
  14959. this.selected.elements)
  14960. }
  14961. }
  14962. },
  14963. isSelected : function(A) {
  14964. return this.selected.contains(this.getNode(A))
  14965. },
  14966. deselect : function(A) {
  14967. if (this.isSelected(A)) {
  14968. var A = this.getNode(A);
  14969. this.selected.removeElement(A);
  14970. if (this.last == A.viewIndex) {
  14971. this.last = false
  14972. }
  14973. Ext.fly(A).removeClass(this.selectedClass);
  14974. this.fireEvent("selectionchange", this,
  14975. this.selected.elements)
  14976. }
  14977. },
  14978. select : function(D, F, B) {
  14979. if (Ext.isArray(D)) {
  14980. if (!F) {
  14981. this.clearSelections(true)
  14982. }
  14983. for (var C = 0, A = D.length; C < A; C++) {
  14984. this.select(D[C], true, true)
  14985. }
  14986. } else {
  14987. var E = this.getNode(D);
  14988. if (!F) {
  14989. this.clearSelections(true)
  14990. }
  14991. if (E && !this.isSelected(E)) {
  14992. if (this.fireEvent("beforeselect", this, E,
  14993. this.selected.elements) !== false) {
  14994. Ext.fly(E).addClass(this.selectedClass);
  14995. this.selected.add(E);
  14996. this.last = E.viewIndex;
  14997. if (!B) {
  14998. this.fireEvent("selectionchange", this,
  14999. this.selected.elements)
  15000. }
  15001. }
  15002. }
  15003. }
  15004. },
  15005. selectRange : function(C, A, B) {
  15006. if (!B) {
  15007. this.clearSelections(true)
  15008. }
  15009. this.select(this.getNodes(C, A), true)
  15010. },
  15011. getNode : function(A) {
  15012. if (typeof A == "string") {
  15013. return document.getElementById(A)
  15014. } else {
  15015. if (typeof A == "number") {
  15016. return this.all.elements[A]
  15017. }
  15018. }
  15019. return A
  15020. },
  15021. getNodes : function(E, A) {
  15022. var D = this.all.elements;
  15023. E = E || 0;
  15024. A = typeof A == "undefined" ? D.length - 1 : A;
  15025. var B = [], C;
  15026. if (E <= A) {
  15027. for (C = E; C <= A; C++) {
  15028. B.push(D[C])
  15029. }
  15030. } else {
  15031. for (C = E; C >= A; C--) {
  15032. B.push(D[C])
  15033. }
  15034. }
  15035. return B
  15036. },
  15037. indexOf : function(A) {
  15038. A = this.getNode(A);
  15039. if (typeof A.viewIndex == "number") {
  15040. return A.viewIndex
  15041. }
  15042. return this.all.indexOf(A)
  15043. },
  15044. onBeforeLoad : function() {
  15045. if (this.loadingText) {
  15046. this.clearSelections(false, true);
  15047. this.el.update("<div class=\"loading-indicator\">"
  15048. + this.loadingText + "</div>");
  15049. this.all.clear()
  15050. }
  15051. }
  15052. });
  15053. Ext.reg("dataview", Ext.DataView);
  15054. Ext.ColorPalette = function(A) {
  15055. Ext.ColorPalette.superclass.constructor.call(this, A);
  15056. this.addEvents("select");
  15057. if (this.handler) {
  15058. this.on("select", this.handler, this.scope, true)
  15059. }
  15060. };
  15061. Ext.extend(Ext.ColorPalette, Ext.Component, {
  15062. itemCls : "x-color-palette",
  15063. value : null,
  15064. clickEvent : "click",
  15065. ctype : "Ext.ColorPalette",
  15066. allowReselect : false,
  15067. colors : ["000000", "993300", "333300", "003300", "003366", "000080",
  15068. "333399", "333333", "800000", "FF6600", "808000", "008000",
  15069. "008080", "0000FF", "666699", "808080", "FF0000", "FF9900",
  15070. "99CC00", "339966", "33CCCC", "3366FF", "800080", "969696",
  15071. "FF00FF", "FFCC00", "FFFF00", "00FF00", "00FFFF", "00CCFF",
  15072. "993366", "C0C0C0", "FF99CC", "FFCC99", "FFFF99", "CCFFCC",
  15073. "CCFFFF", "99CCFF", "CC99FF", "FFFFFF"],
  15074. onRender : function(B, A) {
  15075. var C = this.tpl
  15076. || new Ext.XTemplate("<tpl for=\".\"><a href=\"#\" class=\"color-{.}\" hidefocus=\"on\"><em><span style=\"background:#{.}\" unselectable=\"on\">&#160;</span></em></a></tpl>");
  15077. var D = document.createElement("div");
  15078. D.className = this.itemCls;
  15079. C.overwrite(D, this.colors);
  15080. B.dom.insertBefore(D, A);
  15081. this.el = Ext.get(D);
  15082. this.el.on(this.clickEvent, this.handleClick, this, {
  15083. delegate : "a"
  15084. });
  15085. if (this.clickEvent != "click") {
  15086. this.el.on("click", Ext.emptyFn, this, {
  15087. delegate : "a",
  15088. preventDefault : true
  15089. })
  15090. }
  15091. },
  15092. afterRender : function() {
  15093. Ext.ColorPalette.superclass.afterRender.call(this);
  15094. if (this.value) {
  15095. var A = this.value;
  15096. this.value = null;
  15097. this.select(A)
  15098. }
  15099. },
  15100. handleClick : function(B, A) {
  15101. B.preventDefault();
  15102. if (!this.disabled) {
  15103. var C = A.className.match(/(?:^|\s)color-(.{6})(?:\s|$)/)[1];
  15104. this.select(C.toUpperCase())
  15105. }
  15106. },
  15107. select : function(A) {
  15108. A = A.replace("#", "");
  15109. if (A != this.value || this.allowReselect) {
  15110. var B = this.el;
  15111. if (this.value) {
  15112. B.child("a.color-" + this.value)
  15113. .removeClass("x-color-palette-sel")
  15114. }
  15115. B.child("a.color-" + A).addClass("x-color-palette-sel");
  15116. this.value = A;
  15117. this.fireEvent("select", this, A)
  15118. }
  15119. }
  15120. });
  15121. Ext.reg("colorpalette", Ext.ColorPalette);
  15122. Ext.DatePicker = Ext.extend(Ext.Component, {
  15123. todayText : "Today",
  15124. okText : "&#160;OK&#160;",
  15125. cancelText : "Cancel",
  15126. todayTip : "{0} (Spacebar)",
  15127. minDate : null,
  15128. maxDate : null,
  15129. minText : "This date is before the minimum date",
  15130. maxText : "This date is after the maximum date",
  15131. format : "m/d/y",
  15132. disabledDays : null,
  15133. disabledDaysText : "",
  15134. disabledDatesRE : null,
  15135. disabledDatesText : "",
  15136. constrainToViewport : true,
  15137. monthNames : Date.monthNames,
  15138. dayNames : Date.dayNames,
  15139. nextText : "Next Month (Control+Right)",
  15140. prevText : "Previous Month (Control+Left)",
  15141. monthYearText : "Choose a month (Control+Up/Down to move years)",
  15142. startDay : 0,
  15143. initComponent : function() {
  15144. Ext.DatePicker.superclass.initComponent.call(this);
  15145. this.value = this.value ? this.value.clearTime() : new Date()
  15146. .clearTime();
  15147. this.addEvents("select");
  15148. if (this.handler) {
  15149. this.on("select", this.handler, this.scope || this)
  15150. }
  15151. this.initDisabledDays()
  15152. },
  15153. initDisabledDays : function() {
  15154. if (!this.disabledDatesRE && this.disabledDates) {
  15155. var A = this.disabledDates;
  15156. var C = "(?:";
  15157. for (var B = 0; B < A.length; B++) {
  15158. C += A[B];
  15159. if (B != A.length - 1) {
  15160. C += "|"
  15161. }
  15162. }
  15163. this.disabledDatesRE = new RegExp(C + ")")
  15164. }
  15165. },
  15166. setValue : function(B) {
  15167. var A = this.value;
  15168. this.value = B.clearTime(true);
  15169. if (this.el) {
  15170. this.update(this.value)
  15171. }
  15172. },
  15173. getValue : function() {
  15174. return this.value
  15175. },
  15176. focus : function() {
  15177. if (this.el) {
  15178. this.update(this.activeDate)
  15179. }
  15180. },
  15181. onRender : function(A, F) {
  15182. var C = [
  15183. "<table cellspacing=\"0\">",
  15184. "<tr><td class=\"x-date-left\"><a href=\"#\" title=\"",
  15185. this.prevText,
  15186. "\">&#160;</a></td><td class=\"x-date-middle\" align=\"center\"></td><td class=\"x-date-right\"><a href=\"#\" title=\"",
  15187. this.nextText,
  15188. "\">&#160;</a></td></tr>",
  15189. "<tr><td colspan=\"3\"><table class=\"x-date-inner\" cellspacing=\"0\"><thead><tr>"];
  15190. var E = this.dayNames;
  15191. for (var D = 0; D < 7; D++) {
  15192. var G = this.startDay + D;
  15193. if (G > 6) {
  15194. G = G - 7
  15195. }
  15196. C.push("<th><span>", E[G].substr(0, 1), "</span></th>")
  15197. }
  15198. C[C.length] = "</tr></thead><tbody><tr>";
  15199. for (var D = 0; D < 42; D++) {
  15200. if (D % 7 == 0 && D != 0) {
  15201. C[C.length] = "</tr><tr>"
  15202. }
  15203. C[C.length] = "<td><a href=\"#\" hidefocus=\"on\" class=\"x-date-date\" tabIndex=\"1\"><em><span></span></em></a></td>"
  15204. }
  15205. C[C.length] = "</tr></tbody></table></td></tr><tr><td colspan=\"3\" class=\"x-date-bottom\" align=\"center\"></td></tr></table><div class=\"x-date-mp\"></div>";
  15206. var B = document.createElement("div");
  15207. B.className = "x-date-picker";
  15208. B.innerHTML = C.join("");
  15209. A.dom.insertBefore(B, F);
  15210. this.el = Ext.get(B);
  15211. this.eventEl = Ext.get(B.firstChild);
  15212. new Ext.util.ClickRepeater(this.el.child("td.x-date-left a"), {
  15213. handler : this.showPrevMonth,
  15214. scope : this,
  15215. preventDefault : true,
  15216. stopDefault : true
  15217. });
  15218. new Ext.util.ClickRepeater(this.el.child("td.x-date-right a"), {
  15219. handler : this.showNextMonth,
  15220. scope : this,
  15221. preventDefault : true,
  15222. stopDefault : true
  15223. });
  15224. this.eventEl.on("mousewheel", this.handleMouseWheel, this);
  15225. this.monthPicker = this.el.down("div.x-date-mp");
  15226. this.monthPicker.enableDisplayMode("block");
  15227. var I = new Ext.KeyNav(this.eventEl, {
  15228. "left" : function(J) {
  15229. J.ctrlKey ? this.showPrevMonth() : this
  15230. .update(this.activeDate.add("d", -1))
  15231. },
  15232. "right" : function(J) {
  15233. J.ctrlKey ? this.showNextMonth() : this
  15234. .update(this.activeDate.add("d", 1))
  15235. },
  15236. "up" : function(J) {
  15237. J.ctrlKey ? this.showNextYear() : this
  15238. .update(this.activeDate.add("d", -7))
  15239. },
  15240. "down" : function(J) {
  15241. J.ctrlKey ? this.showPrevYear() : this
  15242. .update(this.activeDate.add("d", 7))
  15243. },
  15244. "pageUp" : function(J) {
  15245. this.showNextMonth()
  15246. },
  15247. "pageDown" : function(J) {
  15248. this.showPrevMonth()
  15249. },
  15250. "enter" : function(J) {
  15251. J.stopPropagation();
  15252. return true
  15253. },
  15254. scope : this
  15255. });
  15256. this.eventEl.on("click", this.handleDateClick, this, {
  15257. delegate : "a.x-date-date"
  15258. });
  15259. this.eventEl.addKeyListener(Ext.EventObject.SPACE, this.selectToday,
  15260. this);
  15261. this.el.unselectable();
  15262. this.cells = this.el.select("table.x-date-inner tbody td");
  15263. this.textNodes = this.el.query("table.x-date-inner tbody span");
  15264. this.mbtn = new Ext.Button({
  15265. text : "&#160;",
  15266. tooltip : this.monthYearText,
  15267. renderTo : this.el.child("td.x-date-middle", true)
  15268. });
  15269. this.mbtn.on("click", this.showMonthPicker, this);
  15270. this.mbtn.el.child(this.mbtn.menuClassTarget)
  15271. .addClass("x-btn-with-menu");
  15272. var H = (new Date()).dateFormat(this.format);
  15273. this.todayBtn = new Ext.Button({
  15274. renderTo : this.el.child("td.x-date-bottom", true),
  15275. text : String.format(this.todayText, H),
  15276. tooltip : String.format(this.todayTip, H),
  15277. handler : this.selectToday,
  15278. scope : this
  15279. });
  15280. if (Ext.isIE) {
  15281. this.el.repaint()
  15282. }
  15283. this.update(this.value)
  15284. },
  15285. createMonthPicker : function() {
  15286. if (!this.monthPicker.dom.firstChild) {
  15287. var A = ["<table border=\"0\" cellspacing=\"0\">"];
  15288. for (var B = 0; B < 6; B++) {
  15289. A
  15290. .push(
  15291. "<tr><td class=\"x-date-mp-month\"><a href=\"#\">",
  15292. this.monthNames[B].substr(0, 3),
  15293. "</a></td>",
  15294. "<td class=\"x-date-mp-month x-date-mp-sep\"><a href=\"#\">",
  15295. this.monthNames[B + 6].substr(0, 3),
  15296. "</a></td>",
  15297. B == 0
  15298. ? "<td class=\"x-date-mp-ybtn\" align=\"center\"><a class=\"x-date-mp-prev\"></a></td><td class=\"x-date-mp-ybtn\" align=\"center\"><a class=\"x-date-mp-next\"></a></td></tr>"
  15299. : "<td class=\"x-date-mp-year\"><a href=\"#\"></a></td><td class=\"x-date-mp-year\"><a href=\"#\"></a></td></tr>")
  15300. }
  15301. A
  15302. .push(
  15303. "<tr class=\"x-date-mp-btns\"><td colspan=\"4\"><button type=\"button\" class=\"x-date-mp-ok\">",
  15304. this.okText,
  15305. "</button><button type=\"button\" class=\"x-date-mp-cancel\">",
  15306. this.cancelText, "</button></td></tr>", "</table>");
  15307. this.monthPicker.update(A.join(""));
  15308. this.monthPicker.on("click", this.onMonthClick, this);
  15309. this.monthPicker.on("dblclick", this.onMonthDblClick, this);
  15310. this.mpMonths = this.monthPicker.select("td.x-date-mp-month");
  15311. this.mpYears = this.monthPicker.select("td.x-date-mp-year");
  15312. this.mpMonths.each(function(C, D, E) {
  15313. E += 1;
  15314. if ((E % 2) == 0) {
  15315. C.dom.xmonth = 5 + Math.round(E * 0.5)
  15316. } else {
  15317. C.dom.xmonth = Math.round((E - 1) * 0.5)
  15318. }
  15319. })
  15320. }
  15321. },
  15322. showMonthPicker : function() {
  15323. this.createMonthPicker();
  15324. var A = this.el.getSize();
  15325. this.monthPicker.setSize(A);
  15326. this.monthPicker.child("table").setSize(A);
  15327. this.mpSelMonth = (this.activeDate || this.value).getMonth();
  15328. this.updateMPMonth(this.mpSelMonth);
  15329. this.mpSelYear = (this.activeDate || this.value).getFullYear();
  15330. this.updateMPYear(this.mpSelYear);
  15331. this.monthPicker.slideIn("t", {
  15332. duration : 0.2
  15333. })
  15334. },
  15335. updateMPYear : function(E) {
  15336. this.mpyear = E;
  15337. var C = this.mpYears.elements;
  15338. for (var B = 1; B <= 10; B++) {
  15339. var D = C[B - 1], A;
  15340. if ((B % 2) == 0) {
  15341. A = E + Math.round(B * 0.5);
  15342. D.firstChild.innerHTML = A;
  15343. D.xyear = A
  15344. } else {
  15345. A = E - (5 - Math.round(B * 0.5));
  15346. D.firstChild.innerHTML = A;
  15347. D.xyear = A
  15348. }
  15349. this.mpYears.item(B - 1)[A == this.mpSelYear
  15350. ? "addClass"
  15351. : "removeClass"]("x-date-mp-sel")
  15352. }
  15353. },
  15354. updateMPMonth : function(A) {
  15355. this.mpMonths.each(function(B, C, D) {
  15356. B[B.dom.xmonth == A ? "addClass" : "removeClass"]("x-date-mp-sel")
  15357. })
  15358. },
  15359. selectMPMonth : function(A) {
  15360. },
  15361. onMonthClick : function(D, B) {
  15362. D.stopEvent();
  15363. var C = new Ext.Element(B), A;
  15364. if (C.is("button.x-date-mp-cancel")) {
  15365. this.hideMonthPicker()
  15366. } else {
  15367. if (C.is("button.x-date-mp-ok")) {
  15368. this.update(new Date(this.mpSelYear, this.mpSelMonth,
  15369. (this.activeDate || this.value).getDate()));
  15370. this.hideMonthPicker()
  15371. } else {
  15372. if (A = C.up("td.x-date-mp-month", 2)) {
  15373. this.mpMonths.removeClass("x-date-mp-sel");
  15374. A.addClass("x-date-mp-sel");
  15375. this.mpSelMonth = A.dom.xmonth
  15376. } else {
  15377. if (A = C.up("td.x-date-mp-year", 2)) {
  15378. this.mpYears.removeClass("x-date-mp-sel");
  15379. A.addClass("x-date-mp-sel");
  15380. this.mpSelYear = A.dom.xyear
  15381. } else {
  15382. if (C.is("a.x-date-mp-prev")) {
  15383. this.updateMPYear(this.mpyear - 10)
  15384. } else {
  15385. if (C.is("a.x-date-mp-next")) {
  15386. this.updateMPYear(this.mpyear + 10)
  15387. }
  15388. }
  15389. }
  15390. }
  15391. }
  15392. }
  15393. },
  15394. onMonthDblClick : function(D, B) {
  15395. D.stopEvent();
  15396. var C = new Ext.Element(B), A;
  15397. if (A = C.up("td.x-date-mp-month", 2)) {
  15398. this.update(new Date(this.mpSelYear, A.dom.xmonth,
  15399. (this.activeDate || this.value).getDate()));
  15400. this.hideMonthPicker()
  15401. } else {
  15402. if (A = C.up("td.x-date-mp-year", 2)) {
  15403. this.update(new Date(A.dom.xyear, this.mpSelMonth,
  15404. (this.activeDate || this.value).getDate()));
  15405. this.hideMonthPicker()
  15406. }
  15407. }
  15408. },
  15409. hideMonthPicker : function(A) {
  15410. if (this.monthPicker) {
  15411. if (A === true) {
  15412. this.monthPicker.hide()
  15413. } else {
  15414. this.monthPicker.slideOut("t", {
  15415. duration : 0.2
  15416. })
  15417. }
  15418. }
  15419. },
  15420. showPrevMonth : function(A) {
  15421. this.update(this.activeDate.add("mo", -1))
  15422. },
  15423. showNextMonth : function(A) {
  15424. this.update(this.activeDate.add("mo", 1))
  15425. },
  15426. showPrevYear : function() {
  15427. this.update(this.activeDate.add("y", -1))
  15428. },
  15429. showNextYear : function() {
  15430. this.update(this.activeDate.add("y", 1))
  15431. },
  15432. handleMouseWheel : function(A) {
  15433. var B = A.getWheelDelta();
  15434. if (B > 0) {
  15435. this.showPrevMonth();
  15436. A.stopEvent()
  15437. } else {
  15438. if (B < 0) {
  15439. this.showNextMonth();
  15440. A.stopEvent()
  15441. }
  15442. }
  15443. },
  15444. handleDateClick : function(B, A) {
  15445. B.stopEvent();
  15446. if (A.dateValue && !Ext.fly(A.parentNode).hasClass("x-date-disabled")) {
  15447. this.setValue(new Date(A.dateValue));
  15448. this.fireEvent("select", this, this.value)
  15449. }
  15450. },
  15451. selectToday : function() {
  15452. this.setValue(new Date().clearTime());
  15453. this.fireEvent("select", this, this.value)
  15454. },
  15455. update : function(W) {
  15456. var A = this.activeDate;
  15457. this.activeDate = W;
  15458. if (A && this.el) {
  15459. var I = W.getTime();
  15460. if (A.getMonth() == W.getMonth()
  15461. && A.getFullYear() == W.getFullYear()) {
  15462. this.cells.removeClass("x-date-selected");
  15463. this.cells.each(function(a) {
  15464. if (a.dom.firstChild.dateValue == I) {
  15465. a.addClass("x-date-selected");
  15466. setTimeout(function() {
  15467. try {
  15468. a.dom.firstChild.focus()
  15469. } catch (b) {
  15470. }
  15471. }, 50);
  15472. return false
  15473. }
  15474. });
  15475. return
  15476. }
  15477. }
  15478. var F = W.getDaysInMonth();
  15479. var J = W.getFirstDateOfMonth();
  15480. var C = J.getDay() - this.startDay;
  15481. if (C <= this.startDay) {
  15482. C += 7
  15483. }
  15484. var S = W.add("mo", -1);
  15485. var D = S.getDaysInMonth() - C;
  15486. var B = this.cells.elements;
  15487. var K = this.textNodes;
  15488. F += C;
  15489. var P = 86400000;
  15490. var U = (new Date(S.getFullYear(), S.getMonth(), D)).clearTime();
  15491. var T = new Date().clearTime().getTime();
  15492. var N = W.clearTime().getTime();
  15493. var M = this.minDate
  15494. ? this.minDate.clearTime()
  15495. : Number.NEGATIVE_INFINITY;
  15496. var Q = this.maxDate
  15497. ? this.maxDate.clearTime()
  15498. : Number.POSITIVE_INFINITY;
  15499. var X = this.disabledDatesRE;
  15500. var L = this.disabledDatesText;
  15501. var Z = this.disabledDays ? this.disabledDays.join("") : false;
  15502. var V = this.disabledDaysText;
  15503. var R = this.format;
  15504. var G = function(d, a) {
  15505. a.title = "";
  15506. var b = U.getTime();
  15507. a.firstChild.dateValue = b;
  15508. if (b == T) {
  15509. a.className += " x-date-today";
  15510. a.title = d.todayText
  15511. }
  15512. if (b == N) {
  15513. a.className += " x-date-selected";
  15514. setTimeout(function() {
  15515. try {
  15516. a.firstChild.focus()
  15517. } catch (f) {
  15518. }
  15519. }, 50)
  15520. }
  15521. if (b < M) {
  15522. a.className = " x-date-disabled";
  15523. a.title = d.minText;
  15524. return
  15525. }
  15526. if (b > Q) {
  15527. a.className = " x-date-disabled";
  15528. a.title = d.maxText;
  15529. return
  15530. }
  15531. if (Z) {
  15532. if (Z.indexOf(U.getDay()) != -1) {
  15533. a.title = V;
  15534. a.className = " x-date-disabled"
  15535. }
  15536. }
  15537. if (X && R) {
  15538. var c = U.dateFormat(R);
  15539. if (X.test(c)) {
  15540. a.title = L.replace("%0", c);
  15541. a.className = " x-date-disabled"
  15542. }
  15543. }
  15544. };
  15545. var O = 0;
  15546. for (; O < C; O++) {
  15547. K[O].innerHTML = (++D);
  15548. U.setDate(U.getDate() + 1);
  15549. B[O].className = "x-date-prevday";
  15550. G(this, B[O])
  15551. }
  15552. for (; O < F; O++) {
  15553. intDay = O - C + 1;
  15554. K[O].innerHTML = (intDay);
  15555. U.setDate(U.getDate() + 1);
  15556. B[O].className = "x-date-active";
  15557. G(this, B[O])
  15558. }
  15559. var Y = 0;
  15560. for (; O < 42; O++) {
  15561. K[O].innerHTML = (++Y);
  15562. U.setDate(U.getDate() + 1);
  15563. B[O].className = "x-date-nextday";
  15564. G(this, B[O])
  15565. }
  15566. this.mbtn
  15567. .setText(this.monthNames[W.getMonth()] + " " + W.getFullYear());
  15568. if (!this.internalRender) {
  15569. var E = this.el.dom.firstChild;
  15570. var H = E.offsetWidth;
  15571. this.el.setWidth(H + this.el.getBorderWidth("lr"));
  15572. Ext.fly(E).setWidth(H);
  15573. this.internalRender = true;
  15574. if (Ext.isOpera && !this.secondPass) {
  15575. E.rows[0].cells[1].style.width = (H - (E.rows[0].cells[0].offsetWidth + E.rows[0].cells[2].offsetWidth))
  15576. + "px";
  15577. this.secondPass = true;
  15578. this.update.defer(10, this, [W])
  15579. }
  15580. }
  15581. },
  15582. beforeDestroy : function() {
  15583. this.mbtn.destroy();
  15584. this.todayBtn.destroy()
  15585. }
  15586. });
  15587. Ext.reg("datepicker", Ext.DatePicker);
  15588. Ext.TabPanel = Ext.extend(Ext.Panel, {
  15589. monitorResize : true,
  15590. deferredRender : true,
  15591. tabWidth : 120,
  15592. minTabWidth : 30,
  15593. resizeTabs : false,
  15594. enableTabScroll : false,
  15595. scrollIncrement : 0,
  15596. scrollRepeatInterval : 400,
  15597. scrollDuration : 0.35,
  15598. animScroll : true,
  15599. tabPosition : "top",
  15600. baseCls : "x-tab-panel",
  15601. autoTabs : false,
  15602. autoTabSelector : "div.x-tab",
  15603. activeTab : null,
  15604. tabMargin : 2,
  15605. plain : false,
  15606. wheelIncrement : 20,
  15607. idDelimiter : "__",
  15608. itemCls : "x-tab-item",
  15609. elements : "body",
  15610. headerAsText : false,
  15611. frame : false,
  15612. hideBorders : true,
  15613. initComponent : function() {
  15614. this.frame = false;
  15615. Ext.TabPanel.superclass.initComponent.call(this);
  15616. this.addEvents("beforetabchange", "tabchange", "contextmenu");
  15617. this.setLayout(new Ext.layout.CardLayout({
  15618. deferredRender : this.deferredRender
  15619. }));
  15620. if (this.tabPosition == "top") {
  15621. this.elements += ",header";
  15622. this.stripTarget = "header"
  15623. } else {
  15624. this.elements += ",footer";
  15625. this.stripTarget = "footer"
  15626. }
  15627. if (!this.stack) {
  15628. this.stack = Ext.TabPanel.AccessStack()
  15629. }
  15630. this.initItems()
  15631. },
  15632. render : function() {
  15633. Ext.TabPanel.superclass.render.apply(this, arguments);
  15634. if (this.activeTab !== undefined) {
  15635. var A = this.activeTab;
  15636. delete this.activeTab;
  15637. this.setActiveTab(A)
  15638. }
  15639. },
  15640. onRender : function(C, A) {
  15641. Ext.TabPanel.superclass.onRender.call(this, C, A);
  15642. if (this.plain) {
  15643. var E = this.tabPosition == "top" ? "header" : "footer";
  15644. this[E].addClass("x-tab-panel-" + E + "-plain")
  15645. }
  15646. var B = this[this.stripTarget];
  15647. this.stripWrap = B.createChild({
  15648. cls : "x-tab-strip-wrap",
  15649. cn : {
  15650. tag : "ul",
  15651. cls : "x-tab-strip x-tab-strip-" + this.tabPosition
  15652. }
  15653. });
  15654. this.stripSpacer = B.createChild({
  15655. cls : "x-tab-strip-spacer"
  15656. });
  15657. this.strip = new Ext.Element(this.stripWrap.dom.firstChild);
  15658. this.edge = this.strip.createChild({
  15659. tag : "li",
  15660. cls : "x-tab-edge"
  15661. });
  15662. this.strip.createChild({
  15663. cls : "x-clear"
  15664. });
  15665. this.body.addClass("x-tab-panel-body-" + this.tabPosition);
  15666. if (!this.itemTpl) {
  15667. var D = new Ext.Template(
  15668. "<li class=\"{cls}\" id=\"{id}\"><a class=\"x-tab-strip-close\" onclick=\"return false;\"></a>",
  15669. "<a class=\"x-tab-right\" href=\"#\" onclick=\"return false;\"><em class=\"x-tab-left\">",
  15670. "<span class=\"x-tab-strip-inner\"><span class=\"x-tab-strip-text {iconCls}\">{text}</span></span>",
  15671. "</em></a></li>");
  15672. D.disableFormats = true;
  15673. D.compile();
  15674. Ext.TabPanel.prototype.itemTpl = D
  15675. }
  15676. this.items.each(this.initTab, this)
  15677. },
  15678. afterRender : function() {
  15679. Ext.TabPanel.superclass.afterRender.call(this);
  15680. if (this.autoTabs) {
  15681. this.readTabs(false)
  15682. }
  15683. },
  15684. initEvents : function() {
  15685. Ext.TabPanel.superclass.initEvents.call(this);
  15686. this.on("add", this.onAdd, this);
  15687. this.on("remove", this.onRemove, this);
  15688. this.strip.on("mousedown", this.onStripMouseDown, this);
  15689. this.strip.on("click", this.onStripClick, this);
  15690. this.strip.on("contextmenu", this.onStripContextMenu, this);
  15691. if (this.enableTabScroll) {
  15692. this.strip.on("mousewheel", this.onWheel, this)
  15693. }
  15694. },
  15695. findTargets : function(C) {
  15696. var B = null;
  15697. var A = C.getTarget("li", this.strip);
  15698. if (A) {
  15699. B = this.getComponent(A.id.split(this.idDelimiter)[1]);
  15700. if (B.disabled) {
  15701. return {
  15702. close : null,
  15703. item : null,
  15704. el : null
  15705. }
  15706. }
  15707. }
  15708. return {
  15709. close : C.getTarget(".x-tab-strip-close", this.strip),
  15710. item : B,
  15711. el : A
  15712. }
  15713. },
  15714. onStripMouseDown : function(B) {
  15715. B.preventDefault();
  15716. if (B.button != 0) {
  15717. return
  15718. }
  15719. var A = this.findTargets(B);
  15720. if (A.close) {
  15721. this.remove(A.item);
  15722. return
  15723. }
  15724. if (A.item && A.item != this.activeTab) {
  15725. this.setActiveTab(A.item)
  15726. }
  15727. },
  15728. onStripClick : function(B) {
  15729. var A = this.findTargets(B);
  15730. if (!A.close && A.item && A.item != this.activeTab) {
  15731. this.setActiveTab(A.item)
  15732. }
  15733. },
  15734. onStripContextMenu : function(B) {
  15735. B.preventDefault();
  15736. var A = this.findTargets(B);
  15737. if (A.item) {
  15738. this.fireEvent("contextmenu", this, A.item, B)
  15739. }
  15740. },
  15741. readTabs : function(D) {
  15742. if (D === true) {
  15743. this.items.each(function(G) {
  15744. this.remove(G)
  15745. }, this)
  15746. }
  15747. var C = this.el.query(this.autoTabSelector);
  15748. for (var B = 0, A = C.length; B < A; B++) {
  15749. var E = C[B];
  15750. var F = E.getAttribute("title");
  15751. E.removeAttribute("title");
  15752. this.add({
  15753. title : F,
  15754. el : E
  15755. })
  15756. }
  15757. },
  15758. initTab : function(D, B) {
  15759. var E = this.strip.dom.childNodes[B];
  15760. var A = D.closable ? "x-tab-strip-closable" : "";
  15761. if (D.disabled) {
  15762. A += " x-item-disabled"
  15763. }
  15764. if (D.iconCls) {
  15765. A += " x-tab-with-icon"
  15766. }
  15767. if (D.tabCls) {
  15768. A += " " + D.tabCls
  15769. }
  15770. var F = {
  15771. id : this.id + this.idDelimiter + D.getItemId(),
  15772. text : D.title,
  15773. cls : A,
  15774. iconCls : D.iconCls || ""
  15775. };
  15776. var C = E ? this.itemTpl.insertBefore(E, F) : this.itemTpl.append(
  15777. this.strip, F);
  15778. Ext.fly(C).addClassOnOver("x-tab-strip-over");
  15779. if (D.tabTip) {
  15780. Ext.fly(C).child("span.x-tab-strip-text", true).qtip = D.tabTip
  15781. }
  15782. D.on("disable", this.onItemDisabled, this);
  15783. D.on("enable", this.onItemEnabled, this);
  15784. D.on("titlechange", this.onItemTitleChanged, this);
  15785. D.on("beforeshow", this.onBeforeShowItem, this)
  15786. },
  15787. onAdd : function(C, B, A) {
  15788. this.initTab(B, A);
  15789. if (this.items.getCount() == 1) {
  15790. this.syncSize()
  15791. }
  15792. this.delegateUpdates()
  15793. },
  15794. onBeforeAdd : function(B) {
  15795. var A = B.events
  15796. ? (this.items.containsKey(B.getItemId()) ? B : null)
  15797. : this.items.get(B);
  15798. if (A) {
  15799. this.setActiveTab(B);
  15800. return false
  15801. }
  15802. Ext.TabPanel.superclass.onBeforeAdd.apply(this, arguments);
  15803. var C = B.elements;
  15804. B.elements = C ? C.replace(",header", "") : C;
  15805. B.border = (B.border === true)
  15806. },
  15807. onRemove : function(C, B) {
  15808. Ext.removeNode(this.getTabEl(B));
  15809. this.stack.remove(B);
  15810. if (B == this.activeTab) {
  15811. var A = this.stack.next();
  15812. if (A) {
  15813. this.setActiveTab(A)
  15814. } else {
  15815. this.setActiveTab(0)
  15816. }
  15817. }
  15818. this.delegateUpdates()
  15819. },
  15820. onBeforeShowItem : function(A) {
  15821. if (A != this.activeTab) {
  15822. this.setActiveTab(A);
  15823. return false
  15824. }
  15825. },
  15826. onItemDisabled : function(B) {
  15827. var A = this.getTabEl(B);
  15828. if (A) {
  15829. Ext.fly(A).addClass("x-item-disabled")
  15830. }
  15831. this.stack.remove(B)
  15832. },
  15833. onItemEnabled : function(B) {
  15834. var A = this.getTabEl(B);
  15835. if (A) {
  15836. Ext.fly(A).removeClass("x-item-disabled")
  15837. }
  15838. },
  15839. onItemTitleChanged : function(B) {
  15840. var A = this.getTabEl(B);
  15841. if (A) {
  15842. Ext.fly(A).child("span.x-tab-strip-text", true).innerHTML = B.title
  15843. }
  15844. },
  15845. getTabEl : function(A) {
  15846. var B = (typeof A === "number") ? this.items.items[A].getItemId() : A
  15847. .getItemId();
  15848. return document.getElementById(this.id + this.idDelimiter + B)
  15849. },
  15850. onResize : function() {
  15851. Ext.TabPanel.superclass.onResize.apply(this, arguments);
  15852. this.delegateUpdates()
  15853. },
  15854. beginUpdate : function() {
  15855. this.suspendUpdates = true
  15856. },
  15857. endUpdate : function() {
  15858. this.suspendUpdates = false;
  15859. this.delegateUpdates()
  15860. },
  15861. hideTabStripItem : function(B) {
  15862. B = this.getComponent(B);
  15863. var A = this.getTabEl(B);
  15864. if (A) {
  15865. A.style.display = "none";
  15866. this.delegateUpdates()
  15867. }
  15868. },
  15869. unhideTabStripItem : function(B) {
  15870. B = this.getComponent(B);
  15871. var A = this.getTabEl(B);
  15872. if (A) {
  15873. A.style.display = "";
  15874. this.delegateUpdates()
  15875. }
  15876. },
  15877. delegateUpdates : function() {
  15878. if (this.suspendUpdates) {
  15879. return
  15880. }
  15881. if (this.resizeTabs && this.rendered) {
  15882. this.autoSizeTabs()
  15883. }
  15884. if (this.enableTabScroll && this.rendered) {
  15885. this.autoScrollTabs()
  15886. }
  15887. },
  15888. autoSizeTabs : function() {
  15889. var G = this.items.length;
  15890. var B = this.tabPosition != "bottom" ? "header" : "footer";
  15891. var C = this[B].dom.offsetWidth;
  15892. var A = this[B].dom.clientWidth;
  15893. if (!this.resizeTabs || G < 1 || !A) {
  15894. return
  15895. }
  15896. var I = Math.max(Math.min(Math.floor((A - 4) / G) - this.tabMargin,
  15897. this.tabWidth), this.minTabWidth);
  15898. this.lastTabWidth = I;
  15899. var K = this.stripWrap.dom.getElementsByTagName("li");
  15900. for (var E = 0, H = K.length - 1; E < H; E++) {
  15901. var J = K[E];
  15902. var L = J.childNodes[1].firstChild.firstChild;
  15903. var F = J.offsetWidth;
  15904. var D = L.offsetWidth;
  15905. L.style.width = (I - (F - D)) + "px"
  15906. }
  15907. },
  15908. adjustBodyWidth : function(A) {
  15909. if (this.header) {
  15910. this.header.setWidth(A)
  15911. }
  15912. if (this.footer) {
  15913. this.footer.setWidth(A)
  15914. }
  15915. return A
  15916. },
  15917. setActiveTab : function(C) {
  15918. C = this.getComponent(C);
  15919. if (!C
  15920. || this.fireEvent("beforetabchange", this, C, this.activeTab) === false) {
  15921. return
  15922. }
  15923. if (!this.rendered) {
  15924. this.activeTab = C;
  15925. return
  15926. }
  15927. if (this.activeTab != C) {
  15928. if (this.activeTab) {
  15929. var A = this.getTabEl(this.activeTab);
  15930. if (A) {
  15931. Ext.fly(A).removeClass("x-tab-strip-active")
  15932. }
  15933. this.activeTab.fireEvent("deactivate", this.activeTab)
  15934. }
  15935. var B = this.getTabEl(C);
  15936. Ext.fly(B).addClass("x-tab-strip-active");
  15937. this.activeTab = C;
  15938. this.stack.add(C);
  15939. this.layout.setActiveItem(C);
  15940. if (this.layoutOnTabChange && C.doLayout) {
  15941. C.doLayout()
  15942. }
  15943. if (this.scrolling) {
  15944. this.scrollToTab(C, this.animScroll)
  15945. }
  15946. C.fireEvent("activate", C);
  15947. this.fireEvent("tabchange", this, C)
  15948. }
  15949. },
  15950. getActiveTab : function() {
  15951. return this.activeTab || null
  15952. },
  15953. getItem : function(A) {
  15954. return this.getComponent(A)
  15955. },
  15956. autoScrollTabs : function() {
  15957. var G = this.items.length;
  15958. var D = this.header.dom.offsetWidth;
  15959. var C = this.header.dom.clientWidth;
  15960. var F = this.stripWrap;
  15961. var E = F.dom;
  15962. var B = E.offsetWidth;
  15963. var H = this.getScrollPos();
  15964. var A = this.edge.getOffsetsTo(this.stripWrap)[0] + H;
  15965. if (!this.enableTabScroll || G < 1 || B < 20) {
  15966. return
  15967. }
  15968. if (A <= C) {
  15969. E.scrollLeft = 0;
  15970. F.setWidth(C);
  15971. if (this.scrolling) {
  15972. this.scrolling = false;
  15973. this.header.removeClass("x-tab-scrolling");
  15974. this.scrollLeft.hide();
  15975. this.scrollRight.hide();
  15976. if (Ext.isAir) {
  15977. E.style.marginLeft = "";
  15978. E.style.marginRight = ""
  15979. }
  15980. }
  15981. } else {
  15982. if (!this.scrolling) {
  15983. this.header.addClass("x-tab-scrolling");
  15984. if (Ext.isAir) {
  15985. E.style.marginLeft = "18px";
  15986. E.style.marginRight = "18px"
  15987. }
  15988. }
  15989. C -= F.getMargins("lr");
  15990. F.setWidth(C > 20 ? C : 20);
  15991. if (!this.scrolling) {
  15992. if (!this.scrollLeft) {
  15993. this.createScrollers()
  15994. } else {
  15995. this.scrollLeft.show();
  15996. this.scrollRight.show()
  15997. }
  15998. }
  15999. this.scrolling = true;
  16000. if (H > (A - C)) {
  16001. E.scrollLeft = A - C
  16002. } else {
  16003. this.scrollToTab(this.activeTab, false)
  16004. }
  16005. this.updateScrollButtons()
  16006. }
  16007. },
  16008. createScrollers : function() {
  16009. var C = this.stripWrap.dom.offsetHeight;
  16010. var A = this.header.insertFirst({
  16011. cls : "x-tab-scroller-left"
  16012. });
  16013. A.setHeight(C);
  16014. A.addClassOnOver("x-tab-scroller-left-over");
  16015. this.leftRepeater = new Ext.util.ClickRepeater(A, {
  16016. interval : this.scrollRepeatInterval,
  16017. handler : this.onScrollLeft,
  16018. scope : this
  16019. });
  16020. this.scrollLeft = A;
  16021. var B = this.header.insertFirst({
  16022. cls : "x-tab-scroller-right"
  16023. });
  16024. B.setHeight(C);
  16025. B.addClassOnOver("x-tab-scroller-right-over");
  16026. this.rightRepeater = new Ext.util.ClickRepeater(B, {
  16027. interval : this.scrollRepeatInterval,
  16028. handler : this.onScrollRight,
  16029. scope : this
  16030. });
  16031. this.scrollRight = B
  16032. },
  16033. getScrollWidth : function() {
  16034. return this.edge.getOffsetsTo(this.stripWrap)[0] + this.getScrollPos()
  16035. },
  16036. getScrollPos : function() {
  16037. return parseInt(this.stripWrap.dom.scrollLeft, 10) || 0
  16038. },
  16039. getScrollArea : function() {
  16040. return parseInt(this.stripWrap.dom.clientWidth, 10) || 0
  16041. },
  16042. getScrollAnim : function() {
  16043. return {
  16044. duration : this.scrollDuration,
  16045. callback : this.updateScrollButtons,
  16046. scope : this
  16047. }
  16048. },
  16049. getScrollIncrement : function() {
  16050. return this.scrollIncrement
  16051. || (this.resizeTabs ? this.lastTabWidth + 2 : 100)
  16052. },
  16053. scrollToTab : function(E, A) {
  16054. if (!E) {
  16055. return
  16056. }
  16057. var C = this.getTabEl(E);
  16058. var G = this.getScrollPos(), D = this.getScrollArea();
  16059. var F = Ext.fly(C).getOffsetsTo(this.stripWrap)[0] + G;
  16060. var B = F + C.offsetWidth;
  16061. if (F < G) {
  16062. this.scrollTo(F, A)
  16063. } else {
  16064. if (B > (G + D)) {
  16065. this.scrollTo(B - D, A)
  16066. }
  16067. }
  16068. },
  16069. scrollTo : function(B, A) {
  16070. this.stripWrap.scrollTo("left", B, A ? this.getScrollAnim() : false);
  16071. if (!A) {
  16072. this.updateScrollButtons()
  16073. }
  16074. },
  16075. onWheel : function(D) {
  16076. var E = D.getWheelDelta() * this.wheelIncrement * -1;
  16077. D.stopEvent();
  16078. var F = this.getScrollPos();
  16079. var C = F + E;
  16080. var A = this.getScrollWidth() - this.getScrollArea();
  16081. var B = Math.max(0, Math.min(A, C));
  16082. if (B != F) {
  16083. this.scrollTo(B, false)
  16084. }
  16085. },
  16086. onScrollRight : function() {
  16087. var A = this.getScrollWidth() - this.getScrollArea();
  16088. var C = this.getScrollPos();
  16089. var B = Math.min(A, C + this.getScrollIncrement());
  16090. if (B != C) {
  16091. this.scrollTo(B, this.animScroll)
  16092. }
  16093. },
  16094. onScrollLeft : function() {
  16095. var B = this.getScrollPos();
  16096. var A = Math.max(0, B - this.getScrollIncrement());
  16097. if (A != B) {
  16098. this.scrollTo(A, this.animScroll)
  16099. }
  16100. },
  16101. updateScrollButtons : function() {
  16102. var A = this.getScrollPos();
  16103. this.scrollLeft[A == 0 ? "addClass" : "removeClass"]("x-tab-scroller-left-disabled");
  16104. this.scrollRight[A >= (this.getScrollWidth() - this.getScrollArea())
  16105. ? "addClass"
  16106. : "removeClass"]("x-tab-scroller-right-disabled")
  16107. }
  16108. });
  16109. Ext.reg("tabpanel", Ext.TabPanel);
  16110. Ext.TabPanel.prototype.activate = Ext.TabPanel.prototype.setActiveTab;
  16111. Ext.TabPanel.AccessStack = function() {
  16112. var A = [];
  16113. return {
  16114. add : function(B) {
  16115. A.push(B);
  16116. if (A.length > 10) {
  16117. A.shift()
  16118. }
  16119. },
  16120. remove : function(E) {
  16121. var D = [];
  16122. for (var C = 0, B = A.length; C < B; C++) {
  16123. if (A[C] != E) {
  16124. D.push(A[C])
  16125. }
  16126. }
  16127. A = D
  16128. },
  16129. next : function() {
  16130. return A.pop()
  16131. }
  16132. }
  16133. };
  16134. Ext.Button = Ext.extend(Ext.Component, {
  16135. hidden : false,
  16136. disabled : false,
  16137. pressed : false,
  16138. enableToggle : false,
  16139. menuAlign : "tl-bl?",
  16140. type : "button",
  16141. menuClassTarget : "tr",
  16142. clickEvent : "click",
  16143. handleMouseEvents : true,
  16144. tooltipType : "qtip",
  16145. buttonSelector : "button:first",
  16146. initComponent : function() {
  16147. Ext.Button.superclass.initComponent.call(this);
  16148. this.addEvents("click", "toggle", "mouseover", "mouseout", "menushow",
  16149. "menuhide", "menutriggerover", "menutriggerout");
  16150. if (this.menu) {
  16151. this.menu = Ext.menu.MenuMgr.get(this.menu)
  16152. }
  16153. if (typeof this.toggleGroup === "string") {
  16154. this.enableToggle = true
  16155. }
  16156. },
  16157. onRender : function(C, A) {
  16158. if (!this.template) {
  16159. if (!Ext.Button.buttonTemplate) {
  16160. Ext.Button.buttonTemplate = new Ext.Template(
  16161. "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"x-btn-wrap\"><tbody><tr>",
  16162. "<td class=\"x-btn-left\"><i>&#160;</i></td><td class=\"x-btn-center\"><em unselectable=\"on\"><button class=\"x-btn-text\" type=\"{1}\">{0}</button></em></td><td class=\"x-btn-right\"><i>&#160;</i></td>",
  16163. "</tr></tbody></table>")
  16164. }
  16165. this.template = Ext.Button.buttonTemplate
  16166. }
  16167. var B, E = [this.text || "&#160;", this.type];
  16168. if (A) {
  16169. B = this.template.insertBefore(A, E, true)
  16170. } else {
  16171. B = this.template.append(C, E, true)
  16172. }
  16173. var D = B.child(this.buttonSelector);
  16174. D.on("focus", this.onFocus, this);
  16175. D.on("blur", this.onBlur, this);
  16176. this.initButtonEl(B, D);
  16177. if (this.menu) {
  16178. this.el.child(this.menuClassTarget).addClass("x-btn-with-menu")
  16179. }
  16180. Ext.ButtonToggleMgr.register(this)
  16181. },
  16182. initButtonEl : function(B, C) {
  16183. this.el = B;
  16184. B.addClass("x-btn");
  16185. if (this.icon) {
  16186. C.setStyle("background-image", "url(" + this.icon + ")")
  16187. }
  16188. if (this.iconCls) {
  16189. C.addClass(this.iconCls);
  16190. if (!this.cls) {
  16191. B.addClass(this.text ? "x-btn-text-icon" : "x-btn-icon")
  16192. }
  16193. }
  16194. if (this.tabIndex !== undefined) {
  16195. C.dom.tabIndex = this.tabIndex
  16196. }
  16197. if (this.tooltip) {
  16198. if (typeof this.tooltip == "object") {
  16199. Ext.QuickTips.register(Ext.apply({
  16200. target : C.id
  16201. }, this.tooltip))
  16202. } else {
  16203. C.dom[this.tooltipType] = this.tooltip
  16204. }
  16205. }
  16206. if (this.pressed) {
  16207. this.el.addClass("x-btn-pressed")
  16208. }
  16209. if (this.handleMouseEvents) {
  16210. B.on("mouseover", this.onMouseOver, this);
  16211. B.on("mousedown", this.onMouseDown, this)
  16212. }
  16213. if (this.menu) {
  16214. this.menu.on("show", this.onMenuShow, this);
  16215. this.menu.on("hide", this.onMenuHide, this)
  16216. }
  16217. if (this.id) {
  16218. this.el.dom.id = this.el.id = this.id
  16219. }
  16220. if (this.repeat) {
  16221. var A = new Ext.util.ClickRepeater(B,
  16222. typeof this.repeat == "object" ? this.repeat : {});
  16223. A.on("click", this.onClick, this)
  16224. }
  16225. B.on(this.clickEvent, this.onClick, this)
  16226. },
  16227. afterRender : function() {
  16228. Ext.Button.superclass.afterRender.call(this);
  16229. if (Ext.isIE6) {
  16230. this.autoWidth.defer(1, this)
  16231. } else {
  16232. this.autoWidth()
  16233. }
  16234. },
  16235. setIconClass : function(A) {
  16236. if (this.el) {
  16237. this.el.child(this.buttonSelector).replaceClass(this.iconCls, A)
  16238. }
  16239. this.iconCls = A
  16240. },
  16241. beforeDestroy : function() {
  16242. if (this.rendered) {
  16243. var A = this.el.child(this.buttonSelector);
  16244. if (A) {
  16245. A.removeAllListeners()
  16246. }
  16247. }
  16248. if (this.menu) {
  16249. Ext.destroy(this.menu)
  16250. }
  16251. },
  16252. onDestroy : function() {
  16253. if (this.rendered) {
  16254. Ext.ButtonToggleMgr.unregister(this)
  16255. }
  16256. },
  16257. autoWidth : function() {
  16258. if (this.el) {
  16259. this.el.setWidth("auto");
  16260. if (Ext.isIE7 && Ext.isStrict) {
  16261. var A = this.el.child(this.buttonSelector);
  16262. if (A && A.getWidth() > 20) {
  16263. A.clip();
  16264. A.setWidth(Ext.util.TextMetrics.measure(A, this.text).width
  16265. + A.getFrameWidth("lr"))
  16266. }
  16267. }
  16268. if (this.minWidth) {
  16269. if (this.el.getWidth() < this.minWidth) {
  16270. this.el.setWidth(this.minWidth)
  16271. }
  16272. }
  16273. }
  16274. },
  16275. setHandler : function(B, A) {
  16276. this.handler = B;
  16277. this.scope = A
  16278. },
  16279. setText : function(A) {
  16280. this.text = A;
  16281. if (this.el) {
  16282. this.el.child("td.x-btn-center " + this.buttonSelector).update(A)
  16283. }
  16284. this.autoWidth()
  16285. },
  16286. getText : function() {
  16287. return this.text
  16288. },
  16289. toggle : function(A) {
  16290. A = A === undefined ? !this.pressed : A;
  16291. if (A != this.pressed) {
  16292. if (A) {
  16293. this.el.addClass("x-btn-pressed");
  16294. this.pressed = true;
  16295. this.fireEvent("toggle", this, true)
  16296. } else {
  16297. this.el.removeClass("x-btn-pressed");
  16298. this.pressed = false;
  16299. this.fireEvent("toggle", this, false)
  16300. }
  16301. if (this.toggleHandler) {
  16302. this.toggleHandler.call(this.scope || this, this, A)
  16303. }
  16304. }
  16305. },
  16306. focus : function() {
  16307. this.el.child(this.buttonSelector).focus()
  16308. },
  16309. onDisable : function() {
  16310. if (this.el) {
  16311. if (!Ext.isIE6 || !this.text) {
  16312. this.el.addClass(this.disabledClass)
  16313. }
  16314. this.el.dom.disabled = true
  16315. }
  16316. this.disabled = true
  16317. },
  16318. onEnable : function() {
  16319. if (this.el) {
  16320. if (!Ext.isIE6 || !this.text) {
  16321. this.el.removeClass(this.disabledClass)
  16322. }
  16323. this.el.dom.disabled = false
  16324. }
  16325. this.disabled = false
  16326. },
  16327. showMenu : function() {
  16328. if (this.menu) {
  16329. this.menu.show(this.el, this.menuAlign)
  16330. }
  16331. return this
  16332. },
  16333. hideMenu : function() {
  16334. if (this.menu) {
  16335. this.menu.hide()
  16336. }
  16337. return this
  16338. },
  16339. hasVisibleMenu : function() {
  16340. return this.menu && this.menu.isVisible()
  16341. },
  16342. onClick : function(A) {
  16343. if (A) {
  16344. A.preventDefault()
  16345. }
  16346. if (A.button != 0) {
  16347. return
  16348. }
  16349. if (!this.disabled) {
  16350. if (this.enableToggle
  16351. && (this.allowDepress !== false || !this.pressed)) {
  16352. this.toggle()
  16353. }
  16354. if (this.menu && !this.menu.isVisible() && !this.ignoreNextClick) {
  16355. this.showMenu()
  16356. }
  16357. this.fireEvent("click", this, A);
  16358. if (this.handler) {
  16359. this.handler.call(this.scope || this, this, A)
  16360. }
  16361. }
  16362. },
  16363. isMenuTriggerOver : function(B, A) {
  16364. return this.menu && !A
  16365. },
  16366. isMenuTriggerOut : function(B, A) {
  16367. return this.menu && !A
  16368. },
  16369. onMouseOver : function(B) {
  16370. if (!this.disabled) {
  16371. var A = B.within(this.el, true);
  16372. if (!A) {
  16373. this.el.addClass("x-btn-over");
  16374. Ext.getDoc().on("mouseover", this.monitorMouseOver, this);
  16375. this.fireEvent("mouseover", this, B)
  16376. }
  16377. if (this.isMenuTriggerOver(B, A)) {
  16378. this.fireEvent("menutriggerover", this, this.menu, B)
  16379. }
  16380. }
  16381. },
  16382. monitorMouseOver : function(A) {
  16383. if (A.target != this.el.dom && !A.within(this.el)) {
  16384. Ext.getDoc().un("mouseover", this.monitorMouseOver, this);
  16385. this.onMouseOut(A)
  16386. }
  16387. },
  16388. onMouseOut : function(B) {
  16389. var A = B.within(this.el) && B.target != this.el.dom;
  16390. this.el.removeClass("x-btn-over");
  16391. this.fireEvent("mouseout", this, B);
  16392. if (this.isMenuTriggerOut(B, A)) {
  16393. this.fireEvent("menutriggerout", this, this.menu, B)
  16394. }
  16395. },
  16396. onFocus : function(A) {
  16397. if (!this.disabled) {
  16398. this.el.addClass("x-btn-focus")
  16399. }
  16400. },
  16401. onBlur : function(A) {
  16402. this.el.removeClass("x-btn-focus")
  16403. },
  16404. getClickEl : function(B, A) {
  16405. return this.el
  16406. },
  16407. onMouseDown : function(A) {
  16408. if (!this.disabled && A.button == 0) {
  16409. this.getClickEl(A).addClass("x-btn-click");
  16410. Ext.getDoc().on("mouseup", this.onMouseUp, this)
  16411. }
  16412. },
  16413. onMouseUp : function(A) {
  16414. if (A.button == 0) {
  16415. this.getClickEl(A, true).removeClass("x-btn-click");
  16416. Ext.getDoc().un("mouseup", this.onMouseUp, this)
  16417. }
  16418. },
  16419. onMenuShow : function(A) {
  16420. this.ignoreNextClick = 0;
  16421. this.el.addClass("x-btn-menu-active");
  16422. this.fireEvent("menushow", this, this.menu)
  16423. },
  16424. onMenuHide : function(A) {
  16425. this.el.removeClass("x-btn-menu-active");
  16426. this.ignoreNextClick = this.restoreClick.defer(250, this);
  16427. this.fireEvent("menuhide", this, this.menu)
  16428. },
  16429. restoreClick : function() {
  16430. this.ignoreNextClick = 0
  16431. }
  16432. });
  16433. Ext.reg("button", Ext.Button);
  16434. Ext.ButtonToggleMgr = function() {
  16435. var A = {};
  16436. function B(E, G) {
  16437. if (G) {
  16438. var F = A[E.toggleGroup];
  16439. for (var D = 0, C = F.length; D < C; D++) {
  16440. if (F[D] != E) {
  16441. F[D].toggle(false)
  16442. }
  16443. }
  16444. }
  16445. }
  16446. return {
  16447. register : function(C) {
  16448. if (!C.toggleGroup) {
  16449. return
  16450. }
  16451. var D = A[C.toggleGroup];
  16452. if (!D) {
  16453. D = A[C.toggleGroup] = []
  16454. }
  16455. D.push(C);
  16456. C.on("toggle", B)
  16457. },
  16458. unregister : function(C) {
  16459. if (!C.toggleGroup) {
  16460. return
  16461. }
  16462. var D = A[C.toggleGroup];
  16463. if (D) {
  16464. D.remove(C);
  16465. C.un("toggle", B)
  16466. }
  16467. }
  16468. }
  16469. }();
  16470. Ext.SplitButton = Ext.extend(Ext.Button, {
  16471. arrowSelector : "button:last",
  16472. initComponent : function() {
  16473. Ext.SplitButton.superclass.initComponent.call(this);
  16474. this.addEvents("arrowclick")
  16475. },
  16476. onRender : function(D, A) {
  16477. var B = new Ext.Template(
  16478. "<table cellspacing=\"0\" class=\"x-btn-menu-wrap x-btn\"><tr><td>",
  16479. "<table cellspacing=\"0\" class=\"x-btn-wrap x-btn-menu-text-wrap\"><tbody>",
  16480. "<tr><td class=\"x-btn-left\"><i>&#160;</i></td><td class=\"x-btn-center\"><button class=\"x-btn-text\" type=\"{1}\">{0}</button></td></tr>",
  16481. "</tbody></table></td><td>",
  16482. "<table cellspacing=\"0\" class=\"x-btn-wrap x-btn-menu-arrow-wrap\"><tbody>",
  16483. "<tr><td class=\"x-btn-center\"><button class=\"x-btn-menu-arrow-el\" type=\"button\">&#160;</button></td><td class=\"x-btn-right\"><i>&#160;</i></td></tr>",
  16484. "</tbody></table></td></tr></table>");
  16485. var C, F = [this.text || "&#160;", this.type];
  16486. if (A) {
  16487. C = B.insertBefore(A, F, true)
  16488. } else {
  16489. C = B.append(D, F, true)
  16490. }
  16491. var E = C.child(this.buttonSelector);
  16492. this.initButtonEl(C, E);
  16493. this.arrowBtnTable = C.child("table:last");
  16494. if (this.arrowTooltip) {
  16495. C.child(this.arrowSelector).dom[this.tooltipType] = this.arrowTooltip
  16496. }
  16497. },
  16498. autoWidth : function() {
  16499. if (this.el) {
  16500. var C = this.el.child("table:first");
  16501. var B = this.el.child("table:last");
  16502. this.el.setWidth("auto");
  16503. C.setWidth("auto");
  16504. if (Ext.isIE7 && Ext.isStrict) {
  16505. var A = this.el.child(this.buttonSelector);
  16506. if (A && A.getWidth() > 20) {
  16507. A.clip();
  16508. A.setWidth(Ext.util.TextMetrics.measure(A, this.text).width
  16509. + A.getFrameWidth("lr"))
  16510. }
  16511. }
  16512. if (this.minWidth) {
  16513. if ((C.getWidth() + B.getWidth()) < this.minWidth) {
  16514. C.setWidth(this.minWidth - B.getWidth())
  16515. }
  16516. }
  16517. this.el.setWidth(C.getWidth() + B.getWidth())
  16518. }
  16519. },
  16520. setArrowHandler : function(B, A) {
  16521. this.arrowHandler = B;
  16522. this.scope = A
  16523. },
  16524. onClick : function(A) {
  16525. A.preventDefault();
  16526. if (!this.disabled) {
  16527. if (A.getTarget(".x-btn-menu-arrow-wrap")) {
  16528. if (this.menu && !this.menu.isVisible()
  16529. && !this.ignoreNextClick) {
  16530. this.showMenu()
  16531. }
  16532. this.fireEvent("arrowclick", this, A);
  16533. if (this.arrowHandler) {
  16534. this.arrowHandler.call(this.scope || this, this, A)
  16535. }
  16536. } else {
  16537. if (this.enableToggle) {
  16538. this.toggle()
  16539. }
  16540. this.fireEvent("click", this, A);
  16541. if (this.handler) {
  16542. this.handler.call(this.scope || this, this, A)
  16543. }
  16544. }
  16545. }
  16546. },
  16547. getClickEl : function(B, A) {
  16548. if (!A) {
  16549. return (this.lastClickEl = B.getTarget("table", 10, true))
  16550. }
  16551. return this.lastClickEl
  16552. },
  16553. onDisable : function() {
  16554. if (this.el) {
  16555. if (!Ext.isIE6) {
  16556. this.el.addClass("x-item-disabled")
  16557. }
  16558. this.el.child(this.buttonSelector).dom.disabled = true;
  16559. this.el.child(this.arrowSelector).dom.disabled = true
  16560. }
  16561. this.disabled = true
  16562. },
  16563. onEnable : function() {
  16564. if (this.el) {
  16565. if (!Ext.isIE6) {
  16566. this.el.removeClass("x-item-disabled")
  16567. }
  16568. this.el.child(this.buttonSelector).dom.disabled = false;
  16569. this.el.child(this.arrowSelector).dom.disabled = false
  16570. }
  16571. this.disabled = false
  16572. },
  16573. isMenuTriggerOver : function(A) {
  16574. return this.menu && A.within(this.arrowBtnTable)
  16575. && !A.within(this.arrowBtnTable, true)
  16576. },
  16577. isMenuTriggerOut : function(B, A) {
  16578. return this.menu && !B.within(this.arrowBtnTable)
  16579. },
  16580. onDestroy : function() {
  16581. Ext.destroy(this.arrowBtnTable);
  16582. Ext.SplitButton.superclass.onDestroy.call(this)
  16583. }
  16584. });
  16585. Ext.MenuButton = Ext.SplitButton;
  16586. Ext.reg("splitbutton", Ext.SplitButton);
  16587. Ext.CycleButton = Ext.extend(Ext.SplitButton, {
  16588. getItemText : function(A) {
  16589. if (A && this.showText === true) {
  16590. var B = "";
  16591. if (this.prependText) {
  16592. B += this.prependText
  16593. }
  16594. B += A.text;
  16595. return B
  16596. }
  16597. return undefined
  16598. },
  16599. setActiveItem : function(C, A) {
  16600. if (typeof C != "object") {
  16601. C = this.menu.items.get(C)
  16602. }
  16603. if (C) {
  16604. if (!this.rendered) {
  16605. this.text = this.getItemText(C);
  16606. this.iconCls = C.iconCls
  16607. } else {
  16608. var B = this.getItemText(C);
  16609. if (B) {
  16610. this.setText(B)
  16611. }
  16612. this.setIconClass(C.iconCls)
  16613. }
  16614. this.activeItem = C;
  16615. if (!C.checked) {
  16616. C.setChecked(true, true)
  16617. }
  16618. if (this.forceIcon) {
  16619. this.setIconClass(this.forceIcon)
  16620. }
  16621. if (!A) {
  16622. this.fireEvent("change", this, C)
  16623. }
  16624. }
  16625. },
  16626. getActiveItem : function() {
  16627. return this.activeItem
  16628. },
  16629. initComponent : function() {
  16630. this.addEvents("change");
  16631. if (this.changeHandler) {
  16632. this.on("change", this.changeHandler, this.scope || this);
  16633. delete this.changeHandler
  16634. }
  16635. this.itemCount = this.items.length;
  16636. this.menu = {
  16637. cls : "x-cycle-menu",
  16638. items : []
  16639. };
  16640. var D;
  16641. for (var B = 0, A = this.itemCount; B < A; B++) {
  16642. var C = this.items[B];
  16643. C.group = C.group || this.id;
  16644. C.itemIndex = B;
  16645. C.checkHandler = this.checkHandler;
  16646. C.scope = this;
  16647. C.checked = C.checked || false;
  16648. this.menu.items.push(C);
  16649. if (C.checked) {
  16650. D = C
  16651. }
  16652. }
  16653. this.setActiveItem(D, true);
  16654. Ext.CycleButton.superclass.initComponent.call(this);
  16655. this.on("click", this.toggleSelected, this)
  16656. },
  16657. checkHandler : function(A, B) {
  16658. if (B) {
  16659. this.setActiveItem(A)
  16660. }
  16661. },
  16662. toggleSelected : function() {
  16663. this.menu.render();
  16664. var C, A;
  16665. for (var B = 1; B < this.itemCount; B++) {
  16666. C = (this.activeItem.itemIndex + B) % this.itemCount;
  16667. A = this.menu.items.itemAt(C);
  16668. if (!A.disabled) {
  16669. A.setChecked(true);
  16670. break
  16671. }
  16672. }
  16673. }
  16674. });
  16675. Ext.reg("cycle", Ext.CycleButton);
  16676. Ext.Toolbar = function(A) {
  16677. if (Ext.isArray(A)) {
  16678. A = {
  16679. buttons : A
  16680. }
  16681. }
  16682. Ext.Toolbar.superclass.constructor.call(this, A)
  16683. };
  16684. (function() {
  16685. var A = Ext.Toolbar;
  16686. Ext.extend(A, Ext.BoxComponent, {
  16687. trackMenus : true,
  16688. initComponent : function() {
  16689. A.superclass.initComponent.call(this);
  16690. if (this.items) {
  16691. this.buttons = this.items
  16692. }
  16693. this.items = new Ext.util.MixedCollection(false,
  16694. function(B) {
  16695. return B.itemId || B.id || Ext.id()
  16696. })
  16697. },
  16698. autoCreate : {
  16699. cls : "x-toolbar x-small-editor",
  16700. html : "<table cellspacing=\"0\"><tr></tr></table>"
  16701. },
  16702. onRender : function(C, B) {
  16703. this.el = C.createChild(Ext.apply({
  16704. id : this.id
  16705. }, this.autoCreate), B);
  16706. this.tr = this.el.child("tr", true)
  16707. },
  16708. afterRender : function() {
  16709. A.superclass.afterRender.call(this);
  16710. if (this.buttons) {
  16711. this.add.apply(this, this.buttons);
  16712. delete this.buttons
  16713. }
  16714. },
  16715. add : function() {
  16716. var C = arguments, B = C.length;
  16717. for (var D = 0; D < B; D++) {
  16718. var E = C[D];
  16719. if (E.isFormField) {
  16720. this.addField(E)
  16721. } else {
  16722. if (E.render) {
  16723. this.addItem(E)
  16724. } else {
  16725. if (typeof E == "string") {
  16726. if (E == "separator" || E == "-") {
  16727. this.addSeparator()
  16728. } else {
  16729. if (E == " ") {
  16730. this.addSpacer()
  16731. } else {
  16732. if (E == "->") {
  16733. this.addFill()
  16734. } else {
  16735. this.addText(E)
  16736. }
  16737. }
  16738. }
  16739. } else {
  16740. if (E.tagName) {
  16741. this.addElement(E)
  16742. } else {
  16743. if (typeof E == "object") {
  16744. if (E.xtype) {
  16745. this.addField(Ext.ComponentMgr
  16746. .create(E, "button"))
  16747. } else {
  16748. this.addButton(E)
  16749. }
  16750. }
  16751. }
  16752. }
  16753. }
  16754. }
  16755. }
  16756. },
  16757. addSeparator : function() {
  16758. return this.addItem(new A.Separator())
  16759. },
  16760. addSpacer : function() {
  16761. return this.addItem(new A.Spacer())
  16762. },
  16763. addFill : function() {
  16764. return this.addItem(new A.Fill())
  16765. },
  16766. addElement : function(B) {
  16767. return this.addItem(new A.Item(B))
  16768. },
  16769. addItem : function(B) {
  16770. var C = this.nextBlock();
  16771. this.initMenuTracking(B);
  16772. B.render(C);
  16773. this.items.add(B);
  16774. return B
  16775. },
  16776. addButton : function(D) {
  16777. if (Ext.isArray(D)) {
  16778. var F = [];
  16779. for (var E = 0, C = D.length; E < C; E++) {
  16780. F.push(this.addButton(D[E]))
  16781. }
  16782. return F
  16783. }
  16784. var B = D;
  16785. if (!(D instanceof A.Button)) {
  16786. B = D.split ? new A.SplitButton(D) : new A.Button(D)
  16787. }
  16788. var G = this.nextBlock();
  16789. this.initMenuTracking(B);
  16790. B.render(G);
  16791. this.items.add(B);
  16792. return B
  16793. },
  16794. initMenuTracking : function(B) {
  16795. if (this.trackMenus && B.menu) {
  16796. B.on({
  16797. "menutriggerover" : this.onButtonTriggerOver,
  16798. "menushow" : this.onButtonMenuShow,
  16799. "menuhide" : this.onButtonMenuHide,
  16800. scope : this
  16801. })
  16802. }
  16803. },
  16804. addText : function(B) {
  16805. return this.addItem(new A.TextItem(B))
  16806. },
  16807. insertButton : function(C, F) {
  16808. if (Ext.isArray(F)) {
  16809. var E = [];
  16810. for (var D = 0, B = F.length; D < B; D++) {
  16811. E.push(this.insertButton(C + D, F[D]))
  16812. }
  16813. return E
  16814. }
  16815. if (!(F instanceof A.Button)) {
  16816. F = new A.Button(F)
  16817. }
  16818. var G = document.createElement("td");
  16819. this.tr.insertBefore(G, this.tr.childNodes[C]);
  16820. this.initMenuTracking(F);
  16821. F.render(G);
  16822. this.items.insert(C, F);
  16823. return F
  16824. },
  16825. addDom : function(C, B) {
  16826. var E = this.nextBlock();
  16827. Ext.DomHelper.overwrite(E, C);
  16828. var D = new A.Item(E.firstChild);
  16829. D.render(E);
  16830. this.items.add(D);
  16831. return D
  16832. },
  16833. addField : function(C) {
  16834. var D = this.nextBlock();
  16835. C.render(D);
  16836. var B = new A.Item(D.firstChild);
  16837. B.render(D);
  16838. this.items.add(B);
  16839. return B
  16840. },
  16841. nextBlock : function() {
  16842. var B = document.createElement("td");
  16843. this.tr.appendChild(B);
  16844. return B
  16845. },
  16846. onDestroy : function() {
  16847. Ext.Toolbar.superclass.onDestroy.call(this);
  16848. if (this.rendered) {
  16849. if (this.items) {
  16850. Ext.destroy.apply(Ext, this.items.items)
  16851. }
  16852. Ext.Element.uncache(this.tr)
  16853. }
  16854. },
  16855. onDisable : function() {
  16856. this.items.each(function(B) {
  16857. if (B.disable) {
  16858. B.disable()
  16859. }
  16860. })
  16861. },
  16862. onEnable : function() {
  16863. this.items.each(function(B) {
  16864. if (B.enable) {
  16865. B.enable()
  16866. }
  16867. })
  16868. },
  16869. onButtonTriggerOver : function(B) {
  16870. if (this.activeMenuBtn && this.activeMenuBtn != B) {
  16871. this.activeMenuBtn.hideMenu();
  16872. B.showMenu();
  16873. this.activeMenuBtn = B
  16874. }
  16875. },
  16876. onButtonMenuShow : function(B) {
  16877. this.activeMenuBtn = B
  16878. },
  16879. onButtonMenuHide : function(B) {
  16880. delete this.activeMenuBtn
  16881. }
  16882. });
  16883. Ext.reg("toolbar", Ext.Toolbar);
  16884. A.Item = function(B) {
  16885. this.el = Ext.getDom(B);
  16886. this.id = Ext.id(this.el);
  16887. this.hidden = false
  16888. };
  16889. A.Item.prototype = {
  16890. getEl : function() {
  16891. return this.el
  16892. },
  16893. render : function(B) {
  16894. this.td = B;
  16895. B.appendChild(this.el)
  16896. },
  16897. destroy : function() {
  16898. if (this.td && this.td.parentNode) {
  16899. this.td.parentNode.removeChild(this.td)
  16900. }
  16901. },
  16902. show : function() {
  16903. this.hidden = false;
  16904. this.td.style.display = ""
  16905. },
  16906. hide : function() {
  16907. this.hidden = true;
  16908. this.td.style.display = "none"
  16909. },
  16910. setVisible : function(B) {
  16911. if (B) {
  16912. this.show()
  16913. } else {
  16914. this.hide()
  16915. }
  16916. },
  16917. focus : function() {
  16918. Ext.fly(this.el).focus()
  16919. },
  16920. disable : function() {
  16921. Ext.fly(this.td).addClass("x-item-disabled");
  16922. this.disabled = true;
  16923. this.el.disabled = true
  16924. },
  16925. enable : function() {
  16926. Ext.fly(this.td).removeClass("x-item-disabled");
  16927. this.disabled = false;
  16928. this.el.disabled = false
  16929. }
  16930. };
  16931. Ext.reg("tbitem", A.Item);
  16932. A.Separator = function() {
  16933. var B = document.createElement("span");
  16934. B.className = "ytb-sep";
  16935. A.Separator.superclass.constructor.call(this, B)
  16936. };
  16937. Ext.extend(A.Separator, A.Item, {
  16938. enable : Ext.emptyFn,
  16939. disable : Ext.emptyFn,
  16940. focus : Ext.emptyFn
  16941. });
  16942. Ext.reg("tbseparator", A.Separator);
  16943. A.Spacer = function() {
  16944. var B = document.createElement("div");
  16945. B.className = "ytb-spacer";
  16946. A.Spacer.superclass.constructor.call(this, B)
  16947. };
  16948. Ext.extend(A.Spacer, A.Item, {
  16949. enable : Ext.emptyFn,
  16950. disable : Ext.emptyFn,
  16951. focus : Ext.emptyFn
  16952. });
  16953. Ext.reg("tbspacer", A.Spacer);
  16954. A.Fill = Ext.extend(A.Spacer, {
  16955. render : function(B) {
  16956. B.style.width = "100%";
  16957. A.Fill.superclass.render.call(this, B)
  16958. }
  16959. });
  16960. Ext.reg("tbfill", A.Fill);
  16961. A.TextItem = function(B) {
  16962. var C = document.createElement("span");
  16963. C.className = "ytb-text";
  16964. C.innerHTML = B.text ? B.text : B;
  16965. A.TextItem.superclass.constructor.call(this, C)
  16966. };
  16967. Ext.extend(A.TextItem, A.Item, {
  16968. enable : Ext.emptyFn,
  16969. disable : Ext.emptyFn,
  16970. focus : Ext.emptyFn
  16971. });
  16972. Ext.reg("tbtext", A.TextItem);
  16973. A.Button = Ext.extend(Ext.Button, {
  16974. hideParent : true,
  16975. onDestroy : function() {
  16976. A.Button.superclass.onDestroy.call(this);
  16977. if (this.container) {
  16978. this.container.remove()
  16979. }
  16980. }
  16981. });
  16982. Ext.reg("tbbutton", A.Button);
  16983. A.SplitButton = Ext.extend(Ext.SplitButton, {
  16984. hideParent : true,
  16985. onDestroy : function() {
  16986. A.SplitButton.superclass.onDestroy.call(this);
  16987. if (this.container) {
  16988. this.container.remove()
  16989. }
  16990. }
  16991. });
  16992. Ext.reg("tbsplit", A.SplitButton);
  16993. A.MenuButton = A.SplitButton
  16994. })();
  16995. Ext.PagingToolbar = Ext.extend(Ext.Toolbar, {
  16996. pageSize : 20,
  16997. displayMsg : "Displaying {0} - {1} of {2}",
  16998. emptyMsg : "No data to display",
  16999. beforePageText : "Page",
  17000. afterPageText : "of {0}",
  17001. firstText : "First Page",
  17002. prevText : "Previous Page",
  17003. nextText : "Next Page",
  17004. lastText : "Last Page",
  17005. refreshText : "Refresh",
  17006. paramNames : {
  17007. start : "start",
  17008. limit : "limit"
  17009. },
  17010. initComponent : function() {
  17011. Ext.PagingToolbar.superclass.initComponent.call(this);
  17012. this.cursor = 0;
  17013. this.bind(this.store)
  17014. },
  17015. onRender : function(B, A) {
  17016. Ext.PagingToolbar.superclass.onRender.call(this, B, A);
  17017. this.first = this.addButton({
  17018. tooltip : this.firstText,
  17019. iconCls : "x-tbar-page-first",
  17020. disabled : true,
  17021. handler : this.onClick.createDelegate(this,
  17022. ["first"])
  17023. });
  17024. this.prev = this.addButton({
  17025. tooltip : this.prevText,
  17026. iconCls : "x-tbar-page-prev",
  17027. disabled : true,
  17028. handler : this.onClick.createDelegate(this,
  17029. ["prev"])
  17030. });
  17031. this.addSeparator();
  17032. this.add(this.beforePageText);
  17033. this.field = Ext.get(this.addDom({
  17034. tag : "input",
  17035. type : "text",
  17036. size : "3",
  17037. value : "1",
  17038. cls : "x-tbar-page-number"
  17039. }).el);
  17040. this.field.on("keydown", this.onPagingKeydown, this);
  17041. this.field.on("focus", function() {
  17042. this.dom.select()
  17043. });
  17044. this.afterTextEl = this.addText(String.format(
  17045. this.afterPageText, 1));
  17046. this.field.setHeight(18);
  17047. this.addSeparator();
  17048. this.next = this.addButton({
  17049. tooltip : this.nextText,
  17050. iconCls : "x-tbar-page-next",
  17051. disabled : true,
  17052. handler : this.onClick.createDelegate(this,
  17053. ["next"])
  17054. });
  17055. this.last = this.addButton({
  17056. tooltip : this.lastText,
  17057. iconCls : "x-tbar-page-last",
  17058. disabled : true,
  17059. handler : this.onClick.createDelegate(this,
  17060. ["last"])
  17061. });
  17062. this.addSeparator();
  17063. this.loading = this.addButton({
  17064. tooltip : this.refreshText,
  17065. iconCls : "x-tbar-loading",
  17066. handler : this.onClick.createDelegate(this,
  17067. ["refresh"])
  17068. });
  17069. if (this.displayInfo) {
  17070. this.displayEl = Ext.fly(this.el.dom).createChild({
  17071. cls : "x-paging-info"
  17072. })
  17073. }
  17074. if (this.dsLoaded) {
  17075. this.onLoad.apply(this, this.dsLoaded)
  17076. }
  17077. },
  17078. updateInfo : function() {
  17079. if (this.displayEl) {
  17080. var A = this.store.getCount();
  17081. var B = A == 0 ? this.emptyMsg : String.format(
  17082. this.displayMsg, this.cursor + 1, this.cursor + A,
  17083. this.store.getTotalCount());
  17084. this.displayEl.update(B)
  17085. }
  17086. },
  17087. onLoad : function(A, C, F) {
  17088. if (!this.rendered) {
  17089. this.dsLoaded = [A, C, F];
  17090. return
  17091. }
  17092. this.cursor = F.params ? F.params[this.paramNames.start] : 0;
  17093. var E = this.getPageData(), B = E.activePage, D = E.pages;
  17094. this.afterTextEl.el.innerHTML = String.format(
  17095. this.afterPageText, E.pages);
  17096. this.field.dom.value = B;
  17097. this.first.setDisabled(B == 1);
  17098. this.prev.setDisabled(B == 1);
  17099. this.next.setDisabled(B == D);
  17100. this.last.setDisabled(B == D);
  17101. this.loading.enable();
  17102. this.updateInfo()
  17103. },
  17104. getPageData : function() {
  17105. var A = this.store.getTotalCount();
  17106. return {
  17107. total : A,
  17108. activePage : Math.ceil((this.cursor + this.pageSize)
  17109. / this.pageSize),
  17110. pages : A < this.pageSize ? 1 : Math
  17111. .ceil(A / this.pageSize)
  17112. }
  17113. },
  17114. onLoadError : function() {
  17115. if (!this.rendered) {
  17116. return
  17117. }
  17118. this.loading.enable()
  17119. },
  17120. readPage : function(C) {
  17121. var A = this.field.dom.value, B;
  17122. if (!A || isNaN(B = parseInt(A, 10))) {
  17123. this.field.dom.value = C.activePage;
  17124. return false
  17125. }
  17126. return B
  17127. },
  17128. onPagingKeydown : function(D) {
  17129. var B = D.getKey(), E = this.getPageData(), C;
  17130. if (B == D.RETURN) {
  17131. D.stopEvent();
  17132. if (C = this.readPage(E)) {
  17133. C = Math.min(Math.max(1, C), E.pages) - 1;
  17134. this.doLoad(C * this.pageSize)
  17135. }
  17136. } else {
  17137. if (B == D.HOME || B == D.END) {
  17138. D.stopEvent();
  17139. C = B == D.HOME ? 1 : E.pages;
  17140. this.field.dom.value = C
  17141. } else {
  17142. if (B == D.UP || B == D.PAGEUP || B == D.DOWN
  17143. || B == D.PAGEDOWN) {
  17144. D.stopEvent();
  17145. if (C = this.readPage(E)) {
  17146. var A = D.shiftKey ? 10 : 1;
  17147. if (B == D.DOWN || B == D.PAGEDOWN) {
  17148. A *= -1
  17149. }
  17150. C += A;
  17151. if (C >= 1 & C <= E.pages) {
  17152. this.field.dom.value = C
  17153. }
  17154. }
  17155. }
  17156. }
  17157. }
  17158. },
  17159. beforeLoad : function() {
  17160. if (this.rendered && this.loading) {
  17161. this.loading.disable()
  17162. }
  17163. },
  17164. doLoad : function(C) {
  17165. var B = {}, A = this.paramNames;
  17166. B[A.start] = C;
  17167. B[A.limit] = this.pageSize;
  17168. this.store.load({
  17169. params : B
  17170. })
  17171. },
  17172. onClick : function(E) {
  17173. var B = this.store;
  17174. switch (E) {
  17175. case "first" :
  17176. this.doLoad(0);
  17177. break;
  17178. case "prev" :
  17179. this.doLoad(Math.max(0, this.cursor - this.pageSize));
  17180. break;
  17181. case "next" :
  17182. this.doLoad(this.cursor + this.pageSize);
  17183. break;
  17184. case "last" :
  17185. var D = B.getTotalCount();
  17186. var A = D % this.pageSize;
  17187. var C = A ? (D - A) : D - this.pageSize;
  17188. this.doLoad(C);
  17189. break;
  17190. case "refresh" :
  17191. this.doLoad(this.cursor);
  17192. break
  17193. }
  17194. },
  17195. unbind : function(A) {
  17196. A = Ext.StoreMgr.lookup(A);
  17197. A.un("beforeload", this.beforeLoad, this);
  17198. A.un("load", this.onLoad, this);
  17199. A.un("loadexception", this.onLoadError, this);
  17200. this.store = undefined
  17201. },
  17202. bind : function(A) {
  17203. A = Ext.StoreMgr.lookup(A);
  17204. A.on("beforeload", this.beforeLoad, this);
  17205. A.on("load", this.onLoad, this);
  17206. A.on("loadexception", this.onLoadError, this);
  17207. this.store = A
  17208. }
  17209. });
  17210. Ext.reg("paging", Ext.PagingToolbar);
  17211. Ext.Resizable = function(D, E) {
  17212. this.el = Ext.get(D);
  17213. if (E && E.wrap) {
  17214. E.resizeChild = this.el;
  17215. this.el = this.el.wrap(typeof E.wrap == "object" ? E.wrap : {
  17216. cls : "xresizable-wrap"
  17217. });
  17218. this.el.id = this.el.dom.id = E.resizeChild.id + "-rzwrap";
  17219. this.el.setStyle("overflow", "hidden");
  17220. this.el.setPositioning(E.resizeChild.getPositioning());
  17221. E.resizeChild.clearPositioning();
  17222. if (!E.width || !E.height) {
  17223. var F = E.resizeChild.getSize();
  17224. this.el.setSize(F.width, F.height)
  17225. }
  17226. if (E.pinned && !E.adjustments) {
  17227. E.adjustments = "auto"
  17228. }
  17229. }
  17230. this.proxy = this.el.createProxy({
  17231. tag : "div",
  17232. cls : "x-resizable-proxy",
  17233. id : this.el.id + "-rzproxy"
  17234. });
  17235. this.proxy.unselectable();
  17236. this.proxy.enableDisplayMode("block");
  17237. Ext.apply(this, E);
  17238. if (this.pinned) {
  17239. this.disableTrackOver = true;
  17240. this.el.addClass("x-resizable-pinned")
  17241. }
  17242. var I = this.el.getStyle("position");
  17243. if (I != "absolute" && I != "fixed") {
  17244. this.el.setStyle("position", "relative")
  17245. }
  17246. if (!this.handles) {
  17247. this.handles = "s,e,se";
  17248. if (this.multiDirectional) {
  17249. this.handles += ",n,w"
  17250. }
  17251. }
  17252. if (this.handles == "all") {
  17253. this.handles = "n s e w ne nw se sw"
  17254. }
  17255. var M = this.handles.split(/\s*?[,;]\s*?| /);
  17256. var C = Ext.Resizable.positions;
  17257. for (var H = 0, J = M.length; H < J; H++) {
  17258. if (M[H] && C[M[H]]) {
  17259. var L = C[M[H]];
  17260. this[L] = new Ext.Resizable.Handle(this, L, this.disableTrackOver,
  17261. this.transparent)
  17262. }
  17263. }
  17264. this.corner = this.southeast;
  17265. if (this.handles.indexOf("n") != -1 || this.handles.indexOf("w") != -1) {
  17266. this.updateBox = true
  17267. }
  17268. this.activeHandle = null;
  17269. if (this.resizeChild) {
  17270. if (typeof this.resizeChild == "boolean") {
  17271. this.resizeChild = Ext.get(this.el.dom.firstChild, true)
  17272. } else {
  17273. this.resizeChild = Ext.get(this.resizeChild, true)
  17274. }
  17275. }
  17276. if (this.adjustments == "auto") {
  17277. var B = this.resizeChild;
  17278. var K = this.west, G = this.east, A = this.north, M = this.south;
  17279. if (B && (K || A)) {
  17280. B.position("relative");
  17281. B.setLeft(K ? K.el.getWidth() : 0);
  17282. B.setTop(A ? A.el.getHeight() : 0)
  17283. }
  17284. this.adjustments = [
  17285. (G ? -G.el.getWidth() : 0) + (K ? -K.el.getWidth() : 0),
  17286. (A ? -A.el.getHeight() : 0) + (M ? -M.el.getHeight() : 0) - 1]
  17287. }
  17288. if (this.draggable) {
  17289. this.dd = this.dynamic ? this.el.initDD(null) : this.el.initDDProxy(
  17290. null, {
  17291. dragElId : this.proxy.id
  17292. });
  17293. this.dd.setHandleElId(this.resizeChild
  17294. ? this.resizeChild.id
  17295. : this.el.id)
  17296. }
  17297. this.addEvents("beforeresize", "resize");
  17298. if (this.width !== null && this.height !== null) {
  17299. this.resizeTo(this.width, this.height)
  17300. } else {
  17301. this.updateChildSize()
  17302. }
  17303. if (Ext.isIE) {
  17304. this.el.dom.style.zoom = 1
  17305. }
  17306. Ext.Resizable.superclass.constructor.call(this)
  17307. };
  17308. Ext.extend(Ext.Resizable, Ext.util.Observable, {
  17309. resizeChild : false,
  17310. adjustments : [0, 0],
  17311. minWidth : 5,
  17312. minHeight : 5,
  17313. maxWidth : 10000,
  17314. maxHeight : 10000,
  17315. enabled : true,
  17316. animate : false,
  17317. duration : 0.35,
  17318. dynamic : false,
  17319. handles : false,
  17320. multiDirectional : false,
  17321. disableTrackOver : false,
  17322. easing : "easeOutStrong",
  17323. widthIncrement : 0,
  17324. heightIncrement : 0,
  17325. pinned : false,
  17326. width : null,
  17327. height : null,
  17328. preserveRatio : false,
  17329. transparent : false,
  17330. minX : 0,
  17331. minY : 0,
  17332. draggable : false,
  17333. resizeTo : function(B, A) {
  17334. this.el.setSize(B, A);
  17335. this.updateChildSize();
  17336. this.fireEvent("resize", this, B, A, null)
  17337. },
  17338. startSizing : function(C, B) {
  17339. this.fireEvent("beforeresize", this, C);
  17340. if (this.enabled) {
  17341. if (!this.overlay) {
  17342. this.overlay = this.el.createProxy({
  17343. tag : "div",
  17344. cls : "x-resizable-overlay",
  17345. html : "&#160;"
  17346. }, Ext.getBody());
  17347. this.overlay.unselectable();
  17348. this.overlay.enableDisplayMode("block");
  17349. this.overlay.on("mousemove", this.onMouseMove, this);
  17350. this.overlay.on("mouseup", this.onMouseUp, this)
  17351. }
  17352. this.overlay.setStyle("cursor", B.el.getStyle("cursor"));
  17353. this.resizing = true;
  17354. this.startBox = this.el.getBox();
  17355. this.startPoint = C.getXY();
  17356. this.offsets = [
  17357. (this.startBox.x + this.startBox.width)
  17358. - this.startPoint[0],
  17359. (this.startBox.y + this.startBox.height)
  17360. - this.startPoint[1]];
  17361. this.overlay.setSize(Ext.lib.Dom.getViewWidth(true),
  17362. Ext.lib.Dom.getViewHeight(true));
  17363. this.overlay.show();
  17364. if (this.constrainTo) {
  17365. var A = Ext.get(this.constrainTo);
  17366. this.resizeRegion = A.getRegion().adjust(
  17367. A.getFrameWidth("t"), A.getFrameWidth("l"),
  17368. -A.getFrameWidth("b"), -A.getFrameWidth("r"))
  17369. }
  17370. this.proxy.setStyle("visibility", "hidden");
  17371. this.proxy.show();
  17372. this.proxy.setBox(this.startBox);
  17373. if (!this.dynamic) {
  17374. this.proxy.setStyle("visibility", "visible")
  17375. }
  17376. }
  17377. },
  17378. onMouseDown : function(A, B) {
  17379. if (this.enabled) {
  17380. B.stopEvent();
  17381. this.activeHandle = A;
  17382. this.startSizing(B, A)
  17383. }
  17384. },
  17385. onMouseUp : function(B) {
  17386. var A = this.resizeElement();
  17387. this.resizing = false;
  17388. this.handleOut();
  17389. this.overlay.hide();
  17390. this.proxy.hide();
  17391. this.fireEvent("resize", this, A.width, A.height, B)
  17392. },
  17393. updateChildSize : function() {
  17394. if (this.resizeChild) {
  17395. var C = this.el;
  17396. var D = this.resizeChild;
  17397. var B = this.adjustments;
  17398. if (C.dom.offsetWidth) {
  17399. var A = C.getSize(true);
  17400. D.setSize(A.width + B[0], A.height + B[1])
  17401. }
  17402. if (Ext.isIE) {
  17403. setTimeout(function() {
  17404. if (C.dom.offsetWidth) {
  17405. var E = C.getSize(true);
  17406. D.setSize(E.width + B[0], E.height
  17407. + B[1])
  17408. }
  17409. }, 10)
  17410. }
  17411. }
  17412. },
  17413. snap : function(C, E, B) {
  17414. if (!E || !C) {
  17415. return C
  17416. }
  17417. var D = C;
  17418. var A = C % E;
  17419. if (A > 0) {
  17420. if (A > (E / 2)) {
  17421. D = C + (E - A)
  17422. } else {
  17423. D = C - A
  17424. }
  17425. }
  17426. return Math.max(B, D)
  17427. },
  17428. resizeElement : function() {
  17429. var A = this.proxy.getBox();
  17430. if (this.updateBox) {
  17431. this.el.setBox(A, false, this.animate, this.duration, null,
  17432. this.easing)
  17433. } else {
  17434. this.el.setSize(A.width, A.height, this.animate,
  17435. this.duration, null, this.easing)
  17436. }
  17437. this.updateChildSize();
  17438. if (!this.dynamic) {
  17439. this.proxy.hide()
  17440. }
  17441. return A
  17442. },
  17443. constrain : function(B, C, A, D) {
  17444. if (B - C < A) {
  17445. C = B - A
  17446. } else {
  17447. if (B - C > D) {
  17448. C = D - B
  17449. }
  17450. }
  17451. return C
  17452. },
  17453. onMouseMove : function(S) {
  17454. if (this.enabled) {
  17455. try {
  17456. if (this.resizeRegion
  17457. && !this.resizeRegion.contains(S.getPoint())) {
  17458. return
  17459. }
  17460. var Q = this.curSize || this.startBox;
  17461. var I = this.startBox.x, H = this.startBox.y;
  17462. var C = I, B = H;
  17463. var J = Q.width, R = Q.height;
  17464. var D = J, L = R;
  17465. var K = this.minWidth, T = this.minHeight;
  17466. var P = this.maxWidth, W = this.maxHeight;
  17467. var F = this.widthIncrement;
  17468. var A = this.heightIncrement;
  17469. var U = S.getXY();
  17470. var O = -(this.startPoint[0] - Math
  17471. .max(this.minX, U[0]));
  17472. var M = -(this.startPoint[1] - Math
  17473. .max(this.minY, U[1]));
  17474. var G = this.activeHandle.position;
  17475. switch (G) {
  17476. case "east" :
  17477. J += O;
  17478. J = Math.min(Math.max(K, J), P);
  17479. break;
  17480. case "south" :
  17481. R += M;
  17482. R = Math.min(Math.max(T, R), W);
  17483. break;
  17484. case "southeast" :
  17485. J += O;
  17486. R += M;
  17487. J = Math.min(Math.max(K, J), P);
  17488. R = Math.min(Math.max(T, R), W);
  17489. break;
  17490. case "north" :
  17491. M = this.constrain(R, M, T, W);
  17492. H += M;
  17493. R -= M;
  17494. break;
  17495. case "west" :
  17496. O = this.constrain(J, O, K, P);
  17497. I += O;
  17498. J -= O;
  17499. break;
  17500. case "northeast" :
  17501. J += O;
  17502. J = Math.min(Math.max(K, J), P);
  17503. M = this.constrain(R, M, T, W);
  17504. H += M;
  17505. R -= M;
  17506. break;
  17507. case "northwest" :
  17508. O = this.constrain(J, O, K, P);
  17509. M = this.constrain(R, M, T, W);
  17510. H += M;
  17511. R -= M;
  17512. I += O;
  17513. J -= O;
  17514. break;
  17515. case "southwest" :
  17516. O = this.constrain(J, O, K, P);
  17517. R += M;
  17518. R = Math.min(Math.max(T, R), W);
  17519. I += O;
  17520. J -= O;
  17521. break
  17522. }
  17523. var N = this.snap(J, F, K);
  17524. var V = this.snap(R, A, T);
  17525. if (N != J || V != R) {
  17526. switch (G) {
  17527. case "northeast" :
  17528. H -= V - R;
  17529. break;
  17530. case "north" :
  17531. H -= V - R;
  17532. break;
  17533. case "southwest" :
  17534. I -= N - J;
  17535. break;
  17536. case "west" :
  17537. I -= N - J;
  17538. break;
  17539. case "northwest" :
  17540. I -= N - J;
  17541. H -= V - R;
  17542. break
  17543. }
  17544. J = N;
  17545. R = V
  17546. }
  17547. if (this.preserveRatio) {
  17548. switch (G) {
  17549. case "southeast" :
  17550. case "east" :
  17551. R = L * (J / D);
  17552. R = Math.min(Math.max(T, R), W);
  17553. J = D * (R / L);
  17554. break;
  17555. case "south" :
  17556. J = D * (R / L);
  17557. J = Math.min(Math.max(K, J), P);
  17558. R = L * (J / D);
  17559. break;
  17560. case "northeast" :
  17561. J = D * (R / L);
  17562. J = Math.min(Math.max(K, J), P);
  17563. R = L * (J / D);
  17564. break;
  17565. case "north" :
  17566. var X = J;
  17567. J = D * (R / L);
  17568. J = Math.min(Math.max(K, J), P);
  17569. R = L * (J / D);
  17570. I += (X - J) / 2;
  17571. break;
  17572. case "southwest" :
  17573. R = L * (J / D);
  17574. R = Math.min(Math.max(T, R), W);
  17575. var X = J;
  17576. J = D * (R / L);
  17577. I += X - J;
  17578. break;
  17579. case "west" :
  17580. var E = R;
  17581. R = L * (J / D);
  17582. R = Math.min(Math.max(T, R), W);
  17583. H += (E - R) / 2;
  17584. var X = J;
  17585. J = D * (R / L);
  17586. I += X - J;
  17587. break;
  17588. case "northwest" :
  17589. var X = J;
  17590. var E = R;
  17591. R = L * (J / D);
  17592. R = Math.min(Math.max(T, R), W);
  17593. J = D * (R / L);
  17594. H += E - R;
  17595. I += X - J;
  17596. break
  17597. }
  17598. }
  17599. this.proxy.setBounds(I, H, J, R);
  17600. if (this.dynamic) {
  17601. this.resizeElement()
  17602. }
  17603. } catch (S) {
  17604. }
  17605. }
  17606. },
  17607. handleOver : function() {
  17608. if (this.enabled) {
  17609. this.el.addClass("x-resizable-over")
  17610. }
  17611. },
  17612. handleOut : function() {
  17613. if (!this.resizing) {
  17614. this.el.removeClass("x-resizable-over")
  17615. }
  17616. },
  17617. getEl : function() {
  17618. return this.el
  17619. },
  17620. getResizeChild : function() {
  17621. return this.resizeChild
  17622. },
  17623. destroy : function(C) {
  17624. this.proxy.remove();
  17625. if (this.overlay) {
  17626. this.overlay.removeAllListeners();
  17627. this.overlay.remove()
  17628. }
  17629. var D = Ext.Resizable.positions;
  17630. for (var A in D) {
  17631. if (typeof D[A] != "function" && this[D[A]]) {
  17632. var B = this[D[A]];
  17633. B.el.removeAllListeners();
  17634. B.el.remove()
  17635. }
  17636. }
  17637. if (C) {
  17638. this.el.update("");
  17639. this.el.remove()
  17640. }
  17641. },
  17642. syncHandleHeight : function() {
  17643. var A = this.el.getHeight(true);
  17644. if (this.west) {
  17645. this.west.el.setHeight(A)
  17646. }
  17647. if (this.east) {
  17648. this.east.el.setHeight(A)
  17649. }
  17650. }
  17651. });
  17652. Ext.Resizable.positions = {
  17653. n : "north",
  17654. s : "south",
  17655. e : "east",
  17656. w : "west",
  17657. se : "southeast",
  17658. sw : "southwest",
  17659. nw : "northwest",
  17660. ne : "northeast"
  17661. };
  17662. Ext.Resizable.Handle = function(C, E, B, D) {
  17663. if (!this.tpl) {
  17664. var A = Ext.DomHelper.createTemplate({
  17665. tag : "div",
  17666. cls : "x-resizable-handle x-resizable-handle-{0}"
  17667. });
  17668. A.compile();
  17669. Ext.Resizable.Handle.prototype.tpl = A
  17670. }
  17671. this.position = E;
  17672. this.rz = C;
  17673. this.el = this.tpl.append(C.el.dom, [this.position], true);
  17674. this.el.unselectable();
  17675. if (D) {
  17676. this.el.setOpacity(0)
  17677. }
  17678. this.el.on("mousedown", this.onMouseDown, this);
  17679. if (!B) {
  17680. this.el.on("mouseover", this.onMouseOver, this);
  17681. this.el.on("mouseout", this.onMouseOut, this)
  17682. }
  17683. };
  17684. Ext.Resizable.Handle.prototype = {
  17685. afterResize : function(A) {
  17686. },
  17687. onMouseDown : function(A) {
  17688. this.rz.onMouseDown(this, A)
  17689. },
  17690. onMouseOver : function(A) {
  17691. this.rz.handleOver(this, A)
  17692. },
  17693. onMouseOut : function(A) {
  17694. this.rz.handleOut(this, A)
  17695. }
  17696. };
  17697. Ext.Editor = function(B, A) {
  17698. this.field = B;
  17699. Ext.Editor.superclass.constructor.call(this, A)
  17700. };
  17701. Ext.extend(Ext.Editor, Ext.Component, {
  17702. value : "",
  17703. alignment : "c-c?",
  17704. shadow : "frame",
  17705. constrain : false,
  17706. swallowKeys : true,
  17707. completeOnEnter : false,
  17708. cancelOnEsc : false,
  17709. updateEl : false,
  17710. initComponent : function() {
  17711. Ext.Editor.superclass.initComponent.call(this);
  17712. this.addEvents("beforestartedit", "startedit", "beforecomplete",
  17713. "complete", "specialkey")
  17714. },
  17715. onRender : function(B, A) {
  17716. this.el = new Ext.Layer({
  17717. shadow : this.shadow,
  17718. cls : "x-editor",
  17719. parentEl : B,
  17720. shim : this.shim,
  17721. shadowOffset : 4,
  17722. id : this.id,
  17723. constrain : this.constrain
  17724. });
  17725. this.el.setStyle("overflow", Ext.isGecko ? "auto" : "hidden");
  17726. if (this.field.msgTarget != "title") {
  17727. this.field.msgTarget = "qtip"
  17728. }
  17729. this.field.inEditor = true;
  17730. this.field.render(this.el);
  17731. if (Ext.isGecko) {
  17732. this.field.el.dom.setAttribute("autocomplete", "off")
  17733. }
  17734. this.field.on("specialkey", this.onSpecialKey, this);
  17735. if (this.swallowKeys) {
  17736. this.field.el.swallowEvent(["keydown", "keypress"])
  17737. }
  17738. this.field.show();
  17739. this.field.on("blur", this.onBlur, this);
  17740. if (this.field.grow) {
  17741. this.field.on("autosize", this.el.sync, this.el, {
  17742. delay : 1
  17743. })
  17744. }
  17745. },
  17746. onSpecialKey : function(B, A) {
  17747. if (this.completeOnEnter && A.getKey() == A.ENTER) {
  17748. A.stopEvent();
  17749. this.completeEdit()
  17750. } else {
  17751. if (this.cancelOnEsc && A.getKey() == A.ESC) {
  17752. this.cancelEdit()
  17753. } else {
  17754. this.fireEvent("specialkey", B, A)
  17755. }
  17756. }
  17757. },
  17758. startEdit : function(B, C) {
  17759. if (this.editing) {
  17760. this.completeEdit()
  17761. }
  17762. this.boundEl = Ext.get(B);
  17763. var A = C !== undefined ? C : this.boundEl.dom.innerHTML;
  17764. if (!this.rendered) {
  17765. this.render(this.parentEl || document.body)
  17766. }
  17767. if (this.fireEvent("beforestartedit", this, this.boundEl, A) === false) {
  17768. return
  17769. }
  17770. this.startValue = A;
  17771. this.field.setValue(A);
  17772. this.doAutoSize();
  17773. this.el.alignTo(this.boundEl, this.alignment);
  17774. this.editing = true;
  17775. this.show()
  17776. },
  17777. doAutoSize : function() {
  17778. if (this.autoSize) {
  17779. var A = this.boundEl.getSize();
  17780. switch (this.autoSize) {
  17781. case "width" :
  17782. this.setSize(A.width, "");
  17783. break;
  17784. case "height" :
  17785. this.setSize("", A.height);
  17786. break;
  17787. default :
  17788. this.setSize(A.width, A.height)
  17789. }
  17790. }
  17791. },
  17792. setSize : function(A, B) {
  17793. delete this.field.lastSize;
  17794. this.field.setSize(A, B);
  17795. if (this.el) {
  17796. this.el.sync()
  17797. }
  17798. },
  17799. realign : function() {
  17800. this.el.alignTo(this.boundEl, this.alignment)
  17801. },
  17802. completeEdit : function(A) {
  17803. if (!this.editing) {
  17804. return
  17805. }
  17806. var B = this.getValue();
  17807. if (this.revertInvalid !== false && !this.field.isValid()) {
  17808. B = this.startValue;
  17809. this.cancelEdit(true)
  17810. }
  17811. if (String(B) === String(this.startValue) && this.ignoreNoChange) {
  17812. this.editing = false;
  17813. this.hide();
  17814. return
  17815. }
  17816. if (this.fireEvent("beforecomplete", this, B, this.startValue) !== false) {
  17817. this.editing = false;
  17818. if (this.updateEl && this.boundEl) {
  17819. this.boundEl.update(B)
  17820. }
  17821. if (A !== true) {
  17822. this.hide()
  17823. }
  17824. this.fireEvent("complete", this, B, this.startValue)
  17825. }
  17826. },
  17827. onShow : function() {
  17828. this.el.show();
  17829. if (this.hideEl !== false) {
  17830. this.boundEl.hide()
  17831. }
  17832. this.field.show();
  17833. if (Ext.isIE && !this.fixIEFocus) {
  17834. this.fixIEFocus = true;
  17835. this.deferredFocus.defer(50, this)
  17836. } else {
  17837. this.field.focus()
  17838. }
  17839. this.fireEvent("startedit", this.boundEl, this.startValue)
  17840. },
  17841. deferredFocus : function() {
  17842. if (this.editing) {
  17843. this.field.focus()
  17844. }
  17845. },
  17846. cancelEdit : function(A) {
  17847. if (this.editing) {
  17848. this.setValue(this.startValue);
  17849. if (A !== true) {
  17850. this.hide()
  17851. }
  17852. }
  17853. },
  17854. onBlur : function() {
  17855. if (this.allowBlur !== true && this.editing) {
  17856. this.completeEdit()
  17857. }
  17858. },
  17859. onHide : function() {
  17860. if (this.editing) {
  17861. this.completeEdit();
  17862. return
  17863. }
  17864. this.field.blur();
  17865. if (this.field.collapse) {
  17866. this.field.collapse()
  17867. }
  17868. this.el.hide();
  17869. if (this.hideEl !== false) {
  17870. this.boundEl.show()
  17871. }
  17872. },
  17873. setValue : function(A) {
  17874. this.field.setValue(A)
  17875. },
  17876. getValue : function() {
  17877. return this.field.getValue()
  17878. },
  17879. beforeDestroy : function() {
  17880. this.field.destroy();
  17881. this.field = null
  17882. }
  17883. });
  17884. Ext.reg("editor", Ext.Editor);
  17885. Ext.MessageBox = function() {
  17886. var R, B, N, Q;
  17887. var G, J, P, A, K, M, H, F;
  17888. var O, S, L, C = "";
  17889. var D = function(U) {
  17890. R.hide();
  17891. Ext.callback(B.fn, B.scope || window, [U, S.dom.value], 1)
  17892. };
  17893. var T = function() {
  17894. if (B && B.cls) {
  17895. R.el.removeClass(B.cls)
  17896. }
  17897. K.reset()
  17898. };
  17899. var E = function(W, U, V) {
  17900. if (B && B.closable !== false) {
  17901. R.hide()
  17902. }
  17903. if (V) {
  17904. V.stopEvent()
  17905. }
  17906. };
  17907. var I = function(U) {
  17908. var W = 0;
  17909. if (!U) {
  17910. O["ok"].hide();
  17911. O["cancel"].hide();
  17912. O["yes"].hide();
  17913. O["no"].hide();
  17914. return W
  17915. }
  17916. R.footer.dom.style.display = "";
  17917. for (var V in O) {
  17918. if (typeof O[V] != "function") {
  17919. if (U[V]) {
  17920. O[V].show();
  17921. O[V].setText(typeof U[V] == "string"
  17922. ? U[V]
  17923. : Ext.MessageBox.buttonText[V]);
  17924. W += O[V].el.getWidth() + 15
  17925. } else {
  17926. O[V].hide()
  17927. }
  17928. }
  17929. }
  17930. return W
  17931. };
  17932. return {
  17933. getDialog : function(U) {
  17934. if (!R) {
  17935. R = new Ext.Window({
  17936. autoCreate : true,
  17937. title : U,
  17938. resizable : false,
  17939. constrain : true,
  17940. constrainHeader : true,
  17941. minimizable : false,
  17942. maximizable : false,
  17943. stateful : false,
  17944. modal : true,
  17945. shim : true,
  17946. buttonAlign : "center",
  17947. width : 400,
  17948. height : 100,
  17949. minHeight : 80,
  17950. plain : true,
  17951. footer : true,
  17952. closable : true,
  17953. close : function() {
  17954. if (B && B.buttons && B.buttons.no && !B.buttons.cancel) {
  17955. D("no")
  17956. } else {
  17957. D("cancel")
  17958. }
  17959. }
  17960. });
  17961. O = {};
  17962. var V = this.buttonText;
  17963. O["ok"] = R.addButton(V["ok"], D.createCallback("ok"));
  17964. O["yes"] = R.addButton(V["yes"], D.createCallback("yes"));
  17965. O["no"] = R.addButton(V["no"], D.createCallback("no"));
  17966. O["cancel"] = R.addButton(V["cancel"], D
  17967. .createCallback("cancel"));
  17968. O["ok"].hideMode = O["yes"].hideMode = O["no"].hideMode = O["cancel"].hideMode = "offsets";
  17969. R.render(document.body);
  17970. R.getEl().addClass("x-window-dlg");
  17971. N = R.mask;
  17972. G = R.body.createChild({
  17973. html : "<div class=\"ext-mb-icon\"></div><div class=\"ext-mb-content\"><span class=\"ext-mb-text\"></span><br /><input type=\"text\" class=\"ext-mb-input\" /><textarea class=\"ext-mb-textarea\"></textarea></div>"
  17974. });
  17975. H = Ext.get(G.dom.firstChild);
  17976. var W = G.dom.childNodes[1];
  17977. J = Ext.get(W.firstChild);
  17978. P = Ext.get(W.childNodes[2]);
  17979. P.enableDisplayMode();
  17980. P.addKeyListener([10, 13], function() {
  17981. if (R.isVisible() && B && B.buttons) {
  17982. if (B.buttons.ok) {
  17983. D("ok")
  17984. } else {
  17985. if (B.buttons.yes) {
  17986. D("yes")
  17987. }
  17988. }
  17989. }
  17990. });
  17991. A = Ext.get(W.childNodes[3]);
  17992. A.enableDisplayMode();
  17993. K = new Ext.ProgressBar({
  17994. renderTo : G
  17995. });
  17996. G.createChild({
  17997. cls : "x-clear"
  17998. })
  17999. }
  18000. return R
  18001. },
  18002. updateText : function(X) {
  18003. if (!R.isVisible() && !B.width) {
  18004. R.setSize(this.maxWidth, 100)
  18005. }
  18006. J.update(X || "&#160;");
  18007. var V = C != "" ? (H.getWidth() + H.getMargins("lr")) : 0;
  18008. var Z = J.getWidth() + J.getMargins("lr");
  18009. var W = R.getFrameWidth("lr");
  18010. var Y = R.body.getFrameWidth("lr");
  18011. if (Ext.isIE && V > 0) {
  18012. V += 3
  18013. }
  18014. var U = Math.max(Math.min(B.width || V + Z + W + Y, this.maxWidth),
  18015. Math.max(B.minWidth || this.minWidth, L || 0));
  18016. if (B.prompt === true) {
  18017. S.setWidth(U - V - W - Y)
  18018. }
  18019. if (B.progress === true || B.wait === true) {
  18020. K.setSize(U - V - W - Y)
  18021. }
  18022. R.setSize(U, "auto").center();
  18023. return this
  18024. },
  18025. updateProgress : function(V, U, W) {
  18026. K.updateProgress(V, U);
  18027. if (W) {
  18028. this.updateText(W)
  18029. }
  18030. return this
  18031. },
  18032. isVisible : function() {
  18033. return R && R.isVisible()
  18034. },
  18035. hide : function() {
  18036. if (this.isVisible()) {
  18037. R.hide();
  18038. T()
  18039. }
  18040. return this
  18041. },
  18042. show : function(X) {
  18043. if (this.isVisible()) {
  18044. this.hide()
  18045. }
  18046. B = X;
  18047. var Y = this.getDialog(B.title || "&#160;");
  18048. Y.setTitle(B.title || "&#160;");
  18049. var U = (B.closable !== false && B.progress !== true && B.wait !== true);
  18050. Y.tools.close.setDisplayed(U);
  18051. S = P;
  18052. B.prompt = B.prompt || (B.multiline ? true : false);
  18053. if (B.prompt) {
  18054. if (B.multiline) {
  18055. P.hide();
  18056. A.show();
  18057. A.setHeight(typeof B.multiline == "number"
  18058. ? B.multiline
  18059. : this.defaultTextHeight);
  18060. S = A
  18061. } else {
  18062. P.show();
  18063. A.hide()
  18064. }
  18065. } else {
  18066. P.hide();
  18067. A.hide()
  18068. }
  18069. S.dom.value = B.value || "";
  18070. if (B.prompt) {
  18071. Y.focusEl = S
  18072. } else {
  18073. var W = B.buttons;
  18074. var V = null;
  18075. if (W && W.ok) {
  18076. V = O["ok"]
  18077. } else {
  18078. if (W && W.yes) {
  18079. V = O["yes"]
  18080. }
  18081. }
  18082. if (V) {
  18083. Y.focusEl = V
  18084. }
  18085. }
  18086. this.setIcon(B.icon);
  18087. L = I(B.buttons);
  18088. K.setVisible(B.progress === true || B.wait === true);
  18089. this.updateProgress(0, B.progressText);
  18090. this.updateText(B.msg);
  18091. if (B.cls) {
  18092. Y.el.addClass(B.cls)
  18093. }
  18094. Y.proxyDrag = B.proxyDrag === true;
  18095. Y.modal = B.modal !== false;
  18096. Y.mask = B.modal !== false ? N : false;
  18097. if (!Y.isVisible()) {
  18098. document.body.appendChild(R.el.dom);
  18099. Y.setAnimateTarget(B.animEl);
  18100. Y.show(B.animEl)
  18101. }
  18102. Y.on("show", function() {
  18103. if (U === true) {
  18104. Y.keyMap.enable()
  18105. } else {
  18106. Y.keyMap.disable()
  18107. }
  18108. }, this, {
  18109. single : true
  18110. });
  18111. if (B.wait === true) {
  18112. K.wait(B.waitConfig)
  18113. }
  18114. return this
  18115. },
  18116. setIcon : function(U) {
  18117. if (U && U != "") {
  18118. H.removeClass("x-hidden");
  18119. H.replaceClass(C, U);
  18120. C = U
  18121. } else {
  18122. H.replaceClass(C, "x-hidden");
  18123. C = ""
  18124. }
  18125. return this
  18126. },
  18127. progress : function(W, V, U) {
  18128. this.show({
  18129. title : W,
  18130. msg : V,
  18131. buttons : false,
  18132. progress : true,
  18133. closable : false,
  18134. minWidth : this.minProgressWidth,
  18135. progressText : U
  18136. });
  18137. return this
  18138. },
  18139. wait : function(W, V, U) {
  18140. this.show({
  18141. title : V,
  18142. msg : W,
  18143. buttons : false,
  18144. closable : false,
  18145. wait : true,
  18146. modal : true,
  18147. minWidth : this.minProgressWidth,
  18148. waitConfig : U
  18149. });
  18150. return this
  18151. },
  18152. alert : function(X, W, V, U) {
  18153. this.show({
  18154. title : X,
  18155. msg : W,
  18156. buttons : this.OK,
  18157. fn : V,
  18158. scope : U
  18159. });
  18160. return this
  18161. },
  18162. confirm : function(X, W, V, U) {
  18163. this.show({
  18164. title : X,
  18165. msg : W,
  18166. buttons : this.YESNO,
  18167. fn : V,
  18168. scope : U,
  18169. icon : this.QUESTION
  18170. });
  18171. return this
  18172. },
  18173. prompt : function(Y, X, W, V, U) {
  18174. this.show({
  18175. title : Y,
  18176. msg : X,
  18177. buttons : this.OKCANCEL,
  18178. fn : W,
  18179. minWidth : 250,
  18180. scope : V,
  18181. prompt : true,
  18182. multiline : U
  18183. });
  18184. return this
  18185. },
  18186. OK : {
  18187. ok : true
  18188. },
  18189. CANCEL : {
  18190. cancel : true
  18191. },
  18192. OKCANCEL : {
  18193. ok : true,
  18194. cancel : true
  18195. },
  18196. YESNO : {
  18197. yes : true,
  18198. no : true
  18199. },
  18200. YESNOCANCEL : {
  18201. yes : true,
  18202. no : true,
  18203. cancel : true
  18204. },
  18205. INFO : "ext-mb-info",
  18206. WARNING : "ext-mb-warning",
  18207. QUESTION : "ext-mb-question",
  18208. ERROR : "ext-mb-error",
  18209. defaultTextHeight : 75,
  18210. maxWidth : 600,
  18211. minWidth : 100,
  18212. minProgressWidth : 250,
  18213. buttonText : {
  18214. ok : "OK",
  18215. cancel : "Cancel",
  18216. yes : "Yes",
  18217. no : "No"
  18218. }
  18219. }
  18220. }();
  18221. Ext.Msg = Ext.MessageBox;
  18222. Ext.Tip = Ext.extend(Ext.Panel, {
  18223. minWidth : 40,
  18224. maxWidth : 300,
  18225. shadow : "sides",
  18226. defaultAlign : "tl-bl?",
  18227. autoRender : true,
  18228. quickShowInterval : 250,
  18229. frame : true,
  18230. hidden : true,
  18231. baseCls : "x-tip",
  18232. floating : {
  18233. shadow : true,
  18234. shim : true,
  18235. useDisplay : true,
  18236. constrain : false
  18237. },
  18238. autoHeight : true,
  18239. initComponent : function() {
  18240. Ext.Tip.superclass.initComponent.call(this);
  18241. if (this.closable && !this.title) {
  18242. this.elements += ",header"
  18243. }
  18244. },
  18245. afterRender : function() {
  18246. Ext.Tip.superclass.afterRender.call(this);
  18247. if (this.closable) {
  18248. this.addTool({
  18249. id : "close",
  18250. handler : this.hide,
  18251. scope : this
  18252. })
  18253. }
  18254. },
  18255. showAt : function(A) {
  18256. Ext.Tip.superclass.show.call(this);
  18257. if (this.measureWidth !== false
  18258. && (!this.initialConfig || typeof this.initialConfig.width != "number")) {
  18259. var B = this.body.getTextWidth();
  18260. if (this.title) {
  18261. B = Math.max(B, this.header.child("span")
  18262. .getTextWidth(this.title))
  18263. }
  18264. B += this.getFrameWidth() + (this.closable ? 20 : 0)
  18265. + this.body.getPadding("lr");
  18266. this.setWidth(B.constrain(this.minWidth, this.maxWidth))
  18267. }
  18268. if (this.constrainPosition) {
  18269. A = this.el.adjustForConstraints(A)
  18270. }
  18271. this.setPagePosition(A[0], A[1])
  18272. },
  18273. showBy : function(A, B) {
  18274. if (!this.rendered) {
  18275. this.render(Ext.getBody())
  18276. }
  18277. this.showAt(this.el.getAlignToXY(A, B || this.defaultAlign))
  18278. },
  18279. initDraggable : function() {
  18280. this.dd = new Ext.Tip.DD(this, typeof this.draggable == "boolean"
  18281. ? null
  18282. : this.draggable);
  18283. this.header.addClass("x-tip-draggable")
  18284. }
  18285. });
  18286. Ext.Tip.DD = function(B, A) {
  18287. Ext.apply(this, A);
  18288. this.tip = B;
  18289. Ext.Tip.DD.superclass.constructor.call(this, B.el.id, "WindowDD-" + B.id);
  18290. this.setHandleElId(B.header.id);
  18291. this.scroll = false
  18292. };
  18293. Ext.extend(Ext.Tip.DD, Ext.dd.DD, {
  18294. moveOnly : true,
  18295. scroll : false,
  18296. headerOffsets : [100, 25],
  18297. startDrag : function() {
  18298. this.tip.el.disableShadow()
  18299. },
  18300. endDrag : function(A) {
  18301. this.tip.el.enableShadow(true)
  18302. }
  18303. });
  18304. Ext.ToolTip = Ext.extend(Ext.Tip, {
  18305. showDelay : 500,
  18306. hideDelay : 200,
  18307. dismissDelay : 5000,
  18308. mouseOffset : [15, 18],
  18309. trackMouse : false,
  18310. constrainPosition : true,
  18311. initComponent : function() {
  18312. Ext.ToolTip.superclass.initComponent.call(this);
  18313. this.lastActive = new Date();
  18314. this.initTarget()
  18315. },
  18316. initTarget : function() {
  18317. if (this.target) {
  18318. this.target = Ext.get(this.target);
  18319. this.target.on("mouseover", this.onTargetOver, this);
  18320. this.target.on("mouseout", this.onTargetOut, this);
  18321. this.target.on("mousemove", this.onMouseMove, this)
  18322. }
  18323. },
  18324. onMouseMove : function(A) {
  18325. this.targetXY = A.getXY();
  18326. if (!this.hidden && this.trackMouse) {
  18327. this.setPagePosition(this.getTargetXY())
  18328. }
  18329. },
  18330. getTargetXY : function() {
  18331. return [this.targetXY[0] + this.mouseOffset[0],
  18332. this.targetXY[1] + this.mouseOffset[1]]
  18333. },
  18334. onTargetOver : function(A) {
  18335. if (this.disabled || A.within(this.target.dom, true)) {
  18336. return
  18337. }
  18338. this.clearTimer("hide");
  18339. this.targetXY = A.getXY();
  18340. this.delayShow()
  18341. },
  18342. delayShow : function() {
  18343. if (this.hidden && !this.showTimer) {
  18344. if (this.lastActive.getElapsed() < this.quickShowInterval) {
  18345. this.show()
  18346. } else {
  18347. this.showTimer = this.show.defer(this.showDelay, this)
  18348. }
  18349. } else {
  18350. if (!this.hidden && this.autoHide !== false) {
  18351. this.show()
  18352. }
  18353. }
  18354. },
  18355. onTargetOut : function(A) {
  18356. if (this.disabled || A.within(this.target.dom, true)) {
  18357. return
  18358. }
  18359. this.clearTimer("show");
  18360. if (this.autoHide !== false) {
  18361. this.delayHide()
  18362. }
  18363. },
  18364. delayHide : function() {
  18365. if (!this.hidden && !this.hideTimer) {
  18366. this.hideTimer = this.hide.defer(this.hideDelay, this)
  18367. }
  18368. },
  18369. hide : function() {
  18370. this.clearTimer("dismiss");
  18371. this.lastActive = new Date();
  18372. Ext.ToolTip.superclass.hide.call(this)
  18373. },
  18374. show : function() {
  18375. this.showAt(this.getTargetXY())
  18376. },
  18377. showAt : function(A) {
  18378. this.lastActive = new Date();
  18379. this.clearTimers();
  18380. Ext.ToolTip.superclass.showAt.call(this, A);
  18381. if (this.dismissDelay && this.autoHide !== false) {
  18382. this.dismissTimer = this.hide
  18383. .defer(this.dismissDelay, this)
  18384. }
  18385. },
  18386. clearTimer : function(A) {
  18387. A = A + "Timer";
  18388. clearTimeout(this[A]);
  18389. delete this[A]
  18390. },
  18391. clearTimers : function() {
  18392. this.clearTimer("show");
  18393. this.clearTimer("dismiss");
  18394. this.clearTimer("hide")
  18395. },
  18396. onShow : function() {
  18397. Ext.ToolTip.superclass.onShow.call(this);
  18398. Ext.getDoc().on("mousedown", this.onDocMouseDown, this)
  18399. },
  18400. onHide : function() {
  18401. Ext.ToolTip.superclass.onHide.call(this);
  18402. Ext.getDoc().un("mousedown", this.onDocMouseDown, this)
  18403. },
  18404. onDocMouseDown : function(A) {
  18405. if (this.autoHide !== false && !A.within(this.el.dom)) {
  18406. this.disable();
  18407. this.enable.defer(100, this)
  18408. }
  18409. },
  18410. onDisable : function() {
  18411. this.clearTimers();
  18412. this.hide()
  18413. },
  18414. adjustPosition : function(A, D) {
  18415. var C = this.targetXY[1], B = this.getSize().height;
  18416. if (this.constrainPosition && D <= C && (D + B) >= C) {
  18417. D = C - B - 5
  18418. }
  18419. return {
  18420. x : A,
  18421. y : D
  18422. }
  18423. },
  18424. onDestroy : function() {
  18425. Ext.ToolTip.superclass.onDestroy.call(this);
  18426. if (this.target) {
  18427. this.target.un("mouseover", this.onTargetOver, this);
  18428. this.target.un("mouseout", this.onTargetOut, this);
  18429. this.target.un("mousemove", this.onMouseMove, this)
  18430. }
  18431. }
  18432. });
  18433. Ext.QuickTip = Ext.extend(Ext.ToolTip, {
  18434. interceptTitles : false,
  18435. tagConfig : {
  18436. namespace : "ext",
  18437. attribute : "qtip",
  18438. width : "qwidth",
  18439. target : "target",
  18440. title : "qtitle",
  18441. hide : "hide",
  18442. cls : "qclass",
  18443. align : "qalign"
  18444. },
  18445. initComponent : function() {
  18446. this.target = this.target || Ext.getDoc();
  18447. this.targets = this.targets || {};
  18448. Ext.QuickTip.superclass.initComponent.call(this)
  18449. },
  18450. register : function(D) {
  18451. var F = Ext.isArray(D) ? D : arguments;
  18452. for (var E = 0, A = F.length; E < A; E++) {
  18453. var H = F[E];
  18454. var G = H.target;
  18455. if (G) {
  18456. if (Ext.isArray(G)) {
  18457. for (var C = 0, B = G.length; C < B; C++) {
  18458. this.targets[Ext.id(G[C])] = H
  18459. }
  18460. } else {
  18461. this.targets[Ext.id(G)] = H
  18462. }
  18463. }
  18464. }
  18465. },
  18466. unregister : function(A) {
  18467. delete this.targets[Ext.id(A)]
  18468. },
  18469. onTargetOver : function(G) {
  18470. if (this.disabled) {
  18471. return
  18472. }
  18473. this.targetXY = G.getXY();
  18474. var C = G.getTarget();
  18475. if (!C || C.nodeType !== 1 || C == document
  18476. || C == document.body) {
  18477. return
  18478. }
  18479. if (this.activeTarget && C == this.activeTarget.el) {
  18480. this.clearTimer("hide");
  18481. this.show();
  18482. return
  18483. }
  18484. if (C && this.targets[C.id]) {
  18485. this.activeTarget = this.targets[C.id];
  18486. this.activeTarget.el = C;
  18487. this.delayShow();
  18488. return
  18489. }
  18490. var E, F = Ext.fly(C), B = this.tagConfig;
  18491. var D = B.namespace;
  18492. if (this.interceptTitles && C.title) {
  18493. E = C.title;
  18494. C.qtip = E;
  18495. C.removeAttribute("title");
  18496. G.preventDefault()
  18497. } else {
  18498. E = C.qtip || F.getAttributeNS(D, B.attribute)
  18499. }
  18500. if (E) {
  18501. var A = F.getAttributeNS(D, B.hide);
  18502. this.activeTarget = {
  18503. el : C,
  18504. text : E,
  18505. width : F.getAttributeNS(D, B.width),
  18506. autoHide : A != "user" && A !== "false",
  18507. title : F.getAttributeNS(D, B.title),
  18508. cls : F.getAttributeNS(D, B.cls),
  18509. align : F.getAttributeNS(D, B.align)
  18510. };
  18511. this.delayShow()
  18512. }
  18513. },
  18514. onTargetOut : function(A) {
  18515. this.clearTimer("show");
  18516. if (this.autoHide !== false) {
  18517. this.delayHide()
  18518. }
  18519. },
  18520. showAt : function(B) {
  18521. var A = this.activeTarget;
  18522. if (A) {
  18523. if (!this.rendered) {
  18524. this.render(Ext.getBody());
  18525. this.activeTarget = A
  18526. }
  18527. if (A.width) {
  18528. this.setWidth(A.width);
  18529. this.body.setWidth(this.adjustBodyWidth(A.width
  18530. - this.getFrameWidth()));
  18531. this.measureWidth = false
  18532. } else {
  18533. this.measureWidth = true
  18534. }
  18535. this.setTitle(A.title || "");
  18536. this.body.update(A.text);
  18537. this.autoHide = A.autoHide;
  18538. this.dismissDelay = A.dismissDelay || this.dismissDelay;
  18539. if (this.lastCls) {
  18540. this.el.removeClass(this.lastCls);
  18541. delete this.lastCls
  18542. }
  18543. if (A.cls) {
  18544. this.el.addClass(A.cls);
  18545. this.lastCls = A.cls
  18546. }
  18547. if (A.align) {
  18548. B = this.el.getAlignToXY(A.el, A.align);
  18549. this.constrainPosition = false
  18550. } else {
  18551. this.constrainPosition = true
  18552. }
  18553. }
  18554. Ext.QuickTip.superclass.showAt.call(this, B)
  18555. },
  18556. hide : function() {
  18557. delete this.activeTarget;
  18558. Ext.QuickTip.superclass.hide.call(this)
  18559. }
  18560. });
  18561. Ext.QuickTips = function() {
  18562. var B, A = [];
  18563. return {
  18564. init : function() {
  18565. if (!B) {
  18566. B = new Ext.QuickTip({
  18567. elements : "header,body"
  18568. })
  18569. }
  18570. },
  18571. enable : function() {
  18572. if (B) {
  18573. A.pop();
  18574. if (A.length < 1) {
  18575. B.enable()
  18576. }
  18577. }
  18578. },
  18579. disable : function() {
  18580. if (B) {
  18581. B.disable()
  18582. }
  18583. A.push(1)
  18584. },
  18585. isEnabled : function() {
  18586. return B && !B.disabled
  18587. },
  18588. getQuickTip : function() {
  18589. return B
  18590. },
  18591. register : function() {
  18592. B.register.apply(B, arguments)
  18593. },
  18594. unregister : function() {
  18595. B.unregister.apply(B, arguments)
  18596. },
  18597. tips : function() {
  18598. B.register.apply(B, arguments)
  18599. }
  18600. }
  18601. }();
  18602. Ext.tree.TreePanel = Ext.extend(Ext.Panel, {
  18603. rootVisible : true,
  18604. animate : Ext.enableFx,
  18605. lines : true,
  18606. enableDD : false,
  18607. hlDrop : Ext.enableFx,
  18608. pathSeparator : "/",
  18609. initComponent : function() {
  18610. Ext.tree.TreePanel.superclass.initComponent.call(this);
  18611. if (!this.eventModel) {
  18612. this.eventModel = new Ext.tree.TreeEventModel(this)
  18613. }
  18614. this.nodeHash = {};
  18615. if (this.root) {
  18616. this.setRootNode(this.root)
  18617. }
  18618. this.addEvents("append", "remove", "movenode", "insert",
  18619. "beforeappend", "beforeremove", "beforemovenode",
  18620. "beforeinsert", "beforeload", "load", "textchange",
  18621. "beforeexpandnode", "beforecollapsenode", "expandnode",
  18622. "disabledchange", "collapsenode", "beforeclick",
  18623. "click", "checkchange", "dblclick", "contextmenu",
  18624. "beforechildrenrendered", "startdrag", "enddrag",
  18625. "dragdrop", "beforenodedrop", "nodedrop",
  18626. "nodedragover");
  18627. if (this.singleExpand) {
  18628. this.on("beforeexpandnode", this.restrictExpand, this)
  18629. }
  18630. },
  18631. proxyNodeEvent : function(C, B, A, G, F, E, D) {
  18632. if (C == "collapse" || C == "expand" || C == "beforecollapse"
  18633. || C == "beforeexpand" || C == "move"
  18634. || C == "beforemove") {
  18635. C = C + "node"
  18636. }
  18637. return this.fireEvent(C, B, A, G, F, E, D)
  18638. },
  18639. getRootNode : function() {
  18640. return this.root
  18641. },
  18642. setRootNode : function(B) {
  18643. this.root = B;
  18644. B.ownerTree = this;
  18645. B.isRoot = true;
  18646. this.registerNode(B);
  18647. if (!this.rootVisible) {
  18648. var A = B.attributes.uiProvider;
  18649. B.ui = A ? new A(B) : new Ext.tree.RootTreeNodeUI(B)
  18650. }
  18651. return B
  18652. },
  18653. getNodeById : function(A) {
  18654. return this.nodeHash[A]
  18655. },
  18656. registerNode : function(A) {
  18657. this.nodeHash[A.id] = A
  18658. },
  18659. unregisterNode : function(A) {
  18660. delete this.nodeHash[A.id]
  18661. },
  18662. toString : function() {
  18663. return "[Tree" + (this.id ? " " + this.id : "") + "]"
  18664. },
  18665. restrictExpand : function(A) {
  18666. var B = A.parentNode;
  18667. if (B) {
  18668. if (B.expandedChild && B.expandedChild.parentNode == B) {
  18669. B.expandedChild.collapse()
  18670. }
  18671. B.expandedChild = A
  18672. }
  18673. },
  18674. getChecked : function(A, B) {
  18675. B = B || this.root;
  18676. var C = [];
  18677. var D = function() {
  18678. if (this.attributes.checked) {
  18679. C.push(!A ? this : (A == "id"
  18680. ? this.id
  18681. : this.attributes[A]))
  18682. }
  18683. };
  18684. B.cascade(D);
  18685. return C
  18686. },
  18687. getEl : function() {
  18688. return this.el
  18689. },
  18690. getLoader : function() {
  18691. return this.loader
  18692. },
  18693. expandAll : function() {
  18694. this.root.expand(true)
  18695. },
  18696. collapseAll : function() {
  18697. this.root.collapse(true)
  18698. },
  18699. getSelectionModel : function() {
  18700. if (!this.selModel) {
  18701. this.selModel = new Ext.tree.DefaultSelectionModel()
  18702. }
  18703. return this.selModel
  18704. },
  18705. expandPath : function(F, A, G) {
  18706. A = A || "id";
  18707. var D = F.split(this.pathSeparator);
  18708. var C = this.root;
  18709. if (C.attributes[A] != D[1]) {
  18710. if (G) {
  18711. G(false, null)
  18712. }
  18713. return
  18714. }
  18715. var B = 1;
  18716. var E = function() {
  18717. if (++B == D.length) {
  18718. if (G) {
  18719. G(true, C)
  18720. }
  18721. return
  18722. }
  18723. var H = C.findChild(A, D[B]);
  18724. if (!H) {
  18725. if (G) {
  18726. G(false, C)
  18727. }
  18728. return
  18729. }
  18730. C = H;
  18731. H.expand(false, false, E)
  18732. };
  18733. C.expand(false, false, E)
  18734. },
  18735. selectPath : function(E, A, F) {
  18736. A = A || "id";
  18737. var C = E.split(this.pathSeparator);
  18738. var B = C.pop();
  18739. if (C.length > 0) {
  18740. var D = function(H, G) {
  18741. if (H && G) {
  18742. var I = G.findChild(A, B);
  18743. if (I) {
  18744. I.select();
  18745. if (F) {
  18746. F(true, I)
  18747. }
  18748. } else {
  18749. if (F) {
  18750. F(false, I)
  18751. }
  18752. }
  18753. } else {
  18754. if (F) {
  18755. F(false, I)
  18756. }
  18757. }
  18758. };
  18759. this.expandPath(C.join(this.pathSeparator), A, D)
  18760. } else {
  18761. this.root.select();
  18762. if (F) {
  18763. F(true, this.root)
  18764. }
  18765. }
  18766. },
  18767. getTreeEl : function() {
  18768. return this.body
  18769. },
  18770. onRender : function(B, A) {
  18771. Ext.tree.TreePanel.superclass.onRender.call(this, B, A);
  18772. this.el.addClass("x-tree");
  18773. this.innerCt = this.body.createChild({
  18774. tag : "ul",
  18775. cls : "x-tree-root-ct "
  18776. + (this.useArrows
  18777. ? "x-tree-arrows"
  18778. : this.lines
  18779. ? "x-tree-lines"
  18780. : "x-tree-no-lines")
  18781. })
  18782. },
  18783. initEvents : function() {
  18784. Ext.tree.TreePanel.superclass.initEvents.call(this);
  18785. if (this.containerScroll) {
  18786. Ext.dd.ScrollManager.register(this.body)
  18787. }
  18788. if ((this.enableDD || this.enableDrop) && !this.dropZone) {
  18789. this.dropZone = new Ext.tree.TreeDropZone(this,
  18790. this.dropConfig || {
  18791. ddGroup : this.ddGroup || "TreeDD",
  18792. appendOnly : this.ddAppendOnly === true
  18793. })
  18794. }
  18795. if ((this.enableDD || this.enableDrag) && !this.dragZone) {
  18796. this.dragZone = new Ext.tree.TreeDragZone(this,
  18797. this.dragConfig || {
  18798. ddGroup : this.ddGroup || "TreeDD",
  18799. scroll : this.ddScroll
  18800. })
  18801. }
  18802. this.getSelectionModel().init(this)
  18803. },
  18804. afterRender : function() {
  18805. Ext.tree.TreePanel.superclass.afterRender.call(this);
  18806. this.root.render();
  18807. if (!this.rootVisible) {
  18808. this.root.renderChildren()
  18809. }
  18810. },
  18811. onDestroy : function() {
  18812. if (this.rendered) {
  18813. this.body.removeAllListeners();
  18814. Ext.dd.ScrollManager.unregister(this.body);
  18815. if (this.dropZone) {
  18816. this.dropZone.unreg()
  18817. }
  18818. if (this.dragZone) {
  18819. this.dragZone.unreg()
  18820. }
  18821. }
  18822. this.root.destroy();
  18823. this.nodeHash = null;
  18824. Ext.tree.TreePanel.superclass.onDestroy.call(this)
  18825. }
  18826. });
  18827. Ext.reg("treepanel", Ext.tree.TreePanel);
  18828. Ext.tree.TreeEventModel = function(A) {
  18829. this.tree = A;
  18830. this.tree.on("render", this.initEvents, this)
  18831. };
  18832. Ext.tree.TreeEventModel.prototype = {
  18833. initEvents : function() {
  18834. var A = this.tree.getTreeEl();
  18835. A.on("click", this.delegateClick, this);
  18836. if (this.tree.trackMouseOver !== false) {
  18837. A.on("mouseover", this.delegateOver, this);
  18838. A.on("mouseout", this.delegateOut, this)
  18839. }
  18840. A.on("dblclick", this.delegateDblClick, this);
  18841. A.on("contextmenu", this.delegateContextMenu, this)
  18842. },
  18843. getNode : function(B) {
  18844. var A;
  18845. if (A = B.getTarget(".x-tree-node-el", 10)) {
  18846. var C = Ext.fly(A, "_treeEvents").getAttributeNS("ext",
  18847. "tree-node-id");
  18848. if (C) {
  18849. return this.tree.getNodeById(C)
  18850. }
  18851. }
  18852. return null
  18853. },
  18854. getNodeTarget : function(B) {
  18855. var A = B.getTarget(".x-tree-node-icon", 1);
  18856. if (!A) {
  18857. A = B.getTarget(".x-tree-node-el", 6)
  18858. }
  18859. return A
  18860. },
  18861. delegateOut : function(B, A) {
  18862. if (!this.beforeEvent(B)) {
  18863. return
  18864. }
  18865. if (B.getTarget(".x-tree-ec-icon", 1)) {
  18866. var C = this.getNode(B);
  18867. this.onIconOut(B, C);
  18868. if (C == this.lastEcOver) {
  18869. delete this.lastEcOver
  18870. }
  18871. }
  18872. if ((A = this.getNodeTarget(B)) && !B.within(A, true)) {
  18873. this.onNodeOut(B, this.getNode(B))
  18874. }
  18875. },
  18876. delegateOver : function(B, A) {
  18877. if (!this.beforeEvent(B)) {
  18878. return
  18879. }
  18880. if (this.lastEcOver) {
  18881. this.onIconOut(B, this.lastEcOver);
  18882. delete this.lastEcOver
  18883. }
  18884. if (B.getTarget(".x-tree-ec-icon", 1)) {
  18885. this.lastEcOver = this.getNode(B);
  18886. this.onIconOver(B, this.lastEcOver)
  18887. }
  18888. if (A = this.getNodeTarget(B)) {
  18889. this.onNodeOver(B, this.getNode(B))
  18890. }
  18891. },
  18892. delegateClick : function(B, A) {
  18893. if (!this.beforeEvent(B)) {
  18894. return
  18895. }
  18896. if (B.getTarget("input[type=checkbox]", 1)) {
  18897. this.onCheckboxClick(B, this.getNode(B))
  18898. } else {
  18899. if (B.getTarget(".x-tree-ec-icon", 1)) {
  18900. this.onIconClick(B, this.getNode(B))
  18901. } else {
  18902. if (this.getNodeTarget(B)) {
  18903. this.onNodeClick(B, this.getNode(B))
  18904. }
  18905. }
  18906. }
  18907. },
  18908. delegateDblClick : function(B, A) {
  18909. if (this.beforeEvent(B) && this.getNodeTarget(B)) {
  18910. this.onNodeDblClick(B, this.getNode(B))
  18911. }
  18912. },
  18913. delegateContextMenu : function(B, A) {
  18914. if (this.beforeEvent(B) && this.getNodeTarget(B)) {
  18915. this.onNodeContextMenu(B, this.getNode(B))
  18916. }
  18917. },
  18918. onNodeClick : function(B, A) {
  18919. A.ui.onClick(B)
  18920. },
  18921. onNodeOver : function(B, A) {
  18922. A.ui.onOver(B)
  18923. },
  18924. onNodeOut : function(B, A) {
  18925. A.ui.onOut(B)
  18926. },
  18927. onIconOver : function(B, A) {
  18928. A.ui.addClass("x-tree-ec-over")
  18929. },
  18930. onIconOut : function(B, A) {
  18931. A.ui.removeClass("x-tree-ec-over")
  18932. },
  18933. onIconClick : function(B, A) {
  18934. A.ui.ecClick(B)
  18935. },
  18936. onCheckboxClick : function(B, A) {
  18937. A.ui.onCheckChange(B)
  18938. },
  18939. onNodeDblClick : function(B, A) {
  18940. A.ui.onDblClick(B)
  18941. },
  18942. onNodeContextMenu : function(B, A) {
  18943. A.ui.onContextMenu(B)
  18944. },
  18945. beforeEvent : function(A) {
  18946. if (this.disabled) {
  18947. A.stopEvent();
  18948. return false
  18949. }
  18950. return true
  18951. },
  18952. disable : function() {
  18953. this.disabled = true
  18954. },
  18955. enable : function() {
  18956. this.disabled = false
  18957. }
  18958. };
  18959. Ext.tree.DefaultSelectionModel = function(A) {
  18960. this.selNode = null;
  18961. this.addEvents("selectionchange", "beforeselect");
  18962. Ext.apply(this, A);
  18963. Ext.tree.DefaultSelectionModel.superclass.constructor.call(this)
  18964. };
  18965. Ext.extend(Ext.tree.DefaultSelectionModel, Ext.util.Observable, {
  18966. init : function(A) {
  18967. this.tree = A;
  18968. A.getTreeEl().on("keydown", this.onKeyDown, this);
  18969. A.on("click", this.onNodeClick, this)
  18970. },
  18971. onNodeClick : function(A, B) {
  18972. this.select(A)
  18973. },
  18974. select : function(B) {
  18975. var A = this.selNode;
  18976. if (A != B && this.fireEvent("beforeselect", this, B, A) !== false) {
  18977. if (A) {
  18978. A.ui.onSelectedChange(false)
  18979. }
  18980. this.selNode = B;
  18981. B.ui.onSelectedChange(true);
  18982. this.fireEvent("selectionchange", this, B, A)
  18983. }
  18984. return B
  18985. },
  18986. unselect : function(A) {
  18987. if (this.selNode == A) {
  18988. this.clearSelections()
  18989. }
  18990. },
  18991. clearSelections : function() {
  18992. var A = this.selNode;
  18993. if (A) {
  18994. A.ui.onSelectedChange(false);
  18995. this.selNode = null;
  18996. this.fireEvent("selectionchange", this, null)
  18997. }
  18998. return A
  18999. },
  19000. getSelectedNode : function() {
  19001. return this.selNode
  19002. },
  19003. isSelected : function(A) {
  19004. return this.selNode == A
  19005. },
  19006. selectPrevious : function() {
  19007. var A = this.selNode || this.lastSelNode;
  19008. if (!A) {
  19009. return null
  19010. }
  19011. var C = A.previousSibling;
  19012. if (C) {
  19013. if (!C.isExpanded() || C.childNodes.length < 1) {
  19014. return this.select(C)
  19015. } else {
  19016. var B = C.lastChild;
  19017. while (B && B.isExpanded() && B.childNodes.length > 0) {
  19018. B = B.lastChild
  19019. }
  19020. return this.select(B)
  19021. }
  19022. } else {
  19023. if (A.parentNode && (this.tree.rootVisible || !A.parentNode.isRoot)) {
  19024. return this.select(A.parentNode)
  19025. }
  19026. }
  19027. return null
  19028. },
  19029. selectNext : function() {
  19030. var B = this.selNode || this.lastSelNode;
  19031. if (!B) {
  19032. return null
  19033. }
  19034. if (B.firstChild && B.isExpanded()) {
  19035. return this.select(B.firstChild)
  19036. } else {
  19037. if (B.nextSibling) {
  19038. return this.select(B.nextSibling)
  19039. } else {
  19040. if (B.parentNode) {
  19041. var A = null;
  19042. B.parentNode.bubble(function() {
  19043. if (this.nextSibling) {
  19044. A = this.getOwnerTree().selModel
  19045. .select(this.nextSibling);
  19046. return false
  19047. }
  19048. });
  19049. return A
  19050. }
  19051. }
  19052. }
  19053. return null
  19054. },
  19055. onKeyDown : function(C) {
  19056. var B = this.selNode || this.lastSelNode;
  19057. var D = this;
  19058. if (!B) {
  19059. return
  19060. }
  19061. var A = C.getKey();
  19062. switch (A) {
  19063. case C.DOWN :
  19064. C.stopEvent();
  19065. this.selectNext();
  19066. break;
  19067. case C.UP :
  19068. C.stopEvent();
  19069. this.selectPrevious();
  19070. break;
  19071. case C.RIGHT :
  19072. C.preventDefault();
  19073. if (B.hasChildNodes()) {
  19074. if (!B.isExpanded()) {
  19075. B.expand()
  19076. } else {
  19077. if (B.firstChild) {
  19078. this.select(B.firstChild, C)
  19079. }
  19080. }
  19081. }
  19082. break;
  19083. case C.LEFT :
  19084. C.preventDefault();
  19085. if (B.hasChildNodes() && B.isExpanded()) {
  19086. B.collapse()
  19087. } else {
  19088. if (B.parentNode
  19089. && (this.tree.rootVisible || B.parentNode != this.tree
  19090. .getRootNode())) {
  19091. this.select(B.parentNode, C)
  19092. }
  19093. }
  19094. break
  19095. }
  19096. }
  19097. });
  19098. Ext.tree.MultiSelectionModel = function(A) {
  19099. this.selNodes = [];
  19100. this.selMap = {};
  19101. this.addEvents("selectionchange");
  19102. Ext.apply(this, A);
  19103. Ext.tree.MultiSelectionModel.superclass.constructor.call(this)
  19104. };
  19105. Ext.extend(Ext.tree.MultiSelectionModel, Ext.util.Observable, {
  19106. init : function(A) {
  19107. this.tree = A;
  19108. A.getTreeEl().on("keydown", this.onKeyDown, this);
  19109. A.on("click", this.onNodeClick, this)
  19110. },
  19111. onNodeClick : function(A, B) {
  19112. this.select(A, B, B.ctrlKey)
  19113. },
  19114. select : function(A, C, B) {
  19115. if (B !== true) {
  19116. this.clearSelections(true)
  19117. }
  19118. if (this.isSelected(A)) {
  19119. this.lastSelNode = A;
  19120. return A
  19121. }
  19122. this.selNodes.push(A);
  19123. this.selMap[A.id] = A;
  19124. this.lastSelNode = A;
  19125. A.ui.onSelectedChange(true);
  19126. this.fireEvent("selectionchange", this, this.selNodes);
  19127. return A
  19128. },
  19129. unselect : function(B) {
  19130. if (this.selMap[B.id]) {
  19131. B.ui.onSelectedChange(false);
  19132. var C = this.selNodes;
  19133. var A = C.indexOf(B);
  19134. if (A != -1) {
  19135. this.selNodes.splice(A, 1)
  19136. }
  19137. delete this.selMap[B.id];
  19138. this.fireEvent("selectionchange", this, this.selNodes)
  19139. }
  19140. },
  19141. clearSelections : function(B) {
  19142. var D = this.selNodes;
  19143. if (D.length > 0) {
  19144. for (var C = 0, A = D.length; C < A; C++) {
  19145. D[C].ui.onSelectedChange(false)
  19146. }
  19147. this.selNodes = [];
  19148. this.selMap = {};
  19149. if (B !== true) {
  19150. this.fireEvent("selectionchange", this, this.selNodes)
  19151. }
  19152. }
  19153. },
  19154. isSelected : function(A) {
  19155. return this.selMap[A.id] ? true : false
  19156. },
  19157. getSelectedNodes : function() {
  19158. return this.selNodes
  19159. },
  19160. onKeyDown : Ext.tree.DefaultSelectionModel.prototype.onKeyDown,
  19161. selectNext : Ext.tree.DefaultSelectionModel.prototype.selectNext,
  19162. selectPrevious : Ext.tree.DefaultSelectionModel.prototype.selectPrevious
  19163. });
  19164. Ext.tree.TreeNode = function(A) {
  19165. A = A || {};
  19166. if (typeof A == "string") {
  19167. A = {
  19168. text : A
  19169. }
  19170. }
  19171. this.childrenRendered = false;
  19172. this.rendered = false;
  19173. Ext.tree.TreeNode.superclass.constructor.call(this, A);
  19174. this.expanded = A.expanded === true;
  19175. this.isTarget = A.isTarget !== false;
  19176. this.draggable = A.draggable !== false && A.allowDrag !== false;
  19177. this.allowChildren = A.allowChildren !== false && A.allowDrop !== false;
  19178. this.text = A.text;
  19179. this.disabled = A.disabled === true;
  19180. this.addEvents("textchange", "beforeexpand", "beforecollapse", "expand",
  19181. "disabledchange", "collapse", "beforeclick", "click",
  19182. "checkchange", "dblclick", "contextmenu", "beforechildrenrendered");
  19183. var B = this.attributes.uiProvider || this.defaultUI || Ext.tree.TreeNodeUI;
  19184. this.ui = new B(this)
  19185. };
  19186. Ext.extend(Ext.tree.TreeNode, Ext.data.Node, {
  19187. preventHScroll : true,
  19188. isExpanded : function() {
  19189. return this.expanded
  19190. },
  19191. getUI : function() {
  19192. return this.ui
  19193. },
  19194. setFirstChild : function(A) {
  19195. var B = this.firstChild;
  19196. Ext.tree.TreeNode.superclass.setFirstChild.call(this, A);
  19197. if (this.childrenRendered && B && A != B) {
  19198. B.renderIndent(true, true)
  19199. }
  19200. if (this.rendered) {
  19201. this.renderIndent(true, true)
  19202. }
  19203. },
  19204. setLastChild : function(B) {
  19205. var A = this.lastChild;
  19206. Ext.tree.TreeNode.superclass.setLastChild.call(this, B);
  19207. if (this.childrenRendered && A && B != A) {
  19208. A.renderIndent(true, true)
  19209. }
  19210. if (this.rendered) {
  19211. this.renderIndent(true, true)
  19212. }
  19213. },
  19214. appendChild : function() {
  19215. var A = Ext.tree.TreeNode.superclass.appendChild.apply(this, arguments);
  19216. if (A && this.childrenRendered) {
  19217. A.render()
  19218. }
  19219. this.ui.updateExpandIcon();
  19220. return A
  19221. },
  19222. removeChild : function(A) {
  19223. this.ownerTree.getSelectionModel().unselect(A);
  19224. Ext.tree.TreeNode.superclass.removeChild.apply(this, arguments);
  19225. if (this.childrenRendered) {
  19226. A.ui.remove()
  19227. }
  19228. if (this.childNodes.length < 1) {
  19229. this.collapse(false, false)
  19230. } else {
  19231. this.ui.updateExpandIcon()
  19232. }
  19233. if (!this.firstChild && !this.isHiddenRoot()) {
  19234. this.childrenRendered = false
  19235. }
  19236. return A
  19237. },
  19238. insertBefore : function(C, A) {
  19239. var B = Ext.tree.TreeNode.superclass.insertBefore
  19240. .apply(this, arguments);
  19241. if (B && A && this.childrenRendered) {
  19242. C.render()
  19243. }
  19244. this.ui.updateExpandIcon();
  19245. return B
  19246. },
  19247. setText : function(B) {
  19248. var A = this.text;
  19249. this.text = B;
  19250. this.attributes.text = B;
  19251. if (this.rendered) {
  19252. this.ui.onTextChange(this, B, A)
  19253. }
  19254. this.fireEvent("textchange", this, B, A)
  19255. },
  19256. select : function() {
  19257. this.getOwnerTree().getSelectionModel().select(this)
  19258. },
  19259. unselect : function() {
  19260. this.getOwnerTree().getSelectionModel().unselect(this)
  19261. },
  19262. isSelected : function() {
  19263. return this.getOwnerTree().getSelectionModel().isSelected(this)
  19264. },
  19265. expand : function(A, B, C) {
  19266. if (!this.expanded) {
  19267. if (this.fireEvent("beforeexpand", this, A, B) === false) {
  19268. return
  19269. }
  19270. if (!this.childrenRendered) {
  19271. this.renderChildren()
  19272. }
  19273. this.expanded = true;
  19274. if (!this.isHiddenRoot()
  19275. && (this.getOwnerTree().animate && B !== false) || B) {
  19276. this.ui.animExpand(function() {
  19277. this.fireEvent("expand", this);
  19278. if (typeof C == "function") {
  19279. C(this)
  19280. }
  19281. if (A === true) {
  19282. this.expandChildNodes(true)
  19283. }
  19284. }.createDelegate(this));
  19285. return
  19286. } else {
  19287. this.ui.expand();
  19288. this.fireEvent("expand", this);
  19289. if (typeof C == "function") {
  19290. C(this)
  19291. }
  19292. }
  19293. } else {
  19294. if (typeof C == "function") {
  19295. C(this)
  19296. }
  19297. }
  19298. if (A === true) {
  19299. this.expandChildNodes(true)
  19300. }
  19301. },
  19302. isHiddenRoot : function() {
  19303. return this.isRoot && !this.getOwnerTree().rootVisible
  19304. },
  19305. collapse : function(B, E) {
  19306. if (this.expanded && !this.isHiddenRoot()) {
  19307. if (this.fireEvent("beforecollapse", this, B, E) === false) {
  19308. return
  19309. }
  19310. this.expanded = false;
  19311. if ((this.getOwnerTree().animate && E !== false) || E) {
  19312. this.ui.animCollapse(function() {
  19313. this.fireEvent("collapse", this);
  19314. if (B === true) {
  19315. this.collapseChildNodes(true)
  19316. }
  19317. }.createDelegate(this));
  19318. return
  19319. } else {
  19320. this.ui.collapse();
  19321. this.fireEvent("collapse", this)
  19322. }
  19323. }
  19324. if (B === true) {
  19325. var D = this.childNodes;
  19326. for (var C = 0, A = D.length; C < A; C++) {
  19327. D[C].collapse(true, false)
  19328. }
  19329. }
  19330. },
  19331. delayedExpand : function(A) {
  19332. if (!this.expandProcId) {
  19333. this.expandProcId = this.expand.defer(A, this)
  19334. }
  19335. },
  19336. cancelExpand : function() {
  19337. if (this.expandProcId) {
  19338. clearTimeout(this.expandProcId)
  19339. }
  19340. this.expandProcId = false
  19341. },
  19342. toggle : function() {
  19343. if (this.expanded) {
  19344. this.collapse()
  19345. } else {
  19346. this.expand()
  19347. }
  19348. },
  19349. ensureVisible : function(B) {
  19350. var A = this.getOwnerTree();
  19351. A.expandPath(this.parentNode.getPath(), false, function() {
  19352. var C = A.getNodeById(this.id);
  19353. A.getTreeEl().scrollChildIntoView(C.ui.anchor);
  19354. Ext.callback(B)
  19355. }.createDelegate(this))
  19356. },
  19357. expandChildNodes : function(B) {
  19358. var D = this.childNodes;
  19359. for (var C = 0, A = D.length; C < A; C++) {
  19360. D[C].expand(B)
  19361. }
  19362. },
  19363. collapseChildNodes : function(B) {
  19364. var D = this.childNodes;
  19365. for (var C = 0, A = D.length; C < A; C++) {
  19366. D[C].collapse(B)
  19367. }
  19368. },
  19369. disable : function() {
  19370. this.disabled = true;
  19371. this.unselect();
  19372. if (this.rendered && this.ui.onDisableChange) {
  19373. this.ui.onDisableChange(this, true)
  19374. }
  19375. this.fireEvent("disabledchange", this, true)
  19376. },
  19377. enable : function() {
  19378. this.disabled = false;
  19379. if (this.rendered && this.ui.onDisableChange) {
  19380. this.ui.onDisableChange(this, false)
  19381. }
  19382. this.fireEvent("disabledchange", this, false)
  19383. },
  19384. renderChildren : function(B) {
  19385. if (B !== false) {
  19386. this.fireEvent("beforechildrenrendered", this)
  19387. }
  19388. var D = this.childNodes;
  19389. for (var C = 0, A = D.length; C < A; C++) {
  19390. D[C].render(true)
  19391. }
  19392. this.childrenRendered = true
  19393. },
  19394. sort : function(E, D) {
  19395. Ext.tree.TreeNode.superclass.sort.apply(this, arguments);
  19396. if (this.childrenRendered) {
  19397. var C = this.childNodes;
  19398. for (var B = 0, A = C.length; B < A; B++) {
  19399. C[B].render(true)
  19400. }
  19401. }
  19402. },
  19403. render : function(A) {
  19404. this.ui.render(A);
  19405. if (!this.rendered) {
  19406. this.getOwnerTree().registerNode(this);
  19407. this.rendered = true;
  19408. if (this.expanded) {
  19409. this.expanded = false;
  19410. this.expand(false, false)
  19411. }
  19412. }
  19413. },
  19414. renderIndent : function(B, E) {
  19415. if (E) {
  19416. this.ui.childIndent = null
  19417. }
  19418. this.ui.renderIndent();
  19419. if (B === true && this.childrenRendered) {
  19420. var D = this.childNodes;
  19421. for (var C = 0, A = D.length; C < A; C++) {
  19422. D[C].renderIndent(true, E)
  19423. }
  19424. }
  19425. },
  19426. beginUpdate : function() {
  19427. this.childrenRendered = false
  19428. },
  19429. endUpdate : function() {
  19430. if (this.expanded) {
  19431. this.renderChildren()
  19432. }
  19433. },
  19434. destroy : function() {
  19435. for (var B = 0, A = this.childNodes.length; B < A; B++) {
  19436. this.childNodes[B].destroy()
  19437. }
  19438. this.childNodes = null;
  19439. if (this.ui.destroy) {
  19440. this.ui.destroy()
  19441. }
  19442. }
  19443. });
  19444. Ext.tree.AsyncTreeNode = function(A) {
  19445. this.loaded = false;
  19446. this.loading = false;
  19447. Ext.tree.AsyncTreeNode.superclass.constructor.apply(this, arguments);
  19448. this.addEvents("beforeload", "load")
  19449. };
  19450. Ext.extend(Ext.tree.AsyncTreeNode, Ext.tree.TreeNode, {
  19451. expand : function(B, D, F) {
  19452. if (this.loading) {
  19453. var E;
  19454. var C = function() {
  19455. if (!this.loading) {
  19456. clearInterval(E);
  19457. this.expand(B, D, F)
  19458. }
  19459. }.createDelegate(this);
  19460. E = setInterval(C, 200);
  19461. return
  19462. }
  19463. if (!this.loaded) {
  19464. if (this.fireEvent("beforeload", this) === false) {
  19465. return
  19466. }
  19467. this.loading = true;
  19468. this.ui.beforeLoad(this);
  19469. var A = this.loader || this.attributes.loader
  19470. || this.getOwnerTree().getLoader();
  19471. if (A) {
  19472. A.load(this, this.loadComplete.createDelegate(this, [B, D, F]));
  19473. return
  19474. }
  19475. }
  19476. Ext.tree.AsyncTreeNode.superclass.expand.call(this, B, D, F)
  19477. },
  19478. isLoading : function() {
  19479. return this.loading
  19480. },
  19481. loadComplete : function(A, B, C) {
  19482. this.loading = false;
  19483. this.loaded = true;
  19484. this.ui.afterLoad(this);
  19485. this.fireEvent("load", this);
  19486. this.expand(A, B, C)
  19487. },
  19488. isLoaded : function() {
  19489. return this.loaded
  19490. },
  19491. hasChildNodes : function() {
  19492. if (!this.isLeaf() && !this.loaded) {
  19493. return true
  19494. } else {
  19495. return Ext.tree.AsyncTreeNode.superclass.hasChildNodes.call(this)
  19496. }
  19497. },
  19498. reload : function(A) {
  19499. this.collapse(false, false);
  19500. while (this.firstChild) {
  19501. this.removeChild(this.firstChild)
  19502. }
  19503. this.childrenRendered = false;
  19504. this.loaded = false;
  19505. if (this.isHiddenRoot()) {
  19506. this.expanded = false
  19507. }
  19508. this.expand(false, false, A)
  19509. }
  19510. });
  19511. Ext.tree.TreeNodeUI = function(A) {
  19512. this.node = A;
  19513. this.rendered = false;
  19514. this.animating = false;
  19515. this.wasLeaf = true;
  19516. this.ecc = "x-tree-ec-icon x-tree-elbow";
  19517. this.emptyIcon = Ext.BLANK_IMAGE_URL
  19518. };
  19519. Ext.tree.TreeNodeUI.prototype = {
  19520. removeChild : function(A) {
  19521. if (this.rendered) {
  19522. this.ctNode.removeChild(A.ui.getEl())
  19523. }
  19524. },
  19525. beforeLoad : function() {
  19526. this.addClass("x-tree-node-loading")
  19527. },
  19528. afterLoad : function() {
  19529. this.removeClass("x-tree-node-loading")
  19530. },
  19531. onTextChange : function(B, C, A) {
  19532. if (this.rendered) {
  19533. this.textNode.innerHTML = C
  19534. }
  19535. },
  19536. onDisableChange : function(A, B) {
  19537. this.disabled = B;
  19538. if (this.checkbox) {
  19539. this.checkbox.disabled = B
  19540. }
  19541. if (B) {
  19542. this.addClass("x-tree-node-disabled")
  19543. } else {
  19544. this.removeClass("x-tree-node-disabled")
  19545. }
  19546. },
  19547. onSelectedChange : function(A) {
  19548. if (A) {
  19549. this.focus();
  19550. this.addClass("x-tree-selected")
  19551. } else {
  19552. this.removeClass("x-tree-selected")
  19553. }
  19554. },
  19555. onMove : function(A, G, E, F, D, B) {
  19556. this.childIndent = null;
  19557. if (this.rendered) {
  19558. var H = F.ui.getContainer();
  19559. if (!H) {
  19560. this.holder = document.createElement("div");
  19561. this.holder.appendChild(this.wrap);
  19562. return
  19563. }
  19564. var C = B ? B.ui.getEl() : null;
  19565. if (C) {
  19566. H.insertBefore(this.wrap, C)
  19567. } else {
  19568. H.appendChild(this.wrap)
  19569. }
  19570. this.node.renderIndent(true)
  19571. }
  19572. },
  19573. addClass : function(A) {
  19574. if (this.elNode) {
  19575. Ext.fly(this.elNode).addClass(A)
  19576. }
  19577. },
  19578. removeClass : function(A) {
  19579. if (this.elNode) {
  19580. Ext.fly(this.elNode).removeClass(A)
  19581. }
  19582. },
  19583. remove : function() {
  19584. if (this.rendered) {
  19585. this.holder = document.createElement("div");
  19586. this.holder.appendChild(this.wrap)
  19587. }
  19588. },
  19589. fireEvent : function() {
  19590. return this.node.fireEvent.apply(this.node, arguments)
  19591. },
  19592. initEvents : function() {
  19593. this.node.on("move", this.onMove, this);
  19594. if (this.node.disabled) {
  19595. this.addClass("x-tree-node-disabled");
  19596. if (this.checkbox) {
  19597. this.checkbox.disabled = true
  19598. }
  19599. }
  19600. if (this.node.hidden) {
  19601. this.hide()
  19602. }
  19603. var B = this.node.getOwnerTree();
  19604. var A = B.enableDD || B.enableDrag || B.enableDrop;
  19605. if (A && (!this.node.isRoot || B.rootVisible)) {
  19606. Ext.dd.Registry.register(this.elNode, {
  19607. node : this.node,
  19608. handles : this.getDDHandles(),
  19609. isHandle : false
  19610. })
  19611. }
  19612. },
  19613. getDDHandles : function() {
  19614. return [this.iconNode, this.textNode, this.elNode]
  19615. },
  19616. hide : function() {
  19617. this.node.hidden = true;
  19618. if (this.wrap) {
  19619. this.wrap.style.display = "none"
  19620. }
  19621. },
  19622. show : function() {
  19623. this.node.hidden = false;
  19624. if (this.wrap) {
  19625. this.wrap.style.display = ""
  19626. }
  19627. },
  19628. onContextMenu : function(A) {
  19629. if (this.node.hasListener("contextmenu")
  19630. || this.node.getOwnerTree().hasListener("contextmenu")) {
  19631. A.preventDefault();
  19632. this.focus();
  19633. this.fireEvent("contextmenu", this.node, A)
  19634. }
  19635. },
  19636. onClick : function(B) {
  19637. if (this.dropping) {
  19638. B.stopEvent();
  19639. return
  19640. }
  19641. if (this.fireEvent("beforeclick", this.node, B) !== false) {
  19642. var A = B.getTarget("a");
  19643. if (!this.disabled && this.node.attributes.href && A) {
  19644. this.fireEvent("click", this.node, B);
  19645. return
  19646. } else {
  19647. if (A && B.ctrlKey) {
  19648. B.stopEvent()
  19649. }
  19650. }
  19651. B.preventDefault();
  19652. if (this.disabled) {
  19653. return
  19654. }
  19655. if (this.node.attributes.singleClickExpand && !this.animating
  19656. && this.node.hasChildNodes()) {
  19657. this.node.toggle()
  19658. }
  19659. this.fireEvent("click", this.node, B)
  19660. } else {
  19661. B.stopEvent()
  19662. }
  19663. },
  19664. onDblClick : function(A) {
  19665. A.preventDefault();
  19666. if (this.disabled) {
  19667. return
  19668. }
  19669. if (this.checkbox) {
  19670. this.toggleCheck()
  19671. }
  19672. if (!this.animating && this.node.hasChildNodes()) {
  19673. this.node.toggle()
  19674. }
  19675. this.fireEvent("dblclick", this.node, A)
  19676. },
  19677. onOver : function(A) {
  19678. this.addClass("x-tree-node-over")
  19679. },
  19680. onOut : function(A) {
  19681. this.removeClass("x-tree-node-over")
  19682. },
  19683. onCheckChange : function() {
  19684. var A = this.checkbox.checked;
  19685. this.node.attributes.checked = A;
  19686. this.fireEvent("checkchange", this.node, A)
  19687. },
  19688. ecClick : function(A) {
  19689. if (!this.animating
  19690. && (this.node.hasChildNodes() || this.node.attributes.expandable)) {
  19691. this.node.toggle()
  19692. }
  19693. },
  19694. startDrop : function() {
  19695. this.dropping = true
  19696. },
  19697. endDrop : function() {
  19698. setTimeout(function() {
  19699. this.dropping = false
  19700. }.createDelegate(this), 50)
  19701. },
  19702. expand : function() {
  19703. this.updateExpandIcon();
  19704. this.ctNode.style.display = ""
  19705. },
  19706. focus : function() {
  19707. if (!this.node.preventHScroll) {
  19708. try {
  19709. this.anchor.focus()
  19710. } catch (C) {
  19711. }
  19712. } else {
  19713. if (!Ext.isIE) {
  19714. try {
  19715. var B = this.node.getOwnerTree().getTreeEl().dom;
  19716. var A = B.scrollLeft;
  19717. this.anchor.focus();
  19718. B.scrollLeft = A
  19719. } catch (C) {
  19720. }
  19721. }
  19722. }
  19723. },
  19724. toggleCheck : function(B) {
  19725. var A = this.checkbox;
  19726. if (A) {
  19727. A.checked = (B === undefined ? !A.checked : B)
  19728. }
  19729. },
  19730. blur : function() {
  19731. try {
  19732. this.anchor.blur()
  19733. } catch (A) {
  19734. }
  19735. },
  19736. animExpand : function(B) {
  19737. var A = Ext.get(this.ctNode);
  19738. A.stopFx();
  19739. if (!this.node.hasChildNodes()) {
  19740. this.updateExpandIcon();
  19741. this.ctNode.style.display = "";
  19742. Ext.callback(B);
  19743. return
  19744. }
  19745. this.animating = true;
  19746. this.updateExpandIcon();
  19747. A.slideIn("t", {
  19748. callback : function() {
  19749. this.animating = false;
  19750. Ext.callback(B)
  19751. },
  19752. scope : this,
  19753. duration : this.node.ownerTree.duration || 0.25
  19754. })
  19755. },
  19756. highlight : function() {
  19757. var A = this.node.getOwnerTree();
  19758. Ext.fly(this.wrap).highlight(A.hlColor || "C3DAF9", {
  19759. endColor : A.hlBaseColor
  19760. })
  19761. },
  19762. collapse : function() {
  19763. this.updateExpandIcon();
  19764. this.ctNode.style.display = "none"
  19765. },
  19766. animCollapse : function(B) {
  19767. var A = Ext.get(this.ctNode);
  19768. A.enableDisplayMode("block");
  19769. A.stopFx();
  19770. this.animating = true;
  19771. this.updateExpandIcon();
  19772. A.slideOut("t", {
  19773. callback : function() {
  19774. this.animating = false;
  19775. Ext.callback(B)
  19776. },
  19777. scope : this,
  19778. duration : this.node.ownerTree.duration || 0.25
  19779. })
  19780. },
  19781. getContainer : function() {
  19782. return this.ctNode
  19783. },
  19784. getEl : function() {
  19785. return this.wrap
  19786. },
  19787. appendDDGhost : function(A) {
  19788. A.appendChild(this.elNode.cloneNode(true))
  19789. },
  19790. getDDRepairXY : function() {
  19791. return Ext.lib.Dom.getXY(this.iconNode)
  19792. },
  19793. onRender : function() {
  19794. this.render()
  19795. },
  19796. render : function(B) {
  19797. var D = this.node, A = D.attributes;
  19798. var C = D.parentNode
  19799. ? D.parentNode.ui.getContainer()
  19800. : D.ownerTree.innerCt.dom;
  19801. if (!this.rendered) {
  19802. this.rendered = true;
  19803. this.renderElements(D, A, C, B);
  19804. if (A.qtip) {
  19805. if (this.textNode.setAttributeNS) {
  19806. this.textNode.setAttributeNS("ext", "qtip", A.qtip);
  19807. if (A.qtipTitle) {
  19808. this.textNode.setAttributeNS("ext", "qtitle",
  19809. A.qtipTitle)
  19810. }
  19811. } else {
  19812. this.textNode.setAttribute("ext:qtip", A.qtip);
  19813. if (A.qtipTitle) {
  19814. this.textNode.setAttribute("ext:qtitle", A.qtipTitle)
  19815. }
  19816. }
  19817. } else {
  19818. if (A.qtipCfg) {
  19819. A.qtipCfg.target = Ext.id(this.textNode);
  19820. Ext.QuickTips.register(A.qtipCfg)
  19821. }
  19822. }
  19823. this.initEvents();
  19824. if (!this.node.expanded) {
  19825. this.updateExpandIcon(true)
  19826. }
  19827. } else {
  19828. if (B === true) {
  19829. C.appendChild(this.wrap)
  19830. }
  19831. }
  19832. },
  19833. renderElements : function(D, I, H, J) {
  19834. this.indentMarkup = D.parentNode
  19835. ? D.parentNode.ui.getChildIndent()
  19836. : "";
  19837. var E = typeof I.checked == "boolean";
  19838. var B = I.href ? I.href : Ext.isGecko ? "" : "#";
  19839. var C = [
  19840. "<li class=\"x-tree-node\"><div ext:tree-node-id=\"",
  19841. D.id,
  19842. "\" class=\"x-tree-node-el x-tree-node-leaf x-unselectable ",
  19843. I.cls,
  19844. "\" unselectable=\"on\">",
  19845. "<span class=\"x-tree-node-indent\">",
  19846. this.indentMarkup,
  19847. "</span>",
  19848. "<img src=\"",
  19849. this.emptyIcon,
  19850. "\" class=\"x-tree-ec-icon x-tree-elbow\" />",
  19851. "<img src=\"",
  19852. I.icon || this.emptyIcon,
  19853. "\" class=\"x-tree-node-icon",
  19854. (I.icon ? " x-tree-node-inline-icon" : ""),
  19855. (I.iconCls ? " " + I.iconCls : ""),
  19856. "\" unselectable=\"on\" />",
  19857. E
  19858. ? ("<input class=\"x-tree-node-cb\" type=\"checkbox\" " + (I.checked
  19859. ? "checked=\"checked\" />"
  19860. : "/>"))
  19861. : "",
  19862. "<a hidefocus=\"on\" class=\"x-tree-node-anchor\" href=\"", B,
  19863. "\" tabIndex=\"1\" ",
  19864. I.hrefTarget ? " target=\"" + I.hrefTarget + "\"" : "",
  19865. "><span unselectable=\"on\">", D.text, "</span></a></div>",
  19866. "<ul class=\"x-tree-node-ct\" style=\"display:none;\"></ul>",
  19867. "</li>"].join("");
  19868. var A;
  19869. if (J !== true && D.nextSibling && (A = D.nextSibling.ui.getEl())) {
  19870. this.wrap = Ext.DomHelper.insertHtml("beforeBegin", A, C)
  19871. } else {
  19872. this.wrap = Ext.DomHelper.insertHtml("beforeEnd", H, C)
  19873. }
  19874. this.elNode = this.wrap.childNodes[0];
  19875. this.ctNode = this.wrap.childNodes[1];
  19876. var G = this.elNode.childNodes;
  19877. this.indentNode = G[0];
  19878. this.ecNode = G[1];
  19879. this.iconNode = G[2];
  19880. var F = 3;
  19881. if (E) {
  19882. this.checkbox = G[3];
  19883. F++
  19884. }
  19885. this.anchor = G[F];
  19886. this.textNode = G[F].firstChild
  19887. },
  19888. getAnchor : function() {
  19889. return this.anchor
  19890. },
  19891. getTextEl : function() {
  19892. return this.textNode
  19893. },
  19894. getIconEl : function() {
  19895. return this.iconNode
  19896. },
  19897. isChecked : function() {
  19898. return this.checkbox ? this.checkbox.checked : false
  19899. },
  19900. updateExpandIcon : function() {
  19901. if (this.rendered) {
  19902. var F = this.node, D, C;
  19903. var A = F.isLast() ? "x-tree-elbow-end" : "x-tree-elbow";
  19904. var E = F.hasChildNodes();
  19905. if (E || F.attributes.expandable) {
  19906. if (F.expanded) {
  19907. A += "-minus";
  19908. D = "x-tree-node-collapsed";
  19909. C = "x-tree-node-expanded"
  19910. } else {
  19911. A += "-plus";
  19912. D = "x-tree-node-expanded";
  19913. C = "x-tree-node-collapsed"
  19914. }
  19915. if (this.wasLeaf) {
  19916. this.removeClass("x-tree-node-leaf");
  19917. this.wasLeaf = false
  19918. }
  19919. if (this.c1 != D || this.c2 != C) {
  19920. Ext.fly(this.elNode).replaceClass(D, C);
  19921. this.c1 = D;
  19922. this.c2 = C
  19923. }
  19924. } else {
  19925. if (!this.wasLeaf) {
  19926. Ext.fly(this.elNode).replaceClass("x-tree-node-expanded",
  19927. "x-tree-node-leaf");
  19928. delete this.c1;
  19929. delete this.c2;
  19930. this.wasLeaf = true
  19931. }
  19932. }
  19933. var B = "x-tree-ec-icon " + A;
  19934. if (this.ecc != B) {
  19935. this.ecNode.className = B;
  19936. this.ecc = B
  19937. }
  19938. }
  19939. },
  19940. getChildIndent : function() {
  19941. if (!this.childIndent) {
  19942. var A = [];
  19943. var B = this.node;
  19944. while (B) {
  19945. if (!B.isRoot || (B.isRoot && B.ownerTree.rootVisible)) {
  19946. if (!B.isLast()) {
  19947. A.unshift("<img src=\"" + this.emptyIcon
  19948. + "\" class=\"x-tree-elbow-line\" />")
  19949. } else {
  19950. A.unshift("<img src=\"" + this.emptyIcon
  19951. + "\" class=\"x-tree-icon\" />")
  19952. }
  19953. }
  19954. B = B.parentNode
  19955. }
  19956. this.childIndent = A.join("")
  19957. }
  19958. return this.childIndent
  19959. },
  19960. renderIndent : function() {
  19961. if (this.rendered) {
  19962. var A = "";
  19963. var B = this.node.parentNode;
  19964. if (B) {
  19965. A = B.ui.getChildIndent()
  19966. }
  19967. if (this.indentMarkup != A) {
  19968. this.indentNode.innerHTML = A;
  19969. this.indentMarkup = A
  19970. }
  19971. this.updateExpandIcon()
  19972. }
  19973. },
  19974. destroy : function() {
  19975. if (this.elNode) {
  19976. Ext.dd.Registry.unregister(this.elNode.id)
  19977. }
  19978. delete this.elNode;
  19979. delete this.ctNode;
  19980. delete this.indentNode;
  19981. delete this.ecNode;
  19982. delete this.iconNode;
  19983. delete this.checkbox;
  19984. delete this.anchor;
  19985. delete this.textNode;
  19986. Ext.removeNode(this.ctNode)
  19987. }
  19988. };
  19989. Ext.tree.RootTreeNodeUI = Ext.extend(Ext.tree.TreeNodeUI, {
  19990. render : function() {
  19991. if (!this.rendered) {
  19992. var A = this.node.ownerTree.innerCt.dom;
  19993. this.node.expanded = true;
  19994. A.innerHTML = "<div class=\"x-tree-root-node\"></div>";
  19995. this.wrap = this.ctNode = A.firstChild
  19996. }
  19997. },
  19998. collapse : Ext.emptyFn,
  19999. expand : Ext.emptyFn
  20000. });
  20001. Ext.tree.TreeLoader = function(A) {
  20002. this.baseParams = {};
  20003. this.requestMethod = "POST";
  20004. Ext.apply(this, A);
  20005. this.addEvents("beforeload", "load", "loadexception");
  20006. Ext.tree.TreeLoader.superclass.constructor.call(this)
  20007. };
  20008. Ext.extend(Ext.tree.TreeLoader, Ext.util.Observable, {
  20009. uiProviders : {},
  20010. clearOnLoad : true,
  20011. load : function(A, B) {
  20012. if (this.clearOnLoad) {
  20013. while (A.firstChild) {
  20014. A.removeChild(A.firstChild)
  20015. }
  20016. }
  20017. if (this.doPreload(A)) {
  20018. if (typeof B == "function") {
  20019. B()
  20020. }
  20021. } else {
  20022. if (this.dataUrl || this.url) {
  20023. this.requestData(A, B)
  20024. }
  20025. }
  20026. },
  20027. doPreload : function(D) {
  20028. if (D.attributes.children) {
  20029. if (D.childNodes.length < 1) {
  20030. var C = D.attributes.children;
  20031. D.beginUpdate();
  20032. for (var B = 0, A = C.length; B < A; B++) {
  20033. var E = D.appendChild(this.createNode(C[B]));
  20034. if (this.preloadChildren) {
  20035. this.doPreload(E)
  20036. }
  20037. }
  20038. D.endUpdate()
  20039. }
  20040. return true
  20041. } else {
  20042. return false
  20043. }
  20044. },
  20045. getParams : function(D) {
  20046. var A = [], C = this.baseParams;
  20047. for (var B in C) {
  20048. if (typeof C[B] != "function") {
  20049. A.push(encodeURIComponent(B), "=",
  20050. encodeURIComponent(C[B]), "&")
  20051. }
  20052. }
  20053. A.push("node=", encodeURIComponent(D.id));
  20054. return A.join("")
  20055. },
  20056. requestData : function(A, B) {
  20057. if (this.fireEvent("beforeload", this, A, B) !== false) {
  20058. this.transId = Ext.Ajax.request({
  20059. method : this.requestMethod,
  20060. url : this.dataUrl || this.url,
  20061. success : this.handleResponse,
  20062. failure : this.handleFailure,
  20063. scope : this,
  20064. argument : {
  20065. callback : B,
  20066. node : A
  20067. },
  20068. params : this.getParams(A)
  20069. })
  20070. } else {
  20071. if (typeof B == "function") {
  20072. B()
  20073. }
  20074. }
  20075. },
  20076. isLoading : function() {
  20077. return this.transId ? true : false
  20078. },
  20079. abort : function() {
  20080. if (this.isLoading()) {
  20081. Ext.Ajax.abort(this.transId)
  20082. }
  20083. },
  20084. createNode : function(attr) {
  20085. if (this.baseAttrs) {
  20086. Ext.applyIf(attr, this.baseAttrs)
  20087. }
  20088. if (this.applyLoader !== false) {
  20089. attr.loader = this
  20090. }
  20091. if (typeof attr.uiProvider == "string") {
  20092. attr.uiProvider = this.uiProviders[attr.uiProvider]
  20093. || eval(attr.uiProvider)
  20094. }
  20095. return (attr.leaf
  20096. ? new Ext.tree.TreeNode(attr)
  20097. : new Ext.tree.AsyncTreeNode(attr))
  20098. },
  20099. processResponse : function(response, node, callback) {
  20100. var json = response.responseText;
  20101. try {
  20102. var o = eval("(" + json + ")");
  20103. node.beginUpdate();
  20104. for (var i = 0, len = o.length; i < len; i++) {
  20105. var n = this.createNode(o[i]);
  20106. if (n) {
  20107. node.appendChild(n)
  20108. }
  20109. }
  20110. node.endUpdate();
  20111. if (typeof callback == "function") {
  20112. callback(this, node)
  20113. }
  20114. } catch (e) {
  20115. this.handleFailure(response)
  20116. }
  20117. },
  20118. handleResponse : function(B) {
  20119. this.transId = false;
  20120. var A = B.argument;
  20121. this.processResponse(B, A.node, A.callback);
  20122. this.fireEvent("load", this, A.node, B)
  20123. },
  20124. handleFailure : function(B) {
  20125. this.transId = false;
  20126. var A = B.argument;
  20127. this.fireEvent("loadexception", this, A.node, B);
  20128. if (typeof A.callback == "function") {
  20129. A.callback(this, A.node)
  20130. }
  20131. }
  20132. });
  20133. Ext.tree.TreeFilter = function(A, B) {
  20134. this.tree = A;
  20135. this.filtered = {};
  20136. Ext.apply(this, B)
  20137. };
  20138. Ext.tree.TreeFilter.prototype = {
  20139. clearBlank : false,
  20140. reverse : false,
  20141. autoClear : false,
  20142. remove : false,
  20143. filter : function(D, A, B) {
  20144. A = A || "text";
  20145. var C;
  20146. if (typeof D == "string") {
  20147. var E = D.length;
  20148. if (E == 0 && this.clearBlank) {
  20149. this.clear();
  20150. return
  20151. }
  20152. D = D.toLowerCase();
  20153. C = function(F) {
  20154. return F.attributes[A].substr(0, E).toLowerCase() == D
  20155. }
  20156. } else {
  20157. if (D.exec) {
  20158. C = function(F) {
  20159. return D.test(F.attributes[A])
  20160. }
  20161. } else {
  20162. throw "Illegal filter type, must be string or regex"
  20163. }
  20164. }
  20165. this.filterBy(C, null, B)
  20166. },
  20167. filterBy : function(D, C, B) {
  20168. B = B || this.tree.root;
  20169. if (this.autoClear) {
  20170. this.clear()
  20171. }
  20172. var A = this.filtered, H = this.reverse;
  20173. var E = function(J) {
  20174. if (J == B) {
  20175. return true
  20176. }
  20177. if (A[J.id]) {
  20178. return false
  20179. }
  20180. var I = D.call(C || J, J);
  20181. if (!I || H) {
  20182. A[J.id] = J;
  20183. J.ui.hide();
  20184. return false
  20185. }
  20186. return true
  20187. };
  20188. B.cascade(E);
  20189. if (this.remove) {
  20190. for (var G in A) {
  20191. if (typeof G != "function") {
  20192. var F = A[G];
  20193. if (F && F.parentNode) {
  20194. F.parentNode.removeChild(F)
  20195. }
  20196. }
  20197. }
  20198. }
  20199. },
  20200. clear : function() {
  20201. var B = this.tree;
  20202. var A = this.filtered;
  20203. for (var D in A) {
  20204. if (typeof D != "function") {
  20205. var C = A[D];
  20206. if (C) {
  20207. C.ui.show()
  20208. }
  20209. }
  20210. }
  20211. this.filtered = {}
  20212. }
  20213. };
  20214. Ext.tree.TreeSorter = function(B, C) {
  20215. Ext.apply(this, C);
  20216. B.on("beforechildrenrendered", this.doSort, this);
  20217. B.on("append", this.updateSort, this);
  20218. B.on("insert", this.updateSort, this);
  20219. B.on("textchange", this.updateSortParent, this);
  20220. var E = this.dir && this.dir.toLowerCase() == "desc";
  20221. var F = this.property || "text";
  20222. var G = this.sortType;
  20223. var A = this.folderSort;
  20224. var D = this.caseSensitive === true;
  20225. var H = this.leafAttr || "leaf";
  20226. this.sortFn = function(J, I) {
  20227. if (A) {
  20228. if (J.attributes[H] && !I.attributes[H]) {
  20229. return 1
  20230. }
  20231. if (!J.attributes[H] && I.attributes[H]) {
  20232. return -1
  20233. }
  20234. }
  20235. var L = G
  20236. ? G(J)
  20237. : (D ? J.attributes[F] : J.attributes[F].toUpperCase());
  20238. var K = G
  20239. ? G(I)
  20240. : (D ? I.attributes[F] : I.attributes[F].toUpperCase());
  20241. if (L < K) {
  20242. return E ? +1 : -1
  20243. } else {
  20244. if (L > K) {
  20245. return E ? -1 : +1
  20246. } else {
  20247. return 0
  20248. }
  20249. }
  20250. }
  20251. };
  20252. Ext.tree.TreeSorter.prototype = {
  20253. doSort : function(A) {
  20254. A.sort(this.sortFn)
  20255. },
  20256. compareNodes : function(B, A) {
  20257. return (B.text.toUpperCase() > A.text.toUpperCase() ? 1 : -1)
  20258. },
  20259. updateSort : function(A, B) {
  20260. if (B.childrenRendered) {
  20261. this.doSort.defer(1, this, [B])
  20262. }
  20263. },
  20264. updateSortParent : function(A) {
  20265. var B = A.parentNode;
  20266. if (B && B.childrenRendered) {
  20267. this.doSort.defer(1, this, [B])
  20268. }
  20269. }
  20270. };
  20271. if (Ext.dd.DropZone) {
  20272. Ext.tree.TreeDropZone = function(A, B) {
  20273. this.allowParentInsert = false;
  20274. this.allowContainerDrop = false;
  20275. this.appendOnly = false;
  20276. Ext.tree.TreeDropZone.superclass.constructor.call(this, A.innerCt, B);
  20277. this.tree = A;
  20278. this.dragOverData = {};
  20279. this.lastInsertClass = "x-tree-no-status"
  20280. };
  20281. Ext.extend(Ext.tree.TreeDropZone, Ext.dd.DropZone, {
  20282. ddGroup : "TreeDD",
  20283. expandDelay : 1000,
  20284. expandNode : function(A) {
  20285. if (A.hasChildNodes() && !A.isExpanded()) {
  20286. A.expand(false, null, this.triggerCacheRefresh
  20287. .createDelegate(this))
  20288. }
  20289. },
  20290. queueExpand : function(A) {
  20291. this.expandProcId = this.expandNode.defer(this.expandDelay,
  20292. this, [A])
  20293. },
  20294. cancelExpand : function() {
  20295. if (this.expandProcId) {
  20296. clearTimeout(this.expandProcId);
  20297. this.expandProcId = false
  20298. }
  20299. },
  20300. isValidDropPoint : function(A, I, G, D, C) {
  20301. if (!A || !C) {
  20302. return false
  20303. }
  20304. var E = A.node;
  20305. var F = C.node;
  20306. if (!(E && E.isTarget && I)) {
  20307. return false
  20308. }
  20309. if (I == "append" && E.allowChildren === false) {
  20310. return false
  20311. }
  20312. if ((I == "above" || I == "below")
  20313. && (E.parentNode && E.parentNode.allowChildren === false)) {
  20314. return false
  20315. }
  20316. if (F && (E == F || F.contains(E))) {
  20317. return false
  20318. }
  20319. var B = this.dragOverData;
  20320. B.tree = this.tree;
  20321. B.target = E;
  20322. B.data = C;
  20323. B.point = I;
  20324. B.source = G;
  20325. B.rawEvent = D;
  20326. B.dropNode = F;
  20327. B.cancel = false;
  20328. var H = this.tree.fireEvent("nodedragover", B);
  20329. return B.cancel === false && H !== false
  20330. },
  20331. getDropPoint : function(E, D, I) {
  20332. var J = D.node;
  20333. if (J.isRoot) {
  20334. return J.allowChildren !== false ? "append" : false
  20335. }
  20336. var B = D.ddel;
  20337. var K = Ext.lib.Dom.getY(B), G = K + B.offsetHeight;
  20338. var F = Ext.lib.Event.getPageY(E);
  20339. var H = J.allowChildren === false || J.isLeaf();
  20340. if (this.appendOnly || J.parentNode.allowChildren === false) {
  20341. return H ? false : "append"
  20342. }
  20343. var C = false;
  20344. if (!this.allowParentInsert) {
  20345. C = J.hasChildNodes() && J.isExpanded()
  20346. }
  20347. var A = (G - K) / (H ? 2 : 3);
  20348. if (F >= K && F < (K + A)) {
  20349. return "above"
  20350. } else {
  20351. if (!C && (H || F >= G - A && F <= G)) {
  20352. return "below"
  20353. } else {
  20354. return "append"
  20355. }
  20356. }
  20357. },
  20358. onNodeEnter : function(D, A, C, B) {
  20359. this.cancelExpand()
  20360. },
  20361. onNodeOver : function(B, G, F, E) {
  20362. var I = this.getDropPoint(F, B, G);
  20363. var C = B.node;
  20364. if (!this.expandProcId && I == "append"
  20365. && C.hasChildNodes() && !B.node.isExpanded()) {
  20366. this.queueExpand(C)
  20367. } else {
  20368. if (I != "append") {
  20369. this.cancelExpand()
  20370. }
  20371. }
  20372. var D = this.dropNotAllowed;
  20373. if (this.isValidDropPoint(B, I, G, F, E)) {
  20374. if (I) {
  20375. var A = B.ddel;
  20376. var H;
  20377. if (I == "above") {
  20378. D = B.node.isFirst()
  20379. ? "x-tree-drop-ok-above"
  20380. : "x-tree-drop-ok-between";
  20381. H = "x-tree-drag-insert-above"
  20382. } else {
  20383. if (I == "below") {
  20384. D = B.node.isLast()
  20385. ? "x-tree-drop-ok-below"
  20386. : "x-tree-drop-ok-between";
  20387. H = "x-tree-drag-insert-below"
  20388. } else {
  20389. D = "x-tree-drop-ok-append";
  20390. H = "x-tree-drag-append"
  20391. }
  20392. }
  20393. if (this.lastInsertClass != H) {
  20394. Ext.fly(A)
  20395. .replaceClass(this.lastInsertClass, H);
  20396. this.lastInsertClass = H
  20397. }
  20398. }
  20399. }
  20400. return D
  20401. },
  20402. onNodeOut : function(D, A, C, B) {
  20403. this.cancelExpand();
  20404. this.removeDropIndicators(D)
  20405. },
  20406. onNodeDrop : function(C, I, E, D) {
  20407. var H = this.getDropPoint(E, C, I);
  20408. var F = C.node;
  20409. F.ui.startDrop();
  20410. if (!this.isValidDropPoint(C, H, I, E, D)) {
  20411. F.ui.endDrop();
  20412. return false
  20413. }
  20414. var G = D.node
  20415. || (I.getTreeNode
  20416. ? I.getTreeNode(D, F, H, E)
  20417. : null);
  20418. var B = {
  20419. tree : this.tree,
  20420. target : F,
  20421. data : D,
  20422. point : H,
  20423. source : I,
  20424. rawEvent : E,
  20425. dropNode : G,
  20426. cancel : !G,
  20427. dropStatus : false
  20428. };
  20429. var A = this.tree.fireEvent("beforenodedrop", B);
  20430. if (A === false || B.cancel === true || !B.dropNode) {
  20431. F.ui.endDrop();
  20432. return B.dropStatus
  20433. }
  20434. F = B.target;
  20435. if (H == "append" && !F.isExpanded()) {
  20436. F.expand(false, null, function() {
  20437. this.completeDrop(B)
  20438. }.createDelegate(this))
  20439. } else {
  20440. this.completeDrop(B)
  20441. }
  20442. return true
  20443. },
  20444. completeDrop : function(G) {
  20445. var D = G.dropNode, E = G.point, C = G.target;
  20446. if (!Ext.isArray(D)) {
  20447. D = [D]
  20448. }
  20449. var F;
  20450. for (var B = 0, A = D.length; B < A; B++) {
  20451. F = D[B];
  20452. if (E == "above") {
  20453. C.parentNode.insertBefore(F, C)
  20454. } else {
  20455. if (E == "below") {
  20456. C.parentNode.insertBefore(F, C.nextSibling)
  20457. } else {
  20458. C.appendChild(F)
  20459. }
  20460. }
  20461. }
  20462. F.ui.focus();
  20463. if (this.tree.hlDrop) {
  20464. F.ui.highlight()
  20465. }
  20466. C.ui.endDrop();
  20467. this.tree.fireEvent("nodedrop", G)
  20468. },
  20469. afterNodeMoved : function(A, C, E, D, B) {
  20470. if (this.tree.hlDrop) {
  20471. B.ui.focus();
  20472. B.ui.highlight()
  20473. }
  20474. this.tree.fireEvent("nodedrop", this.tree, D, C, A, E)
  20475. },
  20476. getTree : function() {
  20477. return this.tree
  20478. },
  20479. removeDropIndicators : function(B) {
  20480. if (B && B.ddel) {
  20481. var A = B.ddel;
  20482. Ext.fly(A).removeClass(["x-tree-drag-insert-above",
  20483. "x-tree-drag-insert-below",
  20484. "x-tree-drag-append"]);
  20485. this.lastInsertClass = "_noclass"
  20486. }
  20487. },
  20488. beforeDragDrop : function(B, A, C) {
  20489. this.cancelExpand();
  20490. return true
  20491. },
  20492. afterRepair : function(A) {
  20493. if (A && Ext.enableFx) {
  20494. A.node.ui.highlight()
  20495. }
  20496. this.hideProxy()
  20497. }
  20498. })
  20499. };
  20500. if (Ext.dd.DragZone) {
  20501. Ext.tree.TreeDragZone = function(A, B) {
  20502. Ext.tree.TreeDragZone.superclass.constructor.call(this, A.getTreeEl(),
  20503. B);
  20504. this.tree = A
  20505. };
  20506. Ext.extend(Ext.tree.TreeDragZone, Ext.dd.DragZone, {
  20507. ddGroup : "TreeDD",
  20508. onBeforeDrag : function(A, B) {
  20509. var C = A.node;
  20510. return C && C.draggable && !C.disabled
  20511. },
  20512. onInitDrag : function(B) {
  20513. var A = this.dragData;
  20514. this.tree.getSelectionModel().select(A.node);
  20515. this.tree.eventModel.disable();
  20516. this.proxy.update("");
  20517. A.node.ui.appendDDGhost(this.proxy.ghost.dom);
  20518. this.tree.fireEvent("startdrag", this.tree, A.node, B)
  20519. },
  20520. getRepairXY : function(B, A) {
  20521. return A.node.ui.getDDRepairXY()
  20522. },
  20523. onEndDrag : function(A, B) {
  20524. this.tree.eventModel.enable.defer(100, this.tree.eventModel);
  20525. this.tree.fireEvent("enddrag", this.tree, A.node, B)
  20526. },
  20527. onValidDrop : function(A, B, C) {
  20528. this.tree
  20529. .fireEvent("dragdrop", this.tree, this.dragData.node, A, B);
  20530. this.hideProxy()
  20531. },
  20532. beforeInvalidDrop : function(A, C) {
  20533. var B = this.tree.getSelectionModel();
  20534. B.clearSelections();
  20535. B.select(this.dragData.node)
  20536. }
  20537. })
  20538. };
  20539. Ext.tree.TreeEditor = function(A, B) {
  20540. B = B || {};
  20541. var C = B.events ? B : new Ext.form.TextField(B);
  20542. Ext.tree.TreeEditor.superclass.constructor.call(this, C);
  20543. this.tree = A;
  20544. if (!A.rendered) {
  20545. A.on("render", this.initEditor, this)
  20546. } else {
  20547. this.initEditor(A)
  20548. }
  20549. };
  20550. Ext.extend(Ext.tree.TreeEditor, Ext.Editor, {
  20551. alignment : "l-l",
  20552. autoSize : false,
  20553. hideEl : false,
  20554. cls : "x-small-editor x-tree-editor",
  20555. shim : false,
  20556. shadow : "frame",
  20557. maxWidth : 250,
  20558. editDelay : 350,
  20559. initEditor : function(A) {
  20560. A.on("beforeclick", this.beforeNodeClick, this);
  20561. A.on("dblclick", this.onNodeDblClick, this);
  20562. this.on("complete", this.updateNode, this);
  20563. this.on("beforestartedit", this.fitToTree, this);
  20564. this.on("startedit", this.bindScroll, this, {
  20565. delay : 10
  20566. });
  20567. this.on("specialkey", this.onSpecialKey, this)
  20568. },
  20569. fitToTree : function(B, C) {
  20570. var E = this.tree.getTreeEl().dom, D = C.dom;
  20571. if (E.scrollLeft > D.offsetLeft) {
  20572. E.scrollLeft = D.offsetLeft
  20573. }
  20574. var A = Math.min(this.maxWidth, (E.clientWidth > 20
  20575. ? E.clientWidth
  20576. : E.offsetWidth)
  20577. - Math.max(0, D.offsetLeft - E.scrollLeft) - 5);
  20578. this.setSize(A, "")
  20579. },
  20580. triggerEdit : function(A, B) {
  20581. this.completeEdit();
  20582. if (A.attributes.editable !== false) {
  20583. this.editNode = A;
  20584. this.autoEditTimer = this.startEdit.defer(this.editDelay,
  20585. this, [A.ui.textNode, A.text]);
  20586. return false
  20587. }
  20588. },
  20589. bindScroll : function() {
  20590. this.tree.getTreeEl().on("scroll", this.cancelEdit, this)
  20591. },
  20592. beforeNodeClick : function(A, B) {
  20593. clearTimeout(this.autoEditTimer);
  20594. if (this.tree.getSelectionModel().isSelected(A)) {
  20595. B.stopEvent();
  20596. return this.triggerEdit(A)
  20597. }
  20598. },
  20599. onNodeDblClick : function(A, B) {
  20600. clearTimeout(this.autoEditTimer)
  20601. },
  20602. updateNode : function(A, B) {
  20603. this.tree.getTreeEl().un("scroll", this.cancelEdit, this);
  20604. this.editNode.setText(B)
  20605. },
  20606. onHide : function() {
  20607. Ext.tree.TreeEditor.superclass.onHide.call(this);
  20608. if (this.editNode) {
  20609. this.editNode.ui.focus.defer(50, this.editNode.ui)
  20610. }
  20611. },
  20612. onSpecialKey : function(C, B) {
  20613. var A = B.getKey();
  20614. if (A == B.ESC) {
  20615. B.stopEvent();
  20616. this.cancelEdit()
  20617. } else {
  20618. if (A == B.ENTER && !B.hasModifier()) {
  20619. B.stopEvent();
  20620. this.completeEdit()
  20621. }
  20622. }
  20623. }
  20624. });
  20625. Ext.menu.Menu = function(A) {
  20626. if (Ext.isArray(A)) {
  20627. A = {
  20628. items : A
  20629. }
  20630. }
  20631. Ext.apply(this, A);
  20632. this.id = this.id || Ext.id();
  20633. this.addEvents("beforeshow", "beforehide", "show", "hide", "click",
  20634. "mouseover", "mouseout", "itemclick");
  20635. Ext.menu.MenuMgr.register(this);
  20636. Ext.menu.Menu.superclass.constructor.call(this);
  20637. var B = this.items;
  20638. this.items = new Ext.util.MixedCollection();
  20639. if (B) {
  20640. this.add.apply(this, B)
  20641. }
  20642. };
  20643. Ext.extend(Ext.menu.Menu, Ext.util.Observable, {
  20644. minWidth : 120,
  20645. shadow : "sides",
  20646. subMenuAlign : "tl-tr?",
  20647. defaultAlign : "tl-bl?",
  20648. allowOtherMenus : false,
  20649. hidden : true,
  20650. createEl : function() {
  20651. return new Ext.Layer({
  20652. cls : "x-menu",
  20653. shadow : this.shadow,
  20654. constrain : false,
  20655. parentEl : this.parentEl || document.body,
  20656. zindex : 15000
  20657. })
  20658. },
  20659. render : function() {
  20660. if (this.el) {
  20661. return
  20662. }
  20663. var B = this.el = this.createEl();
  20664. if (!this.keyNav) {
  20665. this.keyNav = new Ext.menu.MenuNav(this)
  20666. }
  20667. if (this.plain) {
  20668. B.addClass("x-menu-plain")
  20669. }
  20670. if (this.cls) {
  20671. B.addClass(this.cls)
  20672. }
  20673. this.focusEl = B.createChild({
  20674. tag : "a",
  20675. cls : "x-menu-focus",
  20676. href : "#",
  20677. onclick : "return false;",
  20678. tabIndex : "-1"
  20679. });
  20680. var A = B.createChild({
  20681. tag : "ul",
  20682. cls : "x-menu-list"
  20683. });
  20684. A.on("click", this.onClick, this);
  20685. A.on("mouseover", this.onMouseOver, this);
  20686. A.on("mouseout", this.onMouseOut, this);
  20687. this.items.each(function(D) {
  20688. var C = document.createElement("li");
  20689. C.className = "x-menu-list-item";
  20690. A.dom.appendChild(C);
  20691. D.render(C, this)
  20692. }, this);
  20693. this.ul = A;
  20694. this.autoWidth()
  20695. },
  20696. autoWidth : function() {
  20697. var D = this.el, C = this.ul;
  20698. if (!D) {
  20699. return
  20700. }
  20701. var A = this.width;
  20702. if (A) {
  20703. D.setWidth(A)
  20704. } else {
  20705. if (Ext.isIE) {
  20706. D.setWidth(this.minWidth);
  20707. var B = D.dom.offsetWidth;
  20708. D.setWidth(C.getWidth() + D.getFrameWidth("lr"))
  20709. }
  20710. }
  20711. },
  20712. delayAutoWidth : function() {
  20713. if (this.el) {
  20714. if (!this.awTask) {
  20715. this.awTask = new Ext.util.DelayedTask(this.autoWidth,
  20716. this)
  20717. }
  20718. this.awTask.delay(20)
  20719. }
  20720. },
  20721. findTargetItem : function(B) {
  20722. var A = B.getTarget(".x-menu-list-item", this.ul, true);
  20723. if (A && A.menuItemId) {
  20724. return this.items.get(A.menuItemId)
  20725. }
  20726. },
  20727. onClick : function(B) {
  20728. var A;
  20729. if (A = this.findTargetItem(B)) {
  20730. A.onClick(B);
  20731. this.fireEvent("click", this, A, B)
  20732. }
  20733. },
  20734. setActiveItem : function(A, B) {
  20735. if (A != this.activeItem) {
  20736. if (this.activeItem) {
  20737. this.activeItem.deactivate()
  20738. }
  20739. this.activeItem = A;
  20740. A.activate(B)
  20741. } else {
  20742. if (B) {
  20743. A.expandMenu()
  20744. }
  20745. }
  20746. },
  20747. tryActivate : function(F, E) {
  20748. var B = this.items;
  20749. for (var C = F, A = B.length; C >= 0 && C < A; C += E) {
  20750. var D = B.get(C);
  20751. if (!D.disabled && D.canActivate) {
  20752. this.setActiveItem(D, false);
  20753. return D
  20754. }
  20755. }
  20756. return false
  20757. },
  20758. onMouseOver : function(B) {
  20759. var A;
  20760. if (A = this.findTargetItem(B)) {
  20761. if (A.canActivate && !A.disabled) {
  20762. this.setActiveItem(A, true)
  20763. }
  20764. }
  20765. this.fireEvent("mouseover", this, B, A)
  20766. },
  20767. onMouseOut : function(B) {
  20768. var A;
  20769. if (A = this.findTargetItem(B)) {
  20770. if (A == this.activeItem && A.shouldDeactivate(B)) {
  20771. this.activeItem.deactivate();
  20772. delete this.activeItem
  20773. }
  20774. }
  20775. this.fireEvent("mouseout", this, B, A)
  20776. },
  20777. isVisible : function() {
  20778. return this.el && !this.hidden
  20779. },
  20780. show : function(B, C, A) {
  20781. this.parentMenu = A;
  20782. if (!this.el) {
  20783. this.render()
  20784. }
  20785. this.fireEvent("beforeshow", this);
  20786. this.showAt(this.el.getAlignToXY(B, C || this.defaultAlign), A,
  20787. false)
  20788. },
  20789. showAt : function(C, B, A) {
  20790. this.parentMenu = B;
  20791. if (!this.el) {
  20792. this.render()
  20793. }
  20794. if (A !== false) {
  20795. this.fireEvent("beforeshow", this);
  20796. C = this.el.adjustForConstraints(C)
  20797. }
  20798. this.el.setXY(C);
  20799. this.el.show();
  20800. this.hidden = false;
  20801. this.focus();
  20802. this.fireEvent("show", this)
  20803. },
  20804. focus : function() {
  20805. if (!this.hidden) {
  20806. this.doFocus.defer(50, this)
  20807. }
  20808. },
  20809. doFocus : function() {
  20810. if (!this.hidden) {
  20811. this.focusEl.focus()
  20812. }
  20813. },
  20814. hide : function(A) {
  20815. if (this.el && this.isVisible()) {
  20816. this.fireEvent("beforehide", this);
  20817. if (this.activeItem) {
  20818. this.activeItem.deactivate();
  20819. this.activeItem = null
  20820. }
  20821. this.el.hide();
  20822. this.hidden = true;
  20823. this.fireEvent("hide", this)
  20824. }
  20825. if (A === true && this.parentMenu) {
  20826. this.parentMenu.hide(true)
  20827. }
  20828. },
  20829. add : function() {
  20830. var B = arguments, A = B.length, E;
  20831. for (var C = 0; C < A; C++) {
  20832. var D = B[C];
  20833. if (D.render) {
  20834. E = this.addItem(D)
  20835. } else {
  20836. if (typeof D == "string") {
  20837. if (D == "separator" || D == "-") {
  20838. E = this.addSeparator()
  20839. } else {
  20840. E = this.addText(D)
  20841. }
  20842. } else {
  20843. if (D.tagName || D.el) {
  20844. E = this.addElement(D)
  20845. } else {
  20846. if (typeof D == "object") {
  20847. Ext.applyIf(D, this.defaults);
  20848. E = this.addMenuItem(D)
  20849. }
  20850. }
  20851. }
  20852. }
  20853. }
  20854. return E
  20855. },
  20856. getEl : function() {
  20857. if (!this.el) {
  20858. this.render()
  20859. }
  20860. return this.el
  20861. },
  20862. addSeparator : function() {
  20863. return this.addItem(new Ext.menu.Separator())
  20864. },
  20865. addElement : function(A) {
  20866. return this.addItem(new Ext.menu.BaseItem(A))
  20867. },
  20868. addItem : function(B) {
  20869. this.items.add(B);
  20870. if (this.ul) {
  20871. var A = document.createElement("li");
  20872. A.className = "x-menu-list-item";
  20873. this.ul.dom.appendChild(A);
  20874. B.render(A, this);
  20875. this.delayAutoWidth()
  20876. }
  20877. return B
  20878. },
  20879. addMenuItem : function(A) {
  20880. if (!(A instanceof Ext.menu.Item)) {
  20881. if (typeof A.checked == "boolean") {
  20882. A = new Ext.menu.CheckItem(A)
  20883. } else {
  20884. A = new Ext.menu.Item(A)
  20885. }
  20886. }
  20887. return this.addItem(A)
  20888. },
  20889. addText : function(A) {
  20890. return this.addItem(new Ext.menu.TextItem(A))
  20891. },
  20892. insert : function(B, C) {
  20893. this.items.insert(B, C);
  20894. if (this.ul) {
  20895. var A = document.createElement("li");
  20896. A.className = "x-menu-list-item";
  20897. this.ul.dom.insertBefore(A, this.ul.dom.childNodes[B]);
  20898. C.render(A, this);
  20899. this.delayAutoWidth()
  20900. }
  20901. return C
  20902. },
  20903. remove : function(A) {
  20904. this.items.removeKey(A.id);
  20905. A.destroy()
  20906. },
  20907. removeAll : function() {
  20908. var A;
  20909. while (A = this.items.first()) {
  20910. this.remove(A)
  20911. }
  20912. },
  20913. destroy : function() {
  20914. this.beforeDestroy();
  20915. Ext.menu.MenuMgr.unregister(this);
  20916. if (this.keyNav) {
  20917. this.keyNav.disable()
  20918. }
  20919. this.removeAll();
  20920. if (this.ul) {
  20921. this.ul.removeAllListeners()
  20922. }
  20923. if (this.el) {
  20924. this.el.destroy()
  20925. }
  20926. },
  20927. beforeDestroy : Ext.emptyFn
  20928. });
  20929. Ext.menu.MenuNav = function(A) {
  20930. Ext.menu.MenuNav.superclass.constructor.call(this, A.el);
  20931. this.scope = this.menu = A
  20932. };
  20933. Ext.extend(Ext.menu.MenuNav, Ext.KeyNav, {
  20934. doRelay : function(C, B) {
  20935. var A = C.getKey();
  20936. if (!this.menu.activeItem && C.isNavKeyPress() && A != C.SPACE
  20937. && A != C.RETURN) {
  20938. this.menu.tryActivate(0, 1);
  20939. return false
  20940. }
  20941. return B.call(this.scope || this, C, this.menu)
  20942. },
  20943. up : function(B, A) {
  20944. if (!A.tryActivate(A.items.indexOf(A.activeItem) - 1, -1)) {
  20945. A.tryActivate(A.items.length - 1, -1)
  20946. }
  20947. },
  20948. down : function(B, A) {
  20949. if (!A.tryActivate(A.items.indexOf(A.activeItem) + 1, 1)) {
  20950. A.tryActivate(0, 1)
  20951. }
  20952. },
  20953. right : function(B, A) {
  20954. if (A.activeItem) {
  20955. A.activeItem.expandMenu(true)
  20956. }
  20957. },
  20958. left : function(B, A) {
  20959. A.hide();
  20960. if (A.parentMenu && A.parentMenu.activeItem) {
  20961. A.parentMenu.activeItem.activate()
  20962. }
  20963. },
  20964. enter : function(B, A) {
  20965. if (A.activeItem) {
  20966. B.stopPropagation();
  20967. A.activeItem.onClick(B);
  20968. A.fireEvent("click", this, A.activeItem);
  20969. return true
  20970. }
  20971. }
  20972. });
  20973. Ext.menu.MenuMgr = function() {
  20974. var F, D, C = {}, A = false, K = new Date();
  20975. function M() {
  20976. F = {};
  20977. D = new Ext.util.MixedCollection();
  20978. Ext.getDoc().addKeyListener(27, function() {
  20979. if (D.length > 0) {
  20980. H()
  20981. }
  20982. })
  20983. }
  20984. function H() {
  20985. if (D && D.length > 0) {
  20986. var N = D.clone();
  20987. N.each(function(O) {
  20988. O.hide()
  20989. })
  20990. }
  20991. }
  20992. function E(N) {
  20993. D.remove(N);
  20994. if (D.length < 1) {
  20995. Ext.getDoc().un("mousedown", L);
  20996. A = false
  20997. }
  20998. }
  20999. function J(N) {
  21000. var O = D.last();
  21001. K = new Date();
  21002. D.add(N);
  21003. if (!A) {
  21004. Ext.getDoc().on("mousedown", L);
  21005. A = true
  21006. }
  21007. if (N.parentMenu) {
  21008. N.getEl().setZIndex(parseInt(N.parentMenu.getEl()
  21009. .getStyle("z-index"), 10)
  21010. + 3);
  21011. N.parentMenu.activeChild = N
  21012. } else {
  21013. if (O && O.isVisible()) {
  21014. N.getEl().setZIndex(parseInt(O.getEl().getStyle("z-index"), 10)
  21015. + 3)
  21016. }
  21017. }
  21018. }
  21019. function B(N) {
  21020. if (N.activeChild) {
  21021. N.activeChild.hide()
  21022. }
  21023. if (N.autoHideTimer) {
  21024. clearTimeout(N.autoHideTimer);
  21025. delete N.autoHideTimer
  21026. }
  21027. }
  21028. function G(N) {
  21029. var O = N.parentMenu;
  21030. if (!O && !N.allowOtherMenus) {
  21031. H()
  21032. } else {
  21033. if (O && O.activeChild) {
  21034. O.activeChild.hide()
  21035. }
  21036. }
  21037. }
  21038. function L(N) {
  21039. if (K.getElapsed() > 50 && D.length > 0 && !N.getTarget(".x-menu")) {
  21040. H()
  21041. }
  21042. }
  21043. function I(O, R) {
  21044. if (R) {
  21045. var Q = C[O.group];
  21046. for (var P = 0, N = Q.length; P < N; P++) {
  21047. if (Q[P] != O) {
  21048. Q[P].setChecked(false)
  21049. }
  21050. }
  21051. }
  21052. }
  21053. return {
  21054. hideAll : function() {
  21055. H()
  21056. },
  21057. register : function(O) {
  21058. if (!F) {
  21059. M()
  21060. }
  21061. F[O.id] = O;
  21062. O.on("beforehide", B);
  21063. O.on("hide", E);
  21064. O.on("beforeshow", G);
  21065. O.on("show", J);
  21066. var N = O.group;
  21067. if (N && O.events["checkchange"]) {
  21068. if (!C[N]) {
  21069. C[N] = []
  21070. }
  21071. C[N].push(O);
  21072. O.on("checkchange", onCheck)
  21073. }
  21074. },
  21075. get : function(N) {
  21076. if (typeof N == "string") {
  21077. if (!F) {
  21078. return null
  21079. }
  21080. return F[N]
  21081. } else {
  21082. if (N.events) {
  21083. return N
  21084. } else {
  21085. if (typeof N.length == "number") {
  21086. return new Ext.menu.Menu({
  21087. items : N
  21088. })
  21089. } else {
  21090. return new Ext.menu.Menu(N)
  21091. }
  21092. }
  21093. }
  21094. },
  21095. unregister : function(O) {
  21096. delete F[O.id];
  21097. O.un("beforehide", B);
  21098. O.un("hide", E);
  21099. O.un("beforeshow", G);
  21100. O.un("show", J);
  21101. var N = O.group;
  21102. if (N && O.events["checkchange"]) {
  21103. C[N].remove(O);
  21104. O.un("checkchange", onCheck)
  21105. }
  21106. },
  21107. registerCheckable : function(N) {
  21108. var O = N.group;
  21109. if (O) {
  21110. if (!C[O]) {
  21111. C[O] = []
  21112. }
  21113. C[O].push(N);
  21114. N.on("beforecheckchange", I)
  21115. }
  21116. },
  21117. unregisterCheckable : function(N) {
  21118. var O = N.group;
  21119. if (O) {
  21120. C[O].remove(N);
  21121. N.un("beforecheckchange", I)
  21122. }
  21123. },
  21124. getCheckedItem : function(P) {
  21125. var Q = C[P];
  21126. if (Q) {
  21127. for (var O = 0, N = Q.length; O < N; O++) {
  21128. if (Q[O].checked) {
  21129. return Q[O]
  21130. }
  21131. }
  21132. }
  21133. return null
  21134. },
  21135. setCheckedItem : function(P, R) {
  21136. var Q = C[P];
  21137. if (Q) {
  21138. for (var O = 0, N = Q.length; O < N; O++) {
  21139. if (Q[O].id == R) {
  21140. Q[O].setChecked(true)
  21141. }
  21142. }
  21143. }
  21144. return null
  21145. }
  21146. }
  21147. }();
  21148. Ext.menu.BaseItem = function(A) {
  21149. Ext.menu.BaseItem.superclass.constructor.call(this, A);
  21150. this.addEvents("click", "activate", "deactivate");
  21151. if (this.handler) {
  21152. this.on("click", this.handler, this.scope)
  21153. }
  21154. };
  21155. Ext.extend(Ext.menu.BaseItem, Ext.Component, {
  21156. canActivate : false,
  21157. activeClass : "x-menu-item-active",
  21158. hideOnClick : true,
  21159. hideDelay : 100,
  21160. ctype : "Ext.menu.BaseItem",
  21161. actionMode : "container",
  21162. render : function(A, B) {
  21163. this.parentMenu = B;
  21164. Ext.menu.BaseItem.superclass.render.call(this, A);
  21165. this.container.menuItemId = this.id
  21166. },
  21167. onRender : function(B, A) {
  21168. this.el = Ext.get(this.el);
  21169. B.dom.appendChild(this.el.dom)
  21170. },
  21171. setHandler : function(B, A) {
  21172. if (this.handler) {
  21173. this.un("click", this.handler, this.scope)
  21174. }
  21175. this.on("click", this.handler = B, this.scope = A)
  21176. },
  21177. onClick : function(A) {
  21178. if (!this.disabled
  21179. && this.fireEvent("click", this, A) !== false
  21180. && this.parentMenu.fireEvent("itemclick", this, A) !== false) {
  21181. this.handleClick(A)
  21182. } else {
  21183. A.stopEvent()
  21184. }
  21185. },
  21186. activate : function() {
  21187. if (this.disabled) {
  21188. return false
  21189. }
  21190. var A = this.container;
  21191. A.addClass(this.activeClass);
  21192. this.region = A.getRegion().adjust(2, 2, -2, -2);
  21193. this.fireEvent("activate", this);
  21194. return true
  21195. },
  21196. deactivate : function() {
  21197. this.container.removeClass(this.activeClass);
  21198. this.fireEvent("deactivate", this)
  21199. },
  21200. shouldDeactivate : function(A) {
  21201. return !this.region || !this.region.contains(A.getPoint())
  21202. },
  21203. handleClick : function(A) {
  21204. if (this.hideOnClick) {
  21205. this.parentMenu.hide.defer(this.hideDelay, this.parentMenu,
  21206. [true])
  21207. }
  21208. },
  21209. expandMenu : function(A) {
  21210. },
  21211. hideMenu : function() {
  21212. }
  21213. });
  21214. Ext.menu.TextItem = function(A) {
  21215. this.text = A;
  21216. Ext.menu.TextItem.superclass.constructor.call(this)
  21217. };
  21218. Ext.extend(Ext.menu.TextItem, Ext.menu.BaseItem, {
  21219. hideOnClick : false,
  21220. itemCls : "x-menu-text",
  21221. onRender : function() {
  21222. var A = document.createElement("span");
  21223. A.className = this.itemCls;
  21224. A.innerHTML = this.text;
  21225. this.el = A;
  21226. Ext.menu.TextItem.superclass.onRender.apply(this, arguments)
  21227. }
  21228. });
  21229. Ext.menu.Separator = function(A) {
  21230. Ext.menu.Separator.superclass.constructor.call(this, A)
  21231. };
  21232. Ext.extend(Ext.menu.Separator, Ext.menu.BaseItem, {
  21233. itemCls : "x-menu-sep",
  21234. hideOnClick : false,
  21235. onRender : function(A) {
  21236. var B = document.createElement("span");
  21237. B.className = this.itemCls;
  21238. B.innerHTML = "&#160;";
  21239. this.el = B;
  21240. A.addClass("x-menu-sep-li");
  21241. Ext.menu.Separator.superclass.onRender.apply(this, arguments)
  21242. }
  21243. });
  21244. Ext.menu.Item = function(A) {
  21245. Ext.menu.Item.superclass.constructor.call(this, A);
  21246. if (this.menu) {
  21247. this.menu = Ext.menu.MenuMgr.get(this.menu)
  21248. }
  21249. };
  21250. Ext.extend(Ext.menu.Item, Ext.menu.BaseItem, {
  21251. itemCls : "x-menu-item",
  21252. canActivate : true,
  21253. showDelay : 200,
  21254. hideDelay : 200,
  21255. ctype : "Ext.menu.Item",
  21256. onRender : function(B, A) {
  21257. var C = document.createElement("a");
  21258. C.hideFocus = true;
  21259. C.unselectable = "on";
  21260. C.href = this.href || "#";
  21261. if (this.hrefTarget) {
  21262. C.target = this.hrefTarget
  21263. }
  21264. C.className = this.itemCls
  21265. + (this.menu ? " x-menu-item-arrow" : "")
  21266. + (this.cls ? " " + this.cls : "");
  21267. C.innerHTML = String
  21268. .format(
  21269. "<img src=\"{0}\" class=\"x-menu-item-icon {2}\" />{1}",
  21270. this.icon || Ext.BLANK_IMAGE_URL, this.itemText
  21271. || this.text, this.iconCls || "");
  21272. this.el = C;
  21273. Ext.menu.Item.superclass.onRender.call(this, B, A)
  21274. },
  21275. setText : function(A) {
  21276. this.text = A;
  21277. if (this.rendered) {
  21278. this.el
  21279. .update(String
  21280. .format(
  21281. "<img src=\"{0}\" class=\"x-menu-item-icon {2}\">{1}",
  21282. this.icon || Ext.BLANK_IMAGE_URL,
  21283. this.text, this.iconCls || ""));
  21284. this.parentMenu.autoWidth()
  21285. }
  21286. },
  21287. setIconClass : function(A) {
  21288. var B = this.iconCls;
  21289. this.iconCls = A;
  21290. if (this.rendered) {
  21291. this.el.child("img.x-menu-item-icon").replaceClass(B,
  21292. this.iconCls)
  21293. }
  21294. },
  21295. handleClick : function(A) {
  21296. if (!this.href) {
  21297. A.stopEvent()
  21298. }
  21299. Ext.menu.Item.superclass.handleClick.apply(this, arguments)
  21300. },
  21301. activate : function(A) {
  21302. if (Ext.menu.Item.superclass.activate.apply(this, arguments)) {
  21303. this.focus();
  21304. if (A) {
  21305. this.expandMenu()
  21306. }
  21307. }
  21308. return true
  21309. },
  21310. shouldDeactivate : function(A) {
  21311. if (Ext.menu.Item.superclass.shouldDeactivate.call(this, A)) {
  21312. if (this.menu && this.menu.isVisible()) {
  21313. return !this.menu.getEl().getRegion().contains(A
  21314. .getPoint())
  21315. }
  21316. return true
  21317. }
  21318. return false
  21319. },
  21320. deactivate : function() {
  21321. Ext.menu.Item.superclass.deactivate.apply(this, arguments);
  21322. this.hideMenu()
  21323. },
  21324. expandMenu : function(A) {
  21325. if (!this.disabled && this.menu) {
  21326. clearTimeout(this.hideTimer);
  21327. delete this.hideTimer;
  21328. if (!this.menu.isVisible() && !this.showTimer) {
  21329. this.showTimer = this.deferExpand.defer(this.showDelay,
  21330. this, [A])
  21331. } else {
  21332. if (this.menu.isVisible() && A) {
  21333. this.menu.tryActivate(0, 1)
  21334. }
  21335. }
  21336. }
  21337. },
  21338. deferExpand : function(A) {
  21339. delete this.showTimer;
  21340. this.menu.show(this.container, this.parentMenu.subMenuAlign
  21341. || "tl-tr?", this.parentMenu);
  21342. if (A) {
  21343. this.menu.tryActivate(0, 1)
  21344. }
  21345. },
  21346. hideMenu : function() {
  21347. clearTimeout(this.showTimer);
  21348. delete this.showTimer;
  21349. if (!this.hideTimer && this.menu && this.menu.isVisible()) {
  21350. this.hideTimer = this.deferHide.defer(this.hideDelay, this)
  21351. }
  21352. },
  21353. deferHide : function() {
  21354. delete this.hideTimer;
  21355. this.menu.hide()
  21356. }
  21357. });
  21358. Ext.menu.CheckItem = function(A) {
  21359. Ext.menu.CheckItem.superclass.constructor.call(this, A);
  21360. this.addEvents("beforecheckchange", "checkchange");
  21361. if (this.checkHandler) {
  21362. this.on("checkchange", this.checkHandler, this.scope)
  21363. }
  21364. Ext.menu.MenuMgr.registerCheckable(this)
  21365. };
  21366. Ext.extend(Ext.menu.CheckItem, Ext.menu.Item, {
  21367. itemCls : "x-menu-item x-menu-check-item",
  21368. groupClass : "x-menu-group-item",
  21369. checked : false,
  21370. ctype : "Ext.menu.CheckItem",
  21371. onRender : function(A) {
  21372. Ext.menu.CheckItem.superclass.onRender.apply(this, arguments);
  21373. if (this.group) {
  21374. this.el.addClass(this.groupClass)
  21375. }
  21376. if (this.checked) {
  21377. this.checked = false;
  21378. this.setChecked(true, true)
  21379. }
  21380. },
  21381. destroy : function() {
  21382. Ext.menu.MenuMgr.unregisterCheckable(this);
  21383. Ext.menu.CheckItem.superclass.destroy.apply(this, arguments)
  21384. },
  21385. setChecked : function(B, A) {
  21386. if (this.checked != B
  21387. && this.fireEvent("beforecheckchange", this, B) !== false) {
  21388. if (this.container) {
  21389. this.container[B ? "addClass" : "removeClass"]("x-menu-item-checked")
  21390. }
  21391. this.checked = B;
  21392. if (A !== true) {
  21393. this.fireEvent("checkchange", this, B)
  21394. }
  21395. }
  21396. },
  21397. handleClick : function(A) {
  21398. if (!this.disabled && !(this.checked && this.group)) {
  21399. this.setChecked(!this.checked)
  21400. }
  21401. Ext.menu.CheckItem.superclass.handleClick.apply(this, arguments)
  21402. }
  21403. });
  21404. Ext.menu.Adapter = function(B, A) {
  21405. Ext.menu.Adapter.superclass.constructor.call(this, A);
  21406. this.component = B
  21407. };
  21408. Ext.extend(Ext.menu.Adapter, Ext.menu.BaseItem, {
  21409. canActivate : true,
  21410. onRender : function(B, A) {
  21411. this.component.render(B);
  21412. this.el = this.component.getEl()
  21413. },
  21414. activate : function() {
  21415. if (this.disabled) {
  21416. return false
  21417. }
  21418. this.component.focus();
  21419. this.fireEvent("activate", this);
  21420. return true
  21421. },
  21422. deactivate : function() {
  21423. this.fireEvent("deactivate", this)
  21424. },
  21425. disable : function() {
  21426. this.component.disable();
  21427. Ext.menu.Adapter.superclass.disable.call(this)
  21428. },
  21429. enable : function() {
  21430. this.component.enable();
  21431. Ext.menu.Adapter.superclass.enable.call(this)
  21432. }
  21433. });
  21434. Ext.menu.DateItem = function(A) {
  21435. Ext.menu.DateItem.superclass.constructor.call(this, new Ext.DatePicker(A),
  21436. A);
  21437. this.picker = this.component;
  21438. this.addEvents("select");
  21439. this.picker.on("render", function(B) {
  21440. B.getEl().swallowEvent("click");
  21441. B.container.addClass("x-menu-date-item")
  21442. });
  21443. this.picker.on("select", this.onSelect, this)
  21444. };
  21445. Ext.extend(Ext.menu.DateItem, Ext.menu.Adapter, {
  21446. onSelect : function(B, A) {
  21447. this.fireEvent("select", this, A, B);
  21448. Ext.menu.DateItem.superclass.handleClick.call(this)
  21449. }
  21450. });
  21451. Ext.menu.ColorItem = function(A) {
  21452. Ext.menu.ColorItem.superclass.constructor.call(this,
  21453. new Ext.ColorPalette(A), A);
  21454. this.palette = this.component;
  21455. this.relayEvents(this.palette, ["select"]);
  21456. if (this.selectHandler) {
  21457. this.on("select", this.selectHandler, this.scope)
  21458. }
  21459. };
  21460. Ext.extend(Ext.menu.ColorItem, Ext.menu.Adapter);
  21461. Ext.menu.DateMenu = function(A) {
  21462. Ext.menu.DateMenu.superclass.constructor.call(this, A);
  21463. this.plain = true;
  21464. var B = new Ext.menu.DateItem(A);
  21465. this.add(B);
  21466. this.picker = B.picker;
  21467. this.relayEvents(B, ["select"]);
  21468. this.on("beforeshow", function() {
  21469. if (this.picker) {
  21470. this.picker.hideMonthPicker(true)
  21471. }
  21472. }, this)
  21473. };
  21474. Ext.extend(Ext.menu.DateMenu, Ext.menu.Menu, {
  21475. cls : "x-date-menu",
  21476. beforeDestroy : function() {
  21477. this.picker.destroy()
  21478. }
  21479. });
  21480. Ext.menu.ColorMenu = function(A) {
  21481. Ext.menu.ColorMenu.superclass.constructor.call(this, A);
  21482. this.plain = true;
  21483. var B = new Ext.menu.ColorItem(A);
  21484. this.add(B);
  21485. this.palette = B.palette;
  21486. this.relayEvents(B, ["select"])
  21487. };
  21488. Ext.extend(Ext.menu.ColorMenu, Ext.menu.Menu);
  21489. Ext.form.Field = Ext.extend(Ext.BoxComponent, {
  21490. invalidClass : "x-form-invalid",
  21491. invalidText : "The value in this field is invalid",
  21492. focusClass : "x-form-focus",
  21493. validationEvent : "keyup",
  21494. validateOnBlur : true,
  21495. validationDelay : 250,
  21496. defaultAutoCreate : {
  21497. tag : "input",
  21498. type : "text",
  21499. size : "20",
  21500. autocomplete : "off"
  21501. },
  21502. fieldClass : "x-form-field",
  21503. msgTarget : "qtip",
  21504. msgFx : "normal",
  21505. readOnly : false,
  21506. disabled : false,
  21507. isFormField : true,
  21508. hasFocus : false,
  21509. initComponent : function() {
  21510. Ext.form.Field.superclass.initComponent.call(this);
  21511. this.addEvents("focus", "blur", "specialkey", "change",
  21512. "invalid", "valid")
  21513. },
  21514. getName : function() {
  21515. return this.rendered && this.el.dom.name
  21516. ? this.el.dom.name
  21517. : (this.hiddenName || "")
  21518. },
  21519. onRender : function(C, A) {
  21520. Ext.form.Field.superclass.onRender.call(this, C, A);
  21521. if (!this.el) {
  21522. var B = this.getAutoCreate();
  21523. if (!B.name) {
  21524. B.name = this.name || this.id
  21525. }
  21526. if (this.inputType) {
  21527. B.type = this.inputType
  21528. }
  21529. this.el = C.createChild(B, A)
  21530. }
  21531. var D = this.el.dom.type;
  21532. if (D) {
  21533. if (D == "password") {
  21534. D = "text"
  21535. }
  21536. this.el.addClass("x-form-" + D)
  21537. }
  21538. if (this.readOnly) {
  21539. this.el.dom.readOnly = true
  21540. }
  21541. if (this.tabIndex !== undefined) {
  21542. this.el.dom.setAttribute("tabIndex", this.tabIndex)
  21543. }
  21544. this.el.addClass([this.fieldClass, this.cls]);
  21545. this.initValue()
  21546. },
  21547. initValue : function() {
  21548. if (this.value !== undefined) {
  21549. this.setValue(this.value)
  21550. } else {
  21551. if (this.el.dom.value.length > 0) {
  21552. this.setValue(this.el.dom.value)
  21553. }
  21554. }
  21555. },
  21556. isDirty : function() {
  21557. if (this.disabled) {
  21558. return false
  21559. }
  21560. return String(this.getValue()) !== String(this.originalValue)
  21561. },
  21562. afterRender : function() {
  21563. Ext.form.Field.superclass.afterRender.call(this);
  21564. this.initEvents()
  21565. },
  21566. fireKey : function(A) {
  21567. if (A.isSpecialKey()) {
  21568. this.fireEvent("specialkey", this, A)
  21569. }
  21570. },
  21571. reset : function() {
  21572. this.setValue(this.originalValue);
  21573. this.clearInvalid()
  21574. },
  21575. initEvents : function() {
  21576. this.el.on(Ext.isIE ? "keydown" : "keypress", this.fireKey,
  21577. this);
  21578. this.el.on("focus", this.onFocus, this);
  21579. this.el.on("blur", this.onBlur, this);
  21580. this.originalValue = this.getValue()
  21581. },
  21582. onFocus : function() {
  21583. if (!Ext.isOpera && this.focusClass) {
  21584. this.el.addClass(this.focusClass)
  21585. }
  21586. if (!this.hasFocus) {
  21587. this.hasFocus = true;
  21588. this.startValue = this.getValue();
  21589. this.fireEvent("focus", this)
  21590. }
  21591. },
  21592. beforeBlur : Ext.emptyFn,
  21593. onBlur : function() {
  21594. this.beforeBlur();
  21595. if (!Ext.isOpera && this.focusClass) {
  21596. this.el.removeClass(this.focusClass)
  21597. }
  21598. this.hasFocus = false;
  21599. if (this.validationEvent !== false && this.validateOnBlur
  21600. && this.validationEvent != "blur") {
  21601. this.validate()
  21602. }
  21603. var A = this.getValue();
  21604. if (String(A) !== String(this.startValue)) {
  21605. this.fireEvent("change", this, A, this.startValue)
  21606. }
  21607. this.fireEvent("blur", this)
  21608. },
  21609. isValid : function(A) {
  21610. if (this.disabled) {
  21611. return true
  21612. }
  21613. var C = this.preventMark;
  21614. this.preventMark = A === true;
  21615. var B = this.validateValue(this
  21616. .processValue(this.getRawValue()));
  21617. this.preventMark = C;
  21618. return B
  21619. },
  21620. validate : function() {
  21621. if (this.disabled
  21622. || this.validateValue(this.processValue(this
  21623. .getRawValue()))) {
  21624. this.clearInvalid();
  21625. return true
  21626. }
  21627. return false
  21628. },
  21629. processValue : function(A) {
  21630. return A
  21631. },
  21632. validateValue : function(A) {
  21633. return true
  21634. },
  21635. markInvalid : function(C) {
  21636. if (!this.rendered || this.preventMark) {
  21637. return
  21638. }
  21639. this.el.addClass(this.invalidClass);
  21640. C = C || this.invalidText;
  21641. switch (this.msgTarget) {
  21642. case "qtip" :
  21643. this.el.dom.qtip = C;
  21644. this.el.dom.qclass = "x-form-invalid-tip";
  21645. if (Ext.QuickTips) {
  21646. Ext.QuickTips.enable()
  21647. }
  21648. break;
  21649. case "title" :
  21650. this.el.dom.title = C;
  21651. break;
  21652. case "under" :
  21653. if (!this.errorEl) {
  21654. var B = this.el.findParent(".x-form-element", 5,
  21655. true);
  21656. this.errorEl = B.createChild({
  21657. cls : "x-form-invalid-msg"
  21658. });
  21659. this.errorEl.setWidth(B.getWidth(true) - 20)
  21660. }
  21661. this.errorEl.update(C);
  21662. Ext.form.Field.msgFx[this.msgFx].show(this.errorEl,
  21663. this);
  21664. break;
  21665. case "side" :
  21666. if (!this.errorIcon) {
  21667. var B = this.el.findParent(".x-form-element", 5,
  21668. true);
  21669. this.errorIcon = B.createChild({
  21670. cls : "x-form-invalid-icon"
  21671. })
  21672. }
  21673. this.alignErrorIcon();
  21674. this.errorIcon.dom.qtip = C;
  21675. this.errorIcon.dom.qclass = "x-form-invalid-tip";
  21676. this.errorIcon.show();
  21677. this.on("resize", this.alignErrorIcon, this);
  21678. break;
  21679. default :
  21680. var A = Ext.getDom(this.msgTarget);
  21681. A.innerHTML = C;
  21682. A.style.display = this.msgDisplay;
  21683. break
  21684. }
  21685. this.fireEvent("invalid", this, C)
  21686. },
  21687. alignErrorIcon : function() {
  21688. this.errorIcon.alignTo(this.el, "tl-tr", [2, 0])
  21689. },
  21690. clearInvalid : function() {
  21691. if (!this.rendered || this.preventMark) {
  21692. return
  21693. }
  21694. this.el.removeClass(this.invalidClass);
  21695. switch (this.msgTarget) {
  21696. case "qtip" :
  21697. this.el.dom.qtip = "";
  21698. break;
  21699. case "title" :
  21700. this.el.dom.title = "";
  21701. break;
  21702. case "under" :
  21703. if (this.errorEl) {
  21704. Ext.form.Field.msgFx[this.msgFx].hide(this.errorEl,
  21705. this)
  21706. }
  21707. break;
  21708. case "side" :
  21709. if (this.errorIcon) {
  21710. this.errorIcon.dom.qtip = "";
  21711. this.errorIcon.hide();
  21712. this.un("resize", this.alignErrorIcon, this)
  21713. }
  21714. break;
  21715. default :
  21716. var A = Ext.getDom(this.msgTarget);
  21717. A.innerHTML = "";
  21718. A.style.display = "none";
  21719. break
  21720. }
  21721. this.fireEvent("valid", this)
  21722. },
  21723. getRawValue : function() {
  21724. var A = this.rendered ? this.el.getValue() : Ext.value(
  21725. this.value, "");
  21726. if (A === this.emptyText) {
  21727. A = ""
  21728. }
  21729. return A
  21730. },
  21731. getValue : function() {
  21732. if (!this.rendered) {
  21733. return this.value
  21734. }
  21735. var A = this.el.getValue();
  21736. if (A === this.emptyText || A === undefined) {
  21737. A = ""
  21738. }
  21739. return A
  21740. },
  21741. setRawValue : function(A) {
  21742. return this.el.dom.value = (A === null || A === undefined
  21743. ? ""
  21744. : A)
  21745. },
  21746. setValue : function(A) {
  21747. this.value = A;
  21748. if (this.rendered) {
  21749. this.el.dom.value = (A === null || A === undefined ? "" : A);
  21750. this.validate()
  21751. }
  21752. },
  21753. adjustSize : function(A, C) {
  21754. var B = Ext.form.Field.superclass.adjustSize.call(this, A, C);
  21755. B.width = this.adjustWidth(this.el.dom.tagName, B.width);
  21756. return B
  21757. },
  21758. adjustWidth : function(A, B) {
  21759. A = A.toLowerCase();
  21760. if (typeof B == "number" && !Ext.isSafari) {
  21761. if (Ext.isIE && (A == "input" || A == "textarea")) {
  21762. if (A == "input" && !Ext.isStrict) {
  21763. return this.inEditor ? B : B - 3
  21764. }
  21765. if (A == "input" && Ext.isStrict) {
  21766. return B - (Ext.isIE6 ? 4 : 1)
  21767. }
  21768. if (A = "textarea" && Ext.isStrict) {
  21769. return B - 2
  21770. }
  21771. } else {
  21772. if (Ext.isOpera && Ext.isStrict) {
  21773. if (A == "input") {
  21774. return B + 2
  21775. }
  21776. if (A = "textarea") {
  21777. return B - 2
  21778. }
  21779. }
  21780. }
  21781. }
  21782. return B
  21783. }
  21784. });
  21785. Ext.form.Field.msgFx = {
  21786. normal : {
  21787. show : function(A, B) {
  21788. A.setDisplayed("block")
  21789. },
  21790. hide : function(A, B) {
  21791. A.setDisplayed(false).update("")
  21792. }
  21793. },
  21794. slide : {
  21795. show : function(A, B) {
  21796. A.slideIn("t", {
  21797. stopFx : true
  21798. })
  21799. },
  21800. hide : function(A, B) {
  21801. A.slideOut("t", {
  21802. stopFx : true,
  21803. useDisplay : true
  21804. })
  21805. }
  21806. },
  21807. slideRight : {
  21808. show : function(A, B) {
  21809. A.fixDisplay();
  21810. A.alignTo(B.el, "tl-tr");
  21811. A.slideIn("l", {
  21812. stopFx : true
  21813. })
  21814. },
  21815. hide : function(A, B) {
  21816. A.slideOut("l", {
  21817. stopFx : true,
  21818. useDisplay : true
  21819. })
  21820. }
  21821. }
  21822. };
  21823. Ext.reg("field", Ext.form.Field);
  21824. Ext.form.TextField = Ext.extend(Ext.form.Field, {
  21825. grow : false,
  21826. growMin : 30,
  21827. growMax : 800,
  21828. vtype : null,
  21829. maskRe : null,
  21830. disableKeyFilter : false,
  21831. allowBlank : true,
  21832. minLength : 0,
  21833. maxLength : Number.MAX_VALUE,
  21834. minLengthText : "The minimum length for this field is {0}",
  21835. maxLengthText : "The maximum length for this field is {0}",
  21836. selectOnFocus : false,
  21837. blankText : "This field is required",
  21838. validator : null,
  21839. regex : null,
  21840. regexText : "",
  21841. emptyText : null,
  21842. emptyClass : "x-form-empty-field",
  21843. initComponent : function() {
  21844. Ext.form.TextField.superclass.initComponent.call(this);
  21845. this.addEvents("autosize")
  21846. },
  21847. initEvents : function() {
  21848. Ext.form.TextField.superclass.initEvents.call(this);
  21849. if (this.validationEvent == "keyup") {
  21850. this.validationTask = new Ext.util.DelayedTask(this.validate, this);
  21851. this.el.on("keyup", this.filterValidation, this)
  21852. } else {
  21853. if (this.validationEvent !== false) {
  21854. this.el.on(this.validationEvent, this.validate, this, {
  21855. buffer : this.validationDelay
  21856. })
  21857. }
  21858. }
  21859. if (this.selectOnFocus || this.emptyText) {
  21860. this.on("focus", this.preFocus, this);
  21861. if (this.emptyText) {
  21862. this.on("blur", this.postBlur, this);
  21863. this.applyEmptyText()
  21864. }
  21865. }
  21866. if (this.maskRe
  21867. || (this.vtype && this.disableKeyFilter !== true && (this.maskRe = Ext.form.VTypes[this.vtype
  21868. + "Mask"]))) {
  21869. this.el.on("keypress", this.filterKeys, this)
  21870. }
  21871. if (this.grow) {
  21872. this.el.on("keyup", this.onKeyUp, this, {
  21873. buffer : 50
  21874. });
  21875. this.el.on("click", this.autoSize, this)
  21876. }
  21877. },
  21878. processValue : function(A) {
  21879. if (this.stripCharsRe) {
  21880. var B = A.replace(this.stripCharsRe, "");
  21881. if (B !== A) {
  21882. this.setRawValue(B);
  21883. return B
  21884. }
  21885. }
  21886. return A
  21887. },
  21888. filterValidation : function(A) {
  21889. if (!A.isNavKeyPress()) {
  21890. this.validationTask.delay(this.validationDelay)
  21891. }
  21892. },
  21893. onKeyUp : function(A) {
  21894. if (!A.isNavKeyPress()) {
  21895. this.autoSize()
  21896. }
  21897. },
  21898. reset : function() {
  21899. Ext.form.TextField.superclass.reset.call(this);
  21900. this.applyEmptyText()
  21901. },
  21902. applyEmptyText : function() {
  21903. if (this.rendered && this.emptyText && this.getRawValue().length < 1) {
  21904. this.setRawValue(this.emptyText);
  21905. this.el.addClass(this.emptyClass)
  21906. }
  21907. },
  21908. preFocus : function() {
  21909. if (this.emptyText) {
  21910. if (this.el.dom.value == this.emptyText) {
  21911. this.setRawValue("")
  21912. }
  21913. this.el.removeClass(this.emptyClass)
  21914. }
  21915. if (this.selectOnFocus) {
  21916. this.el.dom.select()
  21917. }
  21918. },
  21919. postBlur : function() {
  21920. this.applyEmptyText()
  21921. },
  21922. filterKeys : function(B) {
  21923. var A = B.getKey();
  21924. if (!Ext.isIE
  21925. && (B.isNavKeyPress() || A == B.BACKSPACE || (A == B.DELETE && B.button == -1))) {
  21926. return
  21927. }
  21928. var D = B.getCharCode(), C = String.fromCharCode(D);
  21929. if (Ext.isIE && (B.isSpecialKey() || !C)) {
  21930. return
  21931. }
  21932. if (!this.maskRe.test(C)) {
  21933. B.stopEvent()
  21934. }
  21935. },
  21936. setValue : function(A) {
  21937. if (this.emptyText && this.el && A !== undefined && A !== null
  21938. && A !== "") {
  21939. this.el.removeClass(this.emptyClass)
  21940. }
  21941. Ext.form.TextField.superclass.setValue.apply(this, arguments);
  21942. this.applyEmptyText();
  21943. this.autoSize()
  21944. },
  21945. validateValue : function(A) {
  21946. if (A.length < 1 || A === this.emptyText) {
  21947. if (this.allowBlank) {
  21948. this.clearInvalid();
  21949. return true
  21950. } else {
  21951. this.markInvalid(this.blankText);
  21952. return false
  21953. }
  21954. }
  21955. if (A.length < this.minLength) {
  21956. this.markInvalid(String.format(this.minLengthText, this.minLength));
  21957. return false
  21958. }
  21959. if (A.length > this.maxLength) {
  21960. this.markInvalid(String.format(this.maxLengthText, this.maxLength));
  21961. return false
  21962. }
  21963. if (this.vtype) {
  21964. var C = Ext.form.VTypes;
  21965. if (!C[this.vtype](A, this)) {
  21966. this.markInvalid(this.vtypeText || C[this.vtype + "Text"]);
  21967. return false
  21968. }
  21969. }
  21970. if (typeof this.validator == "function") {
  21971. var B = this.validator(A);
  21972. if (B !== true) {
  21973. this.markInvalid(B);
  21974. return false
  21975. }
  21976. }
  21977. if (this.regex && !this.regex.test(A)) {
  21978. this.markInvalid(this.regexText);
  21979. return false
  21980. }
  21981. return true
  21982. },
  21983. selectText : function(E, A) {
  21984. var C = this.getRawValue();
  21985. if (C.length > 0) {
  21986. E = E === undefined ? 0 : E;
  21987. A = A === undefined ? C.length : A;
  21988. var D = this.el.dom;
  21989. if (D.setSelectionRange) {
  21990. D.setSelectionRange(E, A)
  21991. } else {
  21992. if (D.createTextRange) {
  21993. var B = D.createTextRange();
  21994. B.moveStart("character", E);
  21995. B.moveEnd("character", A - C.length);
  21996. B.select()
  21997. }
  21998. }
  21999. }
  22000. },
  22001. autoSize : function() {
  22002. if (!this.grow || !this.rendered) {
  22003. return
  22004. }
  22005. if (!this.metrics) {
  22006. this.metrics = Ext.util.TextMetrics.createInstance(this.el)
  22007. }
  22008. var C = this.el;
  22009. var B = C.dom.value;
  22010. var D = document.createElement("div");
  22011. D.appendChild(document.createTextNode(B));
  22012. B = D.innerHTML;
  22013. D = null;
  22014. B += "&#160;";
  22015. var A = Math.min(this.growMax, Math.max(this.metrics.getWidth(B) + 10,
  22016. this.growMin));
  22017. this.el.setWidth(A);
  22018. this.fireEvent("autosize", this, A)
  22019. }
  22020. });
  22021. Ext.reg("textfield", Ext.form.TextField);
  22022. Ext.form.TriggerField = Ext.extend(Ext.form.TextField, {
  22023. defaultAutoCreate : {
  22024. tag : "input",
  22025. type : "text",
  22026. size : "16",
  22027. autocomplete : "off"
  22028. },
  22029. hideTrigger : false,
  22030. autoSize : Ext.emptyFn,
  22031. monitorTab : true,
  22032. deferHeight : true,
  22033. mimicing : false,
  22034. onResize : function(A, B) {
  22035. Ext.form.TriggerField.superclass.onResize.call(this, A, B);
  22036. if (typeof A == "number") {
  22037. this.el.setWidth(this.adjustWidth("input", A
  22038. - this.trigger.getWidth()))
  22039. }
  22040. this.wrap
  22041. .setWidth(this.el.getWidth() + this.trigger.getWidth())
  22042. },
  22043. adjustSize : Ext.BoxComponent.prototype.adjustSize,
  22044. getResizeEl : function() {
  22045. return this.wrap
  22046. },
  22047. getPositionEl : function() {
  22048. return this.wrap
  22049. },
  22050. alignErrorIcon : function() {
  22051. this.errorIcon.alignTo(this.wrap, "tl-tr", [2, 0])
  22052. },
  22053. onRender : function(B, A) {
  22054. Ext.form.TriggerField.superclass.onRender.call(this, B, A);
  22055. this.wrap = this.el.wrap({
  22056. cls : "x-form-field-wrap"
  22057. });
  22058. this.trigger = this.wrap.createChild(this.triggerConfig || {
  22059. tag : "img",
  22060. src : Ext.BLANK_IMAGE_URL,
  22061. cls : "x-form-trigger " + this.triggerClass
  22062. });
  22063. if (this.hideTrigger) {
  22064. this.trigger.setDisplayed(false)
  22065. }
  22066. this.initTrigger();
  22067. if (!this.width) {
  22068. this.wrap.setWidth(this.el.getWidth()
  22069. + this.trigger.getWidth())
  22070. }
  22071. },
  22072. initTrigger : function() {
  22073. this.trigger.on("click", this.onTriggerClick, this, {
  22074. preventDefault : true
  22075. });
  22076. this.trigger.addClassOnOver("x-form-trigger-over");
  22077. this.trigger.addClassOnClick("x-form-trigger-click")
  22078. },
  22079. onDestroy : function() {
  22080. if (this.trigger) {
  22081. this.trigger.removeAllListeners();
  22082. this.trigger.remove()
  22083. }
  22084. if (this.wrap) {
  22085. this.wrap.remove()
  22086. }
  22087. Ext.form.TriggerField.superclass.onDestroy.call(this)
  22088. },
  22089. onFocus : function() {
  22090. Ext.form.TriggerField.superclass.onFocus.call(this);
  22091. if (!this.mimicing) {
  22092. this.wrap.addClass("x-trigger-wrap-focus");
  22093. this.mimicing = true;
  22094. Ext.get(Ext.isIE ? document.body : document).on(
  22095. "mousedown", this.mimicBlur, this, {
  22096. delay : 10
  22097. });
  22098. if (this.monitorTab) {
  22099. this.el.on("keydown", this.checkTab, this)
  22100. }
  22101. }
  22102. },
  22103. checkTab : function(A) {
  22104. if (A.getKey() == A.TAB) {
  22105. this.triggerBlur()
  22106. }
  22107. },
  22108. onBlur : function() {
  22109. },
  22110. mimicBlur : function(A) {
  22111. if (!this.wrap.contains(A.target) && this.validateBlur(A)) {
  22112. this.triggerBlur()
  22113. }
  22114. },
  22115. triggerBlur : function() {
  22116. this.mimicing = false;
  22117. Ext.get(Ext.isIE ? document.body : document).un("mousedown",
  22118. this.mimicBlur);
  22119. if (this.monitorTab) {
  22120. this.el.un("keydown", this.checkTab, this)
  22121. }
  22122. this.beforeBlur();
  22123. this.wrap.removeClass("x-trigger-wrap-focus");
  22124. Ext.form.TriggerField.superclass.onBlur.call(this)
  22125. },
  22126. beforeBlur : Ext.emptyFn,
  22127. validateBlur : function(A) {
  22128. return true
  22129. },
  22130. onDisable : function() {
  22131. Ext.form.TriggerField.superclass.onDisable.call(this);
  22132. if (this.wrap) {
  22133. this.wrap.addClass("x-item-disabled")
  22134. }
  22135. },
  22136. onEnable : function() {
  22137. Ext.form.TriggerField.superclass.onEnable.call(this);
  22138. if (this.wrap) {
  22139. this.wrap.removeClass("x-item-disabled")
  22140. }
  22141. },
  22142. onShow : function() {
  22143. if (this.wrap) {
  22144. this.wrap.dom.style.display = "";
  22145. this.wrap.dom.style.visibility = "visible"
  22146. }
  22147. },
  22148. onHide : function() {
  22149. this.wrap.dom.style.display = "none"
  22150. },
  22151. onTriggerClick : Ext.emptyFn
  22152. });
  22153. Ext.form.TwinTriggerField = Ext.extend(Ext.form.TriggerField, {
  22154. initComponent : function() {
  22155. Ext.form.TwinTriggerField.superclass.initComponent.call(this);
  22156. this.triggerConfig = {
  22157. tag : "span",
  22158. cls : "x-form-twin-triggers",
  22159. cn : [{
  22160. tag : "img",
  22161. src : Ext.BLANK_IMAGE_URL,
  22162. cls : "x-form-trigger " + this.trigger1Class
  22163. }, {
  22164. tag : "img",
  22165. src : Ext.BLANK_IMAGE_URL,
  22166. cls : "x-form-trigger " + this.trigger2Class
  22167. }]
  22168. }
  22169. },
  22170. getTrigger : function(A) {
  22171. return this.triggers[A]
  22172. },
  22173. initTrigger : function() {
  22174. var A = this.trigger.select(".x-form-trigger", true);
  22175. this.wrap.setStyle("overflow", "hidden");
  22176. var B = this;
  22177. A.each(function(D, F, C) {
  22178. D.hide = function() {
  22179. var G = B.wrap.getWidth();
  22180. this.dom.style.display = "none";
  22181. B.el.setWidth(G - B.trigger.getWidth())
  22182. };
  22183. D.show = function() {
  22184. var G = B.wrap.getWidth();
  22185. this.dom.style.display = "";
  22186. B.el.setWidth(G - B.trigger.getWidth())
  22187. };
  22188. var E = "Trigger" + (C + 1);
  22189. if (this["hide" + E]) {
  22190. D.dom.style.display = "none"
  22191. }
  22192. D.on("click", this["on" + E + "Click"], this, {
  22193. preventDefault : true
  22194. });
  22195. D.addClassOnOver("x-form-trigger-over");
  22196. D.addClassOnClick("x-form-trigger-click")
  22197. }, this);
  22198. this.triggers = A.elements
  22199. },
  22200. onTrigger1Click : Ext.emptyFn,
  22201. onTrigger2Click : Ext.emptyFn
  22202. });
  22203. Ext.reg("trigger", Ext.form.TriggerField);
  22204. Ext.form.TextArea = Ext.extend(Ext.form.TextField, {
  22205. growMin : 60,
  22206. growMax : 1000,
  22207. growAppend : "&#160;\n&#160;",
  22208. growPad : 0,
  22209. enterIsSpecial : false,
  22210. preventScrollbars : false,
  22211. onRender : function(B, A) {
  22212. if (!this.el) {
  22213. this.defaultAutoCreate = {
  22214. tag : "textarea",
  22215. style : "width:100px;height:60px;",
  22216. autocomplete : "off"
  22217. }
  22218. }
  22219. Ext.form.TextArea.superclass.onRender.call(this, B, A);
  22220. if (this.grow) {
  22221. this.textSizeEl = Ext.DomHelper.append(document.body, {
  22222. tag : "pre",
  22223. cls : "x-form-grow-sizer"
  22224. });
  22225. if (this.preventScrollbars) {
  22226. this.el.setStyle("overflow", "hidden")
  22227. }
  22228. this.el.setHeight(this.growMin)
  22229. }
  22230. },
  22231. onDestroy : function() {
  22232. if (this.textSizeEl) {
  22233. Ext.removeNode(this.textSizeEl)
  22234. }
  22235. Ext.form.TextArea.superclass.onDestroy.call(this)
  22236. },
  22237. fireKey : function(A) {
  22238. if (A.isSpecialKey()
  22239. && (this.enterIsSpecial || (A.getKey() != A.ENTER || A
  22240. .hasModifier()))) {
  22241. this.fireEvent("specialkey", this, A)
  22242. }
  22243. },
  22244. onKeyUp : function(A) {
  22245. if (!A.isNavKeyPress() || A.getKey() == A.ENTER) {
  22246. this.autoSize()
  22247. }
  22248. },
  22249. autoSize : function() {
  22250. if (!this.grow || !this.textSizeEl) {
  22251. return
  22252. }
  22253. var C = this.el;
  22254. var A = C.dom.value;
  22255. var D = this.textSizeEl;
  22256. D.innerHTML = "";
  22257. D.appendChild(document.createTextNode(A));
  22258. A = D.innerHTML;
  22259. Ext.fly(D).setWidth(this.el.getWidth());
  22260. if (A.length < 1) {
  22261. A = "&#160;&#160;"
  22262. } else {
  22263. if (Ext.isIE) {
  22264. A = A.replace(/\n/g, "<p>&#160;</p>")
  22265. }
  22266. A += this.growAppend
  22267. }
  22268. D.innerHTML = A;
  22269. var B = Math.min(this.growMax, Math.max(D.offsetHeight,
  22270. this.growMin)
  22271. + this.growPad);
  22272. if (B != this.lastHeight) {
  22273. this.lastHeight = B;
  22274. this.el.setHeight(B);
  22275. this.fireEvent("autosize", this, B)
  22276. }
  22277. }
  22278. });
  22279. Ext.reg("textarea", Ext.form.TextArea);
  22280. Ext.form.NumberField = Ext.extend(Ext.form.TextField, {
  22281. fieldClass : "x-form-field x-form-num-field",
  22282. allowDecimals : true,
  22283. decimalSeparator : ".",
  22284. decimalPrecision : 2,
  22285. allowNegative : true,
  22286. minValue : Number.NEGATIVE_INFINITY,
  22287. maxValue : Number.MAX_VALUE,
  22288. minText : "The minimum value for this field is {0}",
  22289. maxText : "The maximum value for this field is {0}",
  22290. nanText : "{0} is not a valid number",
  22291. baseChars : "0123456789",
  22292. initEvents : function() {
  22293. Ext.form.NumberField.superclass.initEvents.call(this);
  22294. var B = this.baseChars + "";
  22295. if (this.allowDecimals) {
  22296. B += this.decimalSeparator
  22297. }
  22298. if (this.allowNegative) {
  22299. B += "-"
  22300. }
  22301. this.stripCharsRe = new RegExp("[^" + B + "]", "gi");
  22302. var A = function(D) {
  22303. var C = D.getKey();
  22304. if (!Ext.isIE
  22305. && (D.isSpecialKey() || C == D.BACKSPACE || C == D.DELETE)) {
  22306. return
  22307. }
  22308. var E = D.getCharCode();
  22309. if (B.indexOf(String.fromCharCode(E)) === -1) {
  22310. D.stopEvent()
  22311. }
  22312. };
  22313. this.el.on("keypress", A, this)
  22314. },
  22315. validateValue : function(B) {
  22316. if (!Ext.form.NumberField.superclass.validateValue.call(this, B)) {
  22317. return false
  22318. }
  22319. if (B.length < 1) {
  22320. return true
  22321. }
  22322. B = String(B).replace(this.decimalSeparator, ".");
  22323. if (isNaN(B)) {
  22324. this.markInvalid(String.format(this.nanText, B));
  22325. return false
  22326. }
  22327. var A = this.parseValue(B);
  22328. if (A < this.minValue) {
  22329. this.markInvalid(String.format(this.minText, this.minValue));
  22330. return false
  22331. }
  22332. if (A > this.maxValue) {
  22333. this.markInvalid(String.format(this.maxText, this.maxValue));
  22334. return false
  22335. }
  22336. return true
  22337. },
  22338. getValue : function() {
  22339. return this
  22340. .fixPrecision(this
  22341. .parseValue(Ext.form.NumberField.superclass.getValue
  22342. .call(this)))
  22343. },
  22344. setValue : function(A) {
  22345. A = parseFloat(A);
  22346. A = isNaN(A) ? "" : String(A).replace(".", this.decimalSeparator);
  22347. Ext.form.NumberField.superclass.setValue.call(this, A)
  22348. },
  22349. parseValue : function(A) {
  22350. A = parseFloat(String(A).replace(this.decimalSeparator, "."));
  22351. return isNaN(A) ? "" : A
  22352. },
  22353. fixPrecision : function(B) {
  22354. var A = isNaN(B);
  22355. if (!this.allowDecimals || this.decimalPrecision == -1 || A || !B) {
  22356. return A ? "" : B
  22357. }
  22358. return parseFloat(parseFloat(B).toFixed(this.decimalPrecision))
  22359. },
  22360. beforeBlur : function() {
  22361. var A = this.parseValue(this.getRawValue());
  22362. if (A) {
  22363. this.setValue(this.fixPrecision(A))
  22364. }
  22365. }
  22366. });
  22367. Ext.reg("numberfield", Ext.form.NumberField);
  22368. Ext.form.DateField = Ext.extend(Ext.form.TriggerField, {
  22369. format : "m/d/y",
  22370. altFormats : "m/d/Y|n/j/Y|n/j/y|m/j/y|n/d/y|m/j/Y|n/d/Y|m-d-y|m-d-Y|m/d|m-d|md|mdy|mdY|d|Y-m-d",
  22371. disabledDays : null,
  22372. disabledDaysText : "Disabled",
  22373. disabledDates : null,
  22374. disabledDatesText : "Disabled",
  22375. minValue : null,
  22376. maxValue : null,
  22377. minText : "The date in this field must be equal to or after {0}",
  22378. maxText : "The date in this field must be equal to or before {0}",
  22379. invalidText : "{0} is not a valid date - it must be in the format {1}",
  22380. triggerClass : "x-form-date-trigger",
  22381. defaultAutoCreate : {
  22382. tag : "input",
  22383. type : "text",
  22384. size : "10",
  22385. autocomplete : "off"
  22386. },
  22387. initComponent : function() {
  22388. Ext.form.DateField.superclass.initComponent.call(this);
  22389. if (typeof this.minValue == "string") {
  22390. this.minValue = this.parseDate(this.minValue)
  22391. }
  22392. if (typeof this.maxValue == "string") {
  22393. this.maxValue = this.parseDate(this.maxValue)
  22394. }
  22395. this.ddMatch = null;
  22396. if (this.disabledDates) {
  22397. var A = this.disabledDates;
  22398. var C = "(?:";
  22399. for (var B = 0; B < A.length; B++) {
  22400. C += A[B];
  22401. if (B != A.length - 1) {
  22402. C += "|"
  22403. }
  22404. }
  22405. this.ddMatch = new RegExp(C + ")")
  22406. }
  22407. },
  22408. validateValue : function(E) {
  22409. E = this.formatDate(E);
  22410. if (!Ext.form.DateField.superclass.validateValue.call(this, E)) {
  22411. return false
  22412. }
  22413. if (E.length < 1) {
  22414. return true
  22415. }
  22416. var C = E;
  22417. E = this.parseDate(E);
  22418. if (!E) {
  22419. this.markInvalid(String.format(this.invalidText, C, this.format));
  22420. return false
  22421. }
  22422. var F = E.getTime();
  22423. if (this.minValue && F < this.minValue.getTime()) {
  22424. this.markInvalid(String.format(this.minText, this
  22425. .formatDate(this.minValue)));
  22426. return false
  22427. }
  22428. if (this.maxValue && F > this.maxValue.getTime()) {
  22429. this.markInvalid(String.format(this.maxText, this
  22430. .formatDate(this.maxValue)));
  22431. return false
  22432. }
  22433. if (this.disabledDays) {
  22434. var A = E.getDay();
  22435. for (var B = 0; B < this.disabledDays.length; B++) {
  22436. if (A === this.disabledDays[B]) {
  22437. this.markInvalid(this.disabledDaysText);
  22438. return false
  22439. }
  22440. }
  22441. }
  22442. var D = this.formatDate(E);
  22443. if (this.ddMatch && this.ddMatch.test(D)) {
  22444. this.markInvalid(String.format(this.disabledDatesText, D));
  22445. return false
  22446. }
  22447. return true
  22448. },
  22449. validateBlur : function() {
  22450. return !this.menu || !this.menu.isVisible()
  22451. },
  22452. getValue : function() {
  22453. return this
  22454. .parseDate(Ext.form.DateField.superclass.getValue.call(this))
  22455. || ""
  22456. },
  22457. setValue : function(A) {
  22458. Ext.form.DateField.superclass.setValue.call(this, this.formatDate(this
  22459. .parseDate(A)))
  22460. },
  22461. parseDate : function(D) {
  22462. if (!D || Ext.isDate(D)) {
  22463. return D
  22464. }
  22465. var B = Date.parseDate(D, this.format);
  22466. if (!B && this.altFormats) {
  22467. if (!this.altFormatsArray) {
  22468. this.altFormatsArray = this.altFormats.split("|")
  22469. }
  22470. for (var C = 0, A = this.altFormatsArray.length; C < A && !B; C++) {
  22471. B = Date.parseDate(D, this.altFormatsArray[C])
  22472. }
  22473. }
  22474. return B
  22475. },
  22476. onDestroy : function() {
  22477. if (this.menu) {
  22478. this.menu.destroy()
  22479. }
  22480. if (this.wrap) {
  22481. this.wrap.remove()
  22482. }
  22483. Ext.form.DateField.superclass.onDestroy.call(this)
  22484. },
  22485. formatDate : function(A) {
  22486. return Ext.isDate(A) ? A.dateFormat(this.format) : A
  22487. },
  22488. menuListeners : {
  22489. select : function(A, B) {
  22490. this.setValue(B)
  22491. },
  22492. show : function() {
  22493. this.onFocus()
  22494. },
  22495. hide : function() {
  22496. this.focus.defer(10, this);
  22497. var A = this.menuListeners;
  22498. this.menu.un("select", A.select, this);
  22499. this.menu.un("show", A.show, this);
  22500. this.menu.un("hide", A.hide, this)
  22501. }
  22502. },
  22503. onTriggerClick : function() {
  22504. if (this.disabled) {
  22505. return
  22506. }
  22507. if (this.menu == null) {
  22508. this.menu = new Ext.menu.DateMenu()
  22509. }
  22510. Ext.apply(this.menu.picker, {
  22511. minDate : this.minValue,
  22512. maxDate : this.maxValue,
  22513. disabledDatesRE : this.ddMatch,
  22514. disabledDatesText : this.disabledDatesText,
  22515. disabledDays : this.disabledDays,
  22516. disabledDaysText : this.disabledDaysText,
  22517. format : this.format,
  22518. minText : String.format(this.minText, this
  22519. .formatDate(this.minValue)),
  22520. maxText : String.format(this.maxText, this
  22521. .formatDate(this.maxValue))
  22522. });
  22523. this.menu.on(Ext.apply({}, this.menuListeners, {
  22524. scope : this
  22525. }));
  22526. this.menu.picker.setValue(this.getValue() || new Date());
  22527. this.menu.show(this.el, "tl-bl?")
  22528. },
  22529. beforeBlur : function() {
  22530. var A = this.parseDate(this.getRawValue());
  22531. if (A) {
  22532. this.setValue(A)
  22533. }
  22534. }
  22535. });
  22536. Ext.reg("datefield", Ext.form.DateField);
  22537. Ext.form.ComboBox = Ext.extend(Ext.form.TriggerField, {
  22538. defaultAutoCreate : {
  22539. tag : "input",
  22540. type : "text",
  22541. size : "24",
  22542. autocomplete : "off"
  22543. },
  22544. listClass : "",
  22545. selectedClass : "x-combo-selected",
  22546. triggerClass : "x-form-arrow-trigger",
  22547. shadow : "sides",
  22548. listAlign : "tl-bl?",
  22549. maxHeight : 300,
  22550. minHeight : 90,
  22551. triggerAction : "query",
  22552. minChars : 4,
  22553. typeAhead : false,
  22554. queryDelay : 500,
  22555. pageSize : 0,
  22556. selectOnFocus : false,
  22557. queryParam : "query",
  22558. loadingText : "Loading...",
  22559. resizable : false,
  22560. handleHeight : 8,
  22561. editable : true,
  22562. allQuery : "",
  22563. mode : "remote",
  22564. minListWidth : 70,
  22565. forceSelection : false,
  22566. typeAheadDelay : 250,
  22567. lazyInit : true,
  22568. initComponent : function() {
  22569. Ext.form.ComboBox.superclass.initComponent.call(this);
  22570. this.addEvents("expand", "collapse", "beforeselect", "select",
  22571. "beforequery");
  22572. if (this.transform) {
  22573. this.allowDomMove = false;
  22574. var C = Ext.getDom(this.transform);
  22575. if (!this.hiddenName) {
  22576. this.hiddenName = C.name
  22577. }
  22578. if (!this.store) {
  22579. this.mode = "local";
  22580. var G = [], D = C.options;
  22581. for (var B = 0, A = D.length; B < A; B++) {
  22582. var F = D[B];
  22583. var E = (Ext.isIE
  22584. ? F.getAttributeNode("value").specified
  22585. : F.hasAttribute("value"))
  22586. ? F.value
  22587. : F.text;
  22588. if (F.selected) {
  22589. this.value = E
  22590. }
  22591. G.push([E, F.text])
  22592. }
  22593. this.store = new Ext.data.SimpleStore({
  22594. "id" : 0,
  22595. fields : ["value", "text"],
  22596. data : G
  22597. });
  22598. this.valueField = "value";
  22599. this.displayField = "text"
  22600. }
  22601. C.name = Ext.id();
  22602. if (!this.lazyRender) {
  22603. this.target = true;
  22604. this.el = Ext.DomHelper.insertBefore(C, this.autoCreate
  22605. || this.defaultAutoCreate);
  22606. Ext.removeNode(C);
  22607. this.render(this.el.parentNode)
  22608. } else {
  22609. Ext.removeNode(C)
  22610. }
  22611. }
  22612. this.selectedIndex = -1;
  22613. if (this.mode == "local") {
  22614. if (this.initialConfig.queryDelay === undefined) {
  22615. this.queryDelay = 10
  22616. }
  22617. if (this.initialConfig.minChars === undefined) {
  22618. this.minChars = 0
  22619. }
  22620. }
  22621. },
  22622. onRender : function(B, A) {
  22623. Ext.form.ComboBox.superclass.onRender.call(this, B, A);
  22624. if (this.hiddenName) {
  22625. this.hiddenField = this.el.insertSibling({
  22626. tag : "input",
  22627. type : "hidden",
  22628. name : this.hiddenName,
  22629. id : (this.hiddenId || this.hiddenName)
  22630. }, "before", true);
  22631. this.hiddenField.value = this.hiddenValue !== undefined
  22632. ? this.hiddenValue
  22633. : this.value !== undefined ? this.value : "";
  22634. this.el.dom.removeAttribute("name")
  22635. }
  22636. if (Ext.isGecko) {
  22637. this.el.dom.setAttribute("autocomplete", "off")
  22638. }
  22639. if (!this.lazyInit) {
  22640. this.initList()
  22641. } else {
  22642. this.on("focus", this.initList, this, {
  22643. single : true
  22644. })
  22645. }
  22646. if (!this.editable) {
  22647. this.editable = true;
  22648. this.setEditable(false)
  22649. }
  22650. },
  22651. initList : function() {
  22652. if (!this.list) {
  22653. var A = "x-combo-list";
  22654. this.list = new Ext.Layer({
  22655. shadow : this.shadow,
  22656. cls : [A, this.listClass].join(" "),
  22657. constrain : false
  22658. });
  22659. var B = this.listWidth
  22660. || Math
  22661. .max(this.wrap.getWidth(),
  22662. this.minListWidth);
  22663. this.list.setWidth(B);
  22664. this.list.swallowEvent("mousewheel");
  22665. this.assetHeight = 0;
  22666. if (this.title) {
  22667. this.header = this.list.createChild({
  22668. cls : A + "-hd",
  22669. html : this.title
  22670. });
  22671. this.assetHeight += this.header.getHeight()
  22672. }
  22673. this.innerList = this.list.createChild({
  22674. cls : A + "-inner"
  22675. });
  22676. this.innerList.on("mouseover", this.onViewOver, this);
  22677. this.innerList.on("mousemove", this.onViewMove, this);
  22678. this.innerList.setWidth(B - this.list.getFrameWidth("lr"));
  22679. if (this.pageSize) {
  22680. this.footer = this.list.createChild({
  22681. cls : A + "-ft"
  22682. });
  22683. this.pageTb = new Ext.PagingToolbar({
  22684. store : this.store,
  22685. pageSize : this.pageSize,
  22686. renderTo : this.footer
  22687. });
  22688. this.assetHeight += this.footer.getHeight()
  22689. }
  22690. if (!this.tpl) {
  22691. this.tpl = "<tpl for=\".\"><div class=\"" + A
  22692. + "-item\">{" + this.displayField
  22693. + "}</div></tpl>"
  22694. }
  22695. this.view = new Ext.DataView({
  22696. applyTo : this.innerList,
  22697. tpl : this.tpl,
  22698. singleSelect : true,
  22699. selectedClass : this.selectedClass,
  22700. itemSelector : this.itemSelector || "." + A
  22701. + "-item"
  22702. });
  22703. this.view.on("click", this.onViewClick, this);
  22704. this.bindStore(this.store, true);
  22705. if (this.resizable) {
  22706. this.resizer = new Ext.Resizable(this.list, {
  22707. pinned : true,
  22708. handles : "se"
  22709. });
  22710. this.resizer.on("resize", function(E, C, D) {
  22711. this.maxHeight = D - this.handleHeight
  22712. - this.list.getFrameWidth("tb")
  22713. - this.assetHeight;
  22714. this.listWidth = C;
  22715. this.innerList.setWidth(C
  22716. - this.list.getFrameWidth("lr"));
  22717. this.restrictHeight()
  22718. }, this);
  22719. this[this.pageSize ? "footer" : "innerList"].setStyle(
  22720. "margin-bottom", this.handleHeight + "px")
  22721. }
  22722. }
  22723. },
  22724. bindStore : function(A, B) {
  22725. if (this.store && !B) {
  22726. this.store.un("beforeload", this.onBeforeLoad, this);
  22727. this.store.un("load", this.onLoad, this);
  22728. this.store.un("loadexception", this.collapse, this);
  22729. if (!A) {
  22730. this.store = null;
  22731. if (this.view) {
  22732. this.view.setStore(null)
  22733. }
  22734. }
  22735. }
  22736. if (A) {
  22737. this.store = Ext.StoreMgr.lookup(A);
  22738. this.store.on("beforeload", this.onBeforeLoad, this);
  22739. this.store.on("load", this.onLoad, this);
  22740. this.store.on("loadexception", this.collapse, this);
  22741. if (this.view) {
  22742. this.view.setStore(A)
  22743. }
  22744. }
  22745. },
  22746. initEvents : function() {
  22747. Ext.form.ComboBox.superclass.initEvents.call(this);
  22748. this.keyNav = new Ext.KeyNav(this.el, {
  22749. "up" : function(A) {
  22750. this.inKeyMode = true;
  22751. this.selectPrev()
  22752. },
  22753. "down" : function(A) {
  22754. if (!this.isExpanded()) {
  22755. this.onTriggerClick()
  22756. } else {
  22757. this.inKeyMode = true;
  22758. this.selectNext()
  22759. }
  22760. },
  22761. "enter" : function(A) {
  22762. this.onViewClick();
  22763. this.delayedCheck = true;
  22764. this.unsetDelayCheck.defer(10, this)
  22765. },
  22766. "esc" : function(A) {
  22767. this.collapse()
  22768. },
  22769. "tab" : function(A) {
  22770. this.onViewClick(false);
  22771. return true
  22772. },
  22773. scope : this,
  22774. doRelay : function(C, B, A) {
  22775. if (A == "down" || this.scope.isExpanded()) {
  22776. return Ext.KeyNav.prototype.doRelay.apply(
  22777. this, arguments)
  22778. }
  22779. return true
  22780. },
  22781. forceKeyDown : true
  22782. });
  22783. this.queryDelay = Math.max(this.queryDelay || 10,
  22784. this.mode == "local" ? 10 : 250);
  22785. this.dqTask = new Ext.util.DelayedTask(this.initQuery, this);
  22786. if (this.typeAhead) {
  22787. this.taTask = new Ext.util.DelayedTask(this.onTypeAhead,
  22788. this)
  22789. }
  22790. if (this.editable !== false) {
  22791. this.el.on("keyup", this.onKeyUp, this)
  22792. }
  22793. if (this.forceSelection) {
  22794. this.on("blur", this.doForce, this)
  22795. }
  22796. },
  22797. onDestroy : function() {
  22798. if (this.view) {
  22799. this.view.el.removeAllListeners();
  22800. this.view.el.remove();
  22801. this.view.purgeListeners()
  22802. }
  22803. if (this.list) {
  22804. this.list.destroy()
  22805. }
  22806. this.bindStore(null);
  22807. Ext.form.ComboBox.superclass.onDestroy.call(this)
  22808. },
  22809. unsetDelayCheck : function() {
  22810. delete this.delayedCheck
  22811. },
  22812. fireKey : function(A) {
  22813. if (A.isNavKeyPress() && !this.isExpanded()
  22814. && !this.delayedCheck) {
  22815. this.fireEvent("specialkey", this, A)
  22816. }
  22817. },
  22818. onResize : function(A, B) {
  22819. Ext.form.ComboBox.superclass.onResize.apply(this, arguments);
  22820. if (this.list && this.listWidth === undefined) {
  22821. var C = Math.max(A, this.minListWidth);
  22822. this.list.setWidth(C);
  22823. this.innerList.setWidth(C - this.list.getFrameWidth("lr"))
  22824. }
  22825. },
  22826. onEnable : function() {
  22827. Ext.form.ComboBox.superclass.onEnable.apply(this, arguments);
  22828. if (this.hiddenField) {
  22829. this.hiddenField.disabled = false
  22830. }
  22831. },
  22832. onDisable : function() {
  22833. Ext.form.ComboBox.superclass.onDisable.apply(this, arguments);
  22834. if (this.hiddenField) {
  22835. this.hiddenField.disabled = true
  22836. }
  22837. },
  22838. setEditable : function(A) {
  22839. if (A == this.editable) {
  22840. return
  22841. }
  22842. this.editable = A;
  22843. if (!A) {
  22844. this.el.dom.setAttribute("readOnly", true);
  22845. this.el.on("mousedown", this.onTriggerClick, this);
  22846. this.el.addClass("x-combo-noedit")
  22847. } else {
  22848. this.el.dom.setAttribute("readOnly", false);
  22849. this.el.un("mousedown", this.onTriggerClick, this);
  22850. this.el.removeClass("x-combo-noedit")
  22851. }
  22852. },
  22853. onBeforeLoad : function() {
  22854. if (!this.hasFocus) {
  22855. return
  22856. }
  22857. this.innerList.update(this.loadingText
  22858. ? "<div class=\"loading-indicator\">"
  22859. + this.loadingText + "</div>"
  22860. : "");
  22861. this.restrictHeight();
  22862. this.selectedIndex = -1
  22863. },
  22864. onLoad : function() {
  22865. if (!this.hasFocus) {
  22866. return
  22867. }
  22868. if (this.store.getCount() > 0) {
  22869. this.expand();
  22870. this.restrictHeight();
  22871. if (this.lastQuery == this.allQuery) {
  22872. if (this.editable) {
  22873. this.el.dom.select()
  22874. }
  22875. if (!this.selectByValue(this.value, true)) {
  22876. this.select(0, true)
  22877. }
  22878. } else {
  22879. this.selectNext();
  22880. if (this.typeAhead
  22881. && this.lastKey != Ext.EventObject.BACKSPACE
  22882. && this.lastKey != Ext.EventObject.DELETE) {
  22883. this.taTask.delay(this.typeAheadDelay)
  22884. }
  22885. }
  22886. } else {
  22887. this.onEmptyResults()
  22888. }
  22889. },
  22890. onTypeAhead : function() {
  22891. if (this.store.getCount() > 0) {
  22892. var B = this.store.getAt(0);
  22893. var C = B.data[this.displayField];
  22894. var A = C.length;
  22895. var D = this.getRawValue().length;
  22896. if (D != A) {
  22897. this.setRawValue(C);
  22898. this.selectText(D, C.length)
  22899. }
  22900. }
  22901. },
  22902. onSelect : function(A, B) {
  22903. if (this.fireEvent("beforeselect", this, A, B) !== false) {
  22904. this.setValue(A.data[this.valueField || this.displayField]);
  22905. this.collapse();
  22906. this.fireEvent("select", this, A, B)
  22907. }
  22908. },
  22909. getValue : function() {
  22910. if (this.valueField) {
  22911. return typeof this.value != "undefined" ? this.value : ""
  22912. } else {
  22913. return Ext.form.ComboBox.superclass.getValue.call(this)
  22914. }
  22915. },
  22916. clearValue : function() {
  22917. if (this.hiddenField) {
  22918. this.hiddenField.value = ""
  22919. }
  22920. this.setRawValue("");
  22921. this.lastSelectionText = "";
  22922. this.applyEmptyText();
  22923. this.value = ""
  22924. },
  22925. setValue : function(A) {
  22926. var C = A;
  22927. if (this.valueField) {
  22928. var B = this.findRecord(this.valueField, A);
  22929. if (B) {
  22930. C = B.data[this.displayField]
  22931. } else {
  22932. if (this.valueNotFoundText !== undefined) {
  22933. C = this.valueNotFoundText
  22934. }
  22935. }
  22936. }
  22937. this.lastSelectionText = C;
  22938. if (this.hiddenField) {
  22939. this.hiddenField.value = A
  22940. }
  22941. Ext.form.ComboBox.superclass.setValue.call(this, C);
  22942. this.value = A
  22943. },
  22944. findRecord : function(C, B) {
  22945. var A;
  22946. if (this.store.getCount() > 0) {
  22947. this.store.each(function(D) {
  22948. if (D.data[C] == B) {
  22949. A = D;
  22950. return false
  22951. }
  22952. })
  22953. }
  22954. return A
  22955. },
  22956. onViewMove : function(B, A) {
  22957. this.inKeyMode = false
  22958. },
  22959. onViewOver : function(D, B) {
  22960. if (this.inKeyMode) {
  22961. return
  22962. }
  22963. var C = this.view.findItemFromChild(B);
  22964. if (C) {
  22965. var A = this.view.indexOf(C);
  22966. this.select(A, false)
  22967. }
  22968. },
  22969. onViewClick : function(B) {
  22970. var A = this.view.getSelectedIndexes()[0];
  22971. var C = this.store.getAt(A);
  22972. if (C) {
  22973. this.onSelect(C, A)
  22974. }
  22975. if (B !== false) {
  22976. this.el.focus()
  22977. }
  22978. },
  22979. restrictHeight : function() {
  22980. this.innerList.dom.style.height = "";
  22981. var B = this.innerList.dom;
  22982. var E = this.list.getFrameWidth("tb")
  22983. + (this.resizable ? this.handleHeight : 0)
  22984. + this.assetHeight;
  22985. var C = Math
  22986. .max(B.clientHeight, B.offsetHeight, B.scrollHeight);
  22987. var A = this.getPosition()[1] - Ext.getBody().getScroll().top;
  22988. var F = Ext.lib.Dom.getViewHeight() - A - this.getSize().height;
  22989. var D = Math.max(A, F, this.minHeight || 0)
  22990. - this.list.shadow.offset - E - 2;
  22991. C = Math.min(C, D, this.maxHeight);
  22992. this.innerList.setHeight(C);
  22993. this.list.beginUpdate();
  22994. this.list.setHeight(C + E);
  22995. this.list.alignTo(this.el, this.listAlign);
  22996. this.list.endUpdate()
  22997. },
  22998. onEmptyResults : function() {
  22999. this.collapse()
  23000. },
  23001. isExpanded : function() {
  23002. return this.list && this.list.isVisible()
  23003. },
  23004. selectByValue : function(A, C) {
  23005. if (A !== undefined && A !== null) {
  23006. var B = this.findRecord(this.valueField
  23007. || this.displayField, A);
  23008. if (B) {
  23009. this.select(this.store.indexOf(B), C);
  23010. return true
  23011. }
  23012. }
  23013. return false
  23014. },
  23015. select : function(A, C) {
  23016. this.selectedIndex = A;
  23017. this.view.select(A);
  23018. if (C !== false) {
  23019. var B = this.view.getNode(A);
  23020. if (B) {
  23021. this.innerList.scrollChildIntoView(B, false)
  23022. }
  23023. }
  23024. },
  23025. selectNext : function() {
  23026. var A = this.store.getCount();
  23027. if (A > 0) {
  23028. if (this.selectedIndex == -1) {
  23029. this.select(0)
  23030. } else {
  23031. if (this.selectedIndex < A - 1) {
  23032. this.select(this.selectedIndex + 1)
  23033. }
  23034. }
  23035. }
  23036. },
  23037. selectPrev : function() {
  23038. var A = this.store.getCount();
  23039. if (A > 0) {
  23040. if (this.selectedIndex == -1) {
  23041. this.select(0)
  23042. } else {
  23043. if (this.selectedIndex != 0) {
  23044. this.select(this.selectedIndex - 1)
  23045. }
  23046. }
  23047. }
  23048. },
  23049. onKeyUp : function(A) {
  23050. if (this.editable !== false && !A.isSpecialKey()) {
  23051. this.lastKey = A.getKey();
  23052. this.dqTask.delay(this.queryDelay)
  23053. }
  23054. },
  23055. validateBlur : function() {
  23056. return !this.list || !this.list.isVisible()
  23057. },
  23058. initQuery : function() {
  23059. this.doQuery(this.getRawValue())
  23060. },
  23061. doForce : function() {
  23062. if (this.el.dom.value.length > 0) {
  23063. this.el.dom.value = this.lastSelectionText === undefined
  23064. ? ""
  23065. : this.lastSelectionText;
  23066. this.applyEmptyText()
  23067. }
  23068. },
  23069. doQuery : function(C, B) {
  23070. if (C === undefined || C === null) {
  23071. C = ""
  23072. }
  23073. var A = {
  23074. query : C,
  23075. forceAll : B,
  23076. combo : this,
  23077. cancel : false
  23078. };
  23079. if (this.fireEvent("beforequery", A) === false || A.cancel) {
  23080. return false
  23081. }
  23082. C = A.query;
  23083. B = A.forceAll;
  23084. if (B === true || (C.length >= this.minChars)) {
  23085. if (this.lastQuery !== C) {
  23086. this.lastQuery = C;
  23087. if (this.mode == "local") {
  23088. this.selectedIndex = -1;
  23089. if (B) {
  23090. this.store.clearFilter()
  23091. } else {
  23092. this.store.filter(this.displayField, C)
  23093. }
  23094. this.onLoad()
  23095. } else {
  23096. this.store.baseParams[this.queryParam] = C;
  23097. this.store.load({
  23098. params : this.getParams(C)
  23099. });
  23100. this.expand()
  23101. }
  23102. } else {
  23103. this.selectedIndex = -1;
  23104. this.onLoad()
  23105. }
  23106. }
  23107. },
  23108. getParams : function(A) {
  23109. var B = {};
  23110. if (this.pageSize) {
  23111. B.start = 0;
  23112. B.limit = this.pageSize
  23113. }
  23114. return B
  23115. },
  23116. collapse : function() {
  23117. if (!this.isExpanded()) {
  23118. return
  23119. }
  23120. this.list.hide();
  23121. Ext.getDoc().un("mousewheel", this.collapseIf, this);
  23122. Ext.getDoc().un("mousedown", this.collapseIf, this);
  23123. this.fireEvent("collapse", this)
  23124. },
  23125. collapseIf : function(A) {
  23126. if (!A.within(this.wrap) && !A.within(this.list)) {
  23127. this.collapse()
  23128. }
  23129. },
  23130. expand : function() {
  23131. if (this.isExpanded() || !this.hasFocus) {
  23132. return
  23133. }
  23134. this.list.alignTo(this.wrap, this.listAlign);
  23135. this.list.show();
  23136. this.innerList.setOverflow("auto");
  23137. Ext.getDoc().on("mousewheel", this.collapseIf, this);
  23138. Ext.getDoc().on("mousedown", this.collapseIf, this);
  23139. this.fireEvent("expand", this)
  23140. },
  23141. onTriggerClick : function() {
  23142. if (this.disabled) {
  23143. return
  23144. }
  23145. if (this.isExpanded()) {
  23146. this.collapse();
  23147. this.el.focus()
  23148. } else {
  23149. this.onFocus({});
  23150. if (this.triggerAction == "all") {
  23151. this.doQuery(this.allQuery, true)
  23152. } else {
  23153. this.doQuery(this.getRawValue())
  23154. }
  23155. this.el.focus()
  23156. }
  23157. }
  23158. });
  23159. Ext.reg("combo", Ext.form.ComboBox);
  23160. Ext.form.Checkbox = Ext.extend(Ext.form.Field, {
  23161. focusClass : undefined,
  23162. fieldClass : "x-form-field",
  23163. checked : false,
  23164. defaultAutoCreate : {
  23165. tag : "input",
  23166. type : "checkbox",
  23167. autocomplete : "off"
  23168. },
  23169. initComponent : function() {
  23170. Ext.form.Checkbox.superclass.initComponent.call(this);
  23171. this.addEvents("check")
  23172. },
  23173. onResize : function() {
  23174. Ext.form.Checkbox.superclass.onResize.apply(this, arguments);
  23175. if (!this.boxLabel) {
  23176. this.el.alignTo(this.wrap, "c-c")
  23177. }
  23178. },
  23179. initEvents : function() {
  23180. Ext.form.Checkbox.superclass.initEvents.call(this);
  23181. this.el.on("click", this.onClick, this);
  23182. this.el.on("change", this.onClick, this)
  23183. },
  23184. getResizeEl : function() {
  23185. return this.wrap
  23186. },
  23187. getPositionEl : function() {
  23188. return this.wrap
  23189. },
  23190. markInvalid : Ext.emptyFn,
  23191. clearInvalid : Ext.emptyFn,
  23192. onRender : function(B, A) {
  23193. Ext.form.Checkbox.superclass.onRender.call(this, B, A);
  23194. if (this.inputValue !== undefined) {
  23195. this.el.dom.value = this.inputValue
  23196. }
  23197. this.wrap = this.el.wrap({
  23198. cls : "x-form-check-wrap"
  23199. });
  23200. if (this.boxLabel) {
  23201. this.wrap.createChild({
  23202. tag : "label",
  23203. htmlFor : this.el.id,
  23204. cls : "x-form-cb-label",
  23205. html : this.boxLabel
  23206. })
  23207. }
  23208. if (this.checked) {
  23209. this.setValue(true)
  23210. } else {
  23211. this.checked = this.el.dom.checked
  23212. }
  23213. },
  23214. onDestroy : function() {
  23215. if (this.wrap) {
  23216. this.wrap.remove()
  23217. }
  23218. Ext.form.Checkbox.superclass.onDestroy.call(this)
  23219. },
  23220. initValue : Ext.emptyFn,
  23221. getValue : function() {
  23222. if (this.rendered) {
  23223. return this.el.dom.checked
  23224. }
  23225. return false
  23226. },
  23227. onClick : function() {
  23228. if (this.el.dom.checked != this.checked) {
  23229. this.setValue(this.el.dom.checked)
  23230. }
  23231. },
  23232. setValue : function(A) {
  23233. this.checked = (A === true || A === "true" || A == "1" || String(A)
  23234. .toLowerCase() == "on");
  23235. if (this.el && this.el.dom) {
  23236. this.el.dom.checked = this.checked;
  23237. this.el.dom.defaultChecked = this.checked
  23238. }
  23239. this.fireEvent("check", this, this.checked)
  23240. }
  23241. });
  23242. Ext.reg("checkbox", Ext.form.Checkbox);
  23243. Ext.form.Radio = Ext.extend(Ext.form.Checkbox, {
  23244. inputType : "radio",
  23245. markInvalid : Ext.emptyFn,
  23246. clearInvalid : Ext.emptyFn,
  23247. getGroupValue : function() {
  23248. var A = this.el.up("form") || Ext.getBody();
  23249. var B = A.child("input[name=" + this.el.dom.name + "]:checked",
  23250. true);
  23251. return B ? B.value : null
  23252. },
  23253. onClick : function() {
  23254. if (this.el.dom.checked != this.checked) {
  23255. var B = this.el.up("form") || Ext.getBody();
  23256. var A = B.select("input[name=" + this.el.dom.name + "]");
  23257. A.each(function(C) {
  23258. if (C.dom.id == this.id) {
  23259. this.setValue(true)
  23260. } else {
  23261. Ext.getCmp(C.dom.id).setValue(false)
  23262. }
  23263. }, this)
  23264. }
  23265. },
  23266. setValue : function(A) {
  23267. if (typeof A == "boolean") {
  23268. Ext.form.Radio.superclass.setValue.call(this, A)
  23269. } else {
  23270. var B = this.el.up("form").child(
  23271. "input[name=" + this.el.dom.name + "][value=" + A
  23272. + "]", true);
  23273. if (B) {
  23274. B.checked = true
  23275. }
  23276. }
  23277. }
  23278. });
  23279. Ext.reg("radio", Ext.form.Radio);
  23280. Ext.form.Hidden = Ext.extend(Ext.form.Field, {
  23281. inputType : "hidden",
  23282. onRender : function() {
  23283. Ext.form.Hidden.superclass.onRender.apply(this, arguments)
  23284. },
  23285. initEvents : function() {
  23286. this.originalValue = this.getValue()
  23287. },
  23288. setSize : Ext.emptyFn,
  23289. setWidth : Ext.emptyFn,
  23290. setHeight : Ext.emptyFn,
  23291. setPosition : Ext.emptyFn,
  23292. setPagePosition : Ext.emptyFn,
  23293. markInvalid : Ext.emptyFn,
  23294. clearInvalid : Ext.emptyFn
  23295. });
  23296. Ext.reg("hidden", Ext.form.Hidden);
  23297. Ext.form.BasicForm = function(B, A) {
  23298. Ext.apply(this, A);
  23299. this.items = new Ext.util.MixedCollection(false, function(C) {
  23300. return C.id || (C.id = Ext.id())
  23301. });
  23302. this.addEvents("beforeaction", "actionfailed", "actioncomplete");
  23303. if (B) {
  23304. this.initEl(B)
  23305. }
  23306. Ext.form.BasicForm.superclass.constructor.call(this)
  23307. };
  23308. Ext.extend(Ext.form.BasicForm, Ext.util.Observable, {
  23309. timeout : 30,
  23310. activeAction : null,
  23311. trackResetOnLoad : false,
  23312. initEl : function(A) {
  23313. this.el = Ext.get(A);
  23314. this.id = this.el.id || Ext.id();
  23315. if (!this.standardSubmit) {
  23316. this.el.on("submit", this.onSubmit, this)
  23317. }
  23318. this.el.addClass("x-form")
  23319. },
  23320. getEl : function() {
  23321. return this.el
  23322. },
  23323. onSubmit : function(A) {
  23324. A.stopEvent()
  23325. },
  23326. destroy : function() {
  23327. this.items.each(function(A) {
  23328. Ext.destroy(A)
  23329. });
  23330. if (this.el) {
  23331. this.el.removeAllListeners();
  23332. this.el.remove()
  23333. }
  23334. this.purgeListeners()
  23335. },
  23336. isValid : function() {
  23337. var A = true;
  23338. this.items.each(function(B) {
  23339. if (!B.validate()) {
  23340. A = false
  23341. }
  23342. });
  23343. return A
  23344. },
  23345. isDirty : function() {
  23346. var A = false;
  23347. this.items.each(function(B) {
  23348. if (B.isDirty()) {
  23349. A = true;
  23350. return false
  23351. }
  23352. });
  23353. return A
  23354. },
  23355. doAction : function(B, A) {
  23356. if (typeof B == "string") {
  23357. B = new Ext.form.Action.ACTION_TYPES[B](this, A)
  23358. }
  23359. if (this.fireEvent("beforeaction", this, B) !== false) {
  23360. this.beforeAction(B);
  23361. B.run.defer(100, B)
  23362. }
  23363. return this
  23364. },
  23365. submit : function(B) {
  23366. if (this.standardSubmit) {
  23367. var A = this.isValid();
  23368. if (A) {
  23369. this.el.dom.submit()
  23370. }
  23371. return A
  23372. }
  23373. this.doAction("submit", B);
  23374. return this
  23375. },
  23376. load : function(A) {
  23377. this.doAction("load", A);
  23378. return this
  23379. },
  23380. updateRecord : function(B) {
  23381. B.beginEdit();
  23382. var A = B.fields;
  23383. A.each(function(C) {
  23384. var D = this.findField(C.name);
  23385. if (D) {
  23386. B.set(C.name, D.getValue())
  23387. }
  23388. }, this);
  23389. B.endEdit();
  23390. return this
  23391. },
  23392. loadRecord : function(A) {
  23393. this.setValues(A.data);
  23394. return this
  23395. },
  23396. beforeAction : function(A) {
  23397. var B = A.options;
  23398. if (B.waitMsg) {
  23399. if (this.waitMsgTarget === true) {
  23400. this.el.mask(B.waitMsg, "x-mask-loading")
  23401. } else {
  23402. if (this.waitMsgTarget) {
  23403. this.waitMsgTarget = Ext.get(this.waitMsgTarget);
  23404. this.waitMsgTarget.mask(B.waitMsg, "x-mask-loading")
  23405. } else {
  23406. Ext.MessageBox.wait(B.waitMsg, B.waitTitle
  23407. || this.waitTitle || "Please Wait...")
  23408. }
  23409. }
  23410. }
  23411. },
  23412. afterAction : function(A, C) {
  23413. this.activeAction = null;
  23414. var B = A.options;
  23415. if (B.waitMsg) {
  23416. if (this.waitMsgTarget === true) {
  23417. this.el.unmask()
  23418. } else {
  23419. if (this.waitMsgTarget) {
  23420. this.waitMsgTarget.unmask()
  23421. } else {
  23422. Ext.MessageBox.updateProgress(1);
  23423. Ext.MessageBox.hide()
  23424. }
  23425. }
  23426. }
  23427. if (C) {
  23428. if (B.reset) {
  23429. this.reset()
  23430. }
  23431. Ext.callback(B.success, B.scope, [this, A]);
  23432. this.fireEvent("actioncomplete", this, A)
  23433. } else {
  23434. Ext.callback(B.failure, B.scope, [this, A]);
  23435. this.fireEvent("actionfailed", this, A)
  23436. }
  23437. },
  23438. findField : function(B) {
  23439. var A = this.items.get(B);
  23440. if (!A) {
  23441. this.items.each(function(C) {
  23442. if (C.isFormField
  23443. && (C.dataIndex == B || C.id == B || C.getName() == B)) {
  23444. A = C;
  23445. return false
  23446. }
  23447. })
  23448. }
  23449. return A || null
  23450. },
  23451. markInvalid : function(G) {
  23452. if (Ext.isArray(G)) {
  23453. for (var C = 0, A = G.length; C < A; C++) {
  23454. var B = G[C];
  23455. var D = this.findField(B.id);
  23456. if (D) {
  23457. D.markInvalid(B.msg)
  23458. }
  23459. }
  23460. } else {
  23461. var E, F;
  23462. for (F in G) {
  23463. if (typeof G[F] != "function" && (E = this.findField(F))) {
  23464. E.markInvalid(G[F])
  23465. }
  23466. }
  23467. }
  23468. return this
  23469. },
  23470. setValues : function(C) {
  23471. if (Ext.isArray(C)) {
  23472. for (var D = 0, A = C.length; D < A; D++) {
  23473. var B = C[D];
  23474. var E = this.findField(B.id);
  23475. if (E) {
  23476. E.setValue(B.value);
  23477. if (this.trackResetOnLoad) {
  23478. E.originalValue = E.getValue()
  23479. }
  23480. }
  23481. }
  23482. } else {
  23483. var F, G;
  23484. for (G in C) {
  23485. if (typeof C[G] != "function" && (F = this.findField(G))) {
  23486. F.setValue(C[G]);
  23487. if (this.trackResetOnLoad) {
  23488. F.originalValue = F.getValue()
  23489. }
  23490. }
  23491. }
  23492. }
  23493. return this
  23494. },
  23495. getValues : function(B) {
  23496. var A = Ext.lib.Ajax.serializeForm(this.el.dom);
  23497. if (B === true) {
  23498. return A
  23499. }
  23500. return Ext.urlDecode(A)
  23501. },
  23502. clearInvalid : function() {
  23503. this.items.each(function(A) {
  23504. A.clearInvalid()
  23505. });
  23506. return this
  23507. },
  23508. reset : function() {
  23509. this.items.each(function(A) {
  23510. A.reset()
  23511. });
  23512. return this
  23513. },
  23514. add : function() {
  23515. this.items.addAll(Array.prototype.slice.call(arguments, 0));
  23516. return this
  23517. },
  23518. remove : function(A) {
  23519. this.items.remove(A);
  23520. return this
  23521. },
  23522. render : function() {
  23523. this.items.each(function(A) {
  23524. if (A.isFormField && !A.rendered
  23525. && document.getElementById(A.id)) {
  23526. A.applyToMarkup(A.id)
  23527. }
  23528. });
  23529. return this
  23530. },
  23531. applyToFields : function(A) {
  23532. this.items.each(function(B) {
  23533. Ext.apply(B, A)
  23534. });
  23535. return this
  23536. },
  23537. applyIfToFields : function(A) {
  23538. this.items.each(function(B) {
  23539. Ext.applyIf(B, A)
  23540. });
  23541. return this
  23542. }
  23543. });
  23544. Ext.BasicForm = Ext.form.BasicForm;
  23545. Ext.FormPanel = Ext.extend(Ext.Panel, {
  23546. buttonAlign : "center",
  23547. minButtonWidth : 75,
  23548. labelAlign : "left",
  23549. monitorValid : false,
  23550. monitorPoll : 200,
  23551. layout : "form",
  23552. initComponent : function() {
  23553. this.form = this.createForm();
  23554. Ext.FormPanel.superclass.initComponent.call(this);
  23555. this.addEvents("clientvalidation");
  23556. this.relayEvents(this.form, ["beforeaction", "actionfailed",
  23557. "actioncomplete"])
  23558. },
  23559. createForm : function() {
  23560. delete this.initialConfig.listeners;
  23561. return new Ext.form.BasicForm(null, this.initialConfig)
  23562. },
  23563. initFields : function() {
  23564. var C = this.form;
  23565. var A = this;
  23566. var B = function(D) {
  23567. if (D.doLayout && D != A) {
  23568. Ext.applyIf(D, {
  23569. labelAlign : D.ownerCt.labelAlign,
  23570. labelWidth : D.ownerCt.labelWidth,
  23571. itemCls : D.ownerCt.itemCls
  23572. });
  23573. if (D.items) {
  23574. D.items.each(B)
  23575. }
  23576. } else {
  23577. if (D.isFormField) {
  23578. C.add(D)
  23579. }
  23580. }
  23581. };
  23582. this.items.each(B)
  23583. },
  23584. getLayoutTarget : function() {
  23585. return this.form.el
  23586. },
  23587. getForm : function() {
  23588. return this.form
  23589. },
  23590. onRender : function(B, A) {
  23591. this.initFields();
  23592. Ext.FormPanel.superclass.onRender.call(this, B, A);
  23593. var C = {
  23594. tag : "form",
  23595. method : this.method || "POST",
  23596. id : this.formId || Ext.id()
  23597. };
  23598. if (this.fileUpload) {
  23599. C.enctype = "multipart/form-data"
  23600. }
  23601. this.form.initEl(this.body.createChild(C))
  23602. },
  23603. beforeDestroy : function() {
  23604. Ext.FormPanel.superclass.beforeDestroy.call(this);
  23605. Ext.destroy(this.form)
  23606. },
  23607. initEvents : function() {
  23608. Ext.FormPanel.superclass.initEvents.call(this);
  23609. this.items.on("remove", this.onRemove, this);
  23610. this.items.on("add", this.onAdd, this);
  23611. if (this.monitorValid) {
  23612. this.startMonitoring()
  23613. }
  23614. },
  23615. onAdd : function(A, B) {
  23616. if (B.isFormField) {
  23617. this.form.add(B)
  23618. }
  23619. },
  23620. onRemove : function(A) {
  23621. if (A.isFormField) {
  23622. Ext.destroy(A.container.up(".x-form-item"));
  23623. this.form.remove(A)
  23624. }
  23625. },
  23626. startMonitoring : function() {
  23627. if (!this.bound) {
  23628. this.bound = true;
  23629. Ext.TaskMgr.start({
  23630. run : this.bindHandler,
  23631. interval : this.monitorPoll || 200,
  23632. scope : this
  23633. })
  23634. }
  23635. },
  23636. stopMonitoring : function() {
  23637. this.bound = false
  23638. },
  23639. load : function() {
  23640. this.form.load.apply(this.form, arguments)
  23641. },
  23642. onDisable : function() {
  23643. Ext.FormPanel.superclass.onDisable.call(this);
  23644. if (this.form) {
  23645. this.form.items.each(function() {
  23646. this.disable()
  23647. })
  23648. }
  23649. },
  23650. onEnable : function() {
  23651. Ext.FormPanel.superclass.onEnable.call(this);
  23652. if (this.form) {
  23653. this.form.items.each(function() {
  23654. this.enable()
  23655. })
  23656. }
  23657. },
  23658. bindHandler : function() {
  23659. if (!this.bound) {
  23660. return false
  23661. }
  23662. var D = true;
  23663. this.form.items.each(function(E) {
  23664. if (!E.isValid(true)) {
  23665. D = false;
  23666. return false
  23667. }
  23668. });
  23669. if (this.buttons) {
  23670. for (var C = 0, A = this.buttons.length; C < A; C++) {
  23671. var B = this.buttons[C];
  23672. if (B.formBind === true && B.disabled === D) {
  23673. B.setDisabled(!D)
  23674. }
  23675. }
  23676. }
  23677. this.fireEvent("clientvalidation", this, D)
  23678. }
  23679. });
  23680. Ext.reg("form", Ext.FormPanel);
  23681. Ext.form.FormPanel = Ext.FormPanel;
  23682. Ext.form.FieldSet = Ext.extend(Ext.Panel, {
  23683. baseCls : "x-fieldset",
  23684. layout : "form",
  23685. onRender : function(B, A) {
  23686. if (!this.el) {
  23687. this.el = document.createElement("fieldset");
  23688. this.el.id = this.id;
  23689. if (this.title || this.header || this.checkboxToggle) {
  23690. this.el.appendChild(document.createElement("legend")).className = "x-fieldset-header"
  23691. }
  23692. }
  23693. Ext.form.FieldSet.superclass.onRender.call(this, B, A);
  23694. if (this.checkboxToggle) {
  23695. var C = typeof this.checkboxToggle == "object"
  23696. ? this.checkboxToggle
  23697. : {
  23698. tag : "input",
  23699. type : "checkbox",
  23700. name : this.checkboxName || this.id + "-checkbox"
  23701. };
  23702. this.checkbox = this.header.insertFirst(C);
  23703. this.checkbox.dom.checked = !this.collapsed;
  23704. this.checkbox.on("click", this.onCheckClick, this)
  23705. }
  23706. },
  23707. onCollapse : function(A, B) {
  23708. if (this.checkbox) {
  23709. this.checkbox.dom.checked = false
  23710. }
  23711. this.afterCollapse()
  23712. },
  23713. onExpand : function(A, B) {
  23714. if (this.checkbox) {
  23715. this.checkbox.dom.checked = true
  23716. }
  23717. this.afterExpand()
  23718. },
  23719. onCheckClick : function() {
  23720. this[this.checkbox.dom.checked ? "expand" : "collapse"]()
  23721. }
  23722. });
  23723. Ext.reg("fieldset", Ext.form.FieldSet);
  23724. Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, {
  23725. enableFormat : true,
  23726. enableFontSize : true,
  23727. enableColors : true,
  23728. enableAlignments : true,
  23729. enableLists : true,
  23730. enableSourceEdit : true,
  23731. enableLinks : true,
  23732. enableFont : true,
  23733. createLinkText : "Please enter the URL for the link:",
  23734. defaultLinkValue : "http:/" + "/",
  23735. fontFamilies : ["Arial", "Courier New", "Tahoma", "Times New Roman",
  23736. "Verdana"],
  23737. defaultFont : "tahoma",
  23738. validationEvent : false,
  23739. deferHeight : true,
  23740. initialized : false,
  23741. activated : false,
  23742. sourceEditMode : false,
  23743. onFocus : Ext.emptyFn,
  23744. iframePad : 3,
  23745. hideMode : "offsets",
  23746. defaultAutoCreate : {
  23747. tag : "textarea",
  23748. style : "width:500px;height:300px;",
  23749. autocomplete : "off"
  23750. },
  23751. initComponent : function() {
  23752. this.addEvents("initialize", "activate", "beforesync", "beforepush",
  23753. "sync", "push", "editmodechange")
  23754. },
  23755. createFontOptions : function() {
  23756. var D = [], B = this.fontFamilies, C, F;
  23757. for (var E = 0, A = B.length; E < A; E++) {
  23758. C = B[E];
  23759. F = C.toLowerCase();
  23760. D.push("<option value=\"", F, "\" style=\"font-family:", C, ";\"",
  23761. (this.defaultFont == F ? " selected=\"true\">" : ">"), C,
  23762. "</option>")
  23763. }
  23764. return D.join("")
  23765. },
  23766. createToolbar : function(C) {
  23767. function B(F, D, E) {
  23768. return {
  23769. itemId : F,
  23770. cls : "x-btn-icon x-edit-" + F,
  23771. enableToggle : D !== false,
  23772. scope : C,
  23773. handler : E || C.relayBtnCmd,
  23774. clickEvent : "mousedown",
  23775. tooltip : C.buttonTips[F] || undefined,
  23776. tabIndex : -1
  23777. }
  23778. }
  23779. var A = new Ext.Toolbar({
  23780. renderTo : this.wrap.dom.firstChild
  23781. });
  23782. A.el.on("click", function(D) {
  23783. D.preventDefault()
  23784. });
  23785. if (this.enableFont && !Ext.isSafari) {
  23786. this.fontSelect = A.el.createChild({
  23787. tag : "select",
  23788. cls : "x-font-select",
  23789. html : this.createFontOptions()
  23790. });
  23791. this.fontSelect.on("change", function() {
  23792. var D = this.fontSelect.dom.value;
  23793. this.relayCmd("fontname", D);
  23794. this.deferFocus()
  23795. }, this);
  23796. A.add(this.fontSelect.dom, "-")
  23797. }
  23798. if (this.enableFormat) {
  23799. A.add(B("bold"), B("italic"), B("underline"))
  23800. }
  23801. if (this.enableFontSize) {
  23802. A.add("-", B("increasefontsize", false, this.adjustFont), B(
  23803. "decreasefontsize", false, this.adjustFont))
  23804. }
  23805. if (this.enableColors) {
  23806. A.add("-", {
  23807. itemId : "forecolor",
  23808. cls : "x-btn-icon x-edit-forecolor",
  23809. clickEvent : "mousedown",
  23810. tooltip : C.buttonTips["forecolor"] || undefined,
  23811. tabIndex : -1,
  23812. menu : new Ext.menu.ColorMenu({
  23813. allowReselect : true,
  23814. focus : Ext.emptyFn,
  23815. value : "000000",
  23816. plain : true,
  23817. selectHandler : function(E, D) {
  23818. this.execCmd("forecolor", Ext.isSafari
  23819. || Ext.isIE
  23820. ? "#" + D
  23821. : D);
  23822. this.deferFocus()
  23823. },
  23824. scope : this,
  23825. clickEvent : "mousedown"
  23826. })
  23827. }, {
  23828. itemId : "backcolor",
  23829. cls : "x-btn-icon x-edit-backcolor",
  23830. clickEvent : "mousedown",
  23831. tooltip : C.buttonTips["backcolor"] || undefined,
  23832. tabIndex : -1,
  23833. menu : new Ext.menu.ColorMenu({
  23834. focus : Ext.emptyFn,
  23835. value : "FFFFFF",
  23836. plain : true,
  23837. allowReselect : true,
  23838. selectHandler : function(E, D) {
  23839. if (Ext.isGecko) {
  23840. this.execCmd("useCSS", false);
  23841. this.execCmd("hilitecolor", D);
  23842. this.execCmd("useCSS", true);
  23843. this.deferFocus()
  23844. } else {
  23845. this.execCmd(Ext.isOpera
  23846. ? "hilitecolor"
  23847. : "backcolor",
  23848. Ext.isSafari || Ext.isIE
  23849. ? "#" + D
  23850. : D);
  23851. this.deferFocus()
  23852. }
  23853. },
  23854. scope : this,
  23855. clickEvent : "mousedown"
  23856. })
  23857. })
  23858. }
  23859. if (this.enableAlignments) {
  23860. A.add("-", B("justifyleft"), B("justifycenter"), B("justifyright"))
  23861. }
  23862. if (!Ext.isSafari) {
  23863. if (this.enableLinks) {
  23864. A.add("-", B("createlink", false, this.createLink))
  23865. }
  23866. if (this.enableLists) {
  23867. A.add("-", B("insertorderedlist"), B("insertunorderedlist"))
  23868. }
  23869. if (this.enableSourceEdit) {
  23870. A.add("-", B("sourceedit", true, function(D) {
  23871. this.toggleSourceEdit(D.pressed)
  23872. }))
  23873. }
  23874. }
  23875. this.tb = A
  23876. },
  23877. getDocMarkup : function() {
  23878. return "<html><head><style type=\"text/css\">body{border:0;margin:0;padding:3px;height:98%;cursor:text;}</style></head><body></body></html>"
  23879. },
  23880. getEditorBody : function() {
  23881. return this.doc.body || this.doc.documentElement
  23882. },
  23883. onRender : function(C, A) {
  23884. Ext.form.HtmlEditor.superclass.onRender.call(this, C, A);
  23885. this.el.dom.style.border = "0 none";
  23886. this.el.dom.setAttribute("tabIndex", -1);
  23887. this.el.addClass("x-hidden");
  23888. if (Ext.isIE) {
  23889. this.el.applyStyles("margin-top:-1px;margin-bottom:-1px;")
  23890. }
  23891. this.wrap = this.el.wrap({
  23892. cls : "x-html-editor-wrap",
  23893. cn : {
  23894. cls : "x-html-editor-tb"
  23895. }
  23896. });
  23897. this.createToolbar(this);
  23898. this.tb.items.each(function(E) {
  23899. if (E.itemId != "sourceedit") {
  23900. E.disable()
  23901. }
  23902. });
  23903. var D = document.createElement("iframe");
  23904. D.name = Ext.id();
  23905. D.frameBorder = "no";
  23906. D.src = (Ext.SSL_SECURE_URL || "javascript:false");
  23907. this.wrap.dom.appendChild(D);
  23908. this.iframe = D;
  23909. if (Ext.isIE) {
  23910. D.contentWindow.document.designMode = "on";
  23911. this.doc = D.contentWindow.document;
  23912. this.win = D.contentWindow
  23913. } else {
  23914. this.doc = (D.contentDocument || window.frames[D.name].document);
  23915. this.win = window.frames[D.name];
  23916. this.doc.designMode = "on"
  23917. }
  23918. this.doc.open();
  23919. this.doc.write(this.getDocMarkup());
  23920. this.doc.close();
  23921. var B = {
  23922. run : function() {
  23923. if (this.doc.body || this.doc.readyState == "complete") {
  23924. Ext.TaskMgr.stop(B);
  23925. this.doc.designMode = "on";
  23926. this.initEditor.defer(10, this)
  23927. }
  23928. },
  23929. interval : 10,
  23930. duration : 10000,
  23931. scope : this
  23932. };
  23933. Ext.TaskMgr.start(B);
  23934. if (!this.width) {
  23935. this.setSize(this.el.getSize())
  23936. }
  23937. },
  23938. onResize : function(B, C) {
  23939. Ext.form.HtmlEditor.superclass.onResize.apply(this, arguments);
  23940. if (this.el && this.iframe) {
  23941. if (typeof B == "number") {
  23942. var D = B - this.wrap.getFrameWidth("lr");
  23943. this.el.setWidth(this.adjustWidth("textarea", D));
  23944. this.iframe.style.width = D + "px"
  23945. }
  23946. if (typeof C == "number") {
  23947. var A = C - this.wrap.getFrameWidth("tb")
  23948. - this.tb.el.getHeight();
  23949. this.el.setHeight(this.adjustWidth("textarea", A));
  23950. this.iframe.style.height = A + "px";
  23951. if (this.doc) {
  23952. this.getEditorBody().style.height = (A - (this.iframePad * 2))
  23953. + "px"
  23954. }
  23955. }
  23956. }
  23957. },
  23958. toggleSourceEdit : function(A) {
  23959. if (A === undefined) {
  23960. A = !this.sourceEditMode
  23961. }
  23962. this.sourceEditMode = A === true;
  23963. var C = this.tb.items.get("sourceedit");
  23964. if (C.pressed !== this.sourceEditMode) {
  23965. C.toggle(this.sourceEditMode);
  23966. return
  23967. }
  23968. if (this.sourceEditMode) {
  23969. this.tb.items.each(function(D) {
  23970. if (D.itemId != "sourceedit") {
  23971. D.disable()
  23972. }
  23973. });
  23974. this.syncValue();
  23975. this.iframe.className = "x-hidden";
  23976. this.el.removeClass("x-hidden");
  23977. this.el.dom.removeAttribute("tabIndex");
  23978. this.el.focus()
  23979. } else {
  23980. if (this.initialized) {
  23981. this.tb.items.each(function(D) {
  23982. D.enable()
  23983. })
  23984. }
  23985. this.pushValue();
  23986. this.iframe.className = "";
  23987. this.el.addClass("x-hidden");
  23988. this.el.dom.setAttribute("tabIndex", -1);
  23989. this.deferFocus()
  23990. }
  23991. var B = this.lastSize;
  23992. if (B) {
  23993. delete this.lastSize;
  23994. this.setSize(B)
  23995. }
  23996. this.fireEvent("editmodechange", this, this.sourceEditMode)
  23997. },
  23998. createLink : function() {
  23999. var A = prompt(this.createLinkText, this.defaultLinkValue);
  24000. if (A && A != "http:/" + "/") {
  24001. this.relayCmd("createlink", A)
  24002. }
  24003. },
  24004. adjustSize : Ext.BoxComponent.prototype.adjustSize,
  24005. getResizeEl : function() {
  24006. return this.wrap
  24007. },
  24008. getPositionEl : function() {
  24009. return this.wrap
  24010. },
  24011. initEvents : function() {
  24012. this.originalValue = this.getValue()
  24013. },
  24014. markInvalid : Ext.emptyFn,
  24015. clearInvalid : Ext.emptyFn,
  24016. setValue : function(A) {
  24017. Ext.form.HtmlEditor.superclass.setValue.call(this, A);
  24018. this.pushValue()
  24019. },
  24020. cleanHtml : function(A) {
  24021. A = String(A);
  24022. if (A.length > 5) {
  24023. if (Ext.isSafari) {
  24024. A = A
  24025. .replace(
  24026. /\sclass="(?:Apple-style-span|khtml-block-placeholder)"/gi,
  24027. "")
  24028. }
  24029. }
  24030. if (A == "&nbsp;") {
  24031. A = ""
  24032. }
  24033. return A
  24034. },
  24035. syncValue : function() {
  24036. if (this.initialized) {
  24037. var D = this.getEditorBody();
  24038. var C = D.innerHTML;
  24039. if (Ext.isSafari) {
  24040. var B = D.getAttribute("style");
  24041. var A = B.match(/text-align:(.*?);/i);
  24042. if (A && A[1]) {
  24043. C = "<div style=\"" + A[0] + "\">" + C + "</div>"
  24044. }
  24045. }
  24046. C = this.cleanHtml(C);
  24047. if (this.fireEvent("beforesync", this, C) !== false) {
  24048. this.el.dom.value = C;
  24049. this.fireEvent("sync", this, C)
  24050. }
  24051. }
  24052. },
  24053. pushValue : function() {
  24054. if (this.initialized) {
  24055. var A = this.el.dom.value;
  24056. if (!this.activated && A.length < 1) {
  24057. A = "&nbsp;"
  24058. }
  24059. if (this.fireEvent("beforepush", this, A) !== false) {
  24060. this.getEditorBody().innerHTML = A;
  24061. this.fireEvent("push", this, A)
  24062. }
  24063. }
  24064. },
  24065. deferFocus : function() {
  24066. this.focus.defer(10, this)
  24067. },
  24068. focus : function() {
  24069. if (this.win && !this.sourceEditMode) {
  24070. this.win.focus()
  24071. } else {
  24072. this.el.focus()
  24073. }
  24074. },
  24075. initEditor : function() {
  24076. var B = this.getEditorBody();
  24077. var A = this.el.getStyles("font-size", "font-family",
  24078. "background-image", "background-repeat");
  24079. A["background-attachment"] = "fixed";
  24080. B.bgProperties = "fixed";
  24081. Ext.DomHelper.applyStyles(B, A);
  24082. Ext.EventManager.on(this.doc, {
  24083. "mousedown" : this.onEditorEvent,
  24084. "dblclick" : this.onEditorEvent,
  24085. "click" : this.onEditorEvent,
  24086. "keyup" : this.onEditorEvent,
  24087. buffer : 100,
  24088. scope : this
  24089. });
  24090. if (Ext.isGecko) {
  24091. Ext.EventManager.on(this.doc, "keypress", this.applyCommand, this)
  24092. }
  24093. if (Ext.isIE || Ext.isSafari || Ext.isOpera) {
  24094. Ext.EventManager.on(this.doc, "keydown", this.fixKeys, this)
  24095. }
  24096. this.initialized = true;
  24097. this.fireEvent("initialize", this);
  24098. this.pushValue()
  24099. },
  24100. onDestroy : function() {
  24101. if (this.rendered) {
  24102. this.tb.items.each(function(A) {
  24103. if (A.menu) {
  24104. A.menu.removeAll();
  24105. if (A.menu.el) {
  24106. A.menu.el.destroy()
  24107. }
  24108. }
  24109. A.destroy()
  24110. });
  24111. this.wrap.dom.innerHTML = "";
  24112. this.wrap.remove()
  24113. }
  24114. },
  24115. onFirstFocus : function() {
  24116. this.activated = true;
  24117. this.tb.items.each(function(D) {
  24118. D.enable()
  24119. });
  24120. if (Ext.isGecko) {
  24121. this.win.focus();
  24122. var A = this.win.getSelection();
  24123. if (!A.focusNode || A.focusNode.nodeType != 3) {
  24124. var B = A.getRangeAt(0);
  24125. B.selectNodeContents(this.getEditorBody());
  24126. B.collapse(true);
  24127. this.deferFocus()
  24128. }
  24129. try {
  24130. this.execCmd("useCSS", true);
  24131. this.execCmd("styleWithCSS", false)
  24132. } catch (C) {
  24133. }
  24134. }
  24135. this.fireEvent("activate", this)
  24136. },
  24137. adjustFont : function(B) {
  24138. var C = B.itemId == "increasefontsize" ? 1 : -1;
  24139. var A = parseInt(this.doc.queryCommandValue("FontSize") || 2, 10);
  24140. if (Ext.isSafari3 || Ext.isAir) {
  24141. if (A <= 10) {
  24142. A = 1 + C
  24143. } else {
  24144. if (A <= 13) {
  24145. A = 2 + C
  24146. } else {
  24147. if (A <= 16) {
  24148. A = 3 + C
  24149. } else {
  24150. if (A <= 18) {
  24151. A = 4 + C
  24152. } else {
  24153. if (A <= 24) {
  24154. A = 5 + C
  24155. } else {
  24156. A = 6 + C
  24157. }
  24158. }
  24159. }
  24160. }
  24161. }
  24162. A = A.constrain(1, 6)
  24163. } else {
  24164. if (Ext.isSafari) {
  24165. C *= 2
  24166. }
  24167. A = Math.max(1, A + C) + (Ext.isSafari ? "px" : 0)
  24168. }
  24169. this.execCmd("FontSize", A)
  24170. },
  24171. onEditorEvent : function(A) {
  24172. this.updateToolbar()
  24173. },
  24174. updateToolbar : function() {
  24175. if (!this.activated) {
  24176. this.onFirstFocus();
  24177. return
  24178. }
  24179. var B = this.tb.items.map, C = this.doc;
  24180. if (this.enableFont && !Ext.isSafari) {
  24181. var A = (this.doc.queryCommandValue("FontName") || this.defaultFont)
  24182. .toLowerCase();
  24183. if (A != this.fontSelect.dom.value) {
  24184. this.fontSelect.dom.value = A
  24185. }
  24186. }
  24187. if (this.enableFormat) {
  24188. B.bold.toggle(C.queryCommandState("bold"));
  24189. B.italic.toggle(C.queryCommandState("italic"));
  24190. B.underline.toggle(C.queryCommandState("underline"))
  24191. }
  24192. if (this.enableAlignments) {
  24193. B.justifyleft.toggle(C.queryCommandState("justifyleft"));
  24194. B.justifycenter.toggle(C.queryCommandState("justifycenter"));
  24195. B.justifyright.toggle(C.queryCommandState("justifyright"))
  24196. }
  24197. if (!Ext.isSafari && this.enableLists) {
  24198. B.insertorderedlist
  24199. .toggle(C.queryCommandState("insertorderedlist"));
  24200. B.insertunorderedlist.toggle(C
  24201. .queryCommandState("insertunorderedlist"))
  24202. }
  24203. Ext.menu.MenuMgr.hideAll();
  24204. this.syncValue()
  24205. },
  24206. relayBtnCmd : function(A) {
  24207. this.relayCmd(A.itemId)
  24208. },
  24209. relayCmd : function(B, A) {
  24210. this.win.focus();
  24211. this.execCmd(B, A);
  24212. this.updateToolbar();
  24213. this.deferFocus()
  24214. },
  24215. execCmd : function(B, A) {
  24216. this.doc.execCommand(B, false, A === undefined ? null : A);
  24217. this.syncValue()
  24218. },
  24219. applyCommand : function(B) {
  24220. if (B.ctrlKey) {
  24221. var C = B.getCharCode(), A;
  24222. if (C > 0) {
  24223. C = String.fromCharCode(C);
  24224. switch (C) {
  24225. case "b" :
  24226. A = "bold";
  24227. break;
  24228. case "i" :
  24229. A = "italic";
  24230. break;
  24231. case "u" :
  24232. A = "underline";
  24233. break
  24234. }
  24235. if (A) {
  24236. this.win.focus();
  24237. this.execCmd(A);
  24238. this.deferFocus();
  24239. B.preventDefault()
  24240. }
  24241. }
  24242. }
  24243. },
  24244. insertAtCursor : function(B) {
  24245. if (!this.activated) {
  24246. return
  24247. }
  24248. if (Ext.isIE) {
  24249. this.win.focus();
  24250. var A = this.doc.selection.createRange();
  24251. if (A) {
  24252. A.collapse(true);
  24253. A.pasteHTML(B);
  24254. this.syncValue();
  24255. this.deferFocus()
  24256. }
  24257. } else {
  24258. if (Ext.isGecko || Ext.isOpera) {
  24259. this.win.focus();
  24260. this.execCmd("InsertHTML", B);
  24261. this.deferFocus()
  24262. } else {
  24263. if (Ext.isSafari) {
  24264. this.execCmd("InsertText", B);
  24265. this.deferFocus()
  24266. }
  24267. }
  24268. }
  24269. },
  24270. fixKeys : function() {
  24271. if (Ext.isIE) {
  24272. return function(D) {
  24273. var A = D.getKey(), B;
  24274. if (A == D.TAB) {
  24275. D.stopEvent();
  24276. B = this.doc.selection.createRange();
  24277. if (B) {
  24278. B.collapse(true);
  24279. B.pasteHTML("&nbsp;&nbsp;&nbsp;&nbsp;");
  24280. this.deferFocus()
  24281. }
  24282. } else {
  24283. if (A == D.ENTER) {
  24284. B = this.doc.selection.createRange();
  24285. if (B) {
  24286. var C = B.parentElement();
  24287. if (!C || C.tagName.toLowerCase() != "li") {
  24288. D.stopEvent();
  24289. B.pasteHTML("<br />");
  24290. B.collapse(false);
  24291. B.select()
  24292. }
  24293. }
  24294. }
  24295. }
  24296. }
  24297. } else {
  24298. if (Ext.isOpera) {
  24299. return function(B) {
  24300. var A = B.getKey();
  24301. if (A == B.TAB) {
  24302. B.stopEvent();
  24303. this.win.focus();
  24304. this.execCmd("InsertHTML", "&nbsp;&nbsp;&nbsp;&nbsp;");
  24305. this.deferFocus()
  24306. }
  24307. }
  24308. } else {
  24309. if (Ext.isSafari) {
  24310. return function(B) {
  24311. var A = B.getKey();
  24312. if (A == B.TAB) {
  24313. B.stopEvent();
  24314. this.execCmd("InsertText", "\t");
  24315. this.deferFocus()
  24316. }
  24317. }
  24318. }
  24319. }
  24320. }
  24321. }(),
  24322. getToolbar : function() {
  24323. return this.tb
  24324. },
  24325. buttonTips : {
  24326. bold : {
  24327. title : "Bold (Ctrl+B)",
  24328. text : "Make the selected text bold.",
  24329. cls : "x-html-editor-tip"
  24330. },
  24331. italic : {
  24332. title : "Italic (Ctrl+I)",
  24333. text : "Make the selected text italic.",
  24334. cls : "x-html-editor-tip"
  24335. },
  24336. underline : {
  24337. title : "Underline (Ctrl+U)",
  24338. text : "Underline the selected text.",
  24339. cls : "x-html-editor-tip"
  24340. },
  24341. increasefontsize : {
  24342. title : "Grow Text",
  24343. text : "Increase the font size.",
  24344. cls : "x-html-editor-tip"
  24345. },
  24346. decreasefontsize : {
  24347. title : "Shrink Text",
  24348. text : "Decrease the font size.",
  24349. cls : "x-html-editor-tip"
  24350. },
  24351. backcolor : {
  24352. title : "Text Highlight Color",
  24353. text : "Change the background color of the selected text.",
  24354. cls : "x-html-editor-tip"
  24355. },
  24356. forecolor : {
  24357. title : "Font Color",
  24358. text : "Change the color of the selected text.",
  24359. cls : "x-html-editor-tip"
  24360. },
  24361. justifyleft : {
  24362. title : "Align Text Left",
  24363. text : "Align text to the left.",
  24364. cls : "x-html-editor-tip"
  24365. },
  24366. justifycenter : {
  24367. title : "Center Text",
  24368. text : "Center text in the editor.",
  24369. cls : "x-html-editor-tip"
  24370. },
  24371. justifyright : {
  24372. title : "Align Text Right",
  24373. text : "Align text to the right.",
  24374. cls : "x-html-editor-tip"
  24375. },
  24376. insertunorderedlist : {
  24377. title : "Bullet List",
  24378. text : "Start a bulleted list.",
  24379. cls : "x-html-editor-tip"
  24380. },
  24381. insertorderedlist : {
  24382. title : "Numbered List",
  24383. text : "Start a numbered list.",
  24384. cls : "x-html-editor-tip"
  24385. },
  24386. createlink : {
  24387. title : "Hyperlink",
  24388. text : "Make the selected text a hyperlink.",
  24389. cls : "x-html-editor-tip"
  24390. },
  24391. sourceedit : {
  24392. title : "Source Edit",
  24393. text : "Switch to source editing mode.",
  24394. cls : "x-html-editor-tip"
  24395. }
  24396. }
  24397. });
  24398. Ext.reg("htmleditor", Ext.form.HtmlEditor);
  24399. Ext.form.TimeField = Ext.extend(Ext.form.ComboBox, {
  24400. minValue : null,
  24401. maxValue : null,
  24402. minText : "The time in this field must be equal to or after {0}",
  24403. maxText : "The time in this field must be equal to or before {0}",
  24404. invalidText : "{0} is not a valid time",
  24405. format : "g:i A",
  24406. altFormats : "g:ia|g:iA|g:i a|g:i A|h:i|g:i|H:i|ga|ha|gA|h a|g a|g A|gi|hi|gia|hia|g|H",
  24407. increment : 15,
  24408. mode : "local",
  24409. triggerAction : "all",
  24410. typeAhead : false,
  24411. initComponent : function() {
  24412. Ext.form.TimeField.superclass.initComponent.call(this);
  24413. if (typeof this.minValue == "string") {
  24414. this.minValue = this.parseDate(this.minValue)
  24415. }
  24416. if (typeof this.maxValue == "string") {
  24417. this.maxValue = this.parseDate(this.maxValue)
  24418. }
  24419. if (!this.store) {
  24420. var B = this.parseDate(this.minValue);
  24421. if (!B) {
  24422. B = new Date().clearTime()
  24423. }
  24424. var A = this.parseDate(this.maxValue);
  24425. if (!A) {
  24426. A = new Date().clearTime().add("mi", (24 * 60) - 1)
  24427. }
  24428. var C = [];
  24429. while (B <= A) {
  24430. C.push([B.dateFormat(this.format)]);
  24431. B = B.add("mi", this.increment)
  24432. }
  24433. this.store = new Ext.data.SimpleStore({
  24434. fields : ["text"],
  24435. data : C
  24436. });
  24437. this.displayField = "text"
  24438. }
  24439. },
  24440. getValue : function() {
  24441. var A = Ext.form.TimeField.superclass.getValue.call(this);
  24442. return this.formatDate(this.parseDate(A)) || ""
  24443. },
  24444. setValue : function(A) {
  24445. Ext.form.TimeField.superclass.setValue.call(this, this.formatDate(this
  24446. .parseDate(A)))
  24447. },
  24448. validateValue : Ext.form.DateField.prototype.validateValue,
  24449. parseDate : Ext.form.DateField.prototype.parseDate,
  24450. formatDate : Ext.form.DateField.prototype.formatDate,
  24451. beforeBlur : function() {
  24452. var A = this.parseDate(this.getRawValue());
  24453. if (A) {
  24454. this.setValue(A.dateFormat(this.format))
  24455. }
  24456. }
  24457. });
  24458. Ext.reg("timefield", Ext.form.TimeField);
  24459. Ext.form.Label = Ext.extend(Ext.BoxComponent, {
  24460. onRender : function(B, A) {
  24461. if (!this.el) {
  24462. this.el = document.createElement("label");
  24463. this.el.innerHTML = this.text ? Ext.util.Format
  24464. .htmlEncode(this.text) : (this.html || "");
  24465. if (this.forId) {
  24466. this.el.setAttribute("htmlFor", this.forId)
  24467. }
  24468. }
  24469. Ext.form.Label.superclass.onRender.call(this, B, A)
  24470. }
  24471. });
  24472. Ext.reg("label", Ext.form.Label);
  24473. Ext.form.Action = function(B, A) {
  24474. this.form = B;
  24475. this.options = A || {}
  24476. };
  24477. Ext.form.Action.CLIENT_INVALID = "client";
  24478. Ext.form.Action.SERVER_INVALID = "server";
  24479. Ext.form.Action.CONNECT_FAILURE = "connect";
  24480. Ext.form.Action.LOAD_FAILURE = "load";
  24481. Ext.form.Action.prototype = {
  24482. type : "default",
  24483. run : function(A) {
  24484. },
  24485. success : function(A) {
  24486. },
  24487. handleResponse : function(A) {
  24488. },
  24489. failure : function(A) {
  24490. this.response = A;
  24491. this.failureType = Ext.form.Action.CONNECT_FAILURE;
  24492. this.form.afterAction(this, false)
  24493. },
  24494. processResponse : function(A) {
  24495. this.response = A;
  24496. if (!A.responseText) {
  24497. return true
  24498. }
  24499. this.result = this.handleResponse(A);
  24500. return this.result
  24501. },
  24502. getUrl : function(C) {
  24503. var A = this.options.url || this.form.url || this.form.el.dom.action;
  24504. if (C) {
  24505. var B = this.getParams();
  24506. if (B) {
  24507. A += (A.indexOf("?") != -1 ? "&" : "?") + B
  24508. }
  24509. }
  24510. return A
  24511. },
  24512. getMethod : function() {
  24513. return (this.options.method || this.form.method
  24514. || this.form.el.dom.method || "POST").toUpperCase()
  24515. },
  24516. getParams : function() {
  24517. var A = this.form.baseParams;
  24518. var B = this.options.params;
  24519. if (B) {
  24520. if (typeof B == "object") {
  24521. B = Ext.urlEncode(Ext.applyIf(B, A))
  24522. } else {
  24523. if (typeof B == "string" && A) {
  24524. B += "&" + Ext.urlEncode(A)
  24525. }
  24526. }
  24527. } else {
  24528. if (A) {
  24529. B = Ext.urlEncode(A)
  24530. }
  24531. }
  24532. return B
  24533. },
  24534. createCallback : function(A) {
  24535. var A = A || {};
  24536. return {
  24537. success : this.success,
  24538. failure : this.failure,
  24539. scope : this,
  24540. timeout : (A.timeout * 1000) || (this.form.timeout * 1000),
  24541. upload : this.form.fileUpload ? this.success : undefined
  24542. }
  24543. }
  24544. };
  24545. Ext.form.Action.Submit = function(B, A) {
  24546. Ext.form.Action.Submit.superclass.constructor.call(this, B, A)
  24547. };
  24548. Ext.extend(Ext.form.Action.Submit, Ext.form.Action, {
  24549. type : "submit",
  24550. run : function() {
  24551. var B = this.options;
  24552. var C = this.getMethod();
  24553. var A = C == "POST";
  24554. if (B.clientValidation === false || this.form.isValid()) {
  24555. Ext.Ajax.request(Ext.apply(this.createCallback(B), {
  24556. form : this.form.el.dom,
  24557. url : this.getUrl(!A),
  24558. method : C,
  24559. params : A ? this.getParams() : null,
  24560. isUpload : this.form.fileUpload
  24561. }))
  24562. } else {
  24563. if (B.clientValidation !== false) {
  24564. this.failureType = Ext.form.Action.CLIENT_INVALID;
  24565. this.form.afterAction(this, false)
  24566. }
  24567. }
  24568. },
  24569. success : function(B) {
  24570. var A = this.processResponse(B);
  24571. if (A === true || A.success) {
  24572. this.form.afterAction(this, true);
  24573. return
  24574. }
  24575. if (A.errors) {
  24576. this.form.markInvalid(A.errors);
  24577. this.failureType = Ext.form.Action.SERVER_INVALID
  24578. }
  24579. this.form.afterAction(this, false)
  24580. },
  24581. handleResponse : function(C) {
  24582. if (this.form.errorReader) {
  24583. var B = this.form.errorReader.read(C);
  24584. var F = [];
  24585. if (B.records) {
  24586. for (var D = 0, A = B.records.length; D < A; D++) {
  24587. var E = B.records[D];
  24588. F[D] = E.data
  24589. }
  24590. }
  24591. if (F.length < 1) {
  24592. F = null
  24593. }
  24594. return {
  24595. success : B.success,
  24596. errors : F
  24597. }
  24598. }
  24599. return Ext.decode(C.responseText)
  24600. }
  24601. });
  24602. Ext.form.Action.Load = function(B, A) {
  24603. Ext.form.Action.Load.superclass.constructor.call(this, B, A);
  24604. this.reader = this.form.reader
  24605. };
  24606. Ext.extend(Ext.form.Action.Load, Ext.form.Action, {
  24607. type : "load",
  24608. run : function() {
  24609. Ext.Ajax.request(Ext.apply(this.createCallback(this.options), {
  24610. method : this.getMethod(),
  24611. url : this.getUrl(false),
  24612. params : this.getParams()
  24613. }))
  24614. },
  24615. success : function(B) {
  24616. var A = this.processResponse(B);
  24617. if (A === true || !A.success || !A.data) {
  24618. this.failureType = Ext.form.Action.LOAD_FAILURE;
  24619. this.form.afterAction(this, false);
  24620. return
  24621. }
  24622. this.form.clearInvalid();
  24623. this.form.setValues(A.data);
  24624. this.form.afterAction(this, true)
  24625. },
  24626. handleResponse : function(B) {
  24627. if (this.form.reader) {
  24628. var A = this.form.reader.read(B);
  24629. var C = A.records && A.records[0]
  24630. ? A.records[0].data
  24631. : null;
  24632. return {
  24633. success : A.success,
  24634. data : C
  24635. }
  24636. }
  24637. return Ext.decode(B.responseText)
  24638. }
  24639. });
  24640. Ext.form.Action.ACTION_TYPES = {
  24641. "load" : Ext.form.Action.Load,
  24642. "submit" : Ext.form.Action.Submit
  24643. };
  24644. Ext.form.VTypes = function() {
  24645. var C = /^[a-zA-Z_]+$/;
  24646. var D = /^[a-zA-Z0-9_]+$/;
  24647. var B = /^([\w]+)(.[\w]+)*@([\w-]+\.){1,5}([A-Za-z]){2,4}$/;
  24648. var A = /(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;
  24649. return {
  24650. "email" : function(E) {
  24651. return B.test(E)
  24652. },
  24653. "emailText" : "This field should be an e-mail address in the format \"user@domain.com\"",
  24654. "emailMask" : /[a-z0-9_\.\-@]/i,
  24655. "url" : function(E) {
  24656. return A.test(E)
  24657. },
  24658. "urlText" : "This field should be a URL in the format \"http:/"
  24659. + "/www.domain.com\"",
  24660. "alpha" : function(E) {
  24661. return C.test(E)
  24662. },
  24663. "alphaText" : "This field should only contain letters and _",
  24664. "alphaMask" : /[a-z_]/i,
  24665. "alphanum" : function(E) {
  24666. return D.test(E)
  24667. },
  24668. "alphanumText" : "This field should only contain letters, numbers and _",
  24669. "alphanumMask" : /[a-z0-9_]/i
  24670. }
  24671. }();
  24672. Ext.grid.GridPanel = Ext.extend(Ext.Panel, {
  24673. ddText : "{0} selected row{1}",
  24674. minColumnWidth : 25,
  24675. trackMouseOver : true,
  24676. enableDragDrop : false,
  24677. enableColumnMove : true,
  24678. enableColumnHide : true,
  24679. enableHdMenu : true,
  24680. stripeRows : false,
  24681. autoExpandColumn : false,
  24682. autoExpandMin : 50,
  24683. autoExpandMax : 1000,
  24684. view : null,
  24685. loadMask : false,
  24686. rendered : false,
  24687. viewReady : false,
  24688. stateEvents : ["columnmove", "columnresize", "sortchange"],
  24689. initComponent : function() {
  24690. Ext.grid.GridPanel.superclass.initComponent.call(this);
  24691. this.autoScroll = false;
  24692. this.autoWidth = false;
  24693. if (Ext.isArray(this.columns)) {
  24694. this.colModel = new Ext.grid.ColumnModel(this.columns);
  24695. delete this.columns
  24696. }
  24697. if (this.ds) {
  24698. this.store = this.ds;
  24699. delete this.ds
  24700. }
  24701. if (this.cm) {
  24702. this.colModel = this.cm;
  24703. delete this.cm
  24704. }
  24705. if (this.sm) {
  24706. this.selModel = this.sm;
  24707. delete this.sm
  24708. }
  24709. this.store = Ext.StoreMgr.lookup(this.store);
  24710. this.addEvents("click", "dblclick", "contextmenu", "mousedown",
  24711. "mouseup", "mouseover", "mouseout", "keypress", "keydown",
  24712. "cellmousedown", "rowmousedown", "headermousedown",
  24713. "cellclick", "celldblclick", "rowclick", "rowdblclick",
  24714. "headerclick", "headerdblclick", "rowcontextmenu",
  24715. "cellcontextmenu", "headercontextmenu", "bodyscroll",
  24716. "columnresize", "columnmove", "sortchange")
  24717. },
  24718. onRender : function(C, A) {
  24719. Ext.grid.GridPanel.superclass.onRender.apply(this, arguments);
  24720. var D = this.body;
  24721. this.el.addClass("x-grid-panel");
  24722. var B = this.getView();
  24723. B.init(this);
  24724. D.on("mousedown", this.onMouseDown, this);
  24725. D.on("click", this.onClick, this);
  24726. D.on("dblclick", this.onDblClick, this);
  24727. D.on("contextmenu", this.onContextMenu, this);
  24728. D.on("keydown", this.onKeyDown, this);
  24729. this.relayEvents(D, ["mousedown", "mouseup", "mouseover", "mouseout",
  24730. "keypress"]);
  24731. this.getSelectionModel().init(this);
  24732. this.view.render()
  24733. },
  24734. initEvents : function() {
  24735. Ext.grid.GridPanel.superclass.initEvents.call(this);
  24736. if (this.loadMask) {
  24737. this.loadMask = new Ext.LoadMask(this.bwrap, Ext.apply({
  24738. store : this.store
  24739. }, this.loadMask))
  24740. }
  24741. },
  24742. initStateEvents : function() {
  24743. Ext.grid.GridPanel.superclass.initStateEvents.call(this);
  24744. this.colModel.on("hiddenchange", this.saveState, this, {
  24745. delay : 100
  24746. })
  24747. },
  24748. applyState : function(F) {
  24749. var B = this.colModel;
  24750. var E = F.columns;
  24751. if (E) {
  24752. for (var C = 0, A = E.length; C < A; C++) {
  24753. var D = E[C];
  24754. var H = B.getColumnById(D.id);
  24755. if (H) {
  24756. H.hidden = D.hidden;
  24757. H.width = D.width;
  24758. var G = B.getIndexById(D.id);
  24759. if (G != C) {
  24760. B.moveColumn(G, C)
  24761. }
  24762. }
  24763. }
  24764. }
  24765. if (F.sort) {
  24766. this.store[this.store.remoteSort ? "setDefaultSort" : "sort"](
  24767. F.sort.field, F.sort.direction)
  24768. }
  24769. },
  24770. getState : function() {
  24771. var C = {
  24772. columns : []
  24773. };
  24774. for (var B = 0, D; D = this.colModel.config[B]; B++) {
  24775. C.columns[B] = {
  24776. id : D.id,
  24777. width : D.width
  24778. };
  24779. if (D.hidden) {
  24780. C.columns[B].hidden = true
  24781. }
  24782. }
  24783. var A = this.store.getSortState();
  24784. if (A) {
  24785. C.sort = A
  24786. }
  24787. return C
  24788. },
  24789. afterRender : function() {
  24790. Ext.grid.GridPanel.superclass.afterRender.call(this);
  24791. this.view.layout();
  24792. this.viewReady = true
  24793. },
  24794. reconfigure : function(A, B) {
  24795. if (this.loadMask) {
  24796. this.loadMask.destroy();
  24797. this.loadMask = new Ext.LoadMask(this.bwrap, Ext.apply({
  24798. store : A
  24799. }, this.initialConfig.loadMask))
  24800. }
  24801. this.view.bind(A, B);
  24802. this.store = A;
  24803. this.colModel = B;
  24804. if (this.rendered) {
  24805. this.view.refresh(true)
  24806. }
  24807. },
  24808. onKeyDown : function(A) {
  24809. this.fireEvent("keydown", A)
  24810. },
  24811. onDestroy : function() {
  24812. if (this.rendered) {
  24813. if (this.loadMask) {
  24814. this.loadMask.destroy()
  24815. }
  24816. var A = this.body;
  24817. A.removeAllListeners();
  24818. this.view.destroy();
  24819. A.update("")
  24820. }
  24821. this.colModel.purgeListeners();
  24822. Ext.grid.GridPanel.superclass.onDestroy.call(this)
  24823. },
  24824. processEvent : function(C, E) {
  24825. this.fireEvent(C, E);
  24826. var D = E.getTarget();
  24827. var B = this.view;
  24828. var G = B.findHeaderIndex(D);
  24829. if (G !== false) {
  24830. this.fireEvent("header" + C, this, G, E)
  24831. } else {
  24832. var F = B.findRowIndex(D);
  24833. var A = B.findCellIndex(D);
  24834. if (F !== false) {
  24835. this.fireEvent("row" + C, this, F, E);
  24836. if (A !== false) {
  24837. this.fireEvent("cell" + C, this, F, A, E)
  24838. }
  24839. }
  24840. }
  24841. },
  24842. onClick : function(A) {
  24843. this.processEvent("click", A)
  24844. },
  24845. onMouseDown : function(A) {
  24846. this.processEvent("mousedown", A)
  24847. },
  24848. onContextMenu : function(B, A) {
  24849. this.processEvent("contextmenu", B)
  24850. },
  24851. onDblClick : function(A) {
  24852. this.processEvent("dblclick", A)
  24853. },
  24854. walkCells : function(J, C, B, E, I) {
  24855. var H = this.colModel, F = H.getColumnCount();
  24856. var A = this.store, G = A.getCount(), D = true;
  24857. if (B < 0) {
  24858. if (C < 0) {
  24859. J--;
  24860. D = false
  24861. }
  24862. while (J >= 0) {
  24863. if (!D) {
  24864. C = F - 1
  24865. }
  24866. D = false;
  24867. while (C >= 0) {
  24868. if (E.call(I || this, J, C, H) === true) {
  24869. return [J, C]
  24870. }
  24871. C--
  24872. }
  24873. J--
  24874. }
  24875. } else {
  24876. if (C >= F) {
  24877. J++;
  24878. D = false
  24879. }
  24880. while (J < G) {
  24881. if (!D) {
  24882. C = 0
  24883. }
  24884. D = false;
  24885. while (C < F) {
  24886. if (E.call(I || this, J, C, H) === true) {
  24887. return [J, C]
  24888. }
  24889. C++
  24890. }
  24891. J++
  24892. }
  24893. }
  24894. return null
  24895. },
  24896. getSelections : function() {
  24897. return this.selModel.getSelections()
  24898. },
  24899. onResize : function() {
  24900. Ext.grid.GridPanel.superclass.onResize.apply(this, arguments);
  24901. if (this.viewReady) {
  24902. this.view.layout()
  24903. }
  24904. },
  24905. getGridEl : function() {
  24906. return this.body
  24907. },
  24908. stopEditing : function() {
  24909. },
  24910. getSelectionModel : function() {
  24911. if (!this.selModel) {
  24912. this.selModel = new Ext.grid.RowSelectionModel(this.disableSelection
  24913. ? {
  24914. selectRow : Ext.emptyFn
  24915. }
  24916. : null)
  24917. }
  24918. return this.selModel
  24919. },
  24920. getStore : function() {
  24921. return this.store
  24922. },
  24923. getColumnModel : function() {
  24924. return this.colModel
  24925. },
  24926. getView : function() {
  24927. if (!this.view) {
  24928. this.view = new Ext.grid.GridView(this.viewConfig)
  24929. }
  24930. return this.view
  24931. },
  24932. getDragDropText : function() {
  24933. var A = this.selModel.getCount();
  24934. return String.format(this.ddText, A, A == 1 ? "" : "s")
  24935. }
  24936. });
  24937. Ext.reg("grid", Ext.grid.GridPanel);
  24938. Ext.grid.GridView = function(A) {
  24939. Ext.apply(this, A);
  24940. this.addEvents("beforerowremoved", "beforerowsinserted", "beforerefresh",
  24941. "rowremoved", "rowsinserted", "rowupdated", "refresh");
  24942. Ext.grid.GridView.superclass.constructor.call(this)
  24943. };
  24944. Ext.extend(Ext.grid.GridView, Ext.util.Observable, {
  24945. scrollOffset : 19,
  24946. autoFill : false,
  24947. forceFit : false,
  24948. sortClasses : ["sort-asc", "sort-desc"],
  24949. sortAscText : "Sort Ascending",
  24950. sortDescText : "Sort Descending",
  24951. columnsText : "Columns",
  24952. borderWidth : 2,
  24953. initTemplates : function() {
  24954. var C = this.templates || {};
  24955. if (!C.master) {
  24956. C.master = new Ext.Template(
  24957. "<div class=\"x-grid3\" hidefocus=\"true\">",
  24958. "<div class=\"x-grid3-viewport\">",
  24959. "<div class=\"x-grid3-header\"><div class=\"x-grid3-header-inner\"><div class=\"x-grid3-header-offset\">{header}</div></div><div class=\"x-clear\"></div></div>",
  24960. "<div class=\"x-grid3-scroller\"><div class=\"x-grid3-body\">{body}</div><a href=\"#\" class=\"x-grid3-focus\" tabIndex=\"-1\"></a></div>",
  24961. "</div>",
  24962. "<div class=\"x-grid3-resize-marker\">&#160;</div>",
  24963. "<div class=\"x-grid3-resize-proxy\">&#160;</div>",
  24964. "</div>")
  24965. }
  24966. if (!C.header) {
  24967. C.header = new Ext.Template(
  24968. "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"{tstyle}\">",
  24969. "<thead><tr class=\"x-grid3-hd-row\">{cells}</tr></thead>",
  24970. "</table>")
  24971. }
  24972. if (!C.hcell) {
  24973. C.hcell = new Ext.Template(
  24974. "<td class=\"x-grid3-hd x-grid3-cell x-grid3-td-{id}\" style=\"{style}\"><div {tooltip} {attr} class=\"x-grid3-hd-inner x-grid3-hd-{id}\" unselectable=\"on\" style=\"{istyle}\">",
  24975. this.grid.enableHdMenu
  24976. ? "<a class=\"x-grid3-hd-btn\" href=\"#\"></a>"
  24977. : "",
  24978. "{value}<img class=\"x-grid3-sort-icon\" src=\"",
  24979. Ext.BLANK_IMAGE_URL, "\" />", "</div></td>")
  24980. }
  24981. if (!C.body) {
  24982. C.body = new Ext.Template("{rows}")
  24983. }
  24984. if (!C.row) {
  24985. C.row = new Ext.Template(
  24986. "<div class=\"x-grid3-row {alt}\" style=\"{tstyle}\"><table class=\"x-grid3-row-table\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"{tstyle}\">",
  24987. "<tbody><tr>{cells}</tr>",
  24988. (this.enableRowBody
  24989. ? "<tr class=\"x-grid3-row-body-tr\" style=\"{bodyStyle}\"><td colspan=\"{cols}\" class=\"x-grid3-body-cell\" tabIndex=\"0\" hidefocus=\"on\"><div class=\"x-grid3-row-body\">{body}</div></td></tr>"
  24990. : ""), "</tbody></table></div>")
  24991. }
  24992. if (!C.cell) {
  24993. C.cell = new Ext.Template(
  24994. "<td class=\"x-grid3-col x-grid3-cell x-grid3-td-{id} {css}\" style=\"{style}\" tabIndex=\"0\" {cellAttr}>",
  24995. "<div class=\"x-grid3-cell-inner x-grid3-col-{id}\" unselectable=\"on\" {attr}>{value}</div>",
  24996. "</td>")
  24997. }
  24998. for (var A in C) {
  24999. var B = C[A];
  25000. if (B && typeof B.compile == "function" && !B.compiled) {
  25001. B.disableFormats = true;
  25002. B.compile()
  25003. }
  25004. }
  25005. this.templates = C;
  25006. this.tdClass = "x-grid3-cell";
  25007. this.cellSelector = "td.x-grid3-cell";
  25008. this.hdCls = "x-grid3-hd";
  25009. this.rowSelector = "div.x-grid3-row";
  25010. this.colRe = new RegExp("x-grid3-td-([^\\s]+)", "")
  25011. },
  25012. fly : function(A) {
  25013. if (!this._flyweight) {
  25014. this._flyweight = new Ext.Element.Flyweight(document.body)
  25015. }
  25016. this._flyweight.dom = A;
  25017. return this._flyweight
  25018. },
  25019. getEditorParent : function(A) {
  25020. return this.scroller.dom
  25021. },
  25022. initElements : function() {
  25023. var C = Ext.Element;
  25024. var B = this.grid.getGridEl().dom.firstChild;
  25025. var A = B.childNodes;
  25026. this.el = new C(B);
  25027. this.mainWrap = new C(A[0]);
  25028. this.mainHd = new C(this.mainWrap.dom.firstChild);
  25029. if (this.grid.hideHeaders) {
  25030. this.mainHd.setDisplayed(false)
  25031. }
  25032. this.innerHd = this.mainHd.dom.firstChild;
  25033. this.scroller = new C(this.mainWrap.dom.childNodes[1]);
  25034. if (this.forceFit) {
  25035. this.scroller.setStyle("overflow-x", "hidden")
  25036. }
  25037. this.mainBody = new C(this.scroller.dom.firstChild);
  25038. this.focusEl = new C(this.scroller.dom.childNodes[1]);
  25039. this.focusEl.swallowEvent("click", true);
  25040. this.resizeMarker = new C(A[1]);
  25041. this.resizeProxy = new C(A[2])
  25042. },
  25043. getRows : function() {
  25044. return this.hasRows() ? this.mainBody.dom.childNodes : []
  25045. },
  25046. findCell : function(A) {
  25047. if (!A) {
  25048. return false
  25049. }
  25050. return this.fly(A).findParent(this.cellSelector, 3)
  25051. },
  25052. findCellIndex : function(C, B) {
  25053. var A = this.findCell(C);
  25054. if (A && (!B || this.fly(A).hasClass(B))) {
  25055. return this.getCellIndex(A)
  25056. }
  25057. return false
  25058. },
  25059. getCellIndex : function(B) {
  25060. if (B) {
  25061. var A = B.className.match(this.colRe);
  25062. if (A && A[1]) {
  25063. return this.cm.getIndexById(A[1])
  25064. }
  25065. }
  25066. return false
  25067. },
  25068. findHeaderCell : function(B) {
  25069. var A = this.findCell(B);
  25070. return A && this.fly(A).hasClass(this.hdCls) ? A : null
  25071. },
  25072. findHeaderIndex : function(A) {
  25073. return this.findCellIndex(A, this.hdCls)
  25074. },
  25075. findRow : function(A) {
  25076. if (!A) {
  25077. return false
  25078. }
  25079. return this.fly(A).findParent(this.rowSelector, 10)
  25080. },
  25081. findRowIndex : function(A) {
  25082. var B = this.findRow(A);
  25083. return B ? B.rowIndex : false
  25084. },
  25085. getRow : function(A) {
  25086. return this.getRows()[A]
  25087. },
  25088. getCell : function(B, A) {
  25089. return this.getRow(B).getElementsByTagName("td")[A]
  25090. },
  25091. getHeaderCell : function(A) {
  25092. return this.mainHd.dom.getElementsByTagName("td")[A]
  25093. },
  25094. addRowClass : function(C, A) {
  25095. var B = this.getRow(C);
  25096. if (B) {
  25097. this.fly(B).addClass(A)
  25098. }
  25099. },
  25100. removeRowClass : function(C, A) {
  25101. var B = this.getRow(C);
  25102. if (B) {
  25103. this.fly(B).removeClass(A)
  25104. }
  25105. },
  25106. removeRow : function(A) {
  25107. Ext.removeNode(this.getRow(A))
  25108. },
  25109. removeRows : function(C, A) {
  25110. var B = this.mainBody.dom;
  25111. for (var D = C; D <= A; D++) {
  25112. Ext.removeNode(B.childNodes[C])
  25113. }
  25114. },
  25115. getScrollState : function() {
  25116. var A = this.scroller.dom;
  25117. return {
  25118. left : A.scrollLeft,
  25119. top : A.scrollTop
  25120. }
  25121. },
  25122. restoreScroll : function(A) {
  25123. var B = this.scroller.dom;
  25124. B.scrollLeft = A.left;
  25125. B.scrollTop = A.top
  25126. },
  25127. scrollToTop : function() {
  25128. this.scroller.dom.scrollTop = 0;
  25129. this.scroller.dom.scrollLeft = 0
  25130. },
  25131. syncScroll : function() {
  25132. this.syncHeaderScroll();
  25133. var A = this.scroller.dom;
  25134. this.grid.fireEvent("bodyscroll", A.scrollLeft, A.scrollTop)
  25135. },
  25136. syncHeaderScroll : function() {
  25137. var A = this.scroller.dom;
  25138. this.innerHd.scrollLeft = A.scrollLeft;
  25139. this.innerHd.scrollLeft = A.scrollLeft
  25140. },
  25141. updateSortIcon : function(B, A) {
  25142. var D = this.sortClasses;
  25143. var C = this.mainHd.select("td").removeClass(D);
  25144. C.item(B).addClass(D[A == "DESC" ? 1 : 0])
  25145. },
  25146. updateAllColumnWidths : function() {
  25147. var D = this.getTotalWidth();
  25148. var H = this.cm.getColumnCount();
  25149. var F = [];
  25150. for (var B = 0; B < H; B++) {
  25151. F[B] = this.getColumnWidth(B)
  25152. }
  25153. this.innerHd.firstChild.firstChild.style.width = D;
  25154. for (var B = 0; B < H; B++) {
  25155. var C = this.getHeaderCell(B);
  25156. C.style.width = F[B]
  25157. }
  25158. var G = this.getRows();
  25159. for (var B = 0, E = G.length; B < E; B++) {
  25160. G[B].style.width = D;
  25161. G[B].firstChild.style.width = D;
  25162. var I = G[B].firstChild.rows[0];
  25163. for (var A = 0; A < H; A++) {
  25164. I.childNodes[A].style.width = F[A]
  25165. }
  25166. }
  25167. this.onAllColumnWidthsUpdated(F, D)
  25168. },
  25169. updateColumnWidth : function(D, G) {
  25170. var B = this.getColumnWidth(D);
  25171. var C = this.getTotalWidth();
  25172. this.innerHd.firstChild.firstChild.style.width = C;
  25173. var H = this.getHeaderCell(D);
  25174. H.style.width = B;
  25175. var F = this.getRows();
  25176. for (var E = 0, A = F.length; E < A; E++) {
  25177. F[E].style.width = C;
  25178. F[E].firstChild.style.width = C;
  25179. F[E].firstChild.rows[0].childNodes[D].style.width = B
  25180. }
  25181. this.onColumnWidthUpdated(D, B, C)
  25182. },
  25183. updateColumnHidden : function(C, F) {
  25184. var B = this.getTotalWidth();
  25185. this.innerHd.firstChild.firstChild.style.width = B;
  25186. var H = F ? "none" : "";
  25187. var G = this.getHeaderCell(C);
  25188. G.style.display = H;
  25189. var E = this.getRows();
  25190. for (var D = 0, A = E.length; D < A; D++) {
  25191. E[D].style.width = B;
  25192. E[D].firstChild.style.width = B;
  25193. E[D].firstChild.rows[0].childNodes[C].style.display = H
  25194. }
  25195. this.onColumnHiddenUpdated(C, F, B);
  25196. delete this.lastViewWidth;
  25197. this.layout()
  25198. },
  25199. doRender : function(E, G, M, A, L, Q) {
  25200. var B = this.templates, D = B.cell, F = B.row, H = L - 1;
  25201. var C = "width:" + this.getTotalWidth() + ";";
  25202. var T = [], N, U, O = {}, I = {
  25203. tstyle : C
  25204. }, K;
  25205. for (var P = 0, S = G.length; P < S; P++) {
  25206. K = G[P];
  25207. N = [];
  25208. var J = (P + A);
  25209. for (var R = 0; R < L; R++) {
  25210. U = E[R];
  25211. O.id = U.id;
  25212. O.css = R == 0 ? "x-grid3-cell-first " : (R == H
  25213. ? "x-grid3-cell-last "
  25214. : "");
  25215. O.attr = O.cellAttr = "";
  25216. O.value = U.renderer(K.data[U.name], O, K, J, R, M);
  25217. O.style = U.style;
  25218. if (O.value == undefined || O.value === "") {
  25219. O.value = "&#160;"
  25220. }
  25221. if (K.dirty && typeof K.modified[U.name] !== "undefined") {
  25222. O.css += " x-grid3-dirty-cell"
  25223. }
  25224. N[N.length] = D.apply(O)
  25225. }
  25226. var V = [];
  25227. if (Q && ((J + 1) % 2 == 0)) {
  25228. V[0] = "x-grid3-row-alt"
  25229. }
  25230. if (K.dirty) {
  25231. V[1] = " x-grid3-dirty-row"
  25232. }
  25233. I.cols = L;
  25234. if (this.getRowClass) {
  25235. V[2] = this.getRowClass(K, J, I, M)
  25236. }
  25237. I.alt = V.join(" ");
  25238. I.cells = N.join("");
  25239. T[T.length] = F.apply(I)
  25240. }
  25241. return T.join("")
  25242. },
  25243. processRows : function(E, D) {
  25244. if (this.ds.getCount() < 1) {
  25245. return
  25246. }
  25247. D = D || !this.grid.stripeRows;
  25248. E = E || 0;
  25249. var I = this.getRows();
  25250. var F = " x-grid3-row-alt ";
  25251. for (var B = E, C = I.length; B < C; B++) {
  25252. var H = I[B];
  25253. H.rowIndex = B;
  25254. if (!D) {
  25255. var A = ((B + 1) % 2 == 0);
  25256. var G = (" " + H.className + " ").indexOf(F) != -1;
  25257. if (A == G) {
  25258. continue
  25259. }
  25260. if (A) {
  25261. H.className += " x-grid3-row-alt"
  25262. } else {
  25263. H.className = H.className.replace("x-grid3-row-alt", "")
  25264. }
  25265. }
  25266. }
  25267. },
  25268. renderUI : function() {
  25269. var E = this.renderHeaders();
  25270. var B = this.templates.body.apply({
  25271. rows : ""
  25272. });
  25273. var C = this.templates.master.apply({
  25274. body : B,
  25275. header : E
  25276. });
  25277. var D = this.grid;
  25278. D.getGridEl().dom.innerHTML = C;
  25279. this.initElements();
  25280. this.mainBody.dom.innerHTML = this.renderRows();
  25281. this.processRows(0, true);
  25282. Ext.fly(this.innerHd).on("click", this.handleHdDown, this);
  25283. this.mainHd.on("mouseover", this.handleHdOver, this);
  25284. this.mainHd.on("mouseout", this.handleHdOut, this);
  25285. this.mainHd.on("mousemove", this.handleHdMove, this);
  25286. this.scroller.on("scroll", this.syncScroll, this);
  25287. if (D.enableColumnResize !== false) {
  25288. this.splitone = new Ext.grid.GridView.SplitDragZone(D,
  25289. this.mainHd.dom)
  25290. }
  25291. if (D.enableColumnMove) {
  25292. this.columnDrag = new Ext.grid.GridView.ColumnDragZone(D,
  25293. this.innerHd);
  25294. this.columnDrop = new Ext.grid.HeaderDropZone(D, this.mainHd.dom)
  25295. }
  25296. if (D.enableHdMenu !== false) {
  25297. if (D.enableColumnHide !== false) {
  25298. this.colMenu = new Ext.menu.Menu({
  25299. id : D.id + "-hcols-menu"
  25300. });
  25301. this.colMenu.on("beforeshow", this.beforeColMenuShow, this);
  25302. this.colMenu.on("itemclick", this.handleHdMenuClick, this)
  25303. }
  25304. this.hmenu = new Ext.menu.Menu({
  25305. id : D.id + "-hctx"
  25306. });
  25307. this.hmenu.add({
  25308. id : "asc",
  25309. text : this.sortAscText,
  25310. cls : "xg-hmenu-sort-asc"
  25311. }, {
  25312. id : "desc",
  25313. text : this.sortDescText,
  25314. cls : "xg-hmenu-sort-desc"
  25315. });
  25316. if (D.enableColumnHide !== false) {
  25317. this.hmenu.add("-", {
  25318. id : "columns",
  25319. text : this.columnsText,
  25320. menu : this.colMenu,
  25321. iconCls : "x-cols-icon"
  25322. })
  25323. }
  25324. this.hmenu.on("itemclick", this.handleHdMenuClick, this)
  25325. }
  25326. if (D.enableDragDrop || D.enableDrag) {
  25327. var A = new Ext.grid.GridDragZone(D, {
  25328. ddGroup : D.ddGroup || "GridDD"
  25329. })
  25330. }
  25331. this.updateHeaderSortState()
  25332. },
  25333. layout : function() {
  25334. if (!this.mainBody) {
  25335. return
  25336. }
  25337. var E = this.grid;
  25338. var G = E.getGridEl(), I = this.cm, B = E.autoExpandColumn, A = this;
  25339. var C = G.getSize(true);
  25340. var H = C.width;
  25341. if (H < 20 || C.height < 20) {
  25342. return
  25343. }
  25344. if (E.autoHeight) {
  25345. this.scroller.dom.style.overflow = "visible"
  25346. } else {
  25347. this.el.setSize(C.width, C.height);
  25348. var F = this.mainHd.getHeight();
  25349. var D = C.height - (F);
  25350. this.scroller.setSize(H, D);
  25351. if (this.innerHd) {
  25352. this.innerHd.style.width = (H) + "px"
  25353. }
  25354. }
  25355. if (this.forceFit) {
  25356. if (this.lastViewWidth != H) {
  25357. this.fitColumns(false, false);
  25358. this.lastViewWidth = H
  25359. }
  25360. } else {
  25361. this.autoExpand();
  25362. this.syncHeaderScroll()
  25363. }
  25364. this.onLayout(H, D)
  25365. },
  25366. onLayout : function(A, B) {
  25367. },
  25368. onColumnWidthUpdated : function(C, A, B) {
  25369. },
  25370. onAllColumnWidthsUpdated : function(A, B) {
  25371. },
  25372. onColumnHiddenUpdated : function(B, C, A) {
  25373. },
  25374. updateColumnText : function(A, B) {
  25375. },
  25376. afterMove : function(A) {
  25377. },
  25378. init : function(A) {
  25379. this.grid = A;
  25380. this.initTemplates();
  25381. this.initData(A.store, A.colModel);
  25382. this.initUI(A)
  25383. },
  25384. getColumnId : function(A) {
  25385. return this.cm.getColumnId(A)
  25386. },
  25387. renderHeaders : function() {
  25388. var C = this.cm, F = this.templates;
  25389. var E = F.hcell;
  25390. var B = [], H = [], G = {};
  25391. for (var D = 0, A = C.getColumnCount(); D < A; D++) {
  25392. G.id = C.getColumnId(D);
  25393. G.value = C.getColumnHeader(D) || "";
  25394. G.style = this.getColumnStyle(D, true);
  25395. G.tooltip = this.getColumnTooltip(D);
  25396. if (C.config[D].align == "right") {
  25397. G.istyle = "padding-right:16px"
  25398. } else {
  25399. delete G.istyle
  25400. }
  25401. B[B.length] = E.apply(G)
  25402. }
  25403. return F.header.apply({
  25404. cells : B.join(""),
  25405. tstyle : "width:" + this.getTotalWidth() + ";"
  25406. })
  25407. },
  25408. getColumnTooltip : function(A) {
  25409. var B = this.cm.getColumnTooltip(A);
  25410. if (B) {
  25411. if (Ext.QuickTips.isEnabled()) {
  25412. return "ext:qtip=\"" + B + "\""
  25413. } else {
  25414. return "title=\"" + B + "\""
  25415. }
  25416. }
  25417. return ""
  25418. },
  25419. beforeUpdate : function() {
  25420. this.grid.stopEditing(true)
  25421. },
  25422. updateHeaders : function() {
  25423. this.innerHd.firstChild.innerHTML = this.renderHeaders()
  25424. },
  25425. focusRow : function(A) {
  25426. this.focusCell(A, 0, false)
  25427. },
  25428. focusCell : function(D, A, C) {
  25429. var B = this.ensureVisible(D, A, C);
  25430. this.focusEl.setXY(B);
  25431. if (Ext.isGecko) {
  25432. this.focusEl.focus()
  25433. } else {
  25434. this.focusEl.focus.defer(1, this.focusEl)
  25435. }
  25436. },
  25437. ensureVisible : function(P, E, D) {
  25438. if (typeof P != "number") {
  25439. P = P.rowIndex
  25440. }
  25441. if (!this.ds) {
  25442. return
  25443. }
  25444. if (P < 0 || P >= this.ds.getCount()) {
  25445. return
  25446. }
  25447. E = (E !== undefined ? E : 0);
  25448. var I = this.getRow(P), F;
  25449. if (!(D === false && E === 0)) {
  25450. while (this.cm.isHidden(E)) {
  25451. E++
  25452. }
  25453. F = this.getCell(P, E)
  25454. }
  25455. if (!I) {
  25456. return
  25457. }
  25458. var L = this.scroller.dom;
  25459. var O = 0;
  25460. var C = I, M = this.el.dom;
  25461. while (C && C != M) {
  25462. O += C.offsetTop;
  25463. C = C.offsetParent
  25464. }
  25465. O -= this.mainHd.dom.offsetHeight;
  25466. var N = O + I.offsetHeight;
  25467. var A = L.clientHeight;
  25468. var M = parseInt(L.scrollTop, 10);
  25469. var K = M + A;
  25470. if (O < M) {
  25471. L.scrollTop = O
  25472. } else {
  25473. if (N > K) {
  25474. L.scrollTop = N - A
  25475. }
  25476. }
  25477. if (D !== false) {
  25478. var J = parseInt(F.offsetLeft, 10);
  25479. var H = J + F.offsetWidth;
  25480. var G = parseInt(L.scrollLeft, 10);
  25481. var B = G + L.clientWidth;
  25482. if (J < G) {
  25483. L.scrollLeft = J
  25484. } else {
  25485. if (H > B) {
  25486. L.scrollLeft = H - L.clientWidth
  25487. }
  25488. }
  25489. }
  25490. return F ? Ext.fly(F).getXY() : [L.scrollLeft, Ext.fly(I).getY()]
  25491. },
  25492. insertRows : function(A, F, C, E) {
  25493. if (!E && F === 0 && C == A.getCount() - 1) {
  25494. this.refresh()
  25495. } else {
  25496. if (!E) {
  25497. this.fireEvent("beforerowsinserted", this, F, C)
  25498. }
  25499. var B = this.renderRows(F, C);
  25500. var D = this.getRow(F);
  25501. if (D) {
  25502. Ext.DomHelper.insertHtml("beforeBegin", D, B)
  25503. } else {
  25504. Ext.DomHelper.insertHtml("beforeEnd", this.mainBody.dom, B)
  25505. }
  25506. if (!E) {
  25507. this.fireEvent("rowsinserted", this, F, C);
  25508. this.processRows(F)
  25509. }
  25510. }
  25511. },
  25512. deleteRows : function(A, C, B) {
  25513. if (A.getRowCount() < 1) {
  25514. this.refresh()
  25515. } else {
  25516. this.fireEvent("beforerowsdeleted", this, C, B);
  25517. this.removeRows(C, B);
  25518. this.processRows(C);
  25519. this.fireEvent("rowsdeleted", this, C, B)
  25520. }
  25521. },
  25522. getColumnStyle : function(A, C) {
  25523. var B = !C ? (this.cm.config[A].css || "") : "";
  25524. B += "width:" + this.getColumnWidth(A) + ";";
  25525. if (this.cm.isHidden(A)) {
  25526. B += "display:none;"
  25527. }
  25528. var D = this.cm.config[A].align;
  25529. if (D) {
  25530. B += "text-align:" + D + ";"
  25531. }
  25532. return B
  25533. },
  25534. getColumnWidth : function(B) {
  25535. var A = this.cm.getColumnWidth(B);
  25536. if (typeof A == "number") {
  25537. return (Ext.isBorderBox ? A : (A - this.borderWidth > 0 ? A
  25538. - this.borderWidth : 0))
  25539. + "px"
  25540. }
  25541. return A
  25542. },
  25543. getTotalWidth : function() {
  25544. return this.cm.getTotalWidth() + "px"
  25545. },
  25546. fitColumns : function(D, G, E) {
  25547. var F = this.cm, S, L, O;
  25548. var R = F.getTotalWidth(false);
  25549. var J = this.grid.getGridEl().getWidth(true) - this.scrollOffset;
  25550. if (J < 20) {
  25551. return
  25552. }
  25553. var B = J - R;
  25554. if (B === 0) {
  25555. return false
  25556. }
  25557. var A = F.getColumnCount(true);
  25558. var P = A - (typeof E == "number" ? 1 : 0);
  25559. if (P === 0) {
  25560. P = 1;
  25561. E = undefined
  25562. }
  25563. var K = F.getColumnCount();
  25564. var I = [];
  25565. var N = 0;
  25566. var M = 0;
  25567. var H;
  25568. for (O = 0; O < K; O++) {
  25569. if (!F.isHidden(O) && !F.isFixed(O) && O !== E) {
  25570. H = F.getColumnWidth(O);
  25571. I.push(O);
  25572. N = O;
  25573. I.push(H);
  25574. M += H
  25575. }
  25576. }
  25577. var C = (J - F.getTotalWidth()) / M;
  25578. while (I.length) {
  25579. H = I.pop();
  25580. O = I.pop();
  25581. F.setColumnWidth(O, Math.max(this.grid.minColumnWidth, Math.floor(H
  25582. + H * C)), true)
  25583. }
  25584. if ((R = F.getTotalWidth(false)) > J) {
  25585. var Q = P != A ? E : N;
  25586. F.setColumnWidth(Q, Math.max(1, F.getColumnWidth(Q) - (R - J)),
  25587. true)
  25588. }
  25589. if (D !== true) {
  25590. this.updateAllColumnWidths()
  25591. }
  25592. return true
  25593. },
  25594. autoExpand : function(B) {
  25595. var G = this.grid, A = this.cm;
  25596. if (!this.userResized && G.autoExpandColumn) {
  25597. var D = A.getTotalWidth(false);
  25598. var H = this.grid.getGridEl().getWidth(true) - this.scrollOffset;
  25599. if (D != H) {
  25600. var F = A.getIndexById(G.autoExpandColumn);
  25601. var E = A.getColumnWidth(F);
  25602. var C = Math.min(Math.max(((H - D) + E), G.autoExpandMin),
  25603. G.autoExpandMax);
  25604. if (C != E) {
  25605. A.setColumnWidth(F, C, true);
  25606. if (B !== true) {
  25607. this.updateColumnWidth(F, C)
  25608. }
  25609. }
  25610. }
  25611. }
  25612. },
  25613. getColumnData : function() {
  25614. var D = [], A = this.cm, E = A.getColumnCount();
  25615. for (var C = 0; C < E; C++) {
  25616. var B = A.getDataIndex(C);
  25617. D[C] = {
  25618. name : (typeof B == "undefined"
  25619. ? this.ds.fields.get(C).name
  25620. : B),
  25621. renderer : A.getRenderer(C),
  25622. id : A.getColumnId(C),
  25623. style : this.getColumnStyle(C)
  25624. }
  25625. }
  25626. return D
  25627. },
  25628. renderRows : function(H, C) {
  25629. var D = this.grid, F = D.colModel, A = D.store, I = D.stripeRows;
  25630. var G = F.getColumnCount();
  25631. if (A.getCount() < 1) {
  25632. return ""
  25633. }
  25634. var E = this.getColumnData();
  25635. H = H || 0;
  25636. C = typeof C == "undefined" ? A.getCount() - 1 : C;
  25637. var B = A.getRange(H, C);
  25638. return this.doRender(E, B, A, H, G, I)
  25639. },
  25640. renderBody : function() {
  25641. var A = this.renderRows();
  25642. return this.templates.body.apply({
  25643. rows : A
  25644. })
  25645. },
  25646. refreshRow : function(B) {
  25647. var D = this.ds, C;
  25648. if (typeof B == "number") {
  25649. C = B;
  25650. B = D.getAt(C)
  25651. } else {
  25652. C = D.indexOf(B)
  25653. }
  25654. var A = [];
  25655. this.insertRows(D, C, C, true);
  25656. this.getRow(C).rowIndex = C;
  25657. this.onRemove(D, B, C + 1, true);
  25658. this.fireEvent("rowupdated", this, C, B)
  25659. },
  25660. refresh : function(B) {
  25661. this.fireEvent("beforerefresh", this);
  25662. this.grid.stopEditing(true);
  25663. var A = this.renderBody();
  25664. this.mainBody.update(A);
  25665. if (B === true) {
  25666. this.updateHeaders();
  25667. this.updateHeaderSortState()
  25668. }
  25669. this.processRows(0, true);
  25670. this.layout();
  25671. this.applyEmptyText();
  25672. this.fireEvent("refresh", this)
  25673. },
  25674. applyEmptyText : function() {
  25675. if (this.emptyText && !this.hasRows()) {
  25676. this.mainBody.update("<div class=\"x-grid-empty\">"
  25677. + this.emptyText + "</div>")
  25678. }
  25679. },
  25680. updateHeaderSortState : function() {
  25681. var B = this.ds.getSortState();
  25682. if (!B) {
  25683. return
  25684. }
  25685. if (!this.sortState
  25686. || (this.sortState.field != B.field || this.sortState.direction != B.direction)) {
  25687. this.grid.fireEvent("sortchange", this.grid, B)
  25688. }
  25689. this.sortState = B;
  25690. var C = this.cm.findColumnIndex(B.field);
  25691. if (C != -1) {
  25692. var A = B.direction;
  25693. this.updateSortIcon(C, A)
  25694. }
  25695. },
  25696. destroy : function() {
  25697. if (this.colMenu) {
  25698. this.colMenu.removeAll();
  25699. Ext.menu.MenuMgr.unregister(this.colMenu);
  25700. this.colMenu.getEl().remove();
  25701. delete this.colMenu
  25702. }
  25703. if (this.hmenu) {
  25704. this.hmenu.removeAll();
  25705. Ext.menu.MenuMgr.unregister(this.hmenu);
  25706. this.hmenu.getEl().remove();
  25707. delete this.hmenu
  25708. }
  25709. if (this.grid.enableColumnMove) {
  25710. var C = Ext.dd.DDM.ids["gridHeader" + this.grid.getGridEl().id];
  25711. if (C) {
  25712. for (var A in C) {
  25713. if (!C[A].config.isTarget && C[A].dragElId) {
  25714. var B = C[A].dragElId;
  25715. C[A].unreg();
  25716. Ext.get(B).remove()
  25717. } else {
  25718. if (C[A].config.isTarget) {
  25719. C[A].proxyTop.remove();
  25720. C[A].proxyBottom.remove();
  25721. C[A].unreg()
  25722. }
  25723. }
  25724. if (Ext.dd.DDM.locationCache[A]) {
  25725. delete Ext.dd.DDM.locationCache[A]
  25726. }
  25727. }
  25728. delete Ext.dd.DDM.ids["gridHeader" + this.grid.getGridEl().id]
  25729. }
  25730. }
  25731. Ext.destroy(this.resizeMarker, this.resizeProxy);
  25732. this.initData(null, null);
  25733. Ext.EventManager.removeResizeListener(this.onWindowResize, this)
  25734. },
  25735. onDenyColumnHide : function() {
  25736. },
  25737. render : function() {
  25738. var A = this.cm;
  25739. var B = A.getColumnCount();
  25740. if (this.autoFill) {
  25741. this.fitColumns(true, true)
  25742. } else {
  25743. if (this.forceFit) {
  25744. this.fitColumns(true, false)
  25745. } else {
  25746. if (this.grid.autoExpandColumn) {
  25747. this.autoExpand(true)
  25748. }
  25749. }
  25750. }
  25751. this.renderUI()
  25752. },
  25753. initData : function(B, A) {
  25754. if (this.ds) {
  25755. this.ds.un("load", this.onLoad, this);
  25756. this.ds.un("datachanged", this.onDataChange, this);
  25757. this.ds.un("add", this.onAdd, this);
  25758. this.ds.un("remove", this.onRemove, this);
  25759. this.ds.un("update", this.onUpdate, this);
  25760. this.ds.un("clear", this.onClear, this)
  25761. }
  25762. if (B) {
  25763. B.on("load", this.onLoad, this);
  25764. B.on("datachanged", this.onDataChange, this);
  25765. B.on("add", this.onAdd, this);
  25766. B.on("remove", this.onRemove, this);
  25767. B.on("update", this.onUpdate, this);
  25768. B.on("clear", this.onClear, this)
  25769. }
  25770. this.ds = B;
  25771. if (this.cm) {
  25772. this.cm.un("configchange", this.onColConfigChange, this);
  25773. this.cm.un("widthchange", this.onColWidthChange, this);
  25774. this.cm.un("headerchange", this.onHeaderChange, this);
  25775. this.cm.un("hiddenchange", this.onHiddenChange, this);
  25776. this.cm.un("columnmoved", this.onColumnMove, this);
  25777. this.cm.un("columnlockchange", this.onColumnLock, this)
  25778. }
  25779. if (A) {
  25780. A.on("configchange", this.onColConfigChange, this);
  25781. A.on("widthchange", this.onColWidthChange, this);
  25782. A.on("headerchange", this.onHeaderChange, this);
  25783. A.on("hiddenchange", this.onHiddenChange, this);
  25784. A.on("columnmoved", this.onColumnMove, this);
  25785. A.on("columnlockchange", this.onColumnLock, this)
  25786. }
  25787. this.cm = A
  25788. },
  25789. onDataChange : function() {
  25790. this.refresh();
  25791. this.updateHeaderSortState()
  25792. },
  25793. onClear : function() {
  25794. this.refresh()
  25795. },
  25796. onUpdate : function(B, A) {
  25797. this.refreshRow(A)
  25798. },
  25799. onAdd : function(C, A, B) {
  25800. this.insertRows(C, B, B + (A.length - 1))
  25801. },
  25802. onRemove : function(D, A, B, C) {
  25803. if (C !== true) {
  25804. this.fireEvent("beforerowremoved", this, B, A)
  25805. }
  25806. this.removeRow(B);
  25807. if (C !== true) {
  25808. this.processRows(B);
  25809. this.applyEmptyText();
  25810. this.fireEvent("rowremoved", this, B, A)
  25811. }
  25812. },
  25813. onLoad : function() {
  25814. this.scrollToTop()
  25815. },
  25816. onColWidthChange : function(A, B, C) {
  25817. this.updateColumnWidth(B, C)
  25818. },
  25819. onHeaderChange : function(A, B, C) {
  25820. this.updateHeaders()
  25821. },
  25822. onHiddenChange : function(A, B, C) {
  25823. this.updateColumnHidden(B, C)
  25824. },
  25825. onColumnMove : function(A, D, B) {
  25826. this.indexMap = null;
  25827. var C = this.getScrollState();
  25828. this.refresh(true);
  25829. this.restoreScroll(C);
  25830. this.afterMove(B)
  25831. },
  25832. onColConfigChange : function() {
  25833. delete this.lastViewWidth;
  25834. this.indexMap = null;
  25835. this.refresh(true)
  25836. },
  25837. initUI : function(A) {
  25838. A.on("headerclick", this.onHeaderClick, this);
  25839. if (A.trackMouseOver) {
  25840. A.on("mouseover", this.onRowOver, this);
  25841. A.on("mouseout", this.onRowOut, this)
  25842. }
  25843. },
  25844. initEvents : function() {
  25845. },
  25846. onHeaderClick : function(B, A) {
  25847. if (this.headersDisabled || !this.cm.isSortable(A)) {
  25848. return
  25849. }
  25850. B.stopEditing(true);
  25851. B.store.sort(this.cm.getDataIndex(A))
  25852. },
  25853. onRowOver : function(B, A) {
  25854. var C;
  25855. if ((C = this.findRowIndex(A)) !== false) {
  25856. this.addRowClass(C, "x-grid3-row-over")
  25857. }
  25858. },
  25859. onRowOut : function(B, A) {
  25860. var C;
  25861. if ((C = this.findRowIndex(A)) !== false
  25862. && C !== this.findRowIndex(B.getRelatedTarget())) {
  25863. this.removeRowClass(C, "x-grid3-row-over")
  25864. }
  25865. },
  25866. handleWheel : function(A) {
  25867. A.stopPropagation()
  25868. },
  25869. onRowSelect : function(A) {
  25870. this.addRowClass(A, "x-grid3-row-selected")
  25871. },
  25872. onRowDeselect : function(A) {
  25873. this.removeRowClass(A, "x-grid3-row-selected")
  25874. },
  25875. onCellSelect : function(C, B) {
  25876. var A = this.getCell(C, B);
  25877. if (A) {
  25878. this.fly(A).addClass("x-grid3-cell-selected")
  25879. }
  25880. },
  25881. onCellDeselect : function(C, B) {
  25882. var A = this.getCell(C, B);
  25883. if (A) {
  25884. this.fly(A).removeClass("x-grid3-cell-selected")
  25885. }
  25886. },
  25887. onColumnSplitterMoved : function(C, B) {
  25888. this.userResized = true;
  25889. var A = this.grid.colModel;
  25890. A.setColumnWidth(C, B, true);
  25891. if (this.forceFit) {
  25892. this.fitColumns(true, false, C);
  25893. this.updateAllColumnWidths()
  25894. } else {
  25895. this.updateColumnWidth(C, B)
  25896. }
  25897. this.grid.fireEvent("columnresize", C, B)
  25898. },
  25899. handleHdMenuClick : function(C) {
  25900. var B = this.hdCtxIndex;
  25901. var A = this.cm, D = this.ds;
  25902. switch (C.id) {
  25903. case "asc" :
  25904. D.sort(A.getDataIndex(B), "ASC");
  25905. break;
  25906. case "desc" :
  25907. D.sort(A.getDataIndex(B), "DESC");
  25908. break;
  25909. default :
  25910. B = A.getIndexById(C.id.substr(4));
  25911. if (B != -1) {
  25912. if (C.checked
  25913. && A.getColumnsBy(this.isHideableColumn, this).length <= 1) {
  25914. this.onDenyColumnHide();
  25915. return false
  25916. }
  25917. A.setHidden(B, C.checked)
  25918. }
  25919. }
  25920. return true
  25921. },
  25922. isHideableColumn : function(A) {
  25923. return !A.hidden && !A.fixed
  25924. },
  25925. beforeColMenuShow : function() {
  25926. var A = this.cm, C = A.getColumnCount();
  25927. this.colMenu.removeAll();
  25928. for (var B = 0; B < C; B++) {
  25929. if (A.config[B].fixed !== true && A.config[B].hideable !== false) {
  25930. this.colMenu.add(new Ext.menu.CheckItem({
  25931. id : "col-" + A.getColumnId(B),
  25932. text : A.getColumnHeader(B),
  25933. checked : !A.isHidden(B),
  25934. hideOnClick : false,
  25935. disabled : A.config[B].hideable === false
  25936. }))
  25937. }
  25938. }
  25939. },
  25940. handleHdDown : function(F, D) {
  25941. if (Ext.fly(D).hasClass("x-grid3-hd-btn")) {
  25942. F.stopEvent();
  25943. var E = this.findHeaderCell(D);
  25944. Ext.fly(E).addClass("x-grid3-hd-menu-open");
  25945. var C = this.getCellIndex(E);
  25946. this.hdCtxIndex = C;
  25947. var B = this.hmenu.items, A = this.cm;
  25948. B.get("asc").setDisabled(!A.isSortable(C));
  25949. B.get("desc").setDisabled(!A.isSortable(C));
  25950. this.hmenu.on("hide", function() {
  25951. Ext.fly(E).removeClass("x-grid3-hd-menu-open")
  25952. }, this, {
  25953. single : true
  25954. });
  25955. this.hmenu.show(D, "tl-bl?")
  25956. }
  25957. },
  25958. handleHdOver : function(D, A) {
  25959. var C = this.findHeaderCell(A);
  25960. if (C && !this.headersDisabled) {
  25961. this.activeHd = C;
  25962. this.activeHdIndex = this.getCellIndex(C);
  25963. var B = this.fly(C);
  25964. this.activeHdRegion = B.getRegion();
  25965. if (!this.cm.isMenuDisabled(this.activeHdIndex)) {
  25966. B.addClass("x-grid3-hd-over");
  25967. this.activeHdBtn = B.child(".x-grid3-hd-btn");
  25968. if (this.activeHdBtn) {
  25969. this.activeHdBtn.dom.style.height = (C.firstChild.offsetHeight - 1)
  25970. + "px"
  25971. }
  25972. }
  25973. }
  25974. },
  25975. handleHdMove : function(F, D) {
  25976. if (this.activeHd && !this.headersDisabled) {
  25977. var B = this.splitHandleWidth || 5;
  25978. var E = this.activeHdRegion;
  25979. var A = F.getPageX();
  25980. var C = this.activeHd.style;
  25981. if (A - E.left <= B && this.cm.isResizable(this.activeHdIndex - 1)) {
  25982. C.cursor = Ext.isAir ? "move" : Ext.isSafari
  25983. ? "e-resize"
  25984. : "col-resize"
  25985. } else {
  25986. if (E.right - A <= (!this.activeHdBtn ? B : 2)
  25987. && this.cm.isResizable(this.activeHdIndex)) {
  25988. C.cursor = Ext.isAir ? "move" : Ext.isSafari
  25989. ? "w-resize"
  25990. : "col-resize"
  25991. } else {
  25992. C.cursor = ""
  25993. }
  25994. }
  25995. }
  25996. },
  25997. handleHdOut : function(C, A) {
  25998. var B = this.findHeaderCell(A);
  25999. if (B && (!Ext.isIE || !C.within(B, true))) {
  26000. this.activeHd = null;
  26001. this.fly(B).removeClass("x-grid3-hd-over");
  26002. B.style.cursor = ""
  26003. }
  26004. },
  26005. hasRows : function() {
  26006. var A = this.mainBody.dom.firstChild;
  26007. return A && A.className != "x-grid-empty"
  26008. },
  26009. bind : function(A, B) {
  26010. this.initData(A, B)
  26011. }
  26012. });
  26013. Ext.grid.GridView.SplitDragZone = function(A, B) {
  26014. this.grid = A;
  26015. this.view = A.getView();
  26016. this.marker = this.view.resizeMarker;
  26017. this.proxy = this.view.resizeProxy;
  26018. Ext.grid.GridView.SplitDragZone.superclass.constructor.call(this, B,
  26019. "gridSplitters" + this.grid.getGridEl().id, {
  26020. dragElId : Ext.id(this.proxy.dom),
  26021. resizeFrame : false
  26022. });
  26023. this.scroll = false;
  26024. this.hw = this.view.splitHandleWidth || 5
  26025. };
  26026. Ext.extend(Ext.grid.GridView.SplitDragZone, Ext.dd.DDProxy, {
  26027. b4StartDrag : function(A, E) {
  26028. this.view.headersDisabled = true;
  26029. var D = this.view.mainWrap.getHeight();
  26030. this.marker.setHeight(D);
  26031. this.marker.show();
  26032. this.marker.alignTo(this.view.getHeaderCell(this.cellIndex),
  26033. "tl-tl", [-2, 0]);
  26034. this.proxy.setHeight(D);
  26035. var B = this.cm.getColumnWidth(this.cellIndex);
  26036. var C = Math.max(B - this.grid.minColumnWidth, 0);
  26037. this.resetConstraints();
  26038. this.setXConstraint(C, 1000);
  26039. this.setYConstraint(0, 0);
  26040. this.minX = A - C;
  26041. this.maxX = A + 1000;
  26042. this.startPos = A;
  26043. Ext.dd.DDProxy.prototype.b4StartDrag.call(this, A, E)
  26044. },
  26045. handleMouseDown : function(A) {
  26046. var H = this.view.findHeaderCell(A.getTarget());
  26047. if (H) {
  26048. var K = this.view.fly(H).getXY(), E = K[0], D = K[1];
  26049. var I = A.getXY(), C = I[0], B = I[1];
  26050. var G = H.offsetWidth, F = false;
  26051. if ((C - E) <= this.hw) {
  26052. F = -1
  26053. } else {
  26054. if ((E + G) - C <= this.hw) {
  26055. F = 0
  26056. }
  26057. }
  26058. if (F !== false) {
  26059. this.cm = this.grid.colModel;
  26060. var J = this.view.getCellIndex(H);
  26061. if (F == -1) {
  26062. if (J + F < 0) {
  26063. return
  26064. }
  26065. while (this.cm.isHidden(J + F)) {
  26066. --F;
  26067. if (J + F < 0) {
  26068. return
  26069. }
  26070. }
  26071. }
  26072. this.cellIndex = J + F;
  26073. this.split = H.dom;
  26074. if (this.cm.isResizable(this.cellIndex)
  26075. && !this.cm.isFixed(this.cellIndex)) {
  26076. Ext.grid.GridView.SplitDragZone.superclass.handleMouseDown
  26077. .apply(this, arguments)
  26078. }
  26079. } else {
  26080. if (this.view.columnDrag) {
  26081. this.view.columnDrag.callHandleMouseDown(A)
  26082. }
  26083. }
  26084. }
  26085. },
  26086. endDrag : function(D) {
  26087. this.marker.hide();
  26088. var A = this.view;
  26089. var B = Math.max(this.minX, D.getPageX());
  26090. var C = B - this.startPos;
  26091. A.onColumnSplitterMoved(this.cellIndex, this.cm
  26092. .getColumnWidth(this.cellIndex)
  26093. + C);
  26094. setTimeout(function() {
  26095. A.headersDisabled = false
  26096. }, 50)
  26097. },
  26098. autoOffset : function() {
  26099. this.setDelta(0, 0)
  26100. }
  26101. });
  26102. Ext.grid.GroupingView = Ext.extend(Ext.grid.GridView, {
  26103. hideGroupedColumn : false,
  26104. showGroupName : true,
  26105. startCollapsed : false,
  26106. enableGrouping : true,
  26107. enableGroupingMenu : true,
  26108. enableNoGroups : true,
  26109. emptyGroupText : "(None)",
  26110. ignoreAdd : false,
  26111. groupTextTpl : "{text}",
  26112. gidSeed : 1000,
  26113. initTemplates : function() {
  26114. Ext.grid.GroupingView.superclass.initTemplates.call(this);
  26115. this.state = {};
  26116. var A = this.grid.getSelectionModel();
  26117. A.on(A.selectRow ? "beforerowselect" : "beforecellselect",
  26118. this.onBeforeRowSelect, this);
  26119. if (!this.startGroup) {
  26120. this.startGroup = new Ext.XTemplate(
  26121. "<div id=\"{groupId}\" class=\"x-grid-group {cls}\">",
  26122. "<div id=\"{groupId}-hd\" class=\"x-grid-group-hd\" style=\"{style}\"><div>",
  26123. this.groupTextTpl, "</div></div>",
  26124. "<div id=\"{groupId}-bd\" class=\"x-grid-group-body\">")
  26125. }
  26126. this.startGroup.compile();
  26127. this.endGroup = "</div></div>"
  26128. },
  26129. findGroup : function(A) {
  26130. return Ext.fly(A).up(".x-grid-group", this.mainBody.dom)
  26131. },
  26132. getGroups : function() {
  26133. return this.hasRows() ? this.mainBody.dom.childNodes : []
  26134. },
  26135. onAdd : function() {
  26136. if (this.enableGrouping && !this.ignoreAdd) {
  26137. var A = this.getScrollState();
  26138. this.refresh();
  26139. this.restoreScroll(A)
  26140. } else {
  26141. if (!this.enableGrouping) {
  26142. Ext.grid.GroupingView.superclass.onAdd.apply(this, arguments)
  26143. }
  26144. }
  26145. },
  26146. onRemove : function(E, A, B, D) {
  26147. Ext.grid.GroupingView.superclass.onRemove.apply(this, arguments);
  26148. var C = document.getElementById(A._groupId);
  26149. if (C && C.childNodes[1].childNodes.length < 1) {
  26150. Ext.removeNode(C)
  26151. }
  26152. this.applyEmptyText()
  26153. },
  26154. refreshRow : function(A) {
  26155. if (this.ds.getCount() == 1) {
  26156. this.refresh()
  26157. } else {
  26158. this.isUpdating = true;
  26159. Ext.grid.GroupingView.superclass.refreshRow.apply(this, arguments);
  26160. this.isUpdating = false
  26161. }
  26162. },
  26163. beforeMenuShow : function() {
  26164. var C = this.getGroupField();
  26165. var B = this.hmenu.items.get("groupBy");
  26166. if (B) {
  26167. B.setDisabled(this.cm.config[this.hdCtxIndex].groupable === false)
  26168. }
  26169. var A = this.hmenu.items.get("showGroups");
  26170. if (A) {
  26171. if (!!C) {
  26172. A
  26173. .setDisabled(this.cm.config[this.hdCtxIndex].groupable === false)
  26174. }
  26175. A.setChecked(!!C)
  26176. }
  26177. },
  26178. renderUI : function() {
  26179. Ext.grid.GroupingView.superclass.renderUI.call(this);
  26180. this.mainBody.on("mousedown", this.interceptMouse, this);
  26181. if (this.enableGroupingMenu && this.hmenu) {
  26182. this.hmenu.add("-", {
  26183. id : "groupBy",
  26184. text : this.groupByText,
  26185. handler : this.onGroupByClick,
  26186. scope : this,
  26187. iconCls : "x-group-by-icon"
  26188. });
  26189. if (this.enableNoGroups) {
  26190. this.hmenu.add({
  26191. id : "showGroups",
  26192. text : this.showGroupsText,
  26193. checked : true,
  26194. checkHandler : this.onShowGroupsClick,
  26195. scope : this
  26196. })
  26197. }
  26198. this.hmenu.on("beforeshow", this.beforeMenuShow, this)
  26199. }
  26200. },
  26201. onGroupByClick : function() {
  26202. this.grid.store.groupBy(this.cm.getDataIndex(this.hdCtxIndex));
  26203. this.beforeMenuShow()
  26204. },
  26205. onShowGroupsClick : function(A, B) {
  26206. if (B) {
  26207. this.onGroupByClick()
  26208. } else {
  26209. this.grid.store.clearGrouping()
  26210. }
  26211. },
  26212. toggleGroup : function(C, B) {
  26213. this.grid.stopEditing(true);
  26214. C = Ext.getDom(C);
  26215. var A = Ext.fly(C);
  26216. B = B !== undefined ? B : A.hasClass("x-grid-group-collapsed");
  26217. this.state[A.dom.id] = B;
  26218. A[B ? "removeClass" : "addClass"]("x-grid-group-collapsed")
  26219. },
  26220. toggleAllGroups : function(C) {
  26221. var B = this.getGroups();
  26222. for (var D = 0, A = B.length; D < A; D++) {
  26223. this.toggleGroup(B[D], C)
  26224. }
  26225. },
  26226. expandAllGroups : function() {
  26227. this.toggleAllGroups(true)
  26228. },
  26229. collapseAllGroups : function() {
  26230. this.toggleAllGroups(false)
  26231. },
  26232. interceptMouse : function(B) {
  26233. var A = B.getTarget(".x-grid-group-hd", this.mainBody);
  26234. if (A) {
  26235. B.stopEvent();
  26236. this.toggleGroup(A.parentNode)
  26237. }
  26238. },
  26239. getGroup : function(A, D, F, G, B, E) {
  26240. var C = F ? F(A, {}, D, G, B, E) : String(A);
  26241. if (C === "") {
  26242. C = this.cm.config[B].emptyGroupText || this.emptyGroupText
  26243. }
  26244. return C
  26245. },
  26246. getGroupField : function() {
  26247. return this.grid.store.getGroupState()
  26248. },
  26249. renderRows : function() {
  26250. var A = this.getGroupField();
  26251. var D = !!A;
  26252. if (this.hideGroupedColumn) {
  26253. var B = this.cm.findColumnIndex(A);
  26254. if (!D && this.lastGroupField !== undefined) {
  26255. this.mainBody.update("");
  26256. this.cm.setHidden(this.cm.findColumnIndex(this.lastGroupField),
  26257. false);
  26258. delete this.lastGroupField
  26259. } else {
  26260. if (D && this.lastGroupField === undefined) {
  26261. this.lastGroupField = A;
  26262. this.cm.setHidden(B, true)
  26263. } else {
  26264. if (D && this.lastGroupField !== undefined
  26265. && A !== this.lastGroupField) {
  26266. this.mainBody.update("");
  26267. var C = this.cm.findColumnIndex(this.lastGroupField);
  26268. this.cm.setHidden(C, false);
  26269. this.lastGroupField = A;
  26270. this.cm.setHidden(B, true)
  26271. }
  26272. }
  26273. }
  26274. }
  26275. return Ext.grid.GroupingView.superclass.renderRows.apply(this,
  26276. arguments)
  26277. },
  26278. doRender : function(D, G, P, A, O, R) {
  26279. if (G.length < 1) {
  26280. return ""
  26281. }
  26282. var Y = this.getGroupField();
  26283. var N = this.cm.findColumnIndex(Y);
  26284. this.enableGrouping = !!Y;
  26285. if (!this.enableGrouping || this.isUpdating) {
  26286. return Ext.grid.GroupingView.superclass.doRender.apply(this,
  26287. arguments)
  26288. }
  26289. var H = "width:" + this.getTotalWidth() + ";";
  26290. var Q = this.grid.getGridEl().id;
  26291. var F = this.cm.config[N];
  26292. var B = F.groupRenderer || F.renderer;
  26293. var S = this.showGroupName ? (F.groupName || F.header) + ": " : "";
  26294. var X = [], K, T, U, M;
  26295. for (T = 0, U = G.length; T < U; T++) {
  26296. var J = A + T;
  26297. var L = G[T], E = L.data[Y], V = this.getGroup(E, L, B, J, N, P);
  26298. if (!K || K.group != V) {
  26299. M = Q + "-gp-" + Y + "-" + Ext.util.Format.htmlEncode(V);
  26300. var C = typeof this.state[M] !== "undefined"
  26301. ? !this.state[M]
  26302. : this.startCollapsed;
  26303. var I = C ? "x-grid-group-collapsed" : "";
  26304. K = {
  26305. group : V,
  26306. gvalue : E,
  26307. text : S + V,
  26308. groupId : M,
  26309. startRow : J,
  26310. rs : [L],
  26311. cls : I,
  26312. style : H
  26313. };
  26314. X.push(K)
  26315. } else {
  26316. K.rs.push(L)
  26317. }
  26318. L._groupId = M
  26319. }
  26320. var W = [];
  26321. for (T = 0, U = X.length; T < U; T++) {
  26322. var V = X[T];
  26323. this.doGroupStart(W, V, D, P, O);
  26324. W[W.length] = Ext.grid.GroupingView.superclass.doRender.call(this,
  26325. D, V.rs, P, V.startRow, O, R);
  26326. this.doGroupEnd(W, V, D, P, O)
  26327. }
  26328. return W.join("")
  26329. },
  26330. getGroupId : function(F) {
  26331. var D = this.grid.getGridEl().id;
  26332. var C = this.getGroupField();
  26333. var E = this.cm.findColumnIndex(C);
  26334. var B = this.cm.config[E];
  26335. var G = B.groupRenderer || B.renderer;
  26336. var A = this.getGroup(F, {
  26337. data : {}
  26338. }, G, 0, E, this.ds);
  26339. return D + "-gp-" + C + "-" + Ext.util.Format.htmlEncode(F)
  26340. },
  26341. doGroupStart : function(A, D, B, E, C) {
  26342. A[A.length] = this.startGroup.apply(D)
  26343. },
  26344. doGroupEnd : function(A, D, B, E, C) {
  26345. A[A.length] = this.endGroup
  26346. },
  26347. getRows : function() {
  26348. if (!this.enableGrouping) {
  26349. return Ext.grid.GroupingView.superclass.getRows.call(this)
  26350. }
  26351. var G = [];
  26352. var F, C = this.getGroups();
  26353. for (var E = 0, A = C.length; E < A; E++) {
  26354. F = C[E].childNodes[1].childNodes;
  26355. for (var D = 0, B = F.length; D < B; D++) {
  26356. G[G.length] = F[D]
  26357. }
  26358. }
  26359. return G
  26360. },
  26361. updateGroupWidths : function() {
  26362. if (!this.enableGrouping || !this.hasRows()) {
  26363. return
  26364. }
  26365. var C = Math.max(this.cm.getTotalWidth(), this.el.dom.offsetWidth
  26366. - this.scrollOffset)
  26367. + "px";
  26368. var B = this.getGroups();
  26369. for (var D = 0, A = B.length; D < A; D++) {
  26370. B[D].firstChild.style.width = C
  26371. }
  26372. },
  26373. onColumnWidthUpdated : function(C, A, B) {
  26374. this.updateGroupWidths()
  26375. },
  26376. onAllColumnWidthsUpdated : function(A, B) {
  26377. this.updateGroupWidths()
  26378. },
  26379. onColumnHiddenUpdated : function(B, C, A) {
  26380. this.updateGroupWidths()
  26381. },
  26382. onLayout : function() {
  26383. this.updateGroupWidths()
  26384. },
  26385. onBeforeRowSelect : function(D, C) {
  26386. if (!this.enableGrouping) {
  26387. return
  26388. }
  26389. var B = this.getRow(C);
  26390. if (B && !B.offsetParent) {
  26391. var A = this.findGroup(B);
  26392. this.toggleGroup(A, true)
  26393. }
  26394. },
  26395. groupByText : "Group By This Field",
  26396. showGroupsText : "Show in Groups"
  26397. });
  26398. Ext.grid.GroupingView.GROUP_ID = 1000;
  26399. Ext.grid.HeaderDragZone = function(A, C, B) {
  26400. this.grid = A;
  26401. this.view = A.getView();
  26402. this.ddGroup = "gridHeader" + this.grid.getGridEl().id;
  26403. Ext.grid.HeaderDragZone.superclass.constructor.call(this, C);
  26404. if (B) {
  26405. this.setHandleElId(Ext.id(C));
  26406. this.setOuterHandleElId(Ext.id(B))
  26407. }
  26408. this.scroll = false
  26409. };
  26410. Ext.extend(Ext.grid.HeaderDragZone, Ext.dd.DragZone, {
  26411. maxDragWidth : 120,
  26412. getDragData : function(C) {
  26413. var A = Ext.lib.Event.getTarget(C);
  26414. var B = this.view.findHeaderCell(A);
  26415. if (B) {
  26416. return {
  26417. ddel : B.firstChild,
  26418. header : B
  26419. }
  26420. }
  26421. return false
  26422. },
  26423. onInitDrag : function(A) {
  26424. this.view.headersDisabled = true;
  26425. var B = this.dragData.ddel.cloneNode(true);
  26426. B.id = Ext.id();
  26427. B.style.width = Math.min(this.dragData.header.offsetWidth,
  26428. this.maxDragWidth)
  26429. + "px";
  26430. this.proxy.update(B);
  26431. return true
  26432. },
  26433. afterValidDrop : function() {
  26434. var A = this.view;
  26435. setTimeout(function() {
  26436. A.headersDisabled = false
  26437. }, 50)
  26438. },
  26439. afterInvalidDrop : function() {
  26440. var A = this.view;
  26441. setTimeout(function() {
  26442. A.headersDisabled = false
  26443. }, 50)
  26444. }
  26445. });
  26446. Ext.grid.HeaderDropZone = function(A, C, B) {
  26447. this.grid = A;
  26448. this.view = A.getView();
  26449. this.proxyTop = Ext.DomHelper.append(document.body, {
  26450. cls : "col-move-top",
  26451. html : "&#160;"
  26452. }, true);
  26453. this.proxyBottom = Ext.DomHelper.append(document.body, {
  26454. cls : "col-move-bottom",
  26455. html : "&#160;"
  26456. }, true);
  26457. this.proxyTop.hide = this.proxyBottom.hide = function() {
  26458. this.setLeftTop(-100, -100);
  26459. this.setStyle("visibility", "hidden")
  26460. };
  26461. this.ddGroup = "gridHeader" + this.grid.getGridEl().id;
  26462. Ext.grid.HeaderDropZone.superclass.constructor
  26463. .call(this, A.getGridEl().dom)
  26464. };
  26465. Ext.extend(Ext.grid.HeaderDropZone, Ext.dd.DropZone, {
  26466. proxyOffsets : [-4, -9],
  26467. fly : Ext.Element.fly,
  26468. getTargetFromEvent : function(C) {
  26469. var A = Ext.lib.Event.getTarget(C);
  26470. var B = this.view.findCellIndex(A);
  26471. if (B !== false) {
  26472. return this.view.getHeaderCell(B)
  26473. }
  26474. },
  26475. nextVisible : function(C) {
  26476. var B = this.view, A = this.grid.colModel;
  26477. C = C.nextSibling;
  26478. while (C) {
  26479. if (!A.isHidden(B.getCellIndex(C))) {
  26480. return C
  26481. }
  26482. C = C.nextSibling
  26483. }
  26484. return null
  26485. },
  26486. prevVisible : function(C) {
  26487. var B = this.view, A = this.grid.colModel;
  26488. C = C.prevSibling;
  26489. while (C) {
  26490. if (!A.isHidden(B.getCellIndex(C))) {
  26491. return C
  26492. }
  26493. C = C.prevSibling
  26494. }
  26495. return null
  26496. },
  26497. positionIndicator : function(D, B, E) {
  26498. var H = Ext.lib.Event.getPageX(E);
  26499. var A = Ext.lib.Dom.getRegion(B.firstChild);
  26500. var I, K, G = A.top + this.proxyOffsets[1];
  26501. if ((A.right - H) <= (A.right - A.left) / 2) {
  26502. I = A.right + this.view.borderWidth;
  26503. K = "after"
  26504. } else {
  26505. I = A.left;
  26506. K = "before"
  26507. }
  26508. var F = this.view.getCellIndex(D);
  26509. var J = this.view.getCellIndex(B);
  26510. if (this.grid.colModel.isFixed(J)) {
  26511. return false
  26512. }
  26513. var C = this.grid.colModel.isLocked(J);
  26514. if (K == "after") {
  26515. J++
  26516. }
  26517. if (F < J) {
  26518. J--
  26519. }
  26520. if (F == J && (C == this.grid.colModel.isLocked(F))) {
  26521. return false
  26522. }
  26523. I += this.proxyOffsets[0];
  26524. this.proxyTop.setLeftTop(I, G);
  26525. this.proxyTop.show();
  26526. if (!this.bottomOffset) {
  26527. this.bottomOffset = this.view.mainHd.getHeight()
  26528. }
  26529. this.proxyBottom.setLeftTop(I, G
  26530. + this.proxyTop.dom.offsetHeight
  26531. + this.bottomOffset);
  26532. this.proxyBottom.show();
  26533. return K
  26534. },
  26535. onNodeEnter : function(D, A, C, B) {
  26536. if (B.header != D) {
  26537. this.positionIndicator(B.header, D, C)
  26538. }
  26539. },
  26540. onNodeOver : function(E, B, D, C) {
  26541. var A = false;
  26542. if (C.header != E) {
  26543. A = this.positionIndicator(C.header, E, D)
  26544. }
  26545. if (!A) {
  26546. this.proxyTop.hide();
  26547. this.proxyBottom.hide()
  26548. }
  26549. return A ? this.dropAllowed : this.dropNotAllowed
  26550. },
  26551. onNodeOut : function(D, A, C, B) {
  26552. this.proxyTop.hide();
  26553. this.proxyBottom.hide()
  26554. },
  26555. onNodeDrop : function(B, K, F, D) {
  26556. var E = D.header;
  26557. if (E != B) {
  26558. var I = this.grid.colModel;
  26559. var H = Ext.lib.Event.getPageX(F);
  26560. var A = Ext.lib.Dom.getRegion(B.firstChild);
  26561. var L = (A.right - H) <= ((A.right - A.left) / 2)
  26562. ? "after"
  26563. : "before";
  26564. var G = this.view.getCellIndex(E);
  26565. var J = this.view.getCellIndex(B);
  26566. var C = I.isLocked(J);
  26567. if (L == "after") {
  26568. J++
  26569. }
  26570. if (G < J) {
  26571. J--
  26572. }
  26573. if (G == J && (C == I.isLocked(G))) {
  26574. return false
  26575. }
  26576. I.setLocked(G, C, true);
  26577. I.moveColumn(G, J);
  26578. this.grid.fireEvent("columnmove", G, J);
  26579. return true
  26580. }
  26581. return false
  26582. }
  26583. });
  26584. Ext.grid.GridView.ColumnDragZone = function(A, B) {
  26585. Ext.grid.GridView.ColumnDragZone.superclass.constructor.call(this, A, B,
  26586. null);
  26587. this.proxy.el.addClass("x-grid3-col-dd")
  26588. };
  26589. Ext.extend(Ext.grid.GridView.ColumnDragZone, Ext.grid.HeaderDragZone, {
  26590. handleMouseDown : function(A) {
  26591. },
  26592. callHandleMouseDown : function(A) {
  26593. Ext.grid.GridView.ColumnDragZone.superclass.handleMouseDown
  26594. .call(this, A)
  26595. }
  26596. });
  26597. Ext.grid.SplitDragZone = function(A, C, B) {
  26598. this.grid = A;
  26599. this.view = A.getView();
  26600. this.proxy = this.view.resizeProxy;
  26601. Ext.grid.SplitDragZone.superclass.constructor.call(this, C, "gridSplitters"
  26602. + this.grid.getGridEl().id, {
  26603. dragElId : Ext.id(this.proxy.dom),
  26604. resizeFrame : false
  26605. });
  26606. this.setHandleElId(Ext.id(C));
  26607. this.setOuterHandleElId(Ext.id(B));
  26608. this.scroll = false
  26609. };
  26610. Ext.extend(Ext.grid.SplitDragZone, Ext.dd.DDProxy, {
  26611. fly : Ext.Element.fly,
  26612. b4StartDrag : function(A, D) {
  26613. this.view.headersDisabled = true;
  26614. this.proxy.setHeight(this.view.mainWrap.getHeight());
  26615. var B = this.cm.getColumnWidth(this.cellIndex);
  26616. var C = Math.max(B - this.grid.minColumnWidth, 0);
  26617. this.resetConstraints();
  26618. this.setXConstraint(C, 1000);
  26619. this.setYConstraint(0, 0);
  26620. this.minX = A - C;
  26621. this.maxX = A + 1000;
  26622. this.startPos = A;
  26623. Ext.dd.DDProxy.prototype.b4StartDrag.call(this, A, D)
  26624. },
  26625. handleMouseDown : function(B) {
  26626. ev = Ext.EventObject.setEvent(B);
  26627. var A = this.fly(ev.getTarget());
  26628. if (A.hasClass("x-grid-split")) {
  26629. this.cellIndex = this.view.getCellIndex(A.dom);
  26630. this.split = A.dom;
  26631. this.cm = this.grid.colModel;
  26632. if (this.cm.isResizable(this.cellIndex)
  26633. && !this.cm.isFixed(this.cellIndex)) {
  26634. Ext.grid.SplitDragZone.superclass.handleMouseDown
  26635. .apply(this, arguments)
  26636. }
  26637. }
  26638. },
  26639. endDrag : function(C) {
  26640. this.view.headersDisabled = false;
  26641. var A = Math.max(this.minX, Ext.lib.Event.getPageX(C));
  26642. var B = A - this.startPos;
  26643. this.view.onColumnSplitterMoved(this.cellIndex, this.cm
  26644. .getColumnWidth(this.cellIndex)
  26645. + B)
  26646. },
  26647. autoOffset : function() {
  26648. this.setDelta(0, 0)
  26649. }
  26650. });
  26651. Ext.grid.GridDragZone = function(B, A) {
  26652. this.view = B.getView();
  26653. Ext.grid.GridDragZone.superclass.constructor.call(this,
  26654. this.view.mainBody.dom, A);
  26655. if (this.view.lockedBody) {
  26656. this.setHandleElId(Ext.id(this.view.mainBody.dom));
  26657. this.setOuterHandleElId(Ext.id(this.view.lockedBody.dom))
  26658. }
  26659. this.scroll = false;
  26660. this.grid = B;
  26661. this.ddel = document.createElement("div");
  26662. this.ddel.className = "x-grid-dd-wrap"
  26663. };
  26664. Ext.extend(Ext.grid.GridDragZone, Ext.dd.DragZone, {
  26665. ddGroup : "GridDD",
  26666. getDragData : function(B) {
  26667. var A = Ext.lib.Event.getTarget(B);
  26668. var D = this.view.findRowIndex(A);
  26669. if (D !== false) {
  26670. var C = this.grid.selModel;
  26671. if (!C.isSelected(D) || B.hasModifier()) {
  26672. C.handleMouseDown(this.grid, D, B)
  26673. }
  26674. return {
  26675. grid : this.grid,
  26676. ddel : this.ddel,
  26677. rowIndex : D,
  26678. selections : C.getSelections()
  26679. }
  26680. }
  26681. return false
  26682. },
  26683. onInitDrag : function(B) {
  26684. var A = this.dragData;
  26685. this.ddel.innerHTML = this.grid.getDragDropText();
  26686. this.proxy.update(this.ddel)
  26687. },
  26688. afterRepair : function() {
  26689. this.dragging = false
  26690. },
  26691. getRepairXY : function(B, A) {
  26692. return false
  26693. },
  26694. onEndDrag : function(A, B) {
  26695. },
  26696. onValidDrop : function(A, B, C) {
  26697. this.hideProxy()
  26698. },
  26699. beforeInvalidDrop : function(A, B) {
  26700. }
  26701. });
  26702. Ext.grid.ColumnModel = function(A) {
  26703. this.defaultWidth = 100;
  26704. this.defaultSortable = false;
  26705. if (A.columns) {
  26706. Ext.apply(this, A);
  26707. this.setConfig(A.columns, true)
  26708. } else {
  26709. this.setConfig(A, true)
  26710. }
  26711. this.addEvents("widthchange", "headerchange", "hiddenchange",
  26712. "columnmoved", "columnlockchange", "configchange");
  26713. Ext.grid.ColumnModel.superclass.constructor.call(this)
  26714. };
  26715. Ext.extend(Ext.grid.ColumnModel, Ext.util.Observable, {
  26716. getColumnId : function(A) {
  26717. return this.config[A].id
  26718. },
  26719. setConfig : function(C, B) {
  26720. if (!B) {
  26721. delete this.totalWidth;
  26722. for (var D = 0, A = this.config.length; D < A; D++) {
  26723. var E = this.config[D];
  26724. if (E.editor) {
  26725. E.editor.destroy()
  26726. }
  26727. }
  26728. }
  26729. this.config = C;
  26730. this.lookup = {};
  26731. for (var D = 0, A = C.length; D < A; D++) {
  26732. var E = C[D];
  26733. if (typeof E.renderer == "string") {
  26734. E.renderer = Ext.util.Format[E.renderer]
  26735. }
  26736. if (typeof E.id == "undefined") {
  26737. E.id = D
  26738. }
  26739. if (E.editor && E.editor.isFormField) {
  26740. E.editor = new Ext.grid.GridEditor(E.editor)
  26741. }
  26742. this.lookup[E.id] = E
  26743. }
  26744. if (!B) {
  26745. this.fireEvent("configchange", this)
  26746. }
  26747. },
  26748. getColumnById : function(A) {
  26749. return this.lookup[A]
  26750. },
  26751. getIndexById : function(C) {
  26752. for (var B = 0, A = this.config.length; B < A; B++) {
  26753. if (this.config[B].id == C) {
  26754. return B
  26755. }
  26756. }
  26757. return -1
  26758. },
  26759. moveColumn : function(C, A) {
  26760. var B = this.config[C];
  26761. this.config.splice(C, 1);
  26762. this.config.splice(A, 0, B);
  26763. this.dataMap = null;
  26764. this.fireEvent("columnmoved", this, C, A)
  26765. },
  26766. isLocked : function(A) {
  26767. return this.config[A].locked === true
  26768. },
  26769. setLocked : function(B, C, A) {
  26770. if (this.isLocked(B) == C) {
  26771. return
  26772. }
  26773. this.config[B].locked = C;
  26774. if (!A) {
  26775. this.fireEvent("columnlockchange", this, B, C)
  26776. }
  26777. },
  26778. getTotalLockedWidth : function() {
  26779. var A = 0;
  26780. for (var B = 0; B < this.config.length; B++) {
  26781. if (this.isLocked(B) && !this.isHidden(B)) {
  26782. this.totalWidth += this.getColumnWidth(B)
  26783. }
  26784. }
  26785. return A
  26786. },
  26787. getLockedCount : function() {
  26788. for (var B = 0, A = this.config.length; B < A; B++) {
  26789. if (!this.isLocked(B)) {
  26790. return B
  26791. }
  26792. }
  26793. },
  26794. getColumnCount : function(C) {
  26795. if (C === true) {
  26796. var D = 0;
  26797. for (var B = 0, A = this.config.length; B < A; B++) {
  26798. if (!this.isHidden(B)) {
  26799. D++
  26800. }
  26801. }
  26802. return D
  26803. }
  26804. return this.config.length
  26805. },
  26806. getColumnsBy : function(D, C) {
  26807. var E = [];
  26808. for (var B = 0, A = this.config.length; B < A; B++) {
  26809. var F = this.config[B];
  26810. if (D.call(C || this, F, B) === true) {
  26811. E[E.length] = F
  26812. }
  26813. }
  26814. return E
  26815. },
  26816. isSortable : function(A) {
  26817. if (typeof this.config[A].sortable == "undefined") {
  26818. return this.defaultSortable
  26819. }
  26820. return this.config[A].sortable
  26821. },
  26822. isMenuDisabled : function(A) {
  26823. return !!this.config[A].menuDisabled
  26824. },
  26825. getRenderer : function(A) {
  26826. if (!this.config[A].renderer) {
  26827. return Ext.grid.ColumnModel.defaultRenderer
  26828. }
  26829. return this.config[A].renderer
  26830. },
  26831. setRenderer : function(A, B) {
  26832. this.config[A].renderer = B
  26833. },
  26834. getColumnWidth : function(A) {
  26835. return this.config[A].width || this.defaultWidth
  26836. },
  26837. setColumnWidth : function(B, C, A) {
  26838. this.config[B].width = C;
  26839. this.totalWidth = null;
  26840. if (!A) {
  26841. this.fireEvent("widthchange", this, B, C)
  26842. }
  26843. },
  26844. getTotalWidth : function(B) {
  26845. if (!this.totalWidth) {
  26846. this.totalWidth = 0;
  26847. for (var C = 0, A = this.config.length; C < A; C++) {
  26848. if (B || !this.isHidden(C)) {
  26849. this.totalWidth += this.getColumnWidth(C)
  26850. }
  26851. }
  26852. }
  26853. return this.totalWidth
  26854. },
  26855. getColumnHeader : function(A) {
  26856. return this.config[A].header
  26857. },
  26858. setColumnHeader : function(A, B) {
  26859. this.config[A].header = B;
  26860. this.fireEvent("headerchange", this, A, B)
  26861. },
  26862. getColumnTooltip : function(A) {
  26863. return this.config[A].tooltip
  26864. },
  26865. setColumnTooltip : function(A, B) {
  26866. this.config[A].tooltip = B
  26867. },
  26868. getDataIndex : function(A) {
  26869. return this.config[A].dataIndex
  26870. },
  26871. setDataIndex : function(A, B) {
  26872. this.config[A].dataIndex = B
  26873. },
  26874. findColumnIndex : function(C) {
  26875. var D = this.config;
  26876. for (var B = 0, A = D.length; B < A; B++) {
  26877. if (D[B].dataIndex == C) {
  26878. return B
  26879. }
  26880. }
  26881. return -1
  26882. },
  26883. isCellEditable : function(A, B) {
  26884. return (this.config[A].editable || (typeof this.config[A].editable == "undefined" && this.config[A].editor))
  26885. ? true
  26886. : false
  26887. },
  26888. getCellEditor : function(A, B) {
  26889. return this.config[A].editor
  26890. },
  26891. setEditable : function(A, B) {
  26892. this.config[A].editable = B
  26893. },
  26894. isHidden : function(A) {
  26895. return this.config[A].hidden
  26896. },
  26897. isFixed : function(A) {
  26898. return this.config[A].fixed
  26899. },
  26900. isResizable : function(A) {
  26901. return A >= 0 && this.config[A].resizable !== false
  26902. && this.config[A].fixed !== true
  26903. },
  26904. setHidden : function(A, B) {
  26905. var C = this.config[A];
  26906. if (C.hidden !== B) {
  26907. C.hidden = B;
  26908. this.totalWidth = null;
  26909. this.fireEvent("hiddenchange", this, A, B)
  26910. }
  26911. },
  26912. setEditor : function(A, B) {
  26913. this.config[A].editor = B
  26914. }
  26915. });
  26916. Ext.grid.ColumnModel.defaultRenderer = function(A) {
  26917. if (typeof A == "string" && A.length < 1) {
  26918. return "&#160;"
  26919. }
  26920. return A
  26921. };
  26922. Ext.grid.DefaultColumnModel = Ext.grid.ColumnModel;
  26923. Ext.grid.AbstractSelectionModel = function() {
  26924. this.locked = false;
  26925. Ext.grid.AbstractSelectionModel.superclass.constructor.call(this)
  26926. };
  26927. Ext.extend(Ext.grid.AbstractSelectionModel, Ext.util.Observable, {
  26928. init : function(A) {
  26929. this.grid = A;
  26930. this.initEvents()
  26931. },
  26932. lock : function() {
  26933. this.locked = true
  26934. },
  26935. unlock : function() {
  26936. this.locked = false
  26937. },
  26938. isLocked : function() {
  26939. return this.locked
  26940. }
  26941. });
  26942. Ext.grid.RowSelectionModel = function(A) {
  26943. Ext.apply(this, A);
  26944. this.selections = new Ext.util.MixedCollection(false, function(B) {
  26945. return B.id
  26946. });
  26947. this.last = false;
  26948. this.lastActive = false;
  26949. this.addEvents("selectionchange", "beforerowselect", "rowselect",
  26950. "rowdeselect");
  26951. Ext.grid.RowSelectionModel.superclass.constructor.call(this)
  26952. };
  26953. Ext.extend(Ext.grid.RowSelectionModel, Ext.grid.AbstractSelectionModel, {
  26954. singleSelect : false,
  26955. initEvents : function() {
  26956. if (!this.grid.enableDragDrop && !this.grid.enableDrag) {
  26957. this.grid.on("rowmousedown", this.handleMouseDown, this)
  26958. } else {
  26959. this.grid.on("rowclick", function(B, D, C) {
  26960. if (C.button === 0 && !C.shiftKey && !C.ctrlKey) {
  26961. this.selectRow(D, false);
  26962. B.view.focusRow(D)
  26963. }
  26964. }, this)
  26965. }
  26966. this.rowNav = new Ext.KeyNav(this.grid.getGridEl(), {
  26967. "up" : function(C) {
  26968. if (!C.shiftKey) {
  26969. this.selectPrevious(C.shiftKey)
  26970. } else {
  26971. if (this.last !== false
  26972. && this.lastActive !== false) {
  26973. var B = this.last;
  26974. this.selectRange(this.last,
  26975. this.lastActive - 1);
  26976. this.grid.getView()
  26977. .focusRow(this.lastActive);
  26978. if (B !== false) {
  26979. this.last = B
  26980. }
  26981. } else {
  26982. this.selectFirstRow()
  26983. }
  26984. }
  26985. },
  26986. "down" : function(C) {
  26987. if (!C.shiftKey) {
  26988. this.selectNext(C.shiftKey)
  26989. } else {
  26990. if (this.last !== false
  26991. && this.lastActive !== false) {
  26992. var B = this.last;
  26993. this.selectRange(this.last,
  26994. this.lastActive + 1);
  26995. this.grid.getView()
  26996. .focusRow(this.lastActive);
  26997. if (B !== false) {
  26998. this.last = B
  26999. }
  27000. } else {
  27001. this.selectFirstRow()
  27002. }
  27003. }
  27004. },
  27005. scope : this
  27006. });
  27007. var A = this.grid.view;
  27008. A.on("refresh", this.onRefresh, this);
  27009. A.on("rowupdated", this.onRowUpdated, this);
  27010. A.on("rowremoved", this.onRemove, this)
  27011. },
  27012. onRefresh : function() {
  27013. var F = this.grid.store, B;
  27014. var D = this.getSelections();
  27015. this.clearSelections(true);
  27016. for (var C = 0, A = D.length; C < A; C++) {
  27017. var E = D[C];
  27018. if ((B = F.indexOfId(E.id)) != -1) {
  27019. this.selectRow(B, true)
  27020. }
  27021. }
  27022. if (D.length != this.selections.getCount()) {
  27023. this.fireEvent("selectionchange", this)
  27024. }
  27025. },
  27026. onRemove : function(A, B, C) {
  27027. if (this.selections.remove(C) !== false) {
  27028. this.fireEvent("selectionchange", this)
  27029. }
  27030. },
  27031. onRowUpdated : function(A, B, C) {
  27032. if (this.isSelected(C)) {
  27033. A.onRowSelect(B)
  27034. }
  27035. },
  27036. selectRecords : function(B, E) {
  27037. if (!E) {
  27038. this.clearSelections()
  27039. }
  27040. var D = this.grid.store;
  27041. for (var C = 0, A = B.length; C < A; C++) {
  27042. this.selectRow(D.indexOf(B[C]), true)
  27043. }
  27044. },
  27045. getCount : function() {
  27046. return this.selections.length
  27047. },
  27048. selectFirstRow : function() {
  27049. this.selectRow(0)
  27050. },
  27051. selectLastRow : function(A) {
  27052. this.selectRow(this.grid.store.getCount() - 1, A)
  27053. },
  27054. selectNext : function(A) {
  27055. if (this.hasNext()) {
  27056. this.selectRow(this.last + 1, A);
  27057. this.grid.getView().focusRow(this.last);
  27058. return true
  27059. }
  27060. return false
  27061. },
  27062. selectPrevious : function(A) {
  27063. if (this.hasPrevious()) {
  27064. this.selectRow(this.last - 1, A);
  27065. this.grid.getView().focusRow(this.last);
  27066. return true
  27067. }
  27068. return false
  27069. },
  27070. hasNext : function() {
  27071. return this.last !== false
  27072. && (this.last + 1) < this.grid.store.getCount()
  27073. },
  27074. hasPrevious : function() {
  27075. return !!this.last
  27076. },
  27077. getSelections : function() {
  27078. return [].concat(this.selections.items)
  27079. },
  27080. getSelected : function() {
  27081. return this.selections.itemAt(0)
  27082. },
  27083. each : function(E, D) {
  27084. var C = this.getSelections();
  27085. for (var B = 0, A = C.length; B < A; B++) {
  27086. if (E.call(D || this, C[B], B) === false) {
  27087. return false
  27088. }
  27089. }
  27090. return true
  27091. },
  27092. clearSelections : function(A) {
  27093. if (this.locked) {
  27094. return
  27095. }
  27096. if (A !== true) {
  27097. var C = this.grid.store;
  27098. var B = this.selections;
  27099. B.each(function(D) {
  27100. this.deselectRow(C.indexOfId(D.id))
  27101. }, this);
  27102. B.clear()
  27103. } else {
  27104. this.selections.clear()
  27105. }
  27106. this.last = false
  27107. },
  27108. selectAll : function() {
  27109. if (this.locked) {
  27110. return
  27111. }
  27112. this.selections.clear();
  27113. for (var B = 0, A = this.grid.store.getCount(); B < A; B++) {
  27114. this.selectRow(B, true)
  27115. }
  27116. },
  27117. hasSelection : function() {
  27118. return this.selections.length > 0
  27119. },
  27120. isSelected : function(A) {
  27121. var B = typeof A == "number" ? this.grid.store.getAt(A) : A;
  27122. return (B && this.selections.key(B.id) ? true : false)
  27123. },
  27124. isIdSelected : function(A) {
  27125. return (this.selections.key(A) ? true : false)
  27126. },
  27127. handleMouseDown : function(D, F, E) {
  27128. if (E.button !== 0 || this.isLocked()) {
  27129. return
  27130. }
  27131. var A = this.grid.getView();
  27132. if (E.shiftKey && this.last !== false) {
  27133. var C = this.last;
  27134. this.selectRange(C, F, E.ctrlKey);
  27135. this.last = C;
  27136. A.focusRow(F)
  27137. } else {
  27138. var B = this.isSelected(F);
  27139. if (E.ctrlKey && B) {
  27140. this.deselectRow(F)
  27141. } else {
  27142. if (!B || this.getCount() > 1) {
  27143. this.selectRow(F, E.ctrlKey || E.shiftKey);
  27144. A.focusRow(F)
  27145. }
  27146. }
  27147. }
  27148. },
  27149. selectRows : function(C, D) {
  27150. if (!D) {
  27151. this.clearSelections()
  27152. }
  27153. for (var B = 0, A = C.length; B < A; B++) {
  27154. this.selectRow(C[B], true)
  27155. }
  27156. },
  27157. selectRange : function(B, A, D) {
  27158. if (this.locked) {
  27159. return
  27160. }
  27161. if (!D) {
  27162. this.clearSelections()
  27163. }
  27164. if (B <= A) {
  27165. for (var C = B; C <= A; C++) {
  27166. this.selectRow(C, true)
  27167. }
  27168. } else {
  27169. for (var C = B; C >= A; C--) {
  27170. this.selectRow(C, true)
  27171. }
  27172. }
  27173. },
  27174. deselectRange : function(C, B, A) {
  27175. if (this.locked) {
  27176. return
  27177. }
  27178. for (var D = C; D <= B; D++) {
  27179. this.deselectRow(D, A)
  27180. }
  27181. },
  27182. selectRow : function(B, D, A) {
  27183. if (this.locked || (B < 0 || B >= this.grid.store.getCount())) {
  27184. return
  27185. }
  27186. var C = this.grid.store.getAt(B);
  27187. if (C
  27188. && this.fireEvent("beforerowselect", this, B, D, C) !== false) {
  27189. if (!D || this.singleSelect) {
  27190. this.clearSelections()
  27191. }
  27192. this.selections.add(C);
  27193. this.last = this.lastActive = B;
  27194. if (!A) {
  27195. this.grid.getView().onRowSelect(B)
  27196. }
  27197. this.fireEvent("rowselect", this, B, C);
  27198. this.fireEvent("selectionchange", this)
  27199. }
  27200. },
  27201. deselectRow : function(B, A) {
  27202. if (this.locked) {
  27203. return
  27204. }
  27205. if (this.last == B) {
  27206. this.last = false
  27207. }
  27208. if (this.lastActive == B) {
  27209. this.lastActive = false
  27210. }
  27211. var C = this.grid.store.getAt(B);
  27212. if (C) {
  27213. this.selections.remove(C);
  27214. if (!A) {
  27215. this.grid.getView().onRowDeselect(B)
  27216. }
  27217. this.fireEvent("rowdeselect", this, B, C);
  27218. this.fireEvent("selectionchange", this)
  27219. }
  27220. },
  27221. restoreLast : function() {
  27222. if (this._last) {
  27223. this.last = this._last
  27224. }
  27225. },
  27226. acceptsNav : function(C, B, A) {
  27227. return !A.isHidden(B) && A.isCellEditable(B, C)
  27228. },
  27229. onEditorKey : function(F, E) {
  27230. var C = E.getKey(), G, D = this.grid, B = D.activeEditor;
  27231. var A = E.shiftKey;
  27232. if (C == E.TAB) {
  27233. E.stopEvent();
  27234. B.completeEdit();
  27235. if (A) {
  27236. G = D.walkCells(B.row, B.col - 1, -1, this.acceptsNav,
  27237. this)
  27238. } else {
  27239. G = D.walkCells(B.row, B.col + 1, 1, this.acceptsNav,
  27240. this)
  27241. }
  27242. } else {
  27243. if (C == E.ENTER) {
  27244. E.stopEvent();
  27245. B.completeEdit();
  27246. if (this.moveEditorOnEnter !== false) {
  27247. if (A) {
  27248. G = D.walkCells(B.row - 1, B.col, -1,
  27249. this.acceptsNav, this)
  27250. } else {
  27251. G = D.walkCells(B.row + 1, B.col, 1,
  27252. this.acceptsNav, this)
  27253. }
  27254. }
  27255. } else {
  27256. if (C == E.ESC) {
  27257. B.cancelEdit()
  27258. }
  27259. }
  27260. }
  27261. if (G) {
  27262. D.startEditing(G[0], G[1])
  27263. }
  27264. }
  27265. });
  27266. Ext.grid.CellSelectionModel = function(A) {
  27267. Ext.apply(this, A);
  27268. this.selection = null;
  27269. this.addEvents("beforecellselect", "cellselect", "selectionchange");
  27270. Ext.grid.CellSelectionModel.superclass.constructor.call(this)
  27271. };
  27272. Ext.extend(Ext.grid.CellSelectionModel, Ext.grid.AbstractSelectionModel, {
  27273. initEvents : function() {
  27274. this.grid.on("cellmousedown", this.handleMouseDown, this);
  27275. this.grid.getGridEl().on(Ext.isIE ? "keydown" : "keypress",
  27276. this.handleKeyDown, this);
  27277. var A = this.grid.view;
  27278. A.on("refresh", this.onViewChange, this);
  27279. A.on("rowupdated", this.onRowUpdated, this);
  27280. A.on("beforerowremoved", this.clearSelections, this);
  27281. A.on("beforerowsinserted", this.clearSelections, this);
  27282. if (this.grid.isEditor) {
  27283. this.grid.on("beforeedit", this.beforeEdit, this)
  27284. }
  27285. },
  27286. beforeEdit : function(A) {
  27287. this.select(A.row, A.column, false, true, A.record)
  27288. },
  27289. onRowUpdated : function(A, B, C) {
  27290. if (this.selection && this.selection.record == C) {
  27291. A.onCellSelect(B, this.selection.cell[1])
  27292. }
  27293. },
  27294. onViewChange : function() {
  27295. this.clearSelections(true)
  27296. },
  27297. getSelectedCell : function() {
  27298. return this.selection ? this.selection.cell : null
  27299. },
  27300. clearSelections : function(B) {
  27301. var A = this.selection;
  27302. if (A) {
  27303. if (B !== true) {
  27304. this.grid.view.onCellDeselect(A.cell[0], A.cell[1])
  27305. }
  27306. this.selection = null;
  27307. this.fireEvent("selectionchange", this, null)
  27308. }
  27309. },
  27310. hasSelection : function() {
  27311. return this.selection ? true : false
  27312. },
  27313. handleMouseDown : function(B, D, A, C) {
  27314. if (C.button !== 0 || this.isLocked()) {
  27315. return
  27316. }
  27317. this.select(D, A)
  27318. },
  27319. select : function(F, C, B, E, D) {
  27320. if (this.fireEvent("beforecellselect", this, F, C) !== false) {
  27321. this.clearSelections();
  27322. D = D || this.grid.store.getAt(F);
  27323. this.selection = {
  27324. record : D,
  27325. cell : [F, C]
  27326. };
  27327. if (!B) {
  27328. var A = this.grid.getView();
  27329. A.onCellSelect(F, C);
  27330. if (E !== true) {
  27331. A.focusCell(F, C)
  27332. }
  27333. }
  27334. this.fireEvent("cellselect", this, F, C);
  27335. this.fireEvent("selectionchange", this, this.selection)
  27336. }
  27337. },
  27338. isSelectable : function(C, B, A) {
  27339. return !A.isHidden(B)
  27340. },
  27341. handleKeyDown : function(F) {
  27342. if (!F.isNavKeyPress()) {
  27343. return
  27344. }
  27345. var E = this.grid, J = this.selection;
  27346. if (!J) {
  27347. F.stopEvent();
  27348. var I = E.walkCells(0, 0, 1, this.isSelectable, this);
  27349. if (I) {
  27350. this.select(I[0], I[1])
  27351. }
  27352. return
  27353. }
  27354. var B = this;
  27355. var H = function(M, K, L) {
  27356. return E.walkCells(M, K, L, B.isSelectable, B)
  27357. };
  27358. var C = F.getKey(), A = J.cell[0], G = J.cell[1];
  27359. var D;
  27360. switch (C) {
  27361. case F.TAB :
  27362. if (F.shiftKey) {
  27363. D = H(A, G - 1, -1)
  27364. } else {
  27365. D = H(A, G + 1, 1)
  27366. }
  27367. break;
  27368. case F.DOWN :
  27369. D = H(A + 1, G, 1);
  27370. break;
  27371. case F.UP :
  27372. D = H(A - 1, G, -1);
  27373. break;
  27374. case F.RIGHT :
  27375. D = H(A, G + 1, 1);
  27376. break;
  27377. case F.LEFT :
  27378. D = H(A, G - 1, -1);
  27379. break;
  27380. case F.ENTER :
  27381. if (E.isEditor && !E.editing) {
  27382. E.startEditing(A, G);
  27383. F.stopEvent();
  27384. return
  27385. }
  27386. break
  27387. }
  27388. if (D) {
  27389. this.select(D[0], D[1]);
  27390. F.stopEvent()
  27391. }
  27392. },
  27393. acceptsNav : function(C, B, A) {
  27394. return !A.isHidden(B) && A.isCellEditable(B, C)
  27395. },
  27396. onEditorKey : function(E, D) {
  27397. var B = D.getKey(), F, C = this.grid, A = C.activeEditor;
  27398. if (B == D.TAB) {
  27399. if (D.shiftKey) {
  27400. F = C.walkCells(A.row, A.col - 1, -1, this.acceptsNav,
  27401. this)
  27402. } else {
  27403. F = C.walkCells(A.row, A.col + 1, 1, this.acceptsNav,
  27404. this)
  27405. }
  27406. D.stopEvent()
  27407. } else {
  27408. if (B == D.ENTER) {
  27409. A.completeEdit();
  27410. D.stopEvent()
  27411. } else {
  27412. if (B == D.ESC) {
  27413. D.stopEvent();
  27414. A.cancelEdit()
  27415. }
  27416. }
  27417. }
  27418. if (F) {
  27419. C.startEditing(F[0], F[1])
  27420. }
  27421. }
  27422. });
  27423. Ext.grid.EditorGridPanel = Ext.extend(Ext.grid.GridPanel, {
  27424. clicksToEdit : 2,
  27425. isEditor : true,
  27426. detectEdit : false,
  27427. autoEncode : false,
  27428. trackMouseOver : false,
  27429. initComponent : function() {
  27430. Ext.grid.EditorGridPanel.superclass.initComponent.call(this);
  27431. if (!this.selModel) {
  27432. this.selModel = new Ext.grid.CellSelectionModel()
  27433. }
  27434. this.activeEditor = null;
  27435. this.addEvents("beforeedit", "afteredit", "validateedit")
  27436. },
  27437. initEvents : function() {
  27438. Ext.grid.EditorGridPanel.superclass.initEvents.call(this);
  27439. this.on("bodyscroll", this.stopEditing, this, [true]);
  27440. if (this.clicksToEdit == 1) {
  27441. this.on("cellclick", this.onCellDblClick, this)
  27442. } else {
  27443. if (this.clicksToEdit == "auto" && this.view.mainBody) {
  27444. this.view.mainBody.on("mousedown",
  27445. this.onAutoEditClick, this)
  27446. }
  27447. this.on("celldblclick", this.onCellDblClick, this)
  27448. }
  27449. this.getGridEl().addClass("xedit-grid")
  27450. },
  27451. onCellDblClick : function(B, C, A) {
  27452. this.startEditing(C, A)
  27453. },
  27454. onAutoEditClick : function(C, B) {
  27455. if (C.button !== 0) {
  27456. return
  27457. }
  27458. var E = this.view.findRowIndex(B);
  27459. var A = this.view.findCellIndex(B);
  27460. if (E !== false && A !== false) {
  27461. this.stopEditing();
  27462. if (this.selModel.getSelectedCell) {
  27463. var D = this.selModel.getSelectedCell();
  27464. if (D && D.cell[0] === E && D.cell[1] === A) {
  27465. this.startEditing(E, A)
  27466. }
  27467. } else {
  27468. if (this.selModel.isSelected(E)) {
  27469. this.startEditing(E, A)
  27470. }
  27471. }
  27472. }
  27473. },
  27474. onEditComplete : function(B, D, A) {
  27475. this.editing = false;
  27476. this.activeEditor = null;
  27477. B.un("specialkey", this.selModel.onEditorKey, this.selModel);
  27478. var C = B.record;
  27479. var F = this.colModel.getDataIndex(B.col);
  27480. D = this.postEditValue(D, A, C, F);
  27481. if (String(D) !== String(A)) {
  27482. var E = {
  27483. grid : this,
  27484. record : C,
  27485. field : F,
  27486. originalValue : A,
  27487. value : D,
  27488. row : B.row,
  27489. column : B.col,
  27490. cancel : false
  27491. };
  27492. if (this.fireEvent("validateedit", E) !== false
  27493. && !E.cancel) {
  27494. C.set(F, E.value);
  27495. delete E.cancel;
  27496. this.fireEvent("afteredit", E)
  27497. }
  27498. }
  27499. this.view.focusCell(B.row, B.col)
  27500. },
  27501. startEditing : function(F, B) {
  27502. this.stopEditing();
  27503. if (this.colModel.isCellEditable(B, F)) {
  27504. this.view.ensureVisible(F, B, true);
  27505. var C = this.store.getAt(F);
  27506. var E = this.colModel.getDataIndex(B);
  27507. var D = {
  27508. grid : this,
  27509. record : C,
  27510. field : E,
  27511. value : C.data[E],
  27512. row : F,
  27513. column : B,
  27514. cancel : false
  27515. };
  27516. if (this.fireEvent("beforeedit", D) !== false && !D.cancel) {
  27517. this.editing = true;
  27518. var A = this.colModel.getCellEditor(B, F);
  27519. if (!A.rendered) {
  27520. A.render(this.view.getEditorParent(A))
  27521. }
  27522. (function () {
  27523. A.row = F;
  27524. A.col = B;
  27525. A.record = C;
  27526. A.on("complete", this.onEditComplete, this, {
  27527. single : true
  27528. });
  27529. A.on("specialkey", this.selModel.onEditorKey,
  27530. this.selModel);
  27531. this.activeEditor = A;
  27532. var G = this.preEditValue(C, E);
  27533. A.startEdit(this.view.getCell(F, B), G)
  27534. }).defer(50, this)
  27535. }
  27536. }
  27537. },
  27538. preEditValue : function(A, B) {
  27539. return this.autoEncode && typeof value == "string"
  27540. ? Ext.util.Format.htmlDecode(A.data[B])
  27541. : A.data[B]
  27542. },
  27543. postEditValue : function(C, A, B, D) {
  27544. return this.autoEncode && typeof C == "string"
  27545. ? Ext.util.Format.htmlEncode(C)
  27546. : C
  27547. },
  27548. stopEditing : function(A) {
  27549. if (this.activeEditor) {
  27550. this.activeEditor[A === true
  27551. ? "cancelEdit"
  27552. : "completeEdit"]()
  27553. }
  27554. this.activeEditor = null
  27555. }
  27556. });
  27557. Ext.reg("editorgrid", Ext.grid.EditorGridPanel);
  27558. Ext.grid.GridEditor = function(B, A) {
  27559. Ext.grid.GridEditor.superclass.constructor.call(this, B, A);
  27560. B.monitorTab = false
  27561. };
  27562. Ext.extend(Ext.grid.GridEditor, Ext.Editor, {
  27563. alignment : "tl-tl",
  27564. autoSize : "width",
  27565. hideEl : false,
  27566. cls : "x-small-editor x-grid-editor",
  27567. shim : false,
  27568. shadow : false
  27569. });
  27570. Ext.grid.PropertyRecord = Ext.data.Record.create([{
  27571. name : "name",
  27572. type : "string"
  27573. }, "value"]);
  27574. Ext.grid.PropertyStore = function(A, B) {
  27575. this.grid = A;
  27576. this.store = new Ext.data.Store({
  27577. recordType : Ext.grid.PropertyRecord
  27578. });
  27579. this.store.on("update", this.onUpdate, this);
  27580. if (B) {
  27581. this.setSource(B)
  27582. }
  27583. Ext.grid.PropertyStore.superclass.constructor.call(this)
  27584. };
  27585. Ext.extend(Ext.grid.PropertyStore, Ext.util.Observable, {
  27586. setSource : function(C) {
  27587. this.source = C;
  27588. this.store.removeAll();
  27589. var B = [];
  27590. for (var A in C) {
  27591. if (this.isEditableValue(C[A])) {
  27592. B.push(new Ext.grid.PropertyRecord({
  27593. name : A,
  27594. value : C[A]
  27595. }, A))
  27596. }
  27597. }
  27598. this.store.loadRecords({
  27599. records : B
  27600. }, {}, true)
  27601. },
  27602. onUpdate : function(E, A, D) {
  27603. if (D == Ext.data.Record.EDIT) {
  27604. var B = A.data["value"];
  27605. var C = A.modified["value"];
  27606. if (this.grid.fireEvent("beforepropertychange",
  27607. this.source, A.id, B, C) !== false) {
  27608. this.source[A.id] = B;
  27609. A.commit();
  27610. this.grid.fireEvent("propertychange", this.source,
  27611. A.id, B, C)
  27612. } else {
  27613. A.reject()
  27614. }
  27615. }
  27616. },
  27617. getProperty : function(A) {
  27618. return this.store.getAt(A)
  27619. },
  27620. isEditableValue : function(A) {
  27621. if (Ext.isDate(A)) {
  27622. return true
  27623. } else {
  27624. if (typeof A == "object" || typeof A == "function") {
  27625. return false
  27626. }
  27627. }
  27628. return true
  27629. },
  27630. setValue : function(B, A) {
  27631. this.source[B] = A;
  27632. this.store.getById(B).set("value", A)
  27633. },
  27634. getSource : function() {
  27635. return this.source
  27636. }
  27637. });
  27638. Ext.grid.PropertyColumnModel = function(C, B) {
  27639. this.grid = C;
  27640. var D = Ext.grid;
  27641. D.PropertyColumnModel.superclass.constructor.call(this, [{
  27642. header : this.nameText,
  27643. width : 50,
  27644. sortable : true,
  27645. dataIndex : "name",
  27646. id : "name",
  27647. menuDisabled : true
  27648. }, {
  27649. header : this.valueText,
  27650. width : 50,
  27651. resizable : false,
  27652. dataIndex : "value",
  27653. id : "value",
  27654. menuDisabled : true
  27655. }]);
  27656. this.store = B;
  27657. this.bselect = Ext.DomHelper.append(document.body, {
  27658. tag : "select",
  27659. cls : "x-grid-editor x-hide-display",
  27660. children : [{
  27661. tag : "option",
  27662. value : "true",
  27663. html : "true"
  27664. }, {
  27665. tag : "option",
  27666. value : "false",
  27667. html : "false"
  27668. }]
  27669. });
  27670. var E = Ext.form;
  27671. var A = new E.Field({
  27672. el : this.bselect,
  27673. bselect : this.bselect,
  27674. autoShow : true,
  27675. getValue : function() {
  27676. return this.bselect.value == "true"
  27677. }
  27678. });
  27679. this.editors = {
  27680. "date" : new D.GridEditor(new E.DateField({
  27681. selectOnFocus : true
  27682. })),
  27683. "string" : new D.GridEditor(new E.TextField({
  27684. selectOnFocus : true
  27685. })),
  27686. "number" : new D.GridEditor(new E.NumberField({
  27687. selectOnFocus : true,
  27688. style : "text-align:left;"
  27689. })),
  27690. "boolean" : new D.GridEditor(A)
  27691. };
  27692. this.renderCellDelegate = this.renderCell.createDelegate(this);
  27693. this.renderPropDelegate = this.renderProp.createDelegate(this)
  27694. };
  27695. Ext.extend(Ext.grid.PropertyColumnModel, Ext.grid.ColumnModel, {
  27696. nameText : "Name",
  27697. valueText : "Value",
  27698. dateFormat : "m/j/Y",
  27699. renderDate : function(A) {
  27700. return A.dateFormat(this.dateFormat)
  27701. },
  27702. renderBool : function(A) {
  27703. return A ? "true" : "false"
  27704. },
  27705. isCellEditable : function(A, B) {
  27706. return A == 1
  27707. },
  27708. getRenderer : function(A) {
  27709. return A == 1
  27710. ? this.renderCellDelegate
  27711. : this.renderPropDelegate
  27712. },
  27713. renderProp : function(A) {
  27714. return this.getPropertyName(A)
  27715. },
  27716. renderCell : function(A) {
  27717. var B = A;
  27718. if (Ext.isDate(A)) {
  27719. B = this.renderDate(A)
  27720. } else {
  27721. if (typeof A == "boolean") {
  27722. B = this.renderBool(A)
  27723. }
  27724. }
  27725. return Ext.util.Format.htmlEncode(B)
  27726. },
  27727. getPropertyName : function(B) {
  27728. var A = this.grid.propertyNames;
  27729. return A && A[B] ? A[B] : B
  27730. },
  27731. getCellEditor : function(A, E) {
  27732. var B = this.store.getProperty(E);
  27733. var D = B.data["name"], C = B.data["value"];
  27734. if (this.grid.customEditors[D]) {
  27735. return this.grid.customEditors[D]
  27736. }
  27737. if (Ext.isDate(C)) {
  27738. return this.editors["date"]
  27739. } else {
  27740. if (typeof C == "number") {
  27741. return this.editors["number"]
  27742. } else {
  27743. if (typeof C == "boolean") {
  27744. return this.editors["boolean"]
  27745. } else {
  27746. return this.editors["string"]
  27747. }
  27748. }
  27749. }
  27750. }
  27751. });
  27752. Ext.grid.PropertyGrid = Ext.extend(Ext.grid.EditorGridPanel, {
  27753. enableColumnMove : false,
  27754. stripeRows : false,
  27755. trackMouseOver : false,
  27756. clicksToEdit : 1,
  27757. enableHdMenu : false,
  27758. viewConfig : {
  27759. forceFit : true
  27760. },
  27761. initComponent : function() {
  27762. this.customEditors = this.customEditors || {};
  27763. this.lastEditRow = null;
  27764. var B = new Ext.grid.PropertyStore(this);
  27765. this.propStore = B;
  27766. var A = new Ext.grid.PropertyColumnModel(this, B);
  27767. B.store.sort("name", "ASC");
  27768. this.addEvents("beforepropertychange", "propertychange");
  27769. this.cm = A;
  27770. this.ds = B.store;
  27771. Ext.grid.PropertyGrid.superclass.initComponent.call(this);
  27772. this.selModel.on("beforecellselect", function(E, D, C) {
  27773. if (C === 0) {
  27774. this.startEditing.defer(200, this, [D, 1]);
  27775. return false
  27776. }
  27777. }, this)
  27778. },
  27779. onRender : function() {
  27780. Ext.grid.PropertyGrid.superclass.onRender
  27781. .apply(this, arguments);
  27782. this.getGridEl().addClass("x-props-grid")
  27783. },
  27784. afterRender : function() {
  27785. Ext.grid.PropertyGrid.superclass.afterRender.apply(this,
  27786. arguments);
  27787. if (this.source) {
  27788. this.setSource(this.source)
  27789. }
  27790. },
  27791. setSource : function(A) {
  27792. this.propStore.setSource(A)
  27793. },
  27794. getSource : function() {
  27795. return this.propStore.getSource()
  27796. }
  27797. });
  27798. Ext.grid.RowNumberer = function(A) {
  27799. Ext.apply(this, A);
  27800. if (this.rowspan) {
  27801. this.renderer = this.renderer.createDelegate(this)
  27802. }
  27803. };
  27804. Ext.grid.RowNumberer.prototype = {
  27805. header : "",
  27806. width : 23,
  27807. sortable : false,
  27808. fixed : true,
  27809. menuDisabled : true,
  27810. dataIndex : "",
  27811. id : "numberer",
  27812. rowspan : undefined,
  27813. renderer : function(B, C, A, D) {
  27814. if (this.rowspan) {
  27815. C.cellAttr = "rowspan=\"" + this.rowspan + "\""
  27816. }
  27817. return D + 1
  27818. }
  27819. };
  27820. Ext.grid.CheckboxSelectionModel = Ext.extend(Ext.grid.RowSelectionModel, {
  27821. header : "<div class=\"x-grid3-hd-checker\">&#160;</div>",
  27822. width : 20,
  27823. sortable : false,
  27824. menuDisabled : true,
  27825. fixed : true,
  27826. dataIndex : "",
  27827. id : "checker",
  27828. initEvents : function() {
  27829. Ext.grid.CheckboxSelectionModel.superclass.initEvents
  27830. .call(this);
  27831. this.grid.on("render", function() {
  27832. var A = this.grid.getView();
  27833. A.mainBody.on("mousedown", this.onMouseDown, this);
  27834. Ext.fly(A.innerHd).on("mousedown",
  27835. this.onHdMouseDown, this)
  27836. }, this)
  27837. },
  27838. onMouseDown : function(C, B) {
  27839. if (C.button === 0 && B.className == "x-grid3-row-checker") {
  27840. C.stopEvent();
  27841. var D = C.getTarget(".x-grid3-row");
  27842. if (D) {
  27843. var A = D.rowIndex;
  27844. if (this.isSelected(A)) {
  27845. this.deselectRow(A)
  27846. } else {
  27847. this.selectRow(A, true)
  27848. }
  27849. }
  27850. }
  27851. },
  27852. onHdMouseDown : function(C, A) {
  27853. if (A.className == "x-grid3-hd-checker") {
  27854. C.stopEvent();
  27855. var B = Ext.fly(A.parentNode);
  27856. var D = B.hasClass("x-grid3-hd-checker-on");
  27857. if (D) {
  27858. B.removeClass("x-grid3-hd-checker-on");
  27859. this.clearSelections()
  27860. } else {
  27861. B.addClass("x-grid3-hd-checker-on");
  27862. this.selectAll()
  27863. }
  27864. }
  27865. },
  27866. renderer : function(B, C, A) {
  27867. return "<div class=\"x-grid3-row-checker\">&#160;</div>"
  27868. }
  27869. });
  27870. Ext.LoadMask = function(C, B) {
  27871. this.el = Ext.get(C);
  27872. Ext.apply(this, B);
  27873. if (this.store) {
  27874. this.store.on("beforeload", this.onBeforeLoad, this);
  27875. this.store.on("load", this.onLoad, this);
  27876. this.store.on("loadexception", this.onLoad, this);
  27877. this.removeMask = Ext.value(this.removeMask, false)
  27878. } else {
  27879. var A = this.el.getUpdater();
  27880. A.showLoadIndicator = false;
  27881. A.on("beforeupdate", this.onBeforeLoad, this);
  27882. A.on("update", this.onLoad, this);
  27883. A.on("failure", this.onLoad, this);
  27884. this.removeMask = Ext.value(this.removeMask, true)
  27885. }
  27886. };
  27887. Ext.LoadMask.prototype = {
  27888. msg : "Loading...",
  27889. msgCls : "x-mask-loading",
  27890. disabled : false,
  27891. disable : function() {
  27892. this.disabled = true
  27893. },
  27894. enable : function() {
  27895. this.disabled = false
  27896. },
  27897. onLoad : function() {
  27898. this.el.unmask(this.removeMask)
  27899. },
  27900. onBeforeLoad : function() {
  27901. if (!this.disabled) {
  27902. this.el.mask(this.msg, this.msgCls)
  27903. }
  27904. },
  27905. show : function() {
  27906. this.onBeforeLoad()
  27907. },
  27908. hide : function() {
  27909. this.onLoad()
  27910. },
  27911. destroy : function() {
  27912. if (this.store) {
  27913. this.store.un("beforeload", this.onBeforeLoad, this);
  27914. this.store.un("load", this.onLoad, this);
  27915. this.store.un("loadexception", this.onLoad, this)
  27916. } else {
  27917. var A = this.el.getUpdater();
  27918. A.un("beforeupdate", this.onBeforeLoad, this);
  27919. A.un("update", this.onLoad, this);
  27920. A.un("failure", this.onLoad, this)
  27921. }
  27922. }
  27923. };
  27924. Ext.ProgressBar = Ext.extend(Ext.BoxComponent, {
  27925. baseCls : "x-progress",
  27926. waitTimer : null,
  27927. initComponent : function() {
  27928. Ext.ProgressBar.superclass.initComponent.call(this);
  27929. this.addEvents("update")
  27930. },
  27931. onRender : function(D, A) {
  27932. Ext.ProgressBar.superclass.onRender.call(this, D, A);
  27933. var C = new Ext.Template("<div class=\"{cls}-wrap\">",
  27934. "<div class=\"{cls}-inner\">", "<div class=\"{cls}-bar\">",
  27935. "<div class=\"{cls}-text\">", "<div>&#160;</div>", "</div>",
  27936. "</div>", "<div class=\"{cls}-text {cls}-text-back\">",
  27937. "<div>&#160;</div>", "</div>", "</div>", "</div>");
  27938. if (A) {
  27939. this.el = C.insertBefore(A, {
  27940. cls : this.baseCls
  27941. }, true)
  27942. } else {
  27943. this.el = C.append(D, {
  27944. cls : this.baseCls
  27945. }, true)
  27946. }
  27947. if (this.id) {
  27948. this.el.dom.id = this.id
  27949. }
  27950. var B = this.el.dom.firstChild;
  27951. this.progressBar = Ext.get(B.firstChild);
  27952. if (this.textEl) {
  27953. this.textEl = Ext.get(this.textEl);
  27954. delete this.textTopEl
  27955. } else {
  27956. this.textTopEl = Ext.get(this.progressBar.dom.firstChild);
  27957. var E = Ext.get(B.childNodes[1]);
  27958. this.textTopEl.setStyle("z-index", 99).addClass("x-hidden");
  27959. this.textEl = new Ext.CompositeElement([
  27960. this.textTopEl.dom.firstChild, E.dom.firstChild]);
  27961. this.textEl.setWidth(B.offsetWidth)
  27962. }
  27963. if (this.value) {
  27964. this.updateProgress(this.value, this.text)
  27965. } else {
  27966. this.updateText(this.text)
  27967. }
  27968. this.setSize(this.width || "auto", "auto");
  27969. this.progressBar.setHeight(B.offsetHeight)
  27970. },
  27971. updateProgress : function(B, C) {
  27972. this.value = B || 0;
  27973. if (C) {
  27974. this.updateText(C)
  27975. }
  27976. var A = Math.floor(B * this.el.dom.firstChild.offsetWidth);
  27977. this.progressBar.setWidth(A);
  27978. if (this.textTopEl) {
  27979. this.textTopEl.removeClass("x-hidden").setWidth(A)
  27980. }
  27981. this.fireEvent("update", this, B, C);
  27982. return this
  27983. },
  27984. wait : function(B) {
  27985. if (!this.waitTimer) {
  27986. var A = this;
  27987. B = B || {};
  27988. this.waitTimer = Ext.TaskMgr.start({
  27989. run : function(C) {
  27990. var D = B.increment || 10;
  27991. this
  27992. .updateProgress(((((C + D) % D) + 1) * (100 / D))
  27993. * 0.01)
  27994. },
  27995. interval : B.interval || 1000,
  27996. duration : B.duration,
  27997. onStop : function() {
  27998. if (B.fn) {
  27999. B.fn.apply(B.scope || this)
  28000. }
  28001. this.reset()
  28002. },
  28003. scope : A
  28004. })
  28005. }
  28006. return this
  28007. },
  28008. isWaiting : function() {
  28009. return this.waitTimer != null
  28010. },
  28011. updateText : function(A) {
  28012. this.text = A || "&#160;";
  28013. this.textEl.update(this.text);
  28014. return this
  28015. },
  28016. setSize : function(A, C) {
  28017. Ext.ProgressBar.superclass.setSize.call(this, A, C);
  28018. if (this.textTopEl) {
  28019. var B = this.el.dom.firstChild;
  28020. this.textEl.setSize(B.offsetWidth, B.offsetHeight)
  28021. }
  28022. return this
  28023. },
  28024. reset : function(A) {
  28025. this.updateProgress(0);
  28026. if (this.textTopEl) {
  28027. this.textTopEl.addClass("x-hidden")
  28028. }
  28029. if (this.waitTimer) {
  28030. this.waitTimer.onStop = null;
  28031. Ext.TaskMgr.stop(this.waitTimer);
  28032. this.waitTimer = null
  28033. }
  28034. if (A === true) {
  28035. this.hide()
  28036. }
  28037. return this
  28038. }
  28039. });
  28040. Ext.reg("progress", Ext.ProgressBar);