ext-core.js 118 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118
  1. /*
  2. * Ext JS Library 2.0 Copyright(c) 2006-2007, 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 P = "";
  15. if (!T.tag) {
  16. T.tag = "div"
  17. }
  18. P += "<" + T.tag;
  19. for (var O in T) {
  20. if (O == "tag" || O == "children" || O == "cn" || O == "html"
  21. || typeof T[O] == "function") {
  22. continue
  23. }
  24. if (O == "style") {
  25. var S = T["style"];
  26. if (typeof S == "function") {
  27. S = S.call()
  28. }
  29. if (typeof S == "string") {
  30. P += " style=\"" + S + "\""
  31. } else {
  32. if (typeof S == "object") {
  33. P += " style=\"";
  34. for (var R in S) {
  35. if (typeof S[R] != "function") {
  36. P += R + ":" + S[R] + ";"
  37. }
  38. }
  39. P += "\""
  40. }
  41. }
  42. } else {
  43. if (O == "cls") {
  44. P += " class=\"" + T["cls"] + "\""
  45. } else {
  46. if (O == "htmlFor") {
  47. P += " for=\"" + T["htmlFor"] + "\""
  48. } else {
  49. P += " " + O + "=\"" + T[O] + "\""
  50. }
  51. }
  52. }
  53. }
  54. if (F.test(T.tag)) {
  55. P += "/>"
  56. } else {
  57. P += ">";
  58. var U = T.children || T.cn;
  59. if (U) {
  60. if (U instanceof Array) {
  61. for (var Q = 0, N = U.length; Q < N; Q++) {
  62. P += A(U[Q], P)
  63. }
  64. } else {
  65. P += A(U, P)
  66. }
  67. }
  68. if (T.html) {
  69. P += T.html
  70. }
  71. P += "</" + T.tag + ">"
  72. }
  73. return P
  74. };
  75. var M = function(T, P) {
  76. var S = document.createElement(T.tag || "div");
  77. var Q = S.setAttribute ? true : false;
  78. for (var O in T) {
  79. if (O == "tag" || O == "children" || O == "cn" || O == "html"
  80. || O == "style" || typeof T[O] == "function") {
  81. continue
  82. }
  83. if (O == "cls") {
  84. S.className = T["cls"]
  85. } else {
  86. if (Q) {
  87. S.setAttribute(O, T[O])
  88. } else {
  89. S[O] = T[O]
  90. }
  91. }
  92. }
  93. Ext.DomHelper.applyStyles(S, T.style);
  94. var U = T.children || T.cn;
  95. if (U) {
  96. if (U instanceof Array) {
  97. for (var R = 0, N = U.length; R < N; R++) {
  98. M(U[R], S)
  99. }
  100. } else {
  101. M(U, S)
  102. }
  103. }
  104. if (T.html) {
  105. S.innerHTML = T.html
  106. }
  107. if (P) {
  108. P.appendChild(S)
  109. }
  110. return S
  111. };
  112. var I = function(S, Q, P, R) {
  113. L.innerHTML = [Q, P, R].join("");
  114. var N = -1, O = L;
  115. while (++N < S) {
  116. O = O.firstChild
  117. }
  118. return O
  119. };
  120. var J = "<table>", E = "</table>", C = J + "<tbody>", K = "</tbody>" + E, H = C
  121. + "<tr>", D = "</tr>" + K;
  122. var G = function(N, O, Q, P) {
  123. if (!L) {
  124. L = document.createElement("div")
  125. }
  126. var R;
  127. var S = null;
  128. if (N == "td") {
  129. if (O == "afterbegin" || O == "beforeend") {
  130. return
  131. }
  132. if (O == "beforebegin") {
  133. S = Q;
  134. Q = Q.parentNode
  135. } else {
  136. S = Q.nextSibling;
  137. Q = Q.parentNode
  138. }
  139. R = I(4, H, P, D)
  140. } else {
  141. if (N == "tr") {
  142. if (O == "beforebegin") {
  143. S = Q;
  144. Q = Q.parentNode;
  145. R = I(3, C, P, K)
  146. } else {
  147. if (O == "afterend") {
  148. S = Q.nextSibling;
  149. Q = Q.parentNode;
  150. R = I(3, C, P, K)
  151. } else {
  152. if (O == "afterbegin") {
  153. S = Q.firstChild
  154. }
  155. R = I(4, H, P, D)
  156. }
  157. }
  158. } else {
  159. if (N == "tbody") {
  160. if (O == "beforebegin") {
  161. S = Q;
  162. Q = Q.parentNode;
  163. R = I(2, J, P, E)
  164. } else {
  165. if (O == "afterend") {
  166. S = Q.nextSibling;
  167. Q = Q.parentNode;
  168. R = I(2, J, P, E)
  169. } else {
  170. if (O == "afterbegin") {
  171. S = Q.firstChild
  172. }
  173. R = I(3, C, P, K)
  174. }
  175. }
  176. } else {
  177. if (O == "beforebegin" || O == "afterend") {
  178. return
  179. }
  180. if (O == "afterbegin") {
  181. S = Q.firstChild
  182. }
  183. R = I(2, J, P, E)
  184. }
  185. }
  186. }
  187. Q.insertBefore(R, S);
  188. return R
  189. };
  190. return {
  191. useDom : false,
  192. markup : function(N) {
  193. return A(N)
  194. },
  195. applyStyles : function(P, Q) {
  196. if (Q) {
  197. P = Ext.fly(P);
  198. if (typeof Q == "string") {
  199. var O = /\s?([a-z\-]*)\:\s?([^;]*);?/gi;
  200. var R;
  201. while ((R = O.exec(Q)) != null) {
  202. P.setStyle(R[1], R[2])
  203. }
  204. } else {
  205. if (typeof Q == "object") {
  206. for (var N in Q) {
  207. P.setStyle(N, Q[N])
  208. }
  209. } else {
  210. if (typeof Q == "function") {
  211. Ext.DomHelper.applyStyles(P, Q.call())
  212. }
  213. }
  214. }
  215. }
  216. },
  217. insertHtml : function(P, R, Q) {
  218. P = P.toLowerCase();
  219. if (R.insertAdjacentHTML) {
  220. if (B.test(R.tagName)) {
  221. var O;
  222. if (O = G(R.tagName.toLowerCase(), P, R, Q)) {
  223. return O
  224. }
  225. }
  226. switch (P) {
  227. case "beforebegin" :
  228. R.insertAdjacentHTML("BeforeBegin", Q);
  229. return R.previousSibling;
  230. case "afterbegin" :
  231. R.insertAdjacentHTML("AfterBegin", Q);
  232. return R.firstChild;
  233. case "beforeend" :
  234. R.insertAdjacentHTML("BeforeEnd", Q);
  235. return R.lastChild;
  236. case "afterend" :
  237. R.insertAdjacentHTML("AfterEnd", Q);
  238. return R.nextSibling
  239. }
  240. throw "Illegal insertion point -> \"" + P + "\""
  241. }
  242. var N = R.ownerDocument.createRange();
  243. var S;
  244. switch (P) {
  245. case "beforebegin" :
  246. N.setStartBefore(R);
  247. S = N.createContextualFragment(Q);
  248. R.parentNode.insertBefore(S, R);
  249. return R.previousSibling;
  250. case "afterbegin" :
  251. if (R.firstChild) {
  252. N.setStartBefore(R.firstChild);
  253. S = N.createContextualFragment(Q);
  254. R.insertBefore(S, R.firstChild);
  255. return R.firstChild
  256. } else {
  257. R.innerHTML = Q;
  258. return R.firstChild
  259. }
  260. case "beforeend" :
  261. if (R.lastChild) {
  262. N.setStartAfter(R.lastChild);
  263. S = N.createContextualFragment(Q);
  264. R.appendChild(S);
  265. return R.lastChild
  266. } else {
  267. R.innerHTML = Q;
  268. return R.lastChild
  269. }
  270. case "afterend" :
  271. N.setStartAfter(R);
  272. S = N.createContextualFragment(Q);
  273. R.parentNode.insertBefore(S, R.nextSibling);
  274. return R.nextSibling
  275. }
  276. throw "Illegal insertion point -> \"" + P + "\""
  277. },
  278. insertBefore : function(N, P, O) {
  279. return this.doInsert(N, P, O, "beforeBegin")
  280. },
  281. insertAfter : function(N, P, O) {
  282. return this.doInsert(N, P, O, "afterEnd", "nextSibling")
  283. },
  284. insertFirst : function(N, P, O) {
  285. return this.doInsert(N, P, O, "afterBegin", "firstChild")
  286. },
  287. doInsert : function(Q, S, R, T, P) {
  288. Q = Ext.getDom(Q);
  289. var O;
  290. if (this.useDom) {
  291. O = M(S, null);
  292. (P === "firstChild" ? Q : Q.parentNode).insertBefore(O, P
  293. ? Q[P]
  294. : Q)
  295. } else {
  296. var N = A(S);
  297. O = this.insertHtml(T, Q, N)
  298. }
  299. return R ? Ext.get(O, true) : O
  300. },
  301. append : function(P, R, Q) {
  302. P = Ext.getDom(P);
  303. var O;
  304. if (this.useDom) {
  305. O = M(R, null);
  306. P.appendChild(O)
  307. } else {
  308. var N = A(R);
  309. O = this.insertHtml("beforeEnd", P, N)
  310. }
  311. return Q ? Ext.get(O, true) : O
  312. },
  313. overwrite : function(N, P, O) {
  314. N = Ext.getDom(N);
  315. N.innerHTML = A(P);
  316. return O ? Ext.get(N.firstChild, true) : N.firstChild
  317. },
  318. createTemplate : function(O) {
  319. var N = A(O);
  320. return new Ext.Template(N)
  321. }
  322. }
  323. }();
  324. Ext.Template = function(E) {
  325. var B = arguments;
  326. if (E instanceof Array) {
  327. E = E.join("")
  328. } else {
  329. if (B.length > 1) {
  330. var C = [];
  331. for (var D = 0, A = B.length; D < A; D++) {
  332. if (typeof B[D] == "object") {
  333. Ext.apply(this, B[D])
  334. } else {
  335. C[C.length] = B[D]
  336. }
  337. }
  338. E = C.join("")
  339. }
  340. }
  341. this.html = E;
  342. if (this.compiled) {
  343. this.compile()
  344. }
  345. };
  346. Ext.Template.prototype = {
  347. applyTemplate : function(B) {
  348. if (this.compiled) {
  349. return this.compiled(B)
  350. }
  351. var A = this.disableFormats !== true;
  352. var E = Ext.util.Format, C = this;
  353. var D = function(G, I, L, H) {
  354. if (L && A) {
  355. if (L.substr(0, 5) == "this.") {
  356. return C.call(L.substr(5), B[I], B)
  357. } else {
  358. if (H) {
  359. var K = /^\s*['"](.*)["']\s*$/;
  360. H = H.split(",");
  361. for (var J = 0, F = H.length; J < F; J++) {
  362. H[J] = H[J].replace(K, "$1")
  363. }
  364. H = [B[I]].concat(H)
  365. } else {
  366. H = [B[I]]
  367. }
  368. return E[L].apply(E, H)
  369. }
  370. } else {
  371. return B[I] !== undefined ? B[I] : ""
  372. }
  373. };
  374. return this.html.replace(this.re, D)
  375. },
  376. set : function(A, B) {
  377. this.html = A;
  378. this.compiled = null;
  379. if (B) {
  380. this.compile()
  381. }
  382. return this
  383. },
  384. disableFormats : false,
  385. re : /\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,
  386. compile : function() {
  387. var fm = Ext.util.Format;
  388. var useF = this.disableFormats !== true;
  389. var sep = Ext.isGecko ? "+" : ",";
  390. var fn = function(m, name, format, args) {
  391. if (format && useF) {
  392. args = args ? "," + args : "";
  393. if (format.substr(0, 5) != "this.") {
  394. format = "fm." + format + "("
  395. } else {
  396. format = "this.call(\"" + format.substr(5) + "\", ";
  397. args = ", values"
  398. }
  399. } else {
  400. args = "";
  401. format = "(values['" + name + "'] == undefined ? '' : "
  402. }
  403. return "'" + sep + format + "values['" + name + "']" + args + ")"
  404. + sep + "'"
  405. };
  406. var body;
  407. if (Ext.isGecko) {
  408. body = "this.compiled = function(values){ return '"
  409. + this.html.replace(/\\/g, "\\\\").replace(/(\r\n|\n)/g,
  410. "\\n").replace(/'/g, "\\'").replace(this.re, fn)
  411. + "';};"
  412. } else {
  413. body = ["this.compiled = function(values){ return ['"];
  414. body.push(this.html.replace(/\\/g, "\\\\").replace(/(\r\n|\n)/g,
  415. "\\n").replace(/'/g, "\\'").replace(this.re, fn));
  416. body.push("'].join('');};");
  417. body = body.join("")
  418. }
  419. eval(body);
  420. return this
  421. },
  422. call : function(C, B, A) {
  423. return this[C](B, A)
  424. },
  425. insertFirst : function(B, A, C) {
  426. return this.doInsert("afterBegin", B, A, C)
  427. },
  428. insertBefore : function(B, A, C) {
  429. return this.doInsert("beforeBegin", B, A, C)
  430. },
  431. insertAfter : function(B, A, C) {
  432. return this.doInsert("afterEnd", B, A, C)
  433. },
  434. append : function(B, A, C) {
  435. return this.doInsert("beforeEnd", B, A, C)
  436. },
  437. doInsert : function(C, E, B, A) {
  438. E = Ext.getDom(E);
  439. var D = Ext.DomHelper.insertHtml(C, E, this.applyTemplate(B));
  440. return A ? Ext.get(D, true) : D
  441. },
  442. overwrite : function(B, A, C) {
  443. B = Ext.getDom(B);
  444. B.innerHTML = this.applyTemplate(A);
  445. return C ? Ext.get(B.firstChild, true) : B.firstChild
  446. }
  447. };
  448. Ext.Template.prototype.apply = Ext.Template.prototype.applyTemplate;
  449. Ext.DomHelper.Template = Ext.Template;
  450. Ext.Template.from = function(B, A) {
  451. B = Ext.getDom(B);
  452. return new Ext.Template(B.value || B.innerHTML, A || "")
  453. };
  454. Ext.DomQuery = function() {
  455. var cache = {}, simpleCache = {}, valueCache = {};
  456. var nonSpace = /\S/;
  457. var trimRe = /^\s+|\s+$/g;
  458. var tplRe = /\{(\d+)\}/g;
  459. var modeRe = /^(\s?[\/>+~]\s?|\s|$)/;
  460. var tagTokenRe = /^(#)?([\w-\*]+)/;
  461. var nthRe = /(\d*)n\+?(\d*)/, nthRe2 = /\D/;
  462. function child(p, index) {
  463. var i = 0;
  464. var n = p.firstChild;
  465. while (n) {
  466. if (n.nodeType == 1) {
  467. if (++i == index) {
  468. return n
  469. }
  470. }
  471. n = n.nextSibling
  472. }
  473. return null
  474. }
  475. function next(n) {
  476. while ((n = n.nextSibling) && n.nodeType != 1) {
  477. }
  478. return n
  479. }
  480. function prev(n) {
  481. while ((n = n.previousSibling) && n.nodeType != 1) {
  482. }
  483. return n
  484. }
  485. function children(d) {
  486. var n = d.firstChild, ni = -1;
  487. while (n) {
  488. var nx = n.nextSibling;
  489. if (n.nodeType == 3 && !nonSpace.test(n.nodeValue)) {
  490. d.removeChild(n)
  491. } else {
  492. n.nodeIndex = ++ni
  493. }
  494. n = nx
  495. }
  496. return this
  497. }
  498. function byClassName(c, a, v) {
  499. if (!v) {
  500. return c
  501. }
  502. var r = [], ri = -1, cn;
  503. for (var i = 0, ci; ci = c[i]; i++) {
  504. if ((" " + ci.className + " ").indexOf(v) != -1) {
  505. r[++ri] = ci
  506. }
  507. }
  508. return r
  509. }
  510. function attrValue(n, attr) {
  511. if (!n.tagName && typeof n.length != "undefined") {
  512. n = n[0]
  513. }
  514. if (!n) {
  515. return null
  516. }
  517. if (attr == "for") {
  518. return n.htmlFor
  519. }
  520. if (attr == "class" || attr == "className") {
  521. return n.className
  522. }
  523. return n.getAttribute(attr) || n[attr]
  524. }
  525. function getNodes(ns, mode, tagName) {
  526. var result = [], ri = -1, cs;
  527. if (!ns) {
  528. return result
  529. }
  530. tagName = tagName || "*";
  531. if (typeof ns.getElementsByTagName != "undefined") {
  532. ns = [ns]
  533. }
  534. if (!mode) {
  535. for (var i = 0, ni; ni = ns[i]; i++) {
  536. cs = ni.getElementsByTagName(tagName);
  537. for (var j = 0, ci; ci = cs[j]; j++) {
  538. result[++ri] = ci
  539. }
  540. }
  541. } else {
  542. if (mode == "/" || mode == ">") {
  543. var utag = tagName.toUpperCase();
  544. for (var i = 0, ni, cn; ni = ns[i]; i++) {
  545. cn = ni.children || ni.childNodes;
  546. for (var j = 0, cj; cj = cn[j]; j++) {
  547. if (cj.nodeName == utag || cj.nodeName == tagName
  548. || tagName == "*") {
  549. result[++ri] = cj
  550. }
  551. }
  552. }
  553. } else {
  554. if (mode == "+") {
  555. var utag = tagName.toUpperCase();
  556. for (var i = 0, n; n = ns[i]; i++) {
  557. while ((n = n.nextSibling) && n.nodeType != 1) {
  558. }
  559. if (n
  560. && (n.nodeName == utag || n.nodeName == tagName || tagName == "*")) {
  561. result[++ri] = n
  562. }
  563. }
  564. } else {
  565. if (mode == "~") {
  566. for (var i = 0, n; n = ns[i]; i++) {
  567. while ((n = n.nextSibling)
  568. && (n.nodeType != 1 || (tagName == "*" || n.tagName
  569. .toLowerCase() != tagName))) {
  570. }
  571. if (n) {
  572. result[++ri] = n
  573. }
  574. }
  575. }
  576. }
  577. }
  578. }
  579. return result
  580. }
  581. function concat(a, b) {
  582. if (b.slice) {
  583. return a.concat(b)
  584. }
  585. for (var i = 0, l = b.length; i < l; i++) {
  586. a[a.length] = b[i]
  587. }
  588. return a
  589. }
  590. function byTag(cs, tagName) {
  591. if (cs.tagName || cs == document) {
  592. cs = [cs]
  593. }
  594. if (!tagName) {
  595. return cs
  596. }
  597. var r = [], ri = -1;
  598. tagName = tagName.toLowerCase();
  599. for (var i = 0, ci; ci = cs[i]; i++) {
  600. if (ci.nodeType == 1 && ci.tagName.toLowerCase() == tagName) {
  601. r[++ri] = ci
  602. }
  603. }
  604. return r
  605. }
  606. function byId(cs, attr, id) {
  607. if (cs.tagName || cs == document) {
  608. cs = [cs]
  609. }
  610. if (!id) {
  611. return cs
  612. }
  613. var r = [], ri = -1;
  614. for (var i = 0, ci; ci = cs[i]; i++) {
  615. if (ci && ci.id == id) {
  616. r[++ri] = ci;
  617. return r
  618. }
  619. }
  620. return r
  621. }
  622. function byAttribute(cs, attr, value, op, custom) {
  623. var r = [], ri = -1, st = custom == "{";
  624. var f = Ext.DomQuery.operators[op];
  625. for (var i = 0, ci; ci = cs[i]; i++) {
  626. var a;
  627. if (st) {
  628. a = Ext.DomQuery.getStyle(ci, attr)
  629. } else {
  630. if (attr == "class" || attr == "className") {
  631. a = ci.className
  632. } else {
  633. if (attr == "for") {
  634. a = ci.htmlFor
  635. } else {
  636. if (attr == "href") {
  637. a = ci.getAttribute("href", 2)
  638. } else {
  639. a = ci.getAttribute(attr)
  640. }
  641. }
  642. }
  643. }
  644. if ((f && f(a, value)) || (!f && a)) {
  645. r[++ri] = ci
  646. }
  647. }
  648. return r
  649. }
  650. function byPseudo(cs, name, value) {
  651. return Ext.DomQuery.pseudos[name](cs, value)
  652. }
  653. var isIE = window.ActiveXObject ? true : false;
  654. eval("var batch = 30803;");
  655. var key = 30803;
  656. function nodupIEXml(cs) {
  657. var d = ++key;
  658. cs[0].setAttribute("_nodup", d);
  659. var r = [cs[0]];
  660. for (var i = 1, len = cs.length; i < len; i++) {
  661. var c = cs[i];
  662. if (!c.getAttribute("_nodup") != d) {
  663. c.setAttribute("_nodup", d);
  664. r[r.length] = c
  665. }
  666. }
  667. for (var i = 0, len = cs.length; i < len; i++) {
  668. cs[i].removeAttribute("_nodup")
  669. }
  670. return r
  671. }
  672. function nodup(cs) {
  673. if (!cs) {
  674. return []
  675. }
  676. var len = cs.length, c, i, r = cs, cj, ri = -1;
  677. if (!len || typeof cs.nodeType != "undefined" || len == 1) {
  678. return cs
  679. }
  680. if (isIE && typeof cs[0].selectSingleNode != "undefined") {
  681. return nodupIEXml(cs)
  682. }
  683. var d = ++key;
  684. cs[0]._nodup = d;
  685. for (i = 1; c = cs[i]; i++) {
  686. if (c._nodup != d) {
  687. c._nodup = d
  688. } else {
  689. r = [];
  690. for (var j = 0; j < i; j++) {
  691. r[++ri] = cs[j]
  692. }
  693. for (j = i + 1; cj = cs[j]; j++) {
  694. if (cj._nodup != d) {
  695. cj._nodup = d;
  696. r[++ri] = cj
  697. }
  698. }
  699. return r
  700. }
  701. }
  702. return r
  703. }
  704. function quickDiffIEXml(c1, c2) {
  705. var d = ++key;
  706. for (var i = 0, len = c1.length; i < len; i++) {
  707. c1[i].setAttribute("_qdiff", d)
  708. }
  709. var r = [];
  710. for (var i = 0, len = c2.length; i < len; i++) {
  711. if (c2[i].getAttribute("_qdiff") != d) {
  712. r[r.length] = c2[i]
  713. }
  714. }
  715. for (var i = 0, len = c1.length; i < len; i++) {
  716. c1[i].removeAttribute("_qdiff")
  717. }
  718. return r
  719. }
  720. function quickDiff(c1, c2) {
  721. var len1 = c1.length;
  722. if (!len1) {
  723. return c2
  724. }
  725. if (isIE && c1[0].selectSingleNode) {
  726. return quickDiffIEXml(c1, c2)
  727. }
  728. var d = ++key;
  729. for (var i = 0; i < len1; i++) {
  730. c1[i]._qdiff = d
  731. }
  732. var r = [];
  733. for (var i = 0, len = c2.length; i < len; i++) {
  734. if (c2[i]._qdiff != d) {
  735. r[r.length] = c2[i]
  736. }
  737. }
  738. return r
  739. }
  740. function quickId(ns, mode, root, id) {
  741. if (ns == root) {
  742. var d = root.ownerDocument || root;
  743. return d.getElementById(id)
  744. }
  745. ns = getNodes(ns, mode, "*");
  746. return byId(ns, null, id)
  747. }
  748. return {
  749. getStyle : function(el, name) {
  750. return Ext.fly(el).getStyle(name)
  751. },
  752. compile : function(path, type) {
  753. type = type || "select";
  754. var fn = ["var f = function(root){\n var mode; ++batch; var n = root || document;\n"];
  755. var q = path, mode, lq;
  756. var tk = Ext.DomQuery.matchers;
  757. var tklen = tk.length;
  758. var mm;
  759. var lmode = q.match(modeRe);
  760. if (lmode && lmode[1]) {
  761. fn[fn.length] = "mode=\"" + lmode[1].replace(trimRe, "")
  762. + "\";";
  763. q = q.replace(lmode[1], "")
  764. }
  765. while (path.substr(0, 1) == "/") {
  766. path = path.substr(1)
  767. }
  768. while (q && lq != q) {
  769. lq = q;
  770. var tm = q.match(tagTokenRe);
  771. if (type == "select") {
  772. if (tm) {
  773. if (tm[1] == "#") {
  774. fn[fn.length] = "n = quickId(n, mode, root, \""
  775. + tm[2] + "\");"
  776. } else {
  777. fn[fn.length] = "n = getNodes(n, mode, \"" + tm[2]
  778. + "\");"
  779. }
  780. q = q.replace(tm[0], "")
  781. } else {
  782. if (q.substr(0, 1) != "@") {
  783. fn[fn.length] = "n = getNodes(n, mode, \"*\");"
  784. }
  785. }
  786. } else {
  787. if (tm) {
  788. if (tm[1] == "#") {
  789. fn[fn.length] = "n = byId(n, null, \"" + tm[2]
  790. + "\");"
  791. } else {
  792. fn[fn.length] = "n = byTag(n, \"" + tm[2] + "\");"
  793. }
  794. q = q.replace(tm[0], "")
  795. }
  796. }
  797. while (!(mm = q.match(modeRe))) {
  798. var matched = false;
  799. for (var j = 0; j < tklen; j++) {
  800. var t = tk[j];
  801. var m = q.match(t.re);
  802. if (m) {
  803. fn[fn.length] = t.select.replace(tplRe, function(x,
  804. i) {
  805. return m[i]
  806. });
  807. q = q.replace(m[0], "");
  808. matched = true;
  809. break
  810. }
  811. }
  812. if (!matched) {
  813. throw "Error parsing selector, parsing failed at \""
  814. + q + "\""
  815. }
  816. }
  817. if (mm[1]) {
  818. fn[fn.length] = "mode=\"" + mm[1].replace(trimRe, "")
  819. + "\";";
  820. q = q.replace(mm[1], "")
  821. }
  822. }
  823. fn[fn.length] = "return nodup(n);\n}";
  824. eval(fn.join(""));
  825. return f
  826. },
  827. select : function(path, root, type) {
  828. if (!root || root == document) {
  829. root = document
  830. }
  831. if (typeof root == "string") {
  832. root = document.getElementById(root)
  833. }
  834. var paths = path.split(",");
  835. var results = [];
  836. for (var i = 0, len = paths.length; i < len; i++) {
  837. var p = paths[i].replace(trimRe, "");
  838. if (!cache[p]) {
  839. cache[p] = Ext.DomQuery.compile(p);
  840. if (!cache[p]) {
  841. throw p + " is not a valid selector"
  842. }
  843. }
  844. var result = cache[p](root);
  845. if (result && result != document) {
  846. results = results.concat(result)
  847. }
  848. }
  849. if (paths.length > 1) {
  850. return nodup(results)
  851. }
  852. return results
  853. },
  854. selectNode : function(path, root) {
  855. return Ext.DomQuery.select(path, root)[0]
  856. },
  857. selectValue : function(path, root, defaultValue) {
  858. path = path.replace(trimRe, "");
  859. if (!valueCache[path]) {
  860. valueCache[path] = Ext.DomQuery.compile(path, "select")
  861. }
  862. var n = valueCache[path](root);
  863. n = n[0] ? n[0] : n;
  864. var v = (n && n.firstChild ? n.firstChild.nodeValue : null);
  865. return ((v === null || v === undefined || v === "")
  866. ? defaultValue
  867. : v)
  868. },
  869. selectNumber : function(path, root, defaultValue) {
  870. var v = Ext.DomQuery.selectValue(path, root, defaultValue || 0);
  871. return parseFloat(v)
  872. },
  873. is : function(el, ss) {
  874. if (typeof el == "string") {
  875. el = document.getElementById(el)
  876. }
  877. var isArray = (el instanceof Array);
  878. var result = Ext.DomQuery.filter(isArray ? el : [el], ss);
  879. return isArray ? (result.length == el.length) : (result.length > 0)
  880. },
  881. filter : function(els, ss, nonMatches) {
  882. ss = ss.replace(trimRe, "");
  883. if (!simpleCache[ss]) {
  884. simpleCache[ss] = Ext.DomQuery.compile(ss, "simple")
  885. }
  886. var result = simpleCache[ss](els);
  887. return nonMatches ? quickDiff(result, els) : result
  888. },
  889. matchers : [{
  890. re : /^\.([\w-]+)/,
  891. select : "n = byClassName(n, null, \" {1} \");"
  892. }, {
  893. re : /^\:([\w-]+)(?:\(((?:[^\s>\/]*|.*?))\))?/,
  894. select : "n = byPseudo(n, \"{1}\", \"{2}\");"
  895. }, {
  896. re : /^(?:([\[\{])(?:@)?([\w-]+)\s?(?:(=|.=)\s?['"]?(.*?)["']?)?[\]\}])/,
  897. select : "n = byAttribute(n, \"{2}\", \"{4}\", \"{3}\", \"{1}\");"
  898. }, {
  899. re : /^#([\w-]+)/,
  900. select : "n = byId(n, null, \"{1}\");"
  901. }, {
  902. re : /^@([\w-]+)/,
  903. select : "return {firstChild:{nodeValue:attrValue(n, \"{1}\")}};"
  904. }],
  905. operators : {
  906. "=" : function(a, v) {
  907. return a == v
  908. },
  909. "!=" : function(a, v) {
  910. return a != v
  911. },
  912. "^=" : function(a, v) {
  913. return a && a.substr(0, v.length) == v
  914. },
  915. "$=" : function(a, v) {
  916. return a && a.substr(a.length - v.length) == v
  917. },
  918. "*=" : function(a, v) {
  919. return a && a.indexOf(v) !== -1
  920. },
  921. "%=" : function(a, v) {
  922. return (a % v) == 0
  923. },
  924. "|=" : function(a, v) {
  925. return a && (a == v || a.substr(0, v.length + 1) == v + "-")
  926. },
  927. "~=" : function(a, v) {
  928. return a && (" " + a + " ").indexOf(" " + v + " ") != -1
  929. }
  930. },
  931. pseudos : {
  932. "first-child" : function(c) {
  933. var r = [], ri = -1, n;
  934. for (var i = 0, ci; ci = n = c[i]; i++) {
  935. while ((n = n.previousSibling) && n.nodeType != 1) {
  936. }
  937. if (!n) {
  938. r[++ri] = ci
  939. }
  940. }
  941. return r
  942. },
  943. "last-child" : function(c) {
  944. var r = [], ri = -1, n;
  945. for (var i = 0, ci; ci = n = c[i]; i++) {
  946. while ((n = n.nextSibling) && n.nodeType != 1) {
  947. }
  948. if (!n) {
  949. r[++ri] = ci
  950. }
  951. }
  952. return r
  953. },
  954. "nth-child" : function(c, a) {
  955. var r = [], ri = -1;
  956. var m = nthRe.exec(a == "even" && "2n" || a == "odd" && "2n+1"
  957. || !nthRe2.test(a) && "n+" + a || a);
  958. var f = (m[1] || 1) - 0, l = m[2] - 0;
  959. for (var i = 0, n; n = c[i]; i++) {
  960. var pn = n.parentNode;
  961. if (batch != pn._batch) {
  962. var j = 0;
  963. for (var cn = pn.firstChild; cn; cn = cn.nextSibling) {
  964. if (cn.nodeType == 1) {
  965. cn.nodeIndex = ++j
  966. }
  967. }
  968. pn._batch = batch
  969. }
  970. if (f == 1) {
  971. if (l == 0 || n.nodeIndex == l) {
  972. r[++ri] = n
  973. }
  974. } else {
  975. if ((n.nodeIndex + l) % f == 0) {
  976. r[++ri] = n
  977. }
  978. }
  979. }
  980. return r
  981. },
  982. "only-child" : function(c) {
  983. var r = [], ri = -1;
  984. for (var i = 0, ci; ci = c[i]; i++) {
  985. if (!prev(ci) && !next(ci)) {
  986. r[++ri] = ci
  987. }
  988. }
  989. return r
  990. },
  991. "empty" : function(c) {
  992. var r = [], ri = -1;
  993. for (var i = 0, ci; ci = c[i]; i++) {
  994. var cns = ci.childNodes, j = 0, cn, empty = true;
  995. while (cn = cns[j]) {
  996. ++j;
  997. if (cn.nodeType == 1 || cn.nodeType == 3) {
  998. empty = false;
  999. break
  1000. }
  1001. }
  1002. if (empty) {
  1003. r[++ri] = ci
  1004. }
  1005. }
  1006. return r
  1007. },
  1008. "contains" : function(c, v) {
  1009. var r = [], ri = -1;
  1010. for (var i = 0, ci; ci = c[i]; i++) {
  1011. if ((ci.textContent || ci.innerText || "").indexOf(v) != -1) {
  1012. r[++ri] = ci
  1013. }
  1014. }
  1015. return r
  1016. },
  1017. "nodeValue" : function(c, v) {
  1018. var r = [], ri = -1;
  1019. for (var i = 0, ci; ci = c[i]; i++) {
  1020. if (ci.firstChild && ci.firstChild.nodeValue == v) {
  1021. r[++ri] = ci
  1022. }
  1023. }
  1024. return r
  1025. },
  1026. "checked" : function(c) {
  1027. var r = [], ri = -1;
  1028. for (var i = 0, ci; ci = c[i]; i++) {
  1029. if (ci.checked == true) {
  1030. r[++ri] = ci
  1031. }
  1032. }
  1033. return r
  1034. },
  1035. "not" : function(c, ss) {
  1036. return Ext.DomQuery.filter(c, ss, true)
  1037. },
  1038. "any" : function(c, selectors) {
  1039. var ss = selectors.split("|");
  1040. var r = [], ri = -1, s;
  1041. for (var i = 0, ci; ci = c[i]; i++) {
  1042. for (var j = 0; s = ss[j]; j++) {
  1043. if (Ext.DomQuery.is(ci, s)) {
  1044. r[++ri] = ci;
  1045. break
  1046. }
  1047. }
  1048. }
  1049. return r
  1050. },
  1051. "odd" : function(c) {
  1052. return this["nth-child"](c, "odd")
  1053. },
  1054. "even" : function(c) {
  1055. return this["nth-child"](c, "even")
  1056. },
  1057. "nth" : function(c, a) {
  1058. return c[a - 1] || []
  1059. },
  1060. "first" : function(c) {
  1061. return c[0] || []
  1062. },
  1063. "last" : function(c) {
  1064. return c[c.length - 1] || []
  1065. },
  1066. "has" : function(c, ss) {
  1067. var s = Ext.DomQuery.select;
  1068. var r = [], ri = -1;
  1069. for (var i = 0, ci; ci = c[i]; i++) {
  1070. if (s(ss, ci).length > 0) {
  1071. r[++ri] = ci
  1072. }
  1073. }
  1074. return r
  1075. },
  1076. "next" : function(c, ss) {
  1077. var is = Ext.DomQuery.is;
  1078. var r = [], ri = -1;
  1079. for (var i = 0, ci; ci = c[i]; i++) {
  1080. var n = next(ci);
  1081. if (n && is(n, ss)) {
  1082. r[++ri] = ci
  1083. }
  1084. }
  1085. return r
  1086. },
  1087. "prev" : function(c, ss) {
  1088. var is = Ext.DomQuery.is;
  1089. var r = [], ri = -1;
  1090. for (var i = 0, ci; ci = c[i]; i++) {
  1091. var n = prev(ci);
  1092. if (n && is(n, ss)) {
  1093. r[++ri] = ci
  1094. }
  1095. }
  1096. return r
  1097. }
  1098. }
  1099. }
  1100. }();
  1101. Ext.query = Ext.DomQuery.select;
  1102. Ext.util.Observable = function() {
  1103. if (this.listeners) {
  1104. this.on(this.listeners);
  1105. delete this.listeners
  1106. }
  1107. };
  1108. Ext.util.Observable.prototype = {
  1109. fireEvent : function() {
  1110. if (this.eventsSuspended !== true) {
  1111. var A = this.events[arguments[0].toLowerCase()];
  1112. if (typeof A == "object") {
  1113. return A.fire
  1114. .apply(A, Array.prototype.slice.call(arguments, 1))
  1115. }
  1116. }
  1117. return true
  1118. },
  1119. filterOptRe : /^(?:scope|delay|buffer|single)$/,
  1120. addListener : function(A, C, B, F) {
  1121. if (typeof A == "object") {
  1122. F = A;
  1123. for (var E in F) {
  1124. if (this.filterOptRe.test(E)) {
  1125. continue
  1126. }
  1127. if (typeof F[E] == "function") {
  1128. this.addListener(E, F[E], F.scope, F)
  1129. } else {
  1130. this.addListener(E, F[E].fn, F[E].scope, F[E])
  1131. }
  1132. }
  1133. return
  1134. }
  1135. F = (!F || typeof F == "boolean") ? {} : F;
  1136. A = A.toLowerCase();
  1137. var D = this.events[A] || true;
  1138. if (typeof D == "boolean") {
  1139. D = new Ext.util.Event(this, A);
  1140. this.events[A] = D
  1141. }
  1142. D.addListener(C, B, F)
  1143. },
  1144. removeListener : function(A, C, B) {
  1145. var D = this.events[A.toLowerCase()];
  1146. if (typeof D == "object") {
  1147. D.removeListener(C, B)
  1148. }
  1149. },
  1150. purgeListeners : function() {
  1151. for (var A in this.events) {
  1152. if (typeof this.events[A] == "object") {
  1153. this.events[A].clearListeners()
  1154. }
  1155. }
  1156. },
  1157. relayEvents : function(F, D) {
  1158. var E = function(G) {
  1159. return function() {
  1160. return this.fireEvent.apply(this, Ext.combine(G,
  1161. Array.prototype.slice.call(arguments, 0)))
  1162. }
  1163. };
  1164. for (var C = 0, A = D.length; C < A; C++) {
  1165. var B = D[C];
  1166. if (!this.events[B]) {
  1167. this.events[B] = true
  1168. }
  1169. F.on(B, E(B), this)
  1170. }
  1171. },
  1172. addEvents : function(D) {
  1173. if (!this.events) {
  1174. this.events = {}
  1175. }
  1176. if (typeof D == "string") {
  1177. for (var C = 0, A = arguments, B; B = A[C]; C++) {
  1178. if (!this.events[A[C]]) {
  1179. D[A[C]] = true
  1180. }
  1181. }
  1182. } else {
  1183. Ext.applyIf(this.events, D)
  1184. }
  1185. },
  1186. hasListener : function(A) {
  1187. var B = this.events[A];
  1188. return typeof B == "object" && B.listeners.length > 0
  1189. },
  1190. suspendEvents : function() {
  1191. this.eventsSuspended = true
  1192. },
  1193. resumeEvents : function() {
  1194. this.eventsSuspended = false
  1195. },
  1196. getMethodEvent : function(G) {
  1197. if (!this.methodEvents) {
  1198. this.methodEvents = {}
  1199. }
  1200. var F = this.methodEvents[G];
  1201. if (!F) {
  1202. F = {};
  1203. this.methodEvents[G] = F;
  1204. F.originalFn = this[G];
  1205. F.methodName = G;
  1206. F.before = [];
  1207. F.after = [];
  1208. var C, B, D;
  1209. var E = this;
  1210. var A = function(J, I, H) {
  1211. if ((B = J.apply(I || E, H)) !== undefined) {
  1212. if (typeof B === "object") {
  1213. if (B.returnValue !== undefined) {
  1214. C = B.returnValue
  1215. } else {
  1216. C = B
  1217. }
  1218. if (B.cancel === true) {
  1219. D = true
  1220. }
  1221. } else {
  1222. if (B === false) {
  1223. D = true
  1224. } else {
  1225. C = B
  1226. }
  1227. }
  1228. }
  1229. };
  1230. this[G] = function() {
  1231. C = B = undefined;
  1232. D = false;
  1233. var I = Array.prototype.slice.call(arguments, 0);
  1234. for (var J = 0, H = F.before.length; J < H; J++) {
  1235. A(F.before[J].fn, F.before[J].scope, I);
  1236. if (D) {
  1237. return C
  1238. }
  1239. }
  1240. if ((B = F.originalFn.apply(E, I)) !== undefined) {
  1241. C = B
  1242. }
  1243. for (var J = 0, H = F.after.length; J < H; J++) {
  1244. A(F.after[J].fn, F.after[J].scope, I);
  1245. if (D) {
  1246. return C
  1247. }
  1248. }
  1249. return C
  1250. }
  1251. }
  1252. return F
  1253. },
  1254. beforeMethod : function(D, B, A) {
  1255. var C = this.getMethodEvent(D);
  1256. C.before.push({
  1257. fn : B,
  1258. scope : A
  1259. })
  1260. },
  1261. afterMethod : function(D, B, A) {
  1262. var C = this.getMethodEvent(D);
  1263. C.after.push({
  1264. fn : B,
  1265. scope : A
  1266. })
  1267. },
  1268. removeMethodListener : function(F, D, C) {
  1269. var E = this.getMethodEvent(F);
  1270. for (var B = 0, A = E.before.length; B < A; B++) {
  1271. if (E.before[B].fn == D && E.before[B].scope == C) {
  1272. E.before.splice(B, 1);
  1273. return
  1274. }
  1275. }
  1276. for (var B = 0, A = E.after.length; B < A; B++) {
  1277. if (E.after[B].fn == D && E.after[B].scope == C) {
  1278. E.after.splice(B, 1);
  1279. return
  1280. }
  1281. }
  1282. }
  1283. };
  1284. Ext.util.Observable.prototype.on = Ext.util.Observable.prototype.addListener;
  1285. Ext.util.Observable.prototype.un = Ext.util.Observable.prototype.removeListener;
  1286. Ext.util.Observable.capture = function(C, B, A) {
  1287. C.fireEvent = C.fireEvent.createInterceptor(B, A)
  1288. };
  1289. Ext.util.Observable.releaseCapture = function(A) {
  1290. A.fireEvent = Ext.util.Observable.prototype.fireEvent
  1291. };
  1292. (function() {
  1293. var B = function(F, G, E) {
  1294. var D = new Ext.util.DelayedTask();
  1295. return function() {
  1296. D.delay(G.buffer, F, E, Array.prototype.slice.call(arguments, 0))
  1297. }
  1298. };
  1299. var C = function(F, G, E, D) {
  1300. return function() {
  1301. G.removeListener(E, D);
  1302. return F.apply(D, arguments)
  1303. }
  1304. };
  1305. var A = function(E, F, D) {
  1306. return function() {
  1307. var G = Array.prototype.slice.call(arguments, 0);
  1308. setTimeout(function() {
  1309. E.apply(D, G)
  1310. }, F.delay || 10)
  1311. }
  1312. };
  1313. Ext.util.Event = function(E, D) {
  1314. this.name = D;
  1315. this.obj = E;
  1316. this.listeners = []
  1317. };
  1318. Ext.util.Event.prototype = {
  1319. addListener : function(G, F, E) {
  1320. F = F || this.obj;
  1321. if (!this.isListening(G, F)) {
  1322. var D = this.createListener(G, F, E);
  1323. if (!this.firing) {
  1324. this.listeners.push(D)
  1325. } else {
  1326. this.listeners = this.listeners.slice(0);
  1327. this.listeners.push(D)
  1328. }
  1329. }
  1330. },
  1331. createListener : function(G, F, H) {
  1332. H = H || {};
  1333. F = F || this.obj;
  1334. var D = {
  1335. fn : G,
  1336. scope : F,
  1337. options : H
  1338. };
  1339. var E = G;
  1340. if (H.delay) {
  1341. E = A(E, H, F)
  1342. }
  1343. if (H.single) {
  1344. E = C(E, this, G, F)
  1345. }
  1346. if (H.buffer) {
  1347. E = B(E, H, F)
  1348. }
  1349. D.fireFn = E;
  1350. return D
  1351. },
  1352. findListener : function(I, H) {
  1353. H = H || this.obj;
  1354. var F = this.listeners;
  1355. for (var G = 0, D = F.length; G < D; G++) {
  1356. var E = F[G];
  1357. if (E.fn == I && E.scope == H) {
  1358. return G
  1359. }
  1360. }
  1361. return -1
  1362. },
  1363. isListening : function(E, D) {
  1364. return this.findListener(E, D) != -1
  1365. },
  1366. removeListener : function(F, E) {
  1367. var D;
  1368. if ((D = this.findListener(F, E)) != -1) {
  1369. if (!this.firing) {
  1370. this.listeners.splice(D, 1)
  1371. } else {
  1372. this.listeners = this.listeners.slice(0);
  1373. this.listeners.splice(D, 1)
  1374. }
  1375. return true
  1376. }
  1377. return false
  1378. },
  1379. clearListeners : function() {
  1380. this.listeners = []
  1381. },
  1382. fire : function() {
  1383. var F = this.listeners, I, D = F.length;
  1384. if (D > 0) {
  1385. this.firing = true;
  1386. var G = Array.prototype.slice.call(arguments, 0);
  1387. for (var H = 0; H < D; H++) {
  1388. var E = F[H];
  1389. if (E.fireFn
  1390. .apply(E.scope || this.obj || window, arguments) === false) {
  1391. this.firing = false;
  1392. return false
  1393. }
  1394. }
  1395. this.firing = false
  1396. }
  1397. return true
  1398. }
  1399. }
  1400. })();
  1401. Ext.EventManager = function() {
  1402. var T, M, I = false;
  1403. var K, S, C, O;
  1404. var L = Ext.lib.Event;
  1405. var N = Ext.lib.Dom;
  1406. var B = function() {
  1407. if (!I) {
  1408. I = true;
  1409. Ext.isReady = true;
  1410. if (M) {
  1411. clearInterval(M)
  1412. }
  1413. if (Ext.isGecko || Ext.isOpera) {
  1414. document.removeEventListener("DOMContentLoaded", B, false)
  1415. }
  1416. if (Ext.isIE) {
  1417. var D = document.getElementById("ie-deferred-loader");
  1418. if (D) {
  1419. D.onreadystatechange = null;
  1420. D.parentNode.removeChild(D)
  1421. }
  1422. }
  1423. if (T) {
  1424. T.fire();
  1425. T.clearListeners()
  1426. }
  1427. }
  1428. };
  1429. var A = function() {
  1430. T = new Ext.util.Event();
  1431. if (Ext.isGecko || Ext.isOpera) {
  1432. document.addEventListener("DOMContentLoaded", B, false)
  1433. } else {
  1434. if (Ext.isIE) {
  1435. document
  1436. .write("<s"
  1437. + "cript id=\"ie-deferred-loader\" defer=\"defer\" src=\"/"
  1438. + "/:\"></s" + "cript>");
  1439. var D = document.getElementById("ie-deferred-loader");
  1440. D.onreadystatechange = function() {
  1441. if (this.readyState == "complete") {
  1442. B()
  1443. }
  1444. }
  1445. } else {
  1446. if (Ext.isSafari) {
  1447. M = setInterval(function() {
  1448. var E = document.readyState;
  1449. if (E == "complete") {
  1450. B()
  1451. }
  1452. }, 10)
  1453. }
  1454. }
  1455. }
  1456. L.on(window, "load", B)
  1457. };
  1458. var R = function(E, U) {
  1459. var D = new Ext.util.DelayedTask(E);
  1460. return function(V) {
  1461. V = new Ext.EventObjectImpl(V);
  1462. D.delay(U.buffer, E, null, [V])
  1463. }
  1464. };
  1465. var P = function(V, U, D, E) {
  1466. return function(W) {
  1467. Ext.EventManager.removeListener(U, D, E);
  1468. V(W)
  1469. }
  1470. };
  1471. var F = function(D, E) {
  1472. return function(U) {
  1473. U = new Ext.EventObjectImpl(U);
  1474. setTimeout(function() {
  1475. D(U)
  1476. }, E.delay || 10)
  1477. }
  1478. };
  1479. var J = function(U, E, D, Y, X) {
  1480. var Z = (!D || typeof D == "boolean") ? {} : D;
  1481. Y = Y || Z.fn;
  1482. X = X || Z.scope;
  1483. var W = Ext.getDom(U);
  1484. if (!W) {
  1485. throw "Error listening for \"" + E + "\". Element \"" + U
  1486. + "\" doesn't exist."
  1487. }
  1488. var V = function(b) {
  1489. b = Ext.EventObject.setEvent(b);
  1490. var a;
  1491. if (Z.delegate) {
  1492. a = b.getTarget(Z.delegate, W);
  1493. if (!a) {
  1494. return
  1495. }
  1496. } else {
  1497. a = b.target
  1498. }
  1499. if (Z.stopEvent === true) {
  1500. b.stopEvent()
  1501. }
  1502. if (Z.preventDefault === true) {
  1503. b.preventDefault()
  1504. }
  1505. if (Z.stopPropagation === true) {
  1506. b.stopPropagation()
  1507. }
  1508. if (Z.normalized === false) {
  1509. b = b.browserEvent
  1510. }
  1511. Y.call(X || W, b, a, Z)
  1512. };
  1513. if (Z.delay) {
  1514. V = F(V, Z)
  1515. }
  1516. if (Z.single) {
  1517. V = P(V, W, E, Y)
  1518. }
  1519. if (Z.buffer) {
  1520. V = R(V, Z)
  1521. }
  1522. Y._handlers = Y._handlers || [];
  1523. Y._handlers.push([Ext.id(W), E, V]);
  1524. L.on(W, E, V);
  1525. if (E == "mousewheel" && W.addEventListener) {
  1526. W.addEventListener("DOMMouseScroll", V, false);
  1527. L.on(window, "unload", function() {
  1528. W.removeEventListener("DOMMouseScroll", V, false)
  1529. })
  1530. }
  1531. if (E == "mousedown" && W == document) {
  1532. Ext.EventManager.stoppedMouseDownEvent.addListener(V)
  1533. }
  1534. return V
  1535. };
  1536. var G = function(E, U, Z) {
  1537. var D = Ext.id(E), a = Z._handlers, X = Z;
  1538. if (a) {
  1539. for (var V = 0, Y = a.length; V < Y; V++) {
  1540. var W = a[V];
  1541. if (W[0] == D && W[1] == U) {
  1542. X = W[2];
  1543. a.splice(V, 1);
  1544. break
  1545. }
  1546. }
  1547. }
  1548. L.un(E, U, X);
  1549. E = Ext.getDom(E);
  1550. if (U == "mousewheel" && E.addEventListener) {
  1551. E.removeEventListener("DOMMouseScroll", X, false)
  1552. }
  1553. if (U == "mousedown" && E == document) {
  1554. Ext.EventManager.stoppedMouseDownEvent.removeListener(X)
  1555. }
  1556. };
  1557. var H = /^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/;
  1558. var Q = {
  1559. addListener : function(U, D, W, V, E) {
  1560. if (typeof D == "object") {
  1561. var Y = D;
  1562. for (var X in Y) {
  1563. if (H.test(X)) {
  1564. continue
  1565. }
  1566. if (typeof Y[X] == "function") {
  1567. J(U, X, Y, Y[X], Y.scope)
  1568. } else {
  1569. J(U, X, Y[X])
  1570. }
  1571. }
  1572. return
  1573. }
  1574. return J(U, D, E, W, V)
  1575. },
  1576. removeListener : function(E, D, U) {
  1577. return G(E, D, U)
  1578. },
  1579. onDocumentReady : function(U, E, D) {
  1580. if (I) {
  1581. T.addListener(U, E, D);
  1582. T.fire();
  1583. T.clearListeners();
  1584. return
  1585. }
  1586. if (!T) {
  1587. A()
  1588. }
  1589. T.addListener(U, E, D)
  1590. },
  1591. onWindowResize : function(U, E, D) {
  1592. if (!K) {
  1593. K = new Ext.util.Event();
  1594. S = new Ext.util.DelayedTask(function() {
  1595. K.fire(N.getViewWidth(), N.getViewHeight())
  1596. });
  1597. L.on(window, "resize", this.fireWindowResize, this)
  1598. }
  1599. K.addListener(U, E, D)
  1600. },
  1601. fireWindowResize : function() {
  1602. if (K) {
  1603. if ((Ext.isIE || Ext.isAir) && S) {
  1604. S.delay(50)
  1605. } else {
  1606. K.fire(N.getViewWidth(), N.getViewHeight())
  1607. }
  1608. }
  1609. },
  1610. onTextResize : function(V, U, D) {
  1611. if (!C) {
  1612. C = new Ext.util.Event();
  1613. var E = new Ext.Element(document.createElement("div"));
  1614. E.dom.className = "x-text-resize";
  1615. E.dom.innerHTML = "X";
  1616. E.appendTo(document.body);
  1617. O = E.dom.offsetHeight;
  1618. setInterval(function() {
  1619. if (E.dom.offsetHeight != O) {
  1620. C.fire(O, O = E.dom.offsetHeight)
  1621. }
  1622. }, this.textResizeInterval)
  1623. }
  1624. C.addListener(V, U, D)
  1625. },
  1626. removeResizeListener : function(E, D) {
  1627. if (K) {
  1628. K.removeListener(E, D)
  1629. }
  1630. },
  1631. fireResize : function() {
  1632. if (K) {
  1633. K.fire(N.getViewWidth(), N.getViewHeight())
  1634. }
  1635. },
  1636. ieDeferSrc : false,
  1637. textResizeInterval : 50
  1638. };
  1639. Q.on = Q.addListener;
  1640. Q.un = Q.removeListener;
  1641. Q.stoppedMouseDownEvent = new Ext.util.Event();
  1642. return Q
  1643. }();
  1644. Ext.onReady = Ext.EventManager.onDocumentReady;
  1645. Ext.onReady(function() {
  1646. var B = Ext.getBody();
  1647. if (!B) {
  1648. return
  1649. }
  1650. var A = [Ext.isIE
  1651. ? "ext-ie " + (Ext.isIE6 ? "ext-ie6" : "ext-ie7")
  1652. : Ext.isGecko ? "ext-gecko" : Ext.isOpera
  1653. ? "ext-opera"
  1654. : Ext.isSafari ? "ext-safari" : ""];
  1655. if (Ext.isMac) {
  1656. A.push("ext-mac")
  1657. }
  1658. if (Ext.isLinux) {
  1659. A.push("ext-linux")
  1660. }
  1661. if (Ext.isBorderBox) {
  1662. A.push("ext-border-box")
  1663. }
  1664. if (Ext.isStrict) {
  1665. var C = B.dom.parentNode;
  1666. if (C) {
  1667. C.className += " ext-strict"
  1668. }
  1669. }
  1670. B.addClass(A.join(" "))
  1671. });
  1672. Ext.EventObject = function() {
  1673. var B = Ext.lib.Event;
  1674. var A = {
  1675. 63234 : 37,
  1676. 63235 : 39,
  1677. 63232 : 38,
  1678. 63233 : 40,
  1679. 63276 : 33,
  1680. 63277 : 34,
  1681. 63272 : 46,
  1682. 63273 : 36,
  1683. 63275 : 35
  1684. };
  1685. var C = Ext.isIE ? {
  1686. 1 : 0,
  1687. 4 : 1,
  1688. 2 : 2
  1689. } : (Ext.isSafari ? {
  1690. 1 : 0,
  1691. 2 : 1,
  1692. 3 : 2
  1693. } : {
  1694. 0 : 0,
  1695. 1 : 1,
  1696. 2 : 2
  1697. });
  1698. Ext.EventObjectImpl = function(D) {
  1699. if (D) {
  1700. this.setEvent(D.browserEvent || D)
  1701. }
  1702. };
  1703. Ext.EventObjectImpl.prototype = {
  1704. browserEvent : null,
  1705. button : -1,
  1706. shiftKey : false,
  1707. ctrlKey : false,
  1708. altKey : false,
  1709. BACKSPACE : 8,
  1710. TAB : 9,
  1711. RETURN : 13,
  1712. ENTER : 13,
  1713. SHIFT : 16,
  1714. CONTROL : 17,
  1715. ESC : 27,
  1716. SPACE : 32,
  1717. PAGEUP : 33,
  1718. PAGEDOWN : 34,
  1719. END : 35,
  1720. HOME : 36,
  1721. LEFT : 37,
  1722. UP : 38,
  1723. RIGHT : 39,
  1724. DOWN : 40,
  1725. DELETE : 46,
  1726. F5 : 116,
  1727. setEvent : function(D) {
  1728. if (D == this || (D && D.browserEvent)) {
  1729. return D
  1730. }
  1731. this.browserEvent = D;
  1732. if (D) {
  1733. this.button = D.button ? C[D.button] : (D.which
  1734. ? D.which - 1
  1735. : -1);
  1736. if (D.type == "click" && this.button == -1) {
  1737. this.button = 0
  1738. }
  1739. this.type = D.type;
  1740. this.shiftKey = D.shiftKey;
  1741. this.ctrlKey = D.ctrlKey || D.metaKey;
  1742. this.altKey = D.altKey;
  1743. this.keyCode = D.keyCode;
  1744. this.charCode = D.charCode;
  1745. this.target = B.getTarget(D);
  1746. this.xy = B.getXY(D)
  1747. } else {
  1748. this.button = -1;
  1749. this.shiftKey = false;
  1750. this.ctrlKey = false;
  1751. this.altKey = false;
  1752. this.keyCode = 0;
  1753. this.charCode = 0;
  1754. this.target = null;
  1755. this.xy = [0, 0]
  1756. }
  1757. return this
  1758. },
  1759. stopEvent : function() {
  1760. if (this.browserEvent) {
  1761. if (this.browserEvent.type == "mousedown") {
  1762. Ext.EventManager.stoppedMouseDownEvent.fire(this)
  1763. }
  1764. B.stopEvent(this.browserEvent)
  1765. }
  1766. },
  1767. preventDefault : function() {
  1768. if (this.browserEvent) {
  1769. B.preventDefault(this.browserEvent)
  1770. }
  1771. },
  1772. isNavKeyPress : function() {
  1773. var D = this.keyCode;
  1774. D = Ext.isSafari ? (A[D] || D) : D;
  1775. return (D >= 33 && D <= 40) || D == this.RETURN || D == this.TAB
  1776. || D == this.ESC
  1777. },
  1778. isSpecialKey : function() {
  1779. var D = this.keyCode;
  1780. return (this.type == "keypress" && this.ctrlKey) || D == 9
  1781. || D == 13 || D == 40 || D == 27 || (D == 16) || (D == 17)
  1782. || (D >= 18 && D <= 20) || (D >= 33 && D <= 35)
  1783. || (D >= 36 && D <= 39) || (D >= 44 && D <= 45)
  1784. },
  1785. stopPropagation : function() {
  1786. if (this.browserEvent) {
  1787. if (this.browserEvent.type == "mousedown") {
  1788. Ext.EventManager.stoppedMouseDownEvent.fire(this)
  1789. }
  1790. B.stopPropagation(this.browserEvent)
  1791. }
  1792. },
  1793. getCharCode : function() {
  1794. return this.charCode || this.keyCode
  1795. },
  1796. getKey : function() {
  1797. var D = this.keyCode || this.charCode;
  1798. return Ext.isSafari ? (A[D] || D) : D
  1799. },
  1800. getPageX : function() {
  1801. return this.xy[0]
  1802. },
  1803. getPageY : function() {
  1804. return this.xy[1]
  1805. },
  1806. getTime : function() {
  1807. if (this.browserEvent) {
  1808. return B.getTime(this.browserEvent)
  1809. }
  1810. return null
  1811. },
  1812. getXY : function() {
  1813. return this.xy
  1814. },
  1815. getTarget : function(E, G, D) {
  1816. var F = Ext.get(this.target);
  1817. return E ? F.findParent(E, G, D) : (D ? F : this.target)
  1818. },
  1819. getRelatedTarget : function() {
  1820. if (this.browserEvent) {
  1821. return B.getRelatedTarget(this.browserEvent)
  1822. }
  1823. return null
  1824. },
  1825. getWheelDelta : function() {
  1826. var D = this.browserEvent;
  1827. var E = 0;
  1828. if (D.wheelDelta) {
  1829. E = D.wheelDelta / 120
  1830. } else {
  1831. if (D.detail) {
  1832. E = -D.detail / 3
  1833. }
  1834. }
  1835. return E
  1836. },
  1837. hasModifier : function() {
  1838. return ((this.ctrlKey || this.altKey) || this.shiftKey)
  1839. ? true
  1840. : false
  1841. },
  1842. within : function(E, F) {
  1843. var D = this[F ? "getRelatedTarget" : "getTarget"]();
  1844. return D && Ext.fly(E).contains(D)
  1845. },
  1846. getPoint : function() {
  1847. return new Ext.lib.Point(this.xy[0], this.xy[1])
  1848. }
  1849. };
  1850. return new Ext.EventObjectImpl()
  1851. }();
  1852. (function() {
  1853. var D = Ext.lib.Dom;
  1854. var E = Ext.lib.Event;
  1855. var A = Ext.lib.Anim;
  1856. var propCache = {};
  1857. var camelRe = /(-[a-z])/gi;
  1858. var camelFn = function(m, a) {
  1859. return a.charAt(1).toUpperCase()
  1860. };
  1861. var view = document.defaultView;
  1862. Ext.Element = function(element, forceNew) {
  1863. var dom = typeof element == "string"
  1864. ? document.getElementById(element)
  1865. : element;
  1866. if (!dom) {
  1867. return null
  1868. }
  1869. var id = dom.id;
  1870. if (forceNew !== true && id && Ext.Element.cache[id]) {
  1871. return Ext.Element.cache[id]
  1872. }
  1873. this.dom = dom;
  1874. this.id = id || Ext.id(dom)
  1875. };
  1876. var El = Ext.Element;
  1877. El.prototype = {
  1878. originalDisplay : "",
  1879. visibilityMode : 1,
  1880. defaultUnit : "px",
  1881. setVisibilityMode : function(visMode) {
  1882. this.visibilityMode = visMode;
  1883. return this
  1884. },
  1885. enableDisplayMode : function(display) {
  1886. this.setVisibilityMode(El.DISPLAY);
  1887. if (typeof display != "undefined") {
  1888. this.originalDisplay = display
  1889. }
  1890. return this
  1891. },
  1892. findParent : function(simpleSelector, maxDepth, returnEl) {
  1893. var p = this.dom, b = document.body, depth = 0, dq = Ext.DomQuery, stopEl;
  1894. maxDepth = maxDepth || 50;
  1895. if (typeof maxDepth != "number") {
  1896. stopEl = Ext.getDom(maxDepth);
  1897. maxDepth = 10
  1898. }
  1899. while (p && p.nodeType == 1 && depth < maxDepth && p != b
  1900. && p != stopEl) {
  1901. if (dq.is(p, simpleSelector)) {
  1902. return returnEl ? Ext.get(p) : p
  1903. }
  1904. depth++;
  1905. p = p.parentNode
  1906. }
  1907. return null
  1908. },
  1909. findParentNode : function(simpleSelector, maxDepth, returnEl) {
  1910. var p = Ext.fly(this.dom.parentNode, "_internal");
  1911. return p ? p.findParent(simpleSelector, maxDepth, returnEl) : null
  1912. },
  1913. up : function(simpleSelector, maxDepth) {
  1914. return this.findParentNode(simpleSelector, maxDepth, true)
  1915. },
  1916. is : function(simpleSelector) {
  1917. return Ext.DomQuery.is(this.dom, simpleSelector)
  1918. },
  1919. animate : function(args, duration, onComplete, easing, animType) {
  1920. this.anim(args, {
  1921. duration : duration,
  1922. callback : onComplete,
  1923. easing : easing
  1924. }, animType);
  1925. return this
  1926. },
  1927. anim : function(args, opt, animType, defaultDur, defaultEase, cb) {
  1928. animType = animType || "run";
  1929. opt = opt || {};
  1930. var anim = Ext.lib.Anim[animType](this.dom, args,
  1931. (opt.duration || defaultDur) || 0.35,
  1932. (opt.easing || defaultEase) || "easeOut", function() {
  1933. Ext.callback(cb, this);
  1934. Ext.callback(opt.callback, opt.scope || this, [this,
  1935. opt])
  1936. }, this);
  1937. opt.anim = anim;
  1938. return anim
  1939. },
  1940. preanim : function(a, i) {
  1941. return !a[i] ? false : (typeof a[i] == "object" ? a[i] : {
  1942. duration : a[i + 1],
  1943. callback : a[i + 2],
  1944. easing : a[i + 3]
  1945. })
  1946. },
  1947. clean : function(forceReclean) {
  1948. if (this.isCleaned && forceReclean !== true) {
  1949. return this
  1950. }
  1951. var ns = /\S/;
  1952. var d = this.dom, n = d.firstChild, ni = -1;
  1953. while (n) {
  1954. var nx = n.nextSibling;
  1955. if (n.nodeType == 3 && !ns.test(n.nodeValue)) {
  1956. d.removeChild(n)
  1957. } else {
  1958. n.nodeIndex = ++ni
  1959. }
  1960. n = nx
  1961. }
  1962. this.isCleaned = true;
  1963. return this
  1964. },
  1965. scrollIntoView : function(container, hscroll) {
  1966. var c = Ext.getDom(container) || Ext.getBody().dom;
  1967. var el = this.dom;
  1968. var o = this.getOffsetsTo(c), l = o[0] + c.scrollLeft, t = o[1]
  1969. + c.scrollTop, b = t + el.offsetHeight, r = l
  1970. + el.offsetWidth;
  1971. var ch = c.clientHeight;
  1972. var ct = parseInt(c.scrollTop, 10);
  1973. var cl = parseInt(c.scrollLeft, 10);
  1974. var cb = ct + ch;
  1975. var cr = cl + c.clientWidth;
  1976. if (el.offsetHeight > ch || t < ct) {
  1977. c.scrollTop = t
  1978. } else {
  1979. if (b > cb) {
  1980. c.scrollTop = b - ch
  1981. }
  1982. }
  1983. c.scrollTop = c.scrollTop;
  1984. if (hscroll !== false) {
  1985. if (el.offsetWidth > c.clientWidth || l < cl) {
  1986. c.scrollLeft = l
  1987. } else {
  1988. if (r > cr) {
  1989. c.scrollLeft = r - c.clientWidth
  1990. }
  1991. }
  1992. c.scrollLeft = c.scrollLeft
  1993. }
  1994. return this
  1995. },
  1996. scrollChildIntoView : function(child, hscroll) {
  1997. Ext.fly(child, "_scrollChildIntoView")
  1998. .scrollIntoView(this, hscroll)
  1999. },
  2000. autoHeight : function(animate, duration, onComplete, easing) {
  2001. var oldHeight = this.getHeight();
  2002. this.clip();
  2003. this.setHeight(1);
  2004. setTimeout(function() {
  2005. var height = parseInt(this.dom.scrollHeight, 10);
  2006. if (!animate) {
  2007. this.setHeight(height);
  2008. this.unclip();
  2009. if (typeof onComplete == "function") {
  2010. onComplete()
  2011. }
  2012. } else {
  2013. this.setHeight(oldHeight);
  2014. this.setHeight(height, animate, duration,
  2015. function() {
  2016. this.unclip();
  2017. if (typeof onComplete == "function") {
  2018. onComplete()
  2019. }
  2020. }.createDelegate(this), easing)
  2021. }
  2022. }.createDelegate(this), 0);
  2023. return this
  2024. },
  2025. contains : function(el) {
  2026. if (!el) {
  2027. return false
  2028. }
  2029. return D.isAncestor(this.dom, el.dom ? el.dom : el)
  2030. },
  2031. isVisible : function(deep) {
  2032. var vis = !(this.getStyle("visibility") == "hidden" || this
  2033. .getStyle("display") == "none");
  2034. if (deep !== true || !vis) {
  2035. return vis
  2036. }
  2037. var p = this.dom.parentNode;
  2038. while (p && p.tagName.toLowerCase() != "body") {
  2039. if (!Ext.fly(p, "_isVisible").isVisible()) {
  2040. return false
  2041. }
  2042. p = p.parentNode
  2043. }
  2044. return true
  2045. },
  2046. select : function(selector, unique) {
  2047. return El.select(selector, unique, this.dom)
  2048. },
  2049. query : function(selector, unique) {
  2050. return Ext.DomQuery.select(selector, this.dom)
  2051. },
  2052. child : function(selector, returnDom) {
  2053. var n = Ext.DomQuery.selectNode(selector, this.dom);
  2054. return returnDom ? n : Ext.get(n)
  2055. },
  2056. down : function(selector, returnDom) {
  2057. var n = Ext.DomQuery.selectNode(" > " + selector, this.dom);
  2058. return returnDom ? n : Ext.get(n)
  2059. },
  2060. initDD : function(group, config, overrides) {
  2061. var dd = new Ext.dd.DD(Ext.id(this.dom), group, config);
  2062. return Ext.apply(dd, overrides)
  2063. },
  2064. initDDProxy : function(group, config, overrides) {
  2065. var dd = new Ext.dd.DDProxy(Ext.id(this.dom), group, config);
  2066. return Ext.apply(dd, overrides)
  2067. },
  2068. initDDTarget : function(group, config, overrides) {
  2069. var dd = new Ext.dd.DDTarget(Ext.id(this.dom), group, config);
  2070. return Ext.apply(dd, overrides)
  2071. },
  2072. setVisible : function(visible, animate) {
  2073. if (!animate || !A) {
  2074. if (this.visibilityMode == El.DISPLAY) {
  2075. this.setDisplayed(visible)
  2076. } else {
  2077. this.fixDisplay();
  2078. this.dom.style.visibility = visible ? "visible" : "hidden"
  2079. }
  2080. } else {
  2081. var dom = this.dom;
  2082. var visMode = this.visibilityMode;
  2083. if (visible) {
  2084. this.setOpacity(0.01);
  2085. this.setVisible(true)
  2086. }
  2087. this.anim({
  2088. opacity : {
  2089. to : (visible ? 1 : 0)
  2090. }
  2091. }, this.preanim(arguments, 1), null, 0.35, "easeIn",
  2092. function() {
  2093. if (!visible) {
  2094. if (visMode == El.DISPLAY) {
  2095. dom.style.display = "none"
  2096. } else {
  2097. dom.style.visibility = "hidden"
  2098. }
  2099. Ext.get(dom).setOpacity(1)
  2100. }
  2101. })
  2102. }
  2103. return this
  2104. },
  2105. isDisplayed : function() {
  2106. return this.getStyle("display") != "none"
  2107. },
  2108. toggle : function(animate) {
  2109. this.setVisible(!this.isVisible(), this.preanim(arguments, 0));
  2110. return this
  2111. },
  2112. setDisplayed : function(value) {
  2113. if (typeof value == "boolean") {
  2114. value = value ? this.originalDisplay : "none"
  2115. }
  2116. this.setStyle("display", value);
  2117. return this
  2118. },
  2119. focus : function() {
  2120. try {
  2121. this.dom.focus()
  2122. } catch (e) {
  2123. }
  2124. return this
  2125. },
  2126. blur : function() {
  2127. try {
  2128. this.dom.blur()
  2129. } catch (e) {
  2130. }
  2131. return this
  2132. },
  2133. addClass : function(className) {
  2134. if (className instanceof Array) {
  2135. for (var i = 0, len = className.length; i < len; i++) {
  2136. this.addClass(className[i])
  2137. }
  2138. } else {
  2139. if (className && !this.hasClass(className)) {
  2140. this.dom.className = this.dom.className + " " + className
  2141. }
  2142. }
  2143. return this
  2144. },
  2145. radioClass : function(className) {
  2146. var siblings = this.dom.parentNode.childNodes;
  2147. for (var i = 0; i < siblings.length; i++) {
  2148. var s = siblings[i];
  2149. if (s.nodeType == 1) {
  2150. Ext.get(s).removeClass(className)
  2151. }
  2152. }
  2153. this.addClass(className);
  2154. return this
  2155. },
  2156. removeClass : function(className) {
  2157. if (!className || !this.dom.className) {
  2158. return this
  2159. }
  2160. if (className instanceof Array) {
  2161. for (var i = 0, len = className.length; i < len; i++) {
  2162. this.removeClass(className[i])
  2163. }
  2164. } else {
  2165. if (this.hasClass(className)) {
  2166. var re = this.classReCache[className];
  2167. if (!re) {
  2168. re = new RegExp(
  2169. "(?:^|\\s+)" + className + "(?:\\s+|$)", "g");
  2170. this.classReCache[className] = re
  2171. }
  2172. this.dom.className = this.dom.className.replace(re, " ")
  2173. }
  2174. }
  2175. return this
  2176. },
  2177. classReCache : {},
  2178. toggleClass : function(className) {
  2179. if (this.hasClass(className)) {
  2180. this.removeClass(className)
  2181. } else {
  2182. this.addClass(className)
  2183. }
  2184. return this
  2185. },
  2186. hasClass : function(className) {
  2187. return className
  2188. && (" " + this.dom.className + " ").indexOf(" " + className
  2189. + " ") != -1
  2190. },
  2191. replaceClass : function(oldClassName, newClassName) {
  2192. this.removeClass(oldClassName);
  2193. this.addClass(newClassName);
  2194. return this
  2195. },
  2196. getStyles : function() {
  2197. var a = arguments, len = a.length, r = {};
  2198. for (var i = 0; i < len; i++) {
  2199. r[a[i]] = this.getStyle(a[i])
  2200. }
  2201. return r
  2202. },
  2203. getStyle : function() {
  2204. return view && view.getComputedStyle ? function(prop) {
  2205. var el = this.dom, v, cs, camel;
  2206. if (prop == "float") {
  2207. prop = "cssFloat"
  2208. }
  2209. if (v = el.style[prop]) {
  2210. return v
  2211. }
  2212. if (cs = view.getComputedStyle(el, "")) {
  2213. if (!(camel = propCache[prop])) {
  2214. camel = propCache[prop] = prop
  2215. .replace(camelRe, camelFn)
  2216. }
  2217. return cs[camel]
  2218. }
  2219. return null
  2220. } : function(prop) {
  2221. var el = this.dom, v, cs, camel;
  2222. if (prop == "opacity") {
  2223. if (typeof el.style.filter == "string") {
  2224. var m = el.style.filter.match(/alpha\(opacity=(.*)\)/i);
  2225. if (m) {
  2226. var fv = parseFloat(m[1]);
  2227. if (!isNaN(fv)) {
  2228. return fv ? fv / 100 : 0
  2229. }
  2230. }
  2231. }
  2232. return 1
  2233. } else {
  2234. if (prop == "float") {
  2235. prop = "styleFloat"
  2236. }
  2237. }
  2238. if (!(camel = propCache[prop])) {
  2239. camel = propCache[prop] = prop.replace(camelRe, camelFn)
  2240. }
  2241. if (v = el.style[camel]) {
  2242. return v
  2243. }
  2244. if (cs = el.currentStyle) {
  2245. return cs[camel]
  2246. }
  2247. return null
  2248. }
  2249. }(),
  2250. setStyle : function(prop, value) {
  2251. if (typeof prop == "string") {
  2252. var camel;
  2253. if (!(camel = propCache[prop])) {
  2254. camel = propCache[prop] = prop.replace(camelRe, camelFn)
  2255. }
  2256. if (camel == "opacity") {
  2257. this.setOpacity(value)
  2258. } else {
  2259. this.dom.style[camel] = value
  2260. }
  2261. } else {
  2262. for (var style in prop) {
  2263. if (typeof prop[style] != "function") {
  2264. this.setStyle(style, prop[style])
  2265. }
  2266. }
  2267. }
  2268. return this
  2269. },
  2270. applyStyles : function(style) {
  2271. Ext.DomHelper.applyStyles(this.dom, style);
  2272. return this
  2273. },
  2274. getX : function() {
  2275. return D.getX(this.dom)
  2276. },
  2277. getY : function() {
  2278. return D.getY(this.dom)
  2279. },
  2280. getXY : function() {
  2281. return D.getXY(this.dom)
  2282. },
  2283. getOffsetsTo : function(el) {
  2284. var o = this.getXY();
  2285. var e = Ext.fly(el, "_internal").getXY();
  2286. return [o[0] - e[0], o[1] - e[1]]
  2287. },
  2288. setX : function(x, animate) {
  2289. if (!animate || !A) {
  2290. D.setX(this.dom, x)
  2291. } else {
  2292. this.setXY([x, this.getY()], this.preanim(arguments, 1))
  2293. }
  2294. return this
  2295. },
  2296. setY : function(y, animate) {
  2297. if (!animate || !A) {
  2298. D.setY(this.dom, y)
  2299. } else {
  2300. this.setXY([this.getX(), y], this.preanim(arguments, 1))
  2301. }
  2302. return this
  2303. },
  2304. setLeft : function(left) {
  2305. this.setStyle("left", this.addUnits(left));
  2306. return this
  2307. },
  2308. setTop : function(top) {
  2309. this.setStyle("top", this.addUnits(top));
  2310. return this
  2311. },
  2312. setRight : function(right) {
  2313. this.setStyle("right", this.addUnits(right));
  2314. return this
  2315. },
  2316. setBottom : function(bottom) {
  2317. this.setStyle("bottom", this.addUnits(bottom));
  2318. return this
  2319. },
  2320. setXY : function(pos, animate) {
  2321. if (!animate || !A) {
  2322. D.setXY(this.dom, pos)
  2323. } else {
  2324. this.anim({
  2325. points : {
  2326. to : pos
  2327. }
  2328. }, this.preanim(arguments, 1), "motion")
  2329. }
  2330. return this
  2331. },
  2332. setLocation : function(x, y, animate) {
  2333. this.setXY([x, y], this.preanim(arguments, 2));
  2334. return this
  2335. },
  2336. moveTo : function(x, y, animate) {
  2337. this.setXY([x, y], this.preanim(arguments, 2));
  2338. return this
  2339. },
  2340. getRegion : function() {
  2341. return D.getRegion(this.dom)
  2342. },
  2343. getHeight : function(contentHeight) {
  2344. var h = this.dom.offsetHeight || 0;
  2345. h = contentHeight !== true ? h : h - this.getBorderWidth("tb")
  2346. - this.getPadding("tb");
  2347. return h < 0 ? 0 : h
  2348. },
  2349. getWidth : function(contentWidth) {
  2350. var w = this.dom.offsetWidth || 0;
  2351. w = contentWidth !== true ? w : w - this.getBorderWidth("lr")
  2352. - this.getPadding("lr");
  2353. return w < 0 ? 0 : w
  2354. },
  2355. getComputedHeight : function() {
  2356. var h = Math.max(this.dom.offsetHeight, this.dom.clientHeight);
  2357. if (!h) {
  2358. h = parseInt(this.getStyle("height"), 10) || 0;
  2359. if (!this.isBorderBox()) {
  2360. h += this.getFrameWidth("tb")
  2361. }
  2362. }
  2363. return h
  2364. },
  2365. getComputedWidth : function() {
  2366. var w = Math.max(this.dom.offsetWidth, this.dom.clientWidth);
  2367. if (!w) {
  2368. w = parseInt(this.getStyle("width"), 10) || 0;
  2369. if (!this.isBorderBox()) {
  2370. w += this.getFrameWidth("lr")
  2371. }
  2372. }
  2373. return w
  2374. },
  2375. getSize : function(contentSize) {
  2376. return {
  2377. width : this.getWidth(contentSize),
  2378. height : this.getHeight(contentSize)
  2379. }
  2380. },
  2381. getStyleSize : function() {
  2382. var w, h, d = this.dom, s = d.style;
  2383. if (s.width && s.width != "auto") {
  2384. w = parseInt(s.width, 10);
  2385. if (Ext.isBorderBox) {
  2386. w -= this.getFrameWidth("lr")
  2387. }
  2388. }
  2389. if (s.height && s.height != "auto") {
  2390. h = parseInt(s.height, 10);
  2391. if (Ext.isBorderBox) {
  2392. h -= this.getFrameWidth("tb")
  2393. }
  2394. }
  2395. return {
  2396. width : w || this.getWidth(true),
  2397. height : h || this.getHeight(true)
  2398. }
  2399. },
  2400. getViewSize : function() {
  2401. var d = this.dom, doc = document, aw = 0, ah = 0;
  2402. if (d == doc || d == doc.body) {
  2403. return {
  2404. width : D.getViewWidth(),
  2405. height : D.getViewHeight()
  2406. }
  2407. } else {
  2408. return {
  2409. width : d.clientWidth,
  2410. height : d.clientHeight
  2411. }
  2412. }
  2413. },
  2414. getValue : function(asNumber) {
  2415. return asNumber ? parseInt(this.dom.value, 10) : this.dom.value
  2416. },
  2417. adjustWidth : function(width) {
  2418. if (typeof width == "number") {
  2419. if (this.autoBoxAdjust && !this.isBorderBox()) {
  2420. width -= (this.getBorderWidth("lr") + this.getPadding("lr"))
  2421. }
  2422. if (width < 0) {
  2423. width = 0
  2424. }
  2425. }
  2426. return width
  2427. },
  2428. adjustHeight : function(height) {
  2429. if (typeof height == "number") {
  2430. if (this.autoBoxAdjust && !this.isBorderBox()) {
  2431. height -= (this.getBorderWidth("tb") + this
  2432. .getPadding("tb"))
  2433. }
  2434. if (height < 0) {
  2435. height = 0
  2436. }
  2437. }
  2438. return height
  2439. },
  2440. setWidth : function(width, animate) {
  2441. width = this.adjustWidth(width);
  2442. if (!animate || !A) {
  2443. this.dom.style.width = this.addUnits(width)
  2444. } else {
  2445. this.anim({
  2446. width : {
  2447. to : width
  2448. }
  2449. }, this.preanim(arguments, 1))
  2450. }
  2451. return this
  2452. },
  2453. setHeight : function(height, animate) {
  2454. height = this.adjustHeight(height);
  2455. if (!animate || !A) {
  2456. this.dom.style.height = this.addUnits(height)
  2457. } else {
  2458. this.anim({
  2459. height : {
  2460. to : height
  2461. }
  2462. }, this.preanim(arguments, 1))
  2463. }
  2464. return this
  2465. },
  2466. setSize : function(width, height, animate) {
  2467. if (typeof width == "object") {
  2468. height = width.height;
  2469. width = width.width
  2470. }
  2471. width = this.adjustWidth(width);
  2472. height = this.adjustHeight(height);
  2473. if (!animate || !A) {
  2474. this.dom.style.width = this.addUnits(width);
  2475. this.dom.style.height = this.addUnits(height)
  2476. } else {
  2477. this.anim({
  2478. width : {
  2479. to : width
  2480. },
  2481. height : {
  2482. to : height
  2483. }
  2484. }, this.preanim(arguments, 2))
  2485. }
  2486. return this
  2487. },
  2488. setBounds : function(x, y, width, height, animate) {
  2489. if (!animate || !A) {
  2490. this.setSize(width, height);
  2491. this.setLocation(x, y)
  2492. } else {
  2493. width = this.adjustWidth(width);
  2494. height = this.adjustHeight(height);
  2495. this.anim({
  2496. points : {
  2497. to : [x, y]
  2498. },
  2499. width : {
  2500. to : width
  2501. },
  2502. height : {
  2503. to : height
  2504. }
  2505. }, this.preanim(arguments, 4), "motion")
  2506. }
  2507. return this
  2508. },
  2509. setRegion : function(region, animate) {
  2510. this.setBounds(region.left, region.top, region.right - region.left,
  2511. region.bottom - region.top, this.preanim(arguments, 1));
  2512. return this
  2513. },
  2514. addListener : function(eventName, fn, scope, options) {
  2515. Ext.EventManager
  2516. .on(this.dom, eventName, fn, scope || this, options)
  2517. },
  2518. removeListener : function(eventName, fn) {
  2519. Ext.EventManager.removeListener(this.dom, eventName, fn);
  2520. return this
  2521. },
  2522. removeAllListeners : function() {
  2523. E.purgeElement(this.dom);
  2524. return this
  2525. },
  2526. relayEvent : function(eventName, observable) {
  2527. this.on(eventName, function(e) {
  2528. observable.fireEvent(eventName, e)
  2529. })
  2530. },
  2531. setOpacity : function(opacity, animate) {
  2532. if (!animate || !A) {
  2533. var s = this.dom.style;
  2534. if (Ext.isIE) {
  2535. s.zoom = 1;
  2536. s.filter = (s.filter || "")
  2537. .replace(/alpha\([^\)]*\)/gi, "")
  2538. + (opacity == 1 ? "" : " alpha(opacity=" + opacity
  2539. * 100 + ")")
  2540. } else {
  2541. s.opacity = opacity
  2542. }
  2543. } else {
  2544. this.anim({
  2545. opacity : {
  2546. to : opacity
  2547. }
  2548. }, this.preanim(arguments, 1), null, 0.35, "easeIn")
  2549. }
  2550. return this
  2551. },
  2552. getLeft : function(local) {
  2553. if (!local) {
  2554. return this.getX()
  2555. } else {
  2556. return parseInt(this.getStyle("left"), 10) || 0
  2557. }
  2558. },
  2559. getRight : function(local) {
  2560. if (!local) {
  2561. return this.getX() + this.getWidth()
  2562. } else {
  2563. return (this.getLeft(true) + this.getWidth()) || 0
  2564. }
  2565. },
  2566. getTop : function(local) {
  2567. if (!local) {
  2568. return this.getY()
  2569. } else {
  2570. return parseInt(this.getStyle("top"), 10) || 0
  2571. }
  2572. },
  2573. getBottom : function(local) {
  2574. if (!local) {
  2575. return this.getY() + this.getHeight()
  2576. } else {
  2577. return (this.getTop(true) + this.getHeight()) || 0
  2578. }
  2579. },
  2580. position : function(pos, zIndex, x, y) {
  2581. if (!pos) {
  2582. if (this.getStyle("position") == "static") {
  2583. this.setStyle("position", "relative")
  2584. }
  2585. } else {
  2586. this.setStyle("position", pos)
  2587. }
  2588. if (zIndex) {
  2589. this.setStyle("z-index", zIndex)
  2590. }
  2591. if (x !== undefined && y !== undefined) {
  2592. this.setXY([x, y])
  2593. } else {
  2594. if (x !== undefined) {
  2595. this.setX(x)
  2596. } else {
  2597. if (y !== undefined) {
  2598. this.setY(y)
  2599. }
  2600. }
  2601. }
  2602. },
  2603. clearPositioning : function(value) {
  2604. value = value || "";
  2605. this.setStyle({
  2606. "left" : value,
  2607. "right" : value,
  2608. "top" : value,
  2609. "bottom" : value,
  2610. "z-index" : "",
  2611. "position" : "static"
  2612. });
  2613. return this
  2614. },
  2615. getPositioning : function() {
  2616. var l = this.getStyle("left");
  2617. var t = this.getStyle("top");
  2618. return {
  2619. "position" : this.getStyle("position"),
  2620. "left" : l,
  2621. "right" : l ? "" : this.getStyle("right"),
  2622. "top" : t,
  2623. "bottom" : t ? "" : this.getStyle("bottom"),
  2624. "z-index" : this.getStyle("z-index")
  2625. }
  2626. },
  2627. getBorderWidth : function(side) {
  2628. return this.addStyles(side, El.borders)
  2629. },
  2630. getPadding : function(side) {
  2631. return this.addStyles(side, El.paddings)
  2632. },
  2633. setPositioning : function(pc) {
  2634. this.applyStyles(pc);
  2635. if (pc.right == "auto") {
  2636. this.dom.style.right = ""
  2637. }
  2638. if (pc.bottom == "auto") {
  2639. this.dom.style.bottom = ""
  2640. }
  2641. return this
  2642. },
  2643. fixDisplay : function() {
  2644. if (this.getStyle("display") == "none") {
  2645. this.setStyle("visibility", "hidden");
  2646. this.setStyle("display", this.originalDisplay);
  2647. if (this.getStyle("display") == "none") {
  2648. this.setStyle("display", "block")
  2649. }
  2650. }
  2651. },
  2652. setLeftTop : function(left, top) {
  2653. this.dom.style.left = this.addUnits(left);
  2654. this.dom.style.top = this.addUnits(top);
  2655. return this
  2656. },
  2657. move : function(direction, distance, animate) {
  2658. var xy = this.getXY();
  2659. direction = direction.toLowerCase();
  2660. switch (direction) {
  2661. case "l" :
  2662. case "left" :
  2663. this.moveTo(xy[0] - distance, xy[1], this.preanim(
  2664. arguments, 2));
  2665. break;
  2666. case "r" :
  2667. case "right" :
  2668. this.moveTo(xy[0] + distance, xy[1], this.preanim(
  2669. arguments, 2));
  2670. break;
  2671. case "t" :
  2672. case "top" :
  2673. case "up" :
  2674. this.moveTo(xy[0], xy[1] - distance, this.preanim(
  2675. arguments, 2));
  2676. break;
  2677. case "b" :
  2678. case "bottom" :
  2679. case "down" :
  2680. this.moveTo(xy[0], xy[1] + distance, this.preanim(
  2681. arguments, 2));
  2682. break
  2683. }
  2684. return this
  2685. },
  2686. clip : function() {
  2687. if (!this.isClipped) {
  2688. this.isClipped = true;
  2689. this.originalClip = {
  2690. "o" : this.getStyle("overflow"),
  2691. "x" : this.getStyle("overflow-x"),
  2692. "y" : this.getStyle("overflow-y")
  2693. };
  2694. this.setStyle("overflow", "hidden");
  2695. this.setStyle("overflow-x", "hidden");
  2696. this.setStyle("overflow-y", "hidden")
  2697. }
  2698. return this
  2699. },
  2700. unclip : function() {
  2701. if (this.isClipped) {
  2702. this.isClipped = false;
  2703. var o = this.originalClip;
  2704. if (o.o) {
  2705. this.setStyle("overflow", o.o)
  2706. }
  2707. if (o.x) {
  2708. this.setStyle("overflow-x", o.x)
  2709. }
  2710. if (o.y) {
  2711. this.setStyle("overflow-y", o.y)
  2712. }
  2713. }
  2714. return this
  2715. },
  2716. getAnchorXY : function(anchor, local, s) {
  2717. var w, h, vp = false;
  2718. if (!s) {
  2719. var d = this.dom;
  2720. if (d == document.body || d == document) {
  2721. vp = true;
  2722. w = D.getViewWidth();
  2723. h = D.getViewHeight()
  2724. } else {
  2725. w = this.getWidth();
  2726. h = this.getHeight()
  2727. }
  2728. } else {
  2729. w = s.width;
  2730. h = s.height
  2731. }
  2732. var x = 0, y = 0, r = Math.round;
  2733. switch ((anchor || "tl").toLowerCase()) {
  2734. case "c" :
  2735. x = r(w * 0.5);
  2736. y = r(h * 0.5);
  2737. break;
  2738. case "t" :
  2739. x = r(w * 0.5);
  2740. y = 0;
  2741. break;
  2742. case "l" :
  2743. x = 0;
  2744. y = r(h * 0.5);
  2745. break;
  2746. case "r" :
  2747. x = w;
  2748. y = r(h * 0.5);
  2749. break;
  2750. case "b" :
  2751. x = r(w * 0.5);
  2752. y = h;
  2753. break;
  2754. case "tl" :
  2755. x = 0;
  2756. y = 0;
  2757. break;
  2758. case "bl" :
  2759. x = 0;
  2760. y = h;
  2761. break;
  2762. case "br" :
  2763. x = w;
  2764. y = h;
  2765. break;
  2766. case "tr" :
  2767. x = w;
  2768. y = 0;
  2769. break
  2770. }
  2771. if (local === true) {
  2772. return [x, y]
  2773. }
  2774. if (vp) {
  2775. var sc = this.getScroll();
  2776. return [x + sc.left, y + sc.top]
  2777. }
  2778. var o = this.getXY();
  2779. return [x + o[0], y + o[1]]
  2780. },
  2781. getAlignToXY : function(el, p, o) {
  2782. el = Ext.get(el);
  2783. if (!el || !el.dom) {
  2784. throw "Element.alignToXY with an element that doesn't exist"
  2785. }
  2786. var d = this.dom;
  2787. var c = false;
  2788. var p1 = "", p2 = "";
  2789. o = o || [0, 0];
  2790. if (!p) {
  2791. p = "tl-bl"
  2792. } else {
  2793. if (p == "?") {
  2794. p = "tl-bl?"
  2795. } else {
  2796. if (p.indexOf("-") == -1) {
  2797. p = "tl-" + p
  2798. }
  2799. }
  2800. }
  2801. p = p.toLowerCase();
  2802. var m = p.match(/^([a-z]+)-([a-z]+)(\?)?$/);
  2803. if (!m) {
  2804. throw "Element.alignTo with an invalid alignment " + p
  2805. }
  2806. p1 = m[1];
  2807. p2 = m[2];
  2808. c = !!m[3];
  2809. var a1 = this.getAnchorXY(p1, true);
  2810. var a2 = el.getAnchorXY(p2, false);
  2811. var x = a2[0] - a1[0] + o[0];
  2812. var y = a2[1] - a1[1] + o[1];
  2813. if (c) {
  2814. var w = this.getWidth(), h = this.getHeight(), r = el
  2815. .getRegion();
  2816. var dw = D.getViewWidth() - 5, dh = D.getViewHeight() - 5;
  2817. var p1y = p1.charAt(0), p1x = p1.charAt(p1.length - 1);
  2818. var p2y = p2.charAt(0), p2x = p2.charAt(p2.length - 1);
  2819. var swapY = ((p1y == "t" && p2y == "b") || (p1y == "b" && p2y == "t"));
  2820. var swapX = ((p1x == "r" && p2x == "l") || (p1x == "l" && p2x == "r"));
  2821. var doc = document;
  2822. var scrollX = (doc.documentElement.scrollLeft
  2823. || doc.body.scrollLeft || 0)
  2824. + 5;
  2825. var scrollY = (doc.documentElement.scrollTop
  2826. || doc.body.scrollTop || 0)
  2827. + 5;
  2828. if ((x + w) > dw + scrollX) {
  2829. x = swapX ? r.left - w : dw + scrollX - w
  2830. }
  2831. if (x < scrollX) {
  2832. x = swapX ? r.right : scrollX
  2833. }
  2834. if ((y + h) > dh + scrollY) {
  2835. y = swapY ? r.top - h : dh + scrollY - h
  2836. }
  2837. if (y < scrollY) {
  2838. y = swapY ? r.bottom : scrollY
  2839. }
  2840. }
  2841. return [x, y]
  2842. },
  2843. getConstrainToXY : function() {
  2844. var os = {
  2845. top : 0,
  2846. left : 0,
  2847. bottom : 0,
  2848. right : 0
  2849. };
  2850. return function(el, local, offsets, proposedXY) {
  2851. el = Ext.get(el);
  2852. offsets = offsets ? Ext.applyIf(offsets, os) : os;
  2853. var vw, vh, vx = 0, vy = 0;
  2854. if (el.dom == document.body || el.dom == document) {
  2855. vw = Ext.lib.Dom.getViewWidth();
  2856. vh = Ext.lib.Dom.getViewHeight()
  2857. } else {
  2858. vw = el.dom.clientWidth;
  2859. vh = el.dom.clientHeight;
  2860. if (!local) {
  2861. var vxy = el.getXY();
  2862. vx = vxy[0];
  2863. vy = vxy[1]
  2864. }
  2865. }
  2866. var s = el.getScroll();
  2867. vx += offsets.left + s.left;
  2868. vy += offsets.top + s.top;
  2869. vw -= offsets.right;
  2870. vh -= offsets.bottom;
  2871. var vr = vx + vw;
  2872. var vb = vy + vh;
  2873. var xy = proposedXY
  2874. || (!local ? this.getXY() : [this.getLeft(true),
  2875. this.getTop(true)]);
  2876. var x = xy[0], y = xy[1];
  2877. var w = this.dom.offsetWidth, h = this.dom.offsetHeight;
  2878. var moved = false;
  2879. if ((x + w) > vr) {
  2880. x = vr - w;
  2881. moved = true
  2882. }
  2883. if ((y + h) > vb) {
  2884. y = vb - h;
  2885. moved = true
  2886. }
  2887. if (x < vx) {
  2888. x = vx;
  2889. moved = true
  2890. }
  2891. if (y < vy) {
  2892. y = vy;
  2893. moved = true
  2894. }
  2895. return moved ? [x, y] : false
  2896. }
  2897. }(),
  2898. adjustForConstraints : function(xy, parent, offsets) {
  2899. return this
  2900. .getConstrainToXY(parent || document, false, offsets, xy)
  2901. || xy
  2902. },
  2903. alignTo : function(element, position, offsets, animate) {
  2904. var xy = this.getAlignToXY(element, position, offsets);
  2905. this.setXY(xy, this.preanim(arguments, 3));
  2906. return this
  2907. },
  2908. anchorTo : function(el, alignment, offsets, animate, monitorScroll,
  2909. callback) {
  2910. var action = function() {
  2911. this.alignTo(el, alignment, offsets, animate);
  2912. Ext.callback(callback, this)
  2913. };
  2914. Ext.EventManager.onWindowResize(action, this);
  2915. var tm = typeof monitorScroll;
  2916. if (tm != "undefined") {
  2917. Ext.EventManager.on(window, "scroll", action, this, {
  2918. buffer : tm == "number" ? monitorScroll : 50
  2919. })
  2920. }
  2921. action.call(this);
  2922. return this
  2923. },
  2924. clearOpacity : function() {
  2925. if (window.ActiveXObject) {
  2926. if (typeof this.dom.style.filter == "string"
  2927. && (/alpha/i).test(this.dom.style.filter)) {
  2928. this.dom.style.filter = ""
  2929. }
  2930. } else {
  2931. this.dom.style.opacity = "";
  2932. this.dom.style["-moz-opacity"] = "";
  2933. this.dom.style["-khtml-opacity"] = ""
  2934. }
  2935. return this
  2936. },
  2937. hide : function(animate) {
  2938. this.setVisible(false, this.preanim(arguments, 0));
  2939. return this
  2940. },
  2941. show : function(animate) {
  2942. this.setVisible(true, this.preanim(arguments, 0));
  2943. return this
  2944. },
  2945. addUnits : function(size) {
  2946. return Ext.Element.addUnits(size, this.defaultUnit)
  2947. },
  2948. update : function(html, loadScripts, callback) {
  2949. if (typeof html == "undefined") {
  2950. html = ""
  2951. }
  2952. if (loadScripts !== true) {
  2953. this.dom.innerHTML = html;
  2954. if (typeof callback == "function") {
  2955. callback()
  2956. }
  2957. return this
  2958. }
  2959. var id = Ext.id();
  2960. var dom = this.dom;
  2961. html += "<span id=\"" + id + "\"></span>";
  2962. E.onAvailable(id, function() {
  2963. var hd = document.getElementsByTagName("head")[0];
  2964. var re = /(?:<script([^>]*)?>)((\n|\r|.)*?)(?:<\/script>)/ig;
  2965. var srcRe = /\ssrc=([\'\"])(.*?)\1/i;
  2966. var typeRe = /\stype=([\'\"])(.*?)\1/i;
  2967. var match;
  2968. while (match = re.exec(html)) {
  2969. var attrs = match[1];
  2970. var srcMatch = attrs ? attrs.match(srcRe) : false;
  2971. if (srcMatch && srcMatch[2]) {
  2972. var s = document.createElement("script");
  2973. s.src = srcMatch[2];
  2974. var typeMatch = attrs.match(typeRe);
  2975. if (typeMatch && typeMatch[2]) {
  2976. s.type = typeMatch[2]
  2977. }
  2978. hd.appendChild(s)
  2979. } else {
  2980. if (match[2] && match[2].length > 0) {
  2981. if (window.execScript) {
  2982. window.execScript(match[2])
  2983. } else {
  2984. window.eval(match[2])
  2985. }
  2986. }
  2987. }
  2988. }
  2989. var el = document.getElementById(id);
  2990. if (el) {
  2991. Ext.removeNode(el)
  2992. }
  2993. if (typeof callback == "function") {
  2994. callback()
  2995. }
  2996. });
  2997. dom.innerHTML = html.replace(
  2998. /(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/ig, "");
  2999. return this
  3000. },
  3001. load : function() {
  3002. var um = this.getUpdater();
  3003. um.update.apply(um, arguments);
  3004. return this
  3005. },
  3006. getUpdater : function() {
  3007. if (!this.updateManager) {
  3008. this.updateManager = new Ext.Updater(this)
  3009. }
  3010. return this.updateManager
  3011. },
  3012. unselectable : function() {
  3013. this.dom.unselectable = "on";
  3014. this.swallowEvent("selectstart", true);
  3015. this.applyStyles("-moz-user-select:none;-khtml-user-select:none;");
  3016. this.addClass("x-unselectable");
  3017. return this
  3018. },
  3019. getCenterXY : function() {
  3020. return this.getAlignToXY(document, "c-c")
  3021. },
  3022. center : function(centerIn) {
  3023. this.alignTo(centerIn || document, "c-c");
  3024. return this
  3025. },
  3026. isBorderBox : function() {
  3027. return noBoxAdjust[this.dom.tagName.toLowerCase()]
  3028. || Ext.isBorderBox
  3029. },
  3030. getBox : function(contentBox, local) {
  3031. var xy;
  3032. if (!local) {
  3033. xy = this.getXY()
  3034. } else {
  3035. var left = parseInt(this.getStyle("left"), 10) || 0;
  3036. var top = parseInt(this.getStyle("top"), 10) || 0;
  3037. xy = [left, top]
  3038. }
  3039. var el = this.dom, w = el.offsetWidth, h = el.offsetHeight, bx;
  3040. if (!contentBox) {
  3041. bx = {
  3042. x : xy[0],
  3043. y : xy[1],
  3044. 0 : xy[0],
  3045. 1 : xy[1],
  3046. width : w,
  3047. height : h
  3048. }
  3049. } else {
  3050. var l = this.getBorderWidth("l") + this.getPadding("l");
  3051. var r = this.getBorderWidth("r") + this.getPadding("r");
  3052. var t = this.getBorderWidth("t") + this.getPadding("t");
  3053. var b = this.getBorderWidth("b") + this.getPadding("b");
  3054. bx = {
  3055. x : xy[0] + l,
  3056. y : xy[1] + t,
  3057. 0 : xy[0] + l,
  3058. 1 : xy[1] + t,
  3059. width : w - (l + r),
  3060. height : h - (t + b)
  3061. }
  3062. }
  3063. bx.right = bx.x + bx.width;
  3064. bx.bottom = bx.y + bx.height;
  3065. return bx
  3066. },
  3067. getFrameWidth : function(sides, onlyContentBox) {
  3068. return onlyContentBox && Ext.isBorderBox ? 0 : (this
  3069. .getPadding(sides) + this.getBorderWidth(sides))
  3070. },
  3071. setBox : function(box, adjust, animate) {
  3072. var w = box.width, h = box.height;
  3073. if ((adjust && !this.autoBoxAdjust) && !this.isBorderBox()) {
  3074. w -= (this.getBorderWidth("lr") + this.getPadding("lr"));
  3075. h -= (this.getBorderWidth("tb") + this.getPadding("tb"))
  3076. }
  3077. this.setBounds(box.x, box.y, w, h, this.preanim(arguments, 2));
  3078. return this
  3079. },
  3080. repaint : function() {
  3081. var dom = this.dom;
  3082. this.addClass("x-repaint");
  3083. setTimeout(function() {
  3084. Ext.get(dom).removeClass("x-repaint")
  3085. }, 1);
  3086. return this
  3087. },
  3088. getMargins : function(side) {
  3089. if (!side) {
  3090. return {
  3091. top : parseInt(this.getStyle("margin-top"), 10) || 0,
  3092. left : parseInt(this.getStyle("margin-left"), 10) || 0,
  3093. bottom : parseInt(this.getStyle("margin-bottom"), 10) || 0,
  3094. right : parseInt(this.getStyle("margin-right"), 10) || 0
  3095. }
  3096. } else {
  3097. return this.addStyles(side, El.margins)
  3098. }
  3099. },
  3100. addStyles : function(sides, styles) {
  3101. var val = 0, v, w;
  3102. for (var i = 0, len = sides.length; i < len; i++) {
  3103. v = this.getStyle(styles[sides.charAt(i)]);
  3104. if (v) {
  3105. w = parseInt(v, 10);
  3106. if (w) {
  3107. val += (w >= 0 ? w : -1 * w)
  3108. }
  3109. }
  3110. }
  3111. return val
  3112. },
  3113. createProxy : function(config, renderTo, matchBox) {
  3114. config = typeof config == "object" ? config : {
  3115. tag : "div",
  3116. cls : config
  3117. };
  3118. var proxy;
  3119. if (renderTo) {
  3120. proxy = Ext.DomHelper.append(renderTo, config, true)
  3121. } else {
  3122. proxy = Ext.DomHelper.insertBefore(this.dom, config, true)
  3123. }
  3124. if (matchBox) {
  3125. proxy.setBox(this.getBox())
  3126. }
  3127. return proxy
  3128. },
  3129. mask : function(msg, msgCls) {
  3130. if (this.getStyle("position") == "static") {
  3131. this.setStyle("position", "relative")
  3132. }
  3133. if (this._maskMsg) {
  3134. this._maskMsg.remove()
  3135. }
  3136. if (this._mask) {
  3137. this._mask.remove()
  3138. }
  3139. this._mask = Ext.DomHelper.append(this.dom, {
  3140. cls : "ext-el-mask"
  3141. }, true);
  3142. this.addClass("x-masked");
  3143. this._mask.setDisplayed(true);
  3144. if (typeof msg == "string") {
  3145. this._maskMsg = Ext.DomHelper.append(this.dom, {
  3146. cls : "ext-el-mask-msg",
  3147. cn : {
  3148. tag : "div"
  3149. }
  3150. }, true);
  3151. var mm = this._maskMsg;
  3152. mm.dom.className = msgCls
  3153. ? "ext-el-mask-msg " + msgCls
  3154. : "ext-el-mask-msg";
  3155. mm.dom.firstChild.innerHTML = msg;
  3156. mm.setDisplayed(true);
  3157. mm.center(this)
  3158. }
  3159. if (Ext.isIE && !(Ext.isIE7 && Ext.isStrict)
  3160. && this.getStyle("height") == "auto") {
  3161. this._mask.setSize(this.dom.clientWidth, this.getHeight())
  3162. }
  3163. return this._mask
  3164. },
  3165. unmask : function() {
  3166. if (this._mask) {
  3167. if (this._maskMsg) {
  3168. this._maskMsg.remove();
  3169. delete this._maskMsg
  3170. }
  3171. this._mask.remove();
  3172. delete this._mask
  3173. }
  3174. this.removeClass("x-masked")
  3175. },
  3176. isMasked : function() {
  3177. return this._mask && this._mask.isVisible()
  3178. },
  3179. createShim : function() {
  3180. var el = document.createElement("iframe");
  3181. el.frameBorder = "no";
  3182. el.className = "ext-shim";
  3183. if (Ext.isIE && Ext.isSecure) {
  3184. el.src = Ext.SSL_SECURE_URL
  3185. }
  3186. var shim = Ext.get(this.dom.parentNode.insertBefore(el, this.dom));
  3187. shim.autoBoxAdjust = false;
  3188. return shim
  3189. },
  3190. remove : function() {
  3191. Ext.removeNode(this.dom);
  3192. delete El.cache[this.dom.id]
  3193. },
  3194. hover : function(overFn, outFn, scope) {
  3195. var preOverFn = function(e) {
  3196. if (!e.within(this, true)) {
  3197. overFn.apply(scope || this, arguments)
  3198. }
  3199. };
  3200. var preOutFn = function(e) {
  3201. if (!e.within(this, true)) {
  3202. outFn.apply(scope || this, arguments)
  3203. }
  3204. };
  3205. this.on("mouseover", preOverFn, this.dom);
  3206. this.on("mouseout", preOutFn, this.dom);
  3207. return this
  3208. },
  3209. addClassOnOver : function(className, preventFlicker) {
  3210. this.hover(function() {
  3211. Ext.fly(this, "_internal").addClass(className)
  3212. }, function() {
  3213. Ext.fly(this, "_internal").removeClass(className)
  3214. });
  3215. return this
  3216. },
  3217. addClassOnFocus : function(className) {
  3218. this.on("focus", function() {
  3219. Ext.fly(this, "_internal").addClass(className)
  3220. }, this.dom);
  3221. this.on("blur", function() {
  3222. Ext.fly(this, "_internal").removeClass(className)
  3223. }, this.dom);
  3224. return this
  3225. },
  3226. addClassOnClick : function(className) {
  3227. var dom = this.dom;
  3228. this.on("mousedown", function() {
  3229. Ext.fly(dom, "_internal").addClass(className);
  3230. var d = Ext.getDoc();
  3231. var fn = function() {
  3232. Ext.fly(dom, "_internal").removeClass(className);
  3233. d.removeListener("mouseup", fn)
  3234. };
  3235. d.on("mouseup", fn)
  3236. });
  3237. return this
  3238. },
  3239. swallowEvent : function(eventName, preventDefault) {
  3240. var fn = function(e) {
  3241. e.stopPropagation();
  3242. if (preventDefault) {
  3243. e.preventDefault()
  3244. }
  3245. };
  3246. if (eventName instanceof Array) {
  3247. for (var i = 0, len = eventName.length; i < len; i++) {
  3248. this.on(eventName[i], fn)
  3249. }
  3250. return this
  3251. }
  3252. this.on(eventName, fn);
  3253. return this
  3254. },
  3255. parent : function(selector, returnDom) {
  3256. return this.matchNode("parentNode", "parentNode", selector,
  3257. returnDom)
  3258. },
  3259. next : function(selector, returnDom) {
  3260. return this.matchNode("nextSibling", "nextSibling", selector,
  3261. returnDom)
  3262. },
  3263. prev : function(selector, returnDom) {
  3264. return this.matchNode("previousSibling", "previousSibling",
  3265. selector, returnDom)
  3266. },
  3267. first : function(selector, returnDom) {
  3268. return this.matchNode("nextSibling", "firstChild", selector,
  3269. returnDom)
  3270. },
  3271. last : function(selector, returnDom) {
  3272. return this.matchNode("previousSibling", "lastChild", selector,
  3273. returnDom)
  3274. },
  3275. matchNode : function(dir, start, selector, returnDom) {
  3276. var n = this.dom[start];
  3277. while (n) {
  3278. if (n.nodeType == 1
  3279. && (!selector || Ext.DomQuery.is(n, selector))) {
  3280. return !returnDom ? Ext.get(n) : n
  3281. }
  3282. n = n[dir]
  3283. }
  3284. return null
  3285. },
  3286. appendChild : function(el) {
  3287. el = Ext.get(el);
  3288. el.appendTo(this);
  3289. return this
  3290. },
  3291. createChild : function(config, insertBefore, returnDom) {
  3292. config = config || {
  3293. tag : "div"
  3294. };
  3295. if (insertBefore) {
  3296. return Ext.DomHelper.insertBefore(insertBefore, config,
  3297. returnDom !== true)
  3298. }
  3299. return Ext.DomHelper[!this.dom.firstChild ? "overwrite" : "append"](
  3300. this.dom, config, returnDom !== true)
  3301. },
  3302. appendTo : function(el) {
  3303. el = Ext.getDom(el);
  3304. el.appendChild(this.dom);
  3305. return this
  3306. },
  3307. insertBefore : function(el) {
  3308. el = Ext.getDom(el);
  3309. el.parentNode.insertBefore(this.dom, el);
  3310. return this
  3311. },
  3312. insertAfter : function(el) {
  3313. el = Ext.getDom(el);
  3314. el.parentNode.insertBefore(this.dom, el.nextSibling);
  3315. return this
  3316. },
  3317. insertFirst : function(el, returnDom) {
  3318. el = el || {};
  3319. if (typeof el == "object" && !el.nodeType) {
  3320. return this.createChild(el, this.dom.firstChild, returnDom)
  3321. } else {
  3322. el = Ext.getDom(el);
  3323. this.dom.insertBefore(el, this.dom.firstChild);
  3324. return !returnDom ? Ext.get(el) : el
  3325. }
  3326. },
  3327. insertSibling : function(el, where, returnDom) {
  3328. var rt;
  3329. if (el instanceof Array) {
  3330. for (var i = 0, len = el.length; i < len; i++) {
  3331. rt = this.insertSibling(el[i], where, returnDom)
  3332. }
  3333. return rt
  3334. }
  3335. where = where ? where.toLowerCase() : "before";
  3336. el = el || {};
  3337. var refNode = where == "before" ? this.dom : this.dom.nextSibling;
  3338. if (typeof el == "object" && !el.nodeType) {
  3339. if (where == "after" && !this.dom.nextSibling) {
  3340. rt = Ext.DomHelper.append(this.dom.parentNode, el,
  3341. !returnDom)
  3342. } else {
  3343. rt = Ext.DomHelper[where == "after"
  3344. ? "insertAfter"
  3345. : "insertBefore"](this.dom, el, !returnDom)
  3346. }
  3347. } else {
  3348. rt = this.dom.parentNode.insertBefore(Ext.getDom(el), refNode);
  3349. if (!returnDom) {
  3350. rt = Ext.get(rt)
  3351. }
  3352. }
  3353. return rt
  3354. },
  3355. wrap : function(config, returnDom) {
  3356. if (!config) {
  3357. config = {
  3358. tag : "div"
  3359. }
  3360. }
  3361. var newEl = Ext.DomHelper
  3362. .insertBefore(this.dom, config, !returnDom);
  3363. newEl.dom ? newEl.dom.appendChild(this.dom) : newEl
  3364. .appendChild(this.dom);
  3365. return newEl
  3366. },
  3367. replace : function(el) {
  3368. el = Ext.get(el);
  3369. this.insertBefore(el);
  3370. el.remove();
  3371. return this
  3372. },
  3373. replaceWith : function(el) {
  3374. if (typeof el == "object" && !el.nodeType) {
  3375. el = this.insertSibling(el, "before")
  3376. } else {
  3377. el = Ext.getDom(el);
  3378. this.dom.parentNode.insertBefore(el, this.dom)
  3379. }
  3380. El.uncache(this.id);
  3381. this.dom.parentNode.removeChild(this.dom);
  3382. this.dom = el;
  3383. this.id = Ext.id(el);
  3384. El.cache[this.id] = this;
  3385. return this
  3386. },
  3387. insertHtml : function(where, html, returnEl) {
  3388. var el = Ext.DomHelper.insertHtml(where, this.dom, html);
  3389. return returnEl ? Ext.get(el) : el
  3390. },
  3391. set : function(o, useSet) {
  3392. var el = this.dom;
  3393. useSet = typeof useSet == "undefined" ? (el.setAttribute
  3394. ? true
  3395. : false) : useSet;
  3396. for (var attr in o) {
  3397. if (attr == "style" || typeof o[attr] == "function") {
  3398. continue
  3399. }
  3400. if (attr == "cls") {
  3401. el.className = o["cls"]
  3402. } else {
  3403. if (o.hasOwnProperty(attr)) {
  3404. if (useSet) {
  3405. el.setAttribute(attr, o[attr])
  3406. } else {
  3407. el[attr] = o[attr]
  3408. }
  3409. }
  3410. }
  3411. }
  3412. if (o.style) {
  3413. Ext.DomHelper.applyStyles(el, o.style)
  3414. }
  3415. return this
  3416. },
  3417. addKeyListener : function(key, fn, scope) {
  3418. var config;
  3419. if (typeof key != "object" || key instanceof Array) {
  3420. config = {
  3421. key : key,
  3422. fn : fn,
  3423. scope : scope
  3424. }
  3425. } else {
  3426. config = {
  3427. key : key.key,
  3428. shift : key.shift,
  3429. ctrl : key.ctrl,
  3430. alt : key.alt,
  3431. fn : fn,
  3432. scope : scope
  3433. }
  3434. }
  3435. return new Ext.KeyMap(this, config)
  3436. },
  3437. addKeyMap : function(config) {
  3438. return new Ext.KeyMap(this, config)
  3439. },
  3440. isScrollable : function() {
  3441. var dom = this.dom;
  3442. return dom.scrollHeight > dom.clientHeight
  3443. || dom.scrollWidth > dom.clientWidth
  3444. },
  3445. scrollTo : function(side, value, animate) {
  3446. var prop = side.toLowerCase() == "left"
  3447. ? "scrollLeft"
  3448. : "scrollTop";
  3449. if (!animate || !A) {
  3450. this.dom[prop] = value
  3451. } else {
  3452. var to = prop == "scrollLeft" ? [value, this.dom.scrollTop] : [
  3453. this.dom.scrollLeft, value];
  3454. this.anim({
  3455. scroll : {
  3456. "to" : to
  3457. }
  3458. }, this.preanim(arguments, 2), "scroll")
  3459. }
  3460. return this
  3461. },
  3462. scroll : function(direction, distance, animate) {
  3463. if (!this.isScrollable()) {
  3464. return
  3465. }
  3466. var el = this.dom;
  3467. var l = el.scrollLeft, t = el.scrollTop;
  3468. var w = el.scrollWidth, h = el.scrollHeight;
  3469. var cw = el.clientWidth, ch = el.clientHeight;
  3470. direction = direction.toLowerCase();
  3471. var scrolled = false;
  3472. var a = this.preanim(arguments, 2);
  3473. switch (direction) {
  3474. case "l" :
  3475. case "left" :
  3476. if (w - l > cw) {
  3477. var v = Math.min(l + distance, w - cw);
  3478. this.scrollTo("left", v, a);
  3479. scrolled = true
  3480. }
  3481. break;
  3482. case "r" :
  3483. case "right" :
  3484. if (l > 0) {
  3485. var v = Math.max(l - distance, 0);
  3486. this.scrollTo("left", v, a);
  3487. scrolled = true
  3488. }
  3489. break;
  3490. case "t" :
  3491. case "top" :
  3492. case "up" :
  3493. if (t > 0) {
  3494. var v = Math.max(t - distance, 0);
  3495. this.scrollTo("top", v, a);
  3496. scrolled = true
  3497. }
  3498. break;
  3499. case "b" :
  3500. case "bottom" :
  3501. case "down" :
  3502. if (h - t > ch) {
  3503. var v = Math.min(t + distance, h - ch);
  3504. this.scrollTo("top", v, a);
  3505. scrolled = true
  3506. }
  3507. break
  3508. }
  3509. return scrolled
  3510. },
  3511. translatePoints : function(x, y) {
  3512. if (typeof x == "object" || x instanceof Array) {
  3513. y = x[1];
  3514. x = x[0]
  3515. }
  3516. var p = this.getStyle("position");
  3517. var o = this.getXY();
  3518. var l = parseInt(this.getStyle("left"), 10);
  3519. var t = parseInt(this.getStyle("top"), 10);
  3520. if (isNaN(l)) {
  3521. l = (p == "relative") ? 0 : this.dom.offsetLeft
  3522. }
  3523. if (isNaN(t)) {
  3524. t = (p == "relative") ? 0 : this.dom.offsetTop
  3525. }
  3526. return {
  3527. left : (x - o[0] + l),
  3528. top : (y - o[1] + t)
  3529. }
  3530. },
  3531. getScroll : function() {
  3532. var d = this.dom, doc = document;
  3533. if (d == doc || d == doc.body) {
  3534. var l, t;
  3535. if (Ext.isIE && Ext.isStrict) {
  3536. l = doc.documentElement.scrollLeft
  3537. || (doc.body.scrollLeft || 0);
  3538. t = doc.documentElement.scrollTop
  3539. || (doc.body.scrollTop || 0)
  3540. } else {
  3541. l = window.pageXOffset || (doc.body.scrollLeft || 0);
  3542. t = window.pageYOffset || (doc.body.scrollTop || 0)
  3543. }
  3544. return {
  3545. left : l,
  3546. top : t
  3547. }
  3548. } else {
  3549. return {
  3550. left : d.scrollLeft,
  3551. top : d.scrollTop
  3552. }
  3553. }
  3554. },
  3555. getColor : function(attr, defaultValue, prefix) {
  3556. var v = this.getStyle(attr);
  3557. if (!v || v == "transparent" || v == "inherit") {
  3558. return defaultValue
  3559. }
  3560. var color = typeof prefix == "undefined" ? "#" : prefix;
  3561. if (v.substr(0, 4) == "rgb(") {
  3562. var rvs = v.slice(4, v.length - 1).split(",");
  3563. for (var i = 0; i < 3; i++) {
  3564. var h = parseInt(rvs[i]);
  3565. var s = h.toString(16);
  3566. if (h < 16) {
  3567. s = "0" + s
  3568. }
  3569. color += s
  3570. }
  3571. } else {
  3572. if (v.substr(0, 1) == "#") {
  3573. if (v.length == 4) {
  3574. for (var i = 1; i < 4; i++) {
  3575. var c = v.charAt(i);
  3576. color += c + c
  3577. }
  3578. } else {
  3579. if (v.length == 7) {
  3580. color += v.substr(1)
  3581. }
  3582. }
  3583. }
  3584. }
  3585. return (color.length > 5 ? color.toLowerCase() : defaultValue)
  3586. },
  3587. boxWrap : function(cls) {
  3588. cls = cls || "x-box";
  3589. var el = Ext.get(this.insertHtml("beforeBegin", String.format(
  3590. "<div class=\"{0}\">" + El.boxMarkup + "</div>",
  3591. cls)));
  3592. el.child("." + cls + "-mc").dom.appendChild(this.dom);
  3593. return el
  3594. },
  3595. getAttributeNS : Ext.isIE ? function(ns, name) {
  3596. var d = this.dom;
  3597. var type = typeof d[ns + ":" + name];
  3598. if (type != "undefined" && type != "unknown") {
  3599. return d[ns + ":" + name]
  3600. }
  3601. return d[name]
  3602. } : function(ns, name) {
  3603. var d = this.dom;
  3604. return d.getAttributeNS(ns, name)
  3605. || d.getAttribute(ns + ":" + name) || d.getAttribute(name)
  3606. || d[name]
  3607. },
  3608. getTextWidth : function(text, min, max) {
  3609. return (Ext.util.TextMetrics.measure(this.dom, Ext.value(text,
  3610. this.dom.innerHTML, true)).width).constrain(min
  3611. || 0, max || 1000000)
  3612. }
  3613. };
  3614. var ep = El.prototype;
  3615. ep.on = ep.addListener;
  3616. ep.mon = ep.addListener;
  3617. ep.getUpdateManager = ep.getUpdater;
  3618. ep.un = ep.removeListener;
  3619. ep.autoBoxAdjust = true;
  3620. El.unitPattern = /\d+(px|em|%|en|ex|pt|in|cm|mm|pc)$/i;
  3621. El.addUnits = function(v, defaultUnit) {
  3622. if (v === "" || v == "auto") {
  3623. return v
  3624. }
  3625. if (v === undefined) {
  3626. return ""
  3627. }
  3628. if (typeof v == "number" || !El.unitPattern.test(v)) {
  3629. return v + (defaultUnit || "px")
  3630. }
  3631. return v
  3632. };
  3633. 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>";
  3634. El.VISIBILITY = 1;
  3635. El.DISPLAY = 2;
  3636. El.borders = {
  3637. l : "border-left-width",
  3638. r : "border-right-width",
  3639. t : "border-top-width",
  3640. b : "border-bottom-width"
  3641. };
  3642. El.paddings = {
  3643. l : "padding-left",
  3644. r : "padding-right",
  3645. t : "padding-top",
  3646. b : "padding-bottom"
  3647. };
  3648. El.margins = {
  3649. l : "margin-left",
  3650. r : "margin-right",
  3651. t : "margin-top",
  3652. b : "margin-bottom"
  3653. };
  3654. El.cache = {};
  3655. var docEl;
  3656. El.get = function(el) {
  3657. var ex, elm, id;
  3658. if (!el) {
  3659. return null
  3660. }
  3661. if (typeof el == "string") {
  3662. if (!(elm = document.getElementById(el))) {
  3663. return null
  3664. }
  3665. if (ex = El.cache[el]) {
  3666. ex.dom = elm
  3667. } else {
  3668. ex = El.cache[el] = new El(elm)
  3669. }
  3670. return ex
  3671. } else {
  3672. if (el.tagName) {
  3673. if (!(id = el.id)) {
  3674. id = Ext.id(el)
  3675. }
  3676. if (ex = El.cache[id]) {
  3677. ex.dom = el
  3678. } else {
  3679. ex = El.cache[id] = new El(el)
  3680. }
  3681. return ex
  3682. } else {
  3683. if (el instanceof El) {
  3684. if (el != docEl) {
  3685. el.dom = document.getElementById(el.id) || el.dom;
  3686. El.cache[el.id] = el
  3687. }
  3688. return el
  3689. } else {
  3690. if (el.isComposite) {
  3691. return el
  3692. } else {
  3693. if (el instanceof Array) {
  3694. return El.select(el)
  3695. } else {
  3696. if (el == document) {
  3697. if (!docEl) {
  3698. var f = function() {
  3699. };
  3700. f.prototype = El.prototype;
  3701. docEl = new f();
  3702. docEl.dom = document
  3703. }
  3704. return docEl
  3705. }
  3706. }
  3707. }
  3708. }
  3709. }
  3710. }
  3711. return null
  3712. };
  3713. El.uncache = function(el) {
  3714. for (var i = 0, a = arguments, len = a.length; i < len; i++) {
  3715. if (a[i]) {
  3716. delete El.cache[a[i].id || a[i]]
  3717. }
  3718. }
  3719. };
  3720. El.garbageCollect = function() {
  3721. if (!Ext.enableGarbageCollector) {
  3722. clearInterval(El.collectorThread);
  3723. return
  3724. }
  3725. for (var eid in El.cache) {
  3726. var el = El.cache[eid], d = el.dom;
  3727. if (!d || !d.parentNode
  3728. || (!d.offsetParent && !document.getElementById(eid))) {
  3729. delete El.cache[eid];
  3730. if (d && Ext.enableListenerCollection) {
  3731. E.purgeElement(d)
  3732. }
  3733. }
  3734. }
  3735. };
  3736. El.collectorThreadId = setInterval(El.garbageCollect, 30000);
  3737. var flyFn = function() {
  3738. };
  3739. flyFn.prototype = El.prototype;
  3740. var _cls = new flyFn();
  3741. El.Flyweight = function(dom) {
  3742. this.dom = dom
  3743. };
  3744. El.Flyweight.prototype = _cls;
  3745. El.Flyweight.prototype.isFlyweight = true;
  3746. El._flyweights = {};
  3747. El.fly = function(el, named) {
  3748. named = named || "_global";
  3749. el = Ext.getDom(el);
  3750. if (!el) {
  3751. return null
  3752. }
  3753. if (!El._flyweights[named]) {
  3754. El._flyweights[named] = new El.Flyweight()
  3755. }
  3756. El._flyweights[named].dom = el;
  3757. return El._flyweights[named]
  3758. };
  3759. Ext.get = El.get;
  3760. Ext.fly = El.fly;
  3761. var noBoxAdjust = Ext.isStrict ? {
  3762. select : 1
  3763. } : {
  3764. input : 1,
  3765. select : 1,
  3766. textarea : 1
  3767. };
  3768. if (Ext.isIE || Ext.isGecko) {
  3769. noBoxAdjust["button"] = 1
  3770. }
  3771. Ext.EventManager.on(window, "unload", function() {
  3772. delete El.cache;
  3773. delete El._flyweights
  3774. })
  3775. })();
  3776. Ext.enableFx = true;
  3777. Ext.Fx = {
  3778. slideIn : function(A, C) {
  3779. var B = this.getFxEl();
  3780. C = C || {};
  3781. B.queueFx(C, function() {
  3782. A = A || "t";
  3783. this.fixDisplay();
  3784. var D = this.getFxRestore();
  3785. var I = this.getBox();
  3786. this.setSize(I);
  3787. var F = this.fxWrap(D.pos, C, "hidden");
  3788. var K = this.dom.style;
  3789. K.visibility = "visible";
  3790. K.position = "absolute";
  3791. var E = function() {
  3792. B.fxUnwrap(F, D.pos, C);
  3793. K.width = D.width;
  3794. K.height = D.height;
  3795. B.afterFx(C)
  3796. };
  3797. var J, L = {
  3798. to : [I.x, I.y]
  3799. }, H = {
  3800. to : I.width
  3801. }, G = {
  3802. to : I.height
  3803. };
  3804. switch (A.toLowerCase()) {
  3805. case "t" :
  3806. F.setSize(I.width, 0);
  3807. K.left = K.bottom = "0";
  3808. J = {
  3809. height : G
  3810. };
  3811. break;
  3812. case "l" :
  3813. F.setSize(0, I.height);
  3814. K.right = K.top = "0";
  3815. J = {
  3816. width : H
  3817. };
  3818. break;
  3819. case "r" :
  3820. F.setSize(0, I.height);
  3821. F.setX(I.right);
  3822. K.left = K.top = "0";
  3823. J = {
  3824. width : H,
  3825. points : L
  3826. };
  3827. break;
  3828. case "b" :
  3829. F.setSize(I.width, 0);
  3830. F.setY(I.bottom);
  3831. K.left = K.top = "0";
  3832. J = {
  3833. height : G,
  3834. points : L
  3835. };
  3836. break;
  3837. case "tl" :
  3838. F.setSize(0, 0);
  3839. K.right = K.bottom = "0";
  3840. J = {
  3841. width : H,
  3842. height : G
  3843. };
  3844. break;
  3845. case "bl" :
  3846. F.setSize(0, 0);
  3847. F.setY(I.y + I.height);
  3848. K.right = K.top = "0";
  3849. J = {
  3850. width : H,
  3851. height : G,
  3852. points : L
  3853. };
  3854. break;
  3855. case "br" :
  3856. F.setSize(0, 0);
  3857. F.setXY([I.right, I.bottom]);
  3858. K.left = K.top = "0";
  3859. J = {
  3860. width : H,
  3861. height : G,
  3862. points : L
  3863. };
  3864. break;
  3865. case "tr" :
  3866. F.setSize(0, 0);
  3867. F.setX(I.x + I.width);
  3868. K.left = K.bottom = "0";
  3869. J = {
  3870. width : H,
  3871. height : G,
  3872. points : L
  3873. };
  3874. break
  3875. }
  3876. this.dom.style.visibility = "visible";
  3877. F.show();
  3878. arguments.callee.anim = F.fxanim(J, C, "motion", 0.5,
  3879. "easeOut", E)
  3880. });
  3881. return this
  3882. },
  3883. slideOut : function(A, C) {
  3884. var B = this.getFxEl();
  3885. C = C || {};
  3886. B.queueFx(C, function() {
  3887. A = A || "t";
  3888. var I = this.getFxRestore();
  3889. var D = this.getBox();
  3890. this.setSize(D);
  3891. var G = this.fxWrap(I.pos, C, "visible");
  3892. var F = this.dom.style;
  3893. F.visibility = "visible";
  3894. F.position = "absolute";
  3895. G.setSize(D);
  3896. var J = function() {
  3897. if (C.useDisplay) {
  3898. B.setDisplayed(false)
  3899. } else {
  3900. B.hide()
  3901. }
  3902. B.fxUnwrap(G, I.pos, C);
  3903. F.width = I.width;
  3904. F.height = I.height;
  3905. B.afterFx(C)
  3906. };
  3907. var E, H = {
  3908. to : 0
  3909. };
  3910. switch (A.toLowerCase()) {
  3911. case "t" :
  3912. F.left = F.bottom = "0";
  3913. E = {
  3914. height : H
  3915. };
  3916. break;
  3917. case "l" :
  3918. F.right = F.top = "0";
  3919. E = {
  3920. width : H
  3921. };
  3922. break;
  3923. case "r" :
  3924. F.left = F.top = "0";
  3925. E = {
  3926. width : H,
  3927. points : {
  3928. to : [D.right, D.y]
  3929. }
  3930. };
  3931. break;
  3932. case "b" :
  3933. F.left = F.top = "0";
  3934. E = {
  3935. height : H,
  3936. points : {
  3937. to : [D.x, D.bottom]
  3938. }
  3939. };
  3940. break;
  3941. case "tl" :
  3942. F.right = F.bottom = "0";
  3943. E = {
  3944. width : H,
  3945. height : H
  3946. };
  3947. break;
  3948. case "bl" :
  3949. F.right = F.top = "0";
  3950. E = {
  3951. width : H,
  3952. height : H,
  3953. points : {
  3954. to : [D.x, D.bottom]
  3955. }
  3956. };
  3957. break;
  3958. case "br" :
  3959. F.left = F.top = "0";
  3960. E = {
  3961. width : H,
  3962. height : H,
  3963. points : {
  3964. to : [D.x + D.width, D.bottom]
  3965. }
  3966. };
  3967. break;
  3968. case "tr" :
  3969. F.left = F.bottom = "0";
  3970. E = {
  3971. width : H,
  3972. height : H,
  3973. points : {
  3974. to : [D.right, D.y]
  3975. }
  3976. };
  3977. break
  3978. }
  3979. arguments.callee.anim = G.fxanim(E, C, "motion", 0.5,
  3980. "easeOut", J)
  3981. });
  3982. return this
  3983. },
  3984. puff : function(B) {
  3985. var A = this.getFxEl();
  3986. B = B || {};
  3987. A.queueFx(B, function() {
  3988. this.clearOpacity();
  3989. this.show();
  3990. var F = this.getFxRestore();
  3991. var D = this.dom.style;
  3992. var G = function() {
  3993. if (B.useDisplay) {
  3994. A.setDisplayed(false)
  3995. } else {
  3996. A.hide()
  3997. }
  3998. A.clearOpacity();
  3999. A.setPositioning(F.pos);
  4000. D.width = F.width;
  4001. D.height = F.height;
  4002. D.fontSize = "";
  4003. A.afterFx(B)
  4004. };
  4005. var E = this.getWidth();
  4006. var C = this.getHeight();
  4007. arguments.callee.anim = this.fxanim({
  4008. width : {
  4009. to : this.adjustWidth(E * 2)
  4010. },
  4011. height : {
  4012. to : this.adjustHeight(C * 2)
  4013. },
  4014. points : {
  4015. by : [-(E * 0.5), -(C * 0.5)]
  4016. },
  4017. opacity : {
  4018. to : 0
  4019. },
  4020. fontSize : {
  4021. to : 200,
  4022. unit : "%"
  4023. }
  4024. }, B, "motion", 0.5, "easeOut", G)
  4025. });
  4026. return this
  4027. },
  4028. switchOff : function(B) {
  4029. var A = this.getFxEl();
  4030. B = B || {};
  4031. A.queueFx(B, function() {
  4032. this.clearOpacity();
  4033. this.clip();
  4034. var D = this.getFxRestore();
  4035. var C = this.dom.style;
  4036. var E = function() {
  4037. if (B.useDisplay) {
  4038. A.setDisplayed(false)
  4039. } else {
  4040. A.hide()
  4041. }
  4042. A.clearOpacity();
  4043. A.setPositioning(D.pos);
  4044. C.width = D.width;
  4045. C.height = D.height;
  4046. A.afterFx(B)
  4047. };
  4048. this.fxanim({
  4049. opacity : {
  4050. to : 0.3
  4051. }
  4052. }, null, null, 0.1, null, function() {
  4053. this.clearOpacity();
  4054. (function() {
  4055. this.fxanim({
  4056. height : {
  4057. to : 1
  4058. },
  4059. points : {
  4060. by : [
  4061. 0,
  4062. this.getHeight()
  4063. * 0.5]
  4064. }
  4065. }, B, "motion", 0.3, "easeIn", E)
  4066. }).defer(100, this)
  4067. })
  4068. });
  4069. return this
  4070. },
  4071. highlight : function(A, C) {
  4072. var B = this.getFxEl();
  4073. C = C || {};
  4074. B.queueFx(C, function() {
  4075. A = A || "ffff9c";
  4076. var D = C.attr || "backgroundColor";
  4077. this.clearOpacity();
  4078. this.show();
  4079. var G = this.getColor(D);
  4080. var H = this.dom.style[D];
  4081. var F = (C.endColor || G) || "ffffff";
  4082. var I = function() {
  4083. B.dom.style[D] = H;
  4084. B.afterFx(C)
  4085. };
  4086. var E = {};
  4087. E[D] = {
  4088. from : A,
  4089. to : F
  4090. };
  4091. arguments.callee.anim = this.fxanim(E, C, "color", 1,
  4092. "easeIn", I)
  4093. });
  4094. return this
  4095. },
  4096. frame : function(A, C, D) {
  4097. var B = this.getFxEl();
  4098. D = D || {};
  4099. B.queueFx(D, function() {
  4100. A = A || "#C3DAF9";
  4101. if (A.length == 6) {
  4102. A = "#" + A
  4103. }
  4104. C = C || 1;
  4105. var G = D.duration || 1;
  4106. this.show();
  4107. var E = this.getBox();
  4108. var F = function() {
  4109. var H = Ext.getBody().createChild({
  4110. style : {
  4111. visbility : "hidden",
  4112. position : "absolute",
  4113. "z-index" : "35000",
  4114. border : "0px solid " + A
  4115. }
  4116. });
  4117. var I = Ext.isBorderBox ? 2 : 1;
  4118. H.animate({
  4119. top : {
  4120. from : E.y,
  4121. to : E.y - 20
  4122. },
  4123. left : {
  4124. from : E.x,
  4125. to : E.x - 20
  4126. },
  4127. borderWidth : {
  4128. from : 0,
  4129. to : 10
  4130. },
  4131. opacity : {
  4132. from : 1,
  4133. to : 0
  4134. },
  4135. height : {
  4136. from : E.height,
  4137. to : (E.height + (20 * I))
  4138. },
  4139. width : {
  4140. from : E.width,
  4141. to : (E.width + (20 * I))
  4142. }
  4143. }, G, function() {
  4144. H.remove();
  4145. if (--C > 0) {
  4146. F()
  4147. } else {
  4148. B.afterFx(D)
  4149. }
  4150. })
  4151. };
  4152. F.call(this)
  4153. });
  4154. return this
  4155. },
  4156. pause : function(C) {
  4157. var A = this.getFxEl();
  4158. var B = {};
  4159. A.queueFx(B, function() {
  4160. setTimeout(function() {
  4161. A.afterFx(B)
  4162. }, C * 1000)
  4163. });
  4164. return this
  4165. },
  4166. fadeIn : function(B) {
  4167. var A = this.getFxEl();
  4168. B = B || {};
  4169. A.queueFx(B, function() {
  4170. this.setOpacity(0);
  4171. this.fixDisplay();
  4172. this.dom.style.visibility = "visible";
  4173. var C = B.endOpacity || 1;
  4174. arguments.callee.anim = this.fxanim({
  4175. opacity : {
  4176. to : C
  4177. }
  4178. }, B, null, 0.5, "easeOut", function() {
  4179. if (C == 1) {
  4180. this.clearOpacity()
  4181. }
  4182. A.afterFx(B)
  4183. })
  4184. });
  4185. return this
  4186. },
  4187. fadeOut : function(B) {
  4188. var A = this.getFxEl();
  4189. B = B || {};
  4190. A.queueFx(B, function() {
  4191. arguments.callee.anim = this.fxanim({
  4192. opacity : {
  4193. to : B.endOpacity || 0
  4194. }
  4195. }, B, null, 0.5, "easeOut", function() {
  4196. if (this.visibilityMode == Ext.Element.DISPLAY
  4197. || B.useDisplay) {
  4198. this.dom.style.display = "none"
  4199. } else {
  4200. this.dom.style.visibility = "hidden"
  4201. }
  4202. this.clearOpacity();
  4203. A.afterFx(B)
  4204. })
  4205. });
  4206. return this
  4207. },
  4208. scale : function(A, B, C) {
  4209. this.shift(Ext.apply({}, C, {
  4210. width : A,
  4211. height : B
  4212. }));
  4213. return this
  4214. },
  4215. shift : function(B) {
  4216. var A = this.getFxEl();
  4217. B = B || {};
  4218. A.queueFx(B, function() {
  4219. var E = {}, D = B.width, F = B.height, C = B.x, H = B.y, G = B.opacity;
  4220. if (D !== undefined) {
  4221. E.width = {
  4222. to : this.adjustWidth(D)
  4223. }
  4224. }
  4225. if (F !== undefined) {
  4226. E.height = {
  4227. to : this.adjustHeight(F)
  4228. }
  4229. }
  4230. if (C !== undefined || H !== undefined) {
  4231. E.points = {
  4232. to : [C !== undefined ? C : this.getX(),
  4233. H !== undefined ? H : this.getY()]
  4234. }
  4235. }
  4236. if (G !== undefined) {
  4237. E.opacity = {
  4238. to : G
  4239. }
  4240. }
  4241. if (B.xy !== undefined) {
  4242. E.points = {
  4243. to : B.xy
  4244. }
  4245. }
  4246. arguments.callee.anim = this.fxanim(E, B, "motion", 0.35,
  4247. "easeOut", function() {
  4248. A.afterFx(B)
  4249. })
  4250. });
  4251. return this
  4252. },
  4253. ghost : function(A, C) {
  4254. var B = this.getFxEl();
  4255. C = C || {};
  4256. B.queueFx(C, function() {
  4257. A = A || "b";
  4258. var H = this.getFxRestore();
  4259. var E = this.getWidth(), G = this.getHeight();
  4260. var F = this.dom.style;
  4261. var J = function() {
  4262. if (C.useDisplay) {
  4263. B.setDisplayed(false)
  4264. } else {
  4265. B.hide()
  4266. }
  4267. B.clearOpacity();
  4268. B.setPositioning(H.pos);
  4269. F.width = H.width;
  4270. F.height = H.height;
  4271. B.afterFx(C)
  4272. };
  4273. var D = {
  4274. opacity : {
  4275. to : 0
  4276. },
  4277. points : {}
  4278. }, I = D.points;
  4279. switch (A.toLowerCase()) {
  4280. case "t" :
  4281. I.by = [0, -G];
  4282. break;
  4283. case "l" :
  4284. I.by = [-E, 0];
  4285. break;
  4286. case "r" :
  4287. I.by = [E, 0];
  4288. break;
  4289. case "b" :
  4290. I.by = [0, G];
  4291. break;
  4292. case "tl" :
  4293. I.by = [-E, -G];
  4294. break;
  4295. case "bl" :
  4296. I.by = [-E, G];
  4297. break;
  4298. case "br" :
  4299. I.by = [E, G];
  4300. break;
  4301. case "tr" :
  4302. I.by = [E, -G];
  4303. break
  4304. }
  4305. arguments.callee.anim = this.fxanim(D, C, "motion", 0.5,
  4306. "easeOut", J)
  4307. });
  4308. return this
  4309. },
  4310. syncFx : function() {
  4311. this.fxDefaults = Ext.apply(this.fxDefaults || {}, {
  4312. block : false,
  4313. concurrent : true,
  4314. stopFx : false
  4315. });
  4316. return this
  4317. },
  4318. sequenceFx : function() {
  4319. this.fxDefaults = Ext.apply(this.fxDefaults || {}, {
  4320. block : false,
  4321. concurrent : false,
  4322. stopFx : false
  4323. });
  4324. return this
  4325. },
  4326. nextFx : function() {
  4327. var A = this.fxQueue[0];
  4328. if (A) {
  4329. A.call(this)
  4330. }
  4331. },
  4332. hasActiveFx : function() {
  4333. return this.fxQueue && this.fxQueue[0]
  4334. },
  4335. stopFx : function() {
  4336. if (this.hasActiveFx()) {
  4337. var A = this.fxQueue[0];
  4338. if (A && A.anim && A.anim.isAnimated()) {
  4339. this.fxQueue = [A];
  4340. A.anim.stop(true)
  4341. }
  4342. }
  4343. return this
  4344. },
  4345. beforeFx : function(A) {
  4346. if (this.hasActiveFx() && !A.concurrent) {
  4347. if (A.stopFx) {
  4348. this.stopFx();
  4349. return true
  4350. }
  4351. return false
  4352. }
  4353. return true
  4354. },
  4355. hasFxBlock : function() {
  4356. var A = this.fxQueue;
  4357. return A && A[0] && A[0].block
  4358. },
  4359. queueFx : function(C, A) {
  4360. if (!this.fxQueue) {
  4361. this.fxQueue = []
  4362. }
  4363. if (!this.hasFxBlock()) {
  4364. Ext.applyIf(C, this.fxDefaults);
  4365. if (!C.concurrent) {
  4366. var B = this.beforeFx(C);
  4367. A.block = C.block;
  4368. this.fxQueue.push(A);
  4369. if (B) {
  4370. this.nextFx()
  4371. }
  4372. } else {
  4373. A.call(this)
  4374. }
  4375. }
  4376. return this
  4377. },
  4378. fxWrap : function(F, D, C) {
  4379. var B;
  4380. if (!D.wrap || !(B = Ext.get(D.wrap))) {
  4381. var A;
  4382. if (D.fixPosition) {
  4383. A = this.getXY()
  4384. }
  4385. var E = document.createElement("div");
  4386. E.style.visibility = C;
  4387. B = Ext.get(this.dom.parentNode.insertBefore(E, this.dom));
  4388. B.setPositioning(F);
  4389. if (B.getStyle("position") == "static") {
  4390. B.position("relative")
  4391. }
  4392. this.clearPositioning("auto");
  4393. B.clip();
  4394. B.dom.appendChild(this.dom);
  4395. if (A) {
  4396. B.setXY(A)
  4397. }
  4398. }
  4399. return B
  4400. },
  4401. fxUnwrap : function(A, C, B) {
  4402. this.clearPositioning();
  4403. this.setPositioning(C);
  4404. if (!B.wrap) {
  4405. A.dom.parentNode.insertBefore(this.dom, A.dom);
  4406. A.remove()
  4407. }
  4408. },
  4409. getFxRestore : function() {
  4410. var A = this.dom.style;
  4411. return {
  4412. pos : this.getPositioning(),
  4413. width : A.width,
  4414. height : A.height
  4415. }
  4416. },
  4417. afterFx : function(A) {
  4418. if (A.afterStyle) {
  4419. this.applyStyles(A.afterStyle)
  4420. }
  4421. if (A.afterCls) {
  4422. this.addClass(A.afterCls)
  4423. }
  4424. if (A.remove === true) {
  4425. this.remove()
  4426. }
  4427. Ext.callback(A.callback, A.scope, [this]);
  4428. if (!A.concurrent) {
  4429. this.fxQueue.shift();
  4430. this.nextFx()
  4431. }
  4432. },
  4433. getFxEl : function() {
  4434. return Ext.get(this.dom)
  4435. },
  4436. fxanim : function(D, E, B, F, C, A) {
  4437. B = B || "run";
  4438. E = E || {};
  4439. var G = Ext.lib.Anim[B](this.dom, D, (E.duration || F) || 0.35,
  4440. (E.easing || C) || "easeOut", function() {
  4441. Ext.callback(A, this)
  4442. }, this);
  4443. E.anim = G;
  4444. return G
  4445. }
  4446. };
  4447. Ext.Fx.resize = Ext.Fx.scale;
  4448. Ext.apply(Ext.Element.prototype, Ext.Fx);
  4449. Ext.CompositeElement = function(A) {
  4450. this.elements = [];
  4451. this.addElements(A)
  4452. };
  4453. Ext.CompositeElement.prototype = {
  4454. isComposite : true,
  4455. addElements : function(E) {
  4456. if (!E) {
  4457. return this
  4458. }
  4459. if (typeof E == "string") {
  4460. E = Ext.Element.selectorFunction(E)
  4461. }
  4462. var D = this.elements;
  4463. var B = D.length - 1;
  4464. for (var C = 0, A = E.length; C < A; C++) {
  4465. D[++B] = Ext.get(E[C])
  4466. }
  4467. return this
  4468. },
  4469. fill : function(A) {
  4470. this.elements = [];
  4471. this.add(A);
  4472. return this
  4473. },
  4474. filter : function(A) {
  4475. var B = [];
  4476. this.each(function(C) {
  4477. if (C.is(A)) {
  4478. B[B.length] = C.dom
  4479. }
  4480. });
  4481. this.fill(B);
  4482. return this
  4483. },
  4484. invoke : function(E, B) {
  4485. var D = this.elements;
  4486. for (var C = 0, A = D.length; C < A; C++) {
  4487. Ext.Element.prototype[E].apply(D[C], B)
  4488. }
  4489. return this
  4490. },
  4491. add : function(A) {
  4492. if (typeof A == "string") {
  4493. this.addElements(Ext.Element.selectorFunction(A))
  4494. } else {
  4495. if (A.length !== undefined) {
  4496. this.addElements(A)
  4497. } else {
  4498. this.addElements([A])
  4499. }
  4500. }
  4501. return this
  4502. },
  4503. each : function(E, D) {
  4504. var C = this.elements;
  4505. for (var B = 0, A = C.length; B < A; B++) {
  4506. if (E.call(D || C[B], C[B], this, B) === false) {
  4507. break
  4508. }
  4509. }
  4510. return this
  4511. },
  4512. item : function(A) {
  4513. return this.elements[A] || null
  4514. },
  4515. first : function() {
  4516. return this.item(0)
  4517. },
  4518. last : function() {
  4519. return this.item(this.elements.length - 1)
  4520. },
  4521. getCount : function() {
  4522. return this.elements.length
  4523. },
  4524. contains : function(A) {
  4525. return this.indexOf(A) !== -1
  4526. },
  4527. indexOf : function(A) {
  4528. return this.elements.indexOf(Ext.get(A))
  4529. },
  4530. removeElement : function(D, F) {
  4531. if (D instanceof Array) {
  4532. for (var C = 0, A = D.length; C < A; C++) {
  4533. this.removeElement(D[C])
  4534. }
  4535. return this
  4536. }
  4537. var B = typeof D == "number" ? D : this.indexOf(D);
  4538. if (B !== -1 && this.elements[B]) {
  4539. if (F) {
  4540. var E = this.elements[B];
  4541. if (E.dom) {
  4542. E.remove()
  4543. } else {
  4544. Ext.removeNode(E)
  4545. }
  4546. }
  4547. this.elements.splice(B, 1)
  4548. }
  4549. return this
  4550. },
  4551. replaceElement : function(D, C, A) {
  4552. var B = typeof D == "number" ? D : this.indexOf(D);
  4553. if (B !== -1) {
  4554. if (A) {
  4555. this.elements[B].replaceWith(C)
  4556. } else {
  4557. this.elements.splice(B, 1, Ext.get(C))
  4558. }
  4559. }
  4560. return this
  4561. },
  4562. clear : function() {
  4563. this.elements = []
  4564. }
  4565. };
  4566. (function() {
  4567. Ext.CompositeElement.createCall = function(B, C) {
  4568. if (!B[C]) {
  4569. B[C] = function() {
  4570. return this.invoke(C, arguments)
  4571. }
  4572. }
  4573. };
  4574. for (var A in Ext.Element.prototype) {
  4575. if (typeof Ext.Element.prototype[A] == "function") {
  4576. Ext.CompositeElement.createCall(Ext.CompositeElement.prototype, A)
  4577. }
  4578. }
  4579. })();
  4580. Ext.CompositeElementLite = function(A) {
  4581. Ext.CompositeElementLite.superclass.constructor.call(this, A);
  4582. this.el = new Ext.Element.Flyweight()
  4583. };
  4584. Ext.extend(Ext.CompositeElementLite, Ext.CompositeElement, {
  4585. addElements : function(E) {
  4586. if (E) {
  4587. if (E instanceof Array) {
  4588. this.elements = this.elements.concat(E)
  4589. } else {
  4590. var D = this.elements;
  4591. var B = D.length - 1;
  4592. for (var C = 0, A = E.length; C < A; C++) {
  4593. D[++B] = E[C]
  4594. }
  4595. }
  4596. }
  4597. return this
  4598. },
  4599. invoke : function(F, B) {
  4600. var D = this.elements;
  4601. var E = this.el;
  4602. for (var C = 0, A = D.length; C < A; C++) {
  4603. E.dom = D[C];
  4604. Ext.Element.prototype[F].apply(E, B)
  4605. }
  4606. return this
  4607. },
  4608. item : function(A) {
  4609. if (!this.elements[A]) {
  4610. return null
  4611. }
  4612. this.el.dom = this.elements[A];
  4613. return this.el
  4614. },
  4615. addListener : function(B, G, F, E) {
  4616. var D = this.elements;
  4617. for (var C = 0, A = D.length; C < A; C++) {
  4618. Ext.EventManager.on(D[C], B, G, F || D[C], E)
  4619. }
  4620. return this
  4621. },
  4622. each : function(F, E) {
  4623. var C = this.elements;
  4624. var D = this.el;
  4625. for (var B = 0, A = C.length; B < A; B++) {
  4626. D.dom = C[B];
  4627. if (F.call(E || D, D, this, B) === false) {
  4628. break
  4629. }
  4630. }
  4631. return this
  4632. },
  4633. indexOf : function(A) {
  4634. return this.elements.indexOf(Ext.getDom(A))
  4635. },
  4636. replaceElement : function(D, C, A) {
  4637. var B = typeof D == "number" ? D : this.indexOf(D);
  4638. if (B !== -1) {
  4639. C = Ext.getDom(C);
  4640. if (A) {
  4641. var E = this.elements[B];
  4642. E.parentNode.insertBefore(C, E);
  4643. Ext.removeNode(E)
  4644. }
  4645. this.elements.splice(B, 1, C)
  4646. }
  4647. return this
  4648. }
  4649. });
  4650. Ext.CompositeElementLite.prototype.on = Ext.CompositeElementLite.prototype.addListener;
  4651. if (Ext.DomQuery) {
  4652. Ext.Element.selectorFunction = Ext.DomQuery.select
  4653. }
  4654. Ext.Element.select = function(A, D, B) {
  4655. var C;
  4656. if (typeof A == "string") {
  4657. C = Ext.Element.selectorFunction(A, B)
  4658. } else {
  4659. if (A.length !== undefined) {
  4660. C = A
  4661. } else {
  4662. throw "Invalid selector"
  4663. }
  4664. }
  4665. if (D === true) {
  4666. return new Ext.CompositeElement(C)
  4667. } else {
  4668. return new Ext.CompositeElementLite(C)
  4669. }
  4670. };
  4671. Ext.select = Ext.Element.select;
  4672. Ext.data.Connection = function(A) {
  4673. Ext.apply(this, A);
  4674. this.addEvents("beforerequest", "requestcomplete", "requestexception");
  4675. Ext.data.Connection.superclass.constructor.call(this)
  4676. };
  4677. Ext.extend(Ext.data.Connection, Ext.util.Observable, {
  4678. timeout : 30000,
  4679. autoAbort : false,
  4680. disableCaching : true,
  4681. request : function(E) {
  4682. if (this.fireEvent("beforerequest", this, E) !== false) {
  4683. var C = E.params;
  4684. if (typeof C == "function") {
  4685. C = C.call(E.scope || window, E)
  4686. }
  4687. if (typeof C == "object") {
  4688. C = Ext.urlEncode(C)
  4689. }
  4690. if (this.extraParams) {
  4691. var G = Ext.urlEncode(this.extraParams);
  4692. C = C ? (C + "&" + G) : G
  4693. }
  4694. var B = E.url || this.url;
  4695. if (typeof B == "function") {
  4696. B = B.call(E.scope || window, E)
  4697. }
  4698. if (E.form) {
  4699. var D = Ext.getDom(E.form);
  4700. B = B || D.action;
  4701. var I = D.getAttribute("enctype");
  4702. if (E.isUpload
  4703. || (I && I.toLowerCase() == "multipart/form-data")) {
  4704. return this.doFormUpload(E, C, B)
  4705. }
  4706. var H = Ext.lib.Ajax.serializeForm(D);
  4707. C = C ? (C + "&" + H) : H
  4708. }
  4709. var J = E.headers;
  4710. if (this.defaultHeaders) {
  4711. J = Ext.apply(J || {}, this.defaultHeaders);
  4712. if (!E.headers) {
  4713. E.headers = J
  4714. }
  4715. }
  4716. var F = {
  4717. success : this.handleResponse,
  4718. failure : this.handleFailure,
  4719. scope : this,
  4720. argument : {
  4721. options : E
  4722. },
  4723. timeout : this.timeout
  4724. };
  4725. var A = E.method || this.method || (C ? "POST" : "GET");
  4726. if (A == "GET"
  4727. && (this.disableCaching && E.disableCaching !== false)
  4728. || E.disableCaching === true) {
  4729. B += (B.indexOf("?") != -1 ? "&" : "?") + "_dc="
  4730. + (allGetServerTime().getTime())
  4731. }
  4732. if (typeof E.autoAbort == "boolean") {
  4733. if (E.autoAbort) {
  4734. this.abort()
  4735. }
  4736. } else {
  4737. if (this.autoAbort !== false) {
  4738. this.abort()
  4739. }
  4740. }
  4741. if ((A == "GET" && C) || E.xmlData || E.jsonData) {
  4742. B += (B.indexOf("?") != -1 ? "&" : "?") + C;
  4743. C = ""
  4744. }
  4745. this.transId = Ext.lib.Ajax.request(A, B, F, C, E);
  4746. return this.transId
  4747. } else {
  4748. Ext.callback(E.callback, E.scope, [E, null, null]);
  4749. return null
  4750. }
  4751. },
  4752. isLoading : function(A) {
  4753. if (A) {
  4754. return Ext.lib.Ajax.isCallInProgress(A)
  4755. } else {
  4756. return this.transId ? true : false
  4757. }
  4758. },
  4759. abort : function(A) {
  4760. if (A || this.isLoading()) {
  4761. Ext.lib.Ajax.abort(A || this.transId)
  4762. }
  4763. },
  4764. handleResponse : function(A) {
  4765. this.transId = false;
  4766. var B = A.argument.options;
  4767. A.argument = B ? B.argument : null;
  4768. this.fireEvent("requestcomplete", this, A, B);
  4769. Ext.callback(B.success, B.scope, [A, B]);
  4770. Ext.callback(B.callback, B.scope, [B, true, A])
  4771. },
  4772. handleFailure : function(A, C) {
  4773. this.transId = false;
  4774. var B = A.argument.options;
  4775. A.argument = B ? B.argument : null;
  4776. this.fireEvent("requestexception", this, A, B, C);
  4777. Ext.callback(B.failure, B.scope, [A, B]);
  4778. Ext.callback(B.callback, B.scope, [B, false, A])
  4779. },
  4780. doFormUpload : function(E, A, B) {
  4781. var C = Ext.id();
  4782. var F = document.createElement("iframe");
  4783. F.id = C;
  4784. F.name = C;
  4785. F.className = "x-hidden";
  4786. if (Ext.isIE) {
  4787. F.src = Ext.SSL_SECURE_URL
  4788. }
  4789. document.body.appendChild(F);
  4790. if (Ext.isIE) {
  4791. document.frames[C].name = C
  4792. }
  4793. var D = Ext.getDom(E.form);
  4794. D.target = C;
  4795. D.method = "POST";
  4796. D.enctype = D.encoding = "multipart/form-data";
  4797. if (B) {
  4798. D.action = B
  4799. }
  4800. var L, J;
  4801. if (A) {
  4802. L = [];
  4803. A = Ext.urlDecode(A, false);
  4804. for (var H in A) {
  4805. if (A.hasOwnProperty(H)) {
  4806. J = document.createElement("input");
  4807. J.type = "hidden";
  4808. J.name = H;
  4809. J.value = A[H];
  4810. D.appendChild(J);
  4811. L.push(J)
  4812. }
  4813. }
  4814. }
  4815. function G() {
  4816. var M = {
  4817. responseText : "",
  4818. responseXML : null
  4819. };
  4820. M.argument = E ? E.argument : null;
  4821. try {
  4822. var O;
  4823. if (Ext.isIE) {
  4824. O = F.contentWindow.document
  4825. } else {
  4826. O = (F.contentDocument || window.frames[C].document)
  4827. }
  4828. if (O && O.body) {
  4829. M.responseText = O.body.innerHTML
  4830. }
  4831. if (O && O.XMLDocument) {
  4832. M.responseXML = O.XMLDocument
  4833. } else {
  4834. M.responseXML = O
  4835. }
  4836. } catch (N) {
  4837. }
  4838. Ext.EventManager.removeListener(F, "load", G, this);
  4839. this.fireEvent("requestcomplete", this, M, E);
  4840. Ext.callback(E.success, E.scope, [M, E]);
  4841. Ext.callback(E.callback, E.scope, [E, true, M]);
  4842. setTimeout(function() {
  4843. Ext.removeNode(F)
  4844. }, 100)
  4845. }
  4846. Ext.EventManager.on(F, "load", G, this);
  4847. D.submit();
  4848. if (L) {
  4849. for (var I = 0, K = L.length; I < K; I++) {
  4850. Ext.removeNode(L[I])
  4851. }
  4852. }
  4853. }
  4854. });
  4855. Ext.Ajax = new Ext.data.Connection({
  4856. autoAbort : false,
  4857. serializeForm : function(A) {
  4858. return Ext.lib.Ajax.serializeForm(A)
  4859. }
  4860. });
  4861. Ext.Updater = function(B, A) {
  4862. B = Ext.get(B);
  4863. if (!A && B.updateManager) {
  4864. return B.updateManager
  4865. }
  4866. this.el = B;
  4867. this.defaultUrl = null;
  4868. this.addEvents("beforeupdate", "update", "failure");
  4869. var C = Ext.Updater.defaults;
  4870. this.sslBlankUrl = C.sslBlankUrl;
  4871. this.disableCaching = C.disableCaching;
  4872. this.indicatorText = C.indicatorText;
  4873. this.showLoadIndicator = C.showLoadIndicator;
  4874. this.timeout = C.timeout;
  4875. this.loadScripts = C.loadScripts;
  4876. this.transaction = null;
  4877. this.autoRefreshProcId = null;
  4878. this.refreshDelegate = this.refresh.createDelegate(this);
  4879. this.updateDelegate = this.update.createDelegate(this);
  4880. this.formUpdateDelegate = this.formUpdate.createDelegate(this);
  4881. if (!this.renderer) {
  4882. this.renderer = new Ext.Updater.BasicRenderer()
  4883. }
  4884. Ext.Updater.superclass.constructor.call(this)
  4885. };
  4886. Ext.extend(Ext.Updater, Ext.util.Observable, {
  4887. getEl : function() {
  4888. return this.el
  4889. },
  4890. update : function(B, F, H, D) {
  4891. if (this.fireEvent("beforeupdate", this.el, B, F) !== false) {
  4892. var G = this.method, A, C;
  4893. if (typeof B == "object") {
  4894. A = B;
  4895. B = A.url;
  4896. F = F || A.params;
  4897. H = H || A.callback;
  4898. D = D || A.discardUrl;
  4899. C = A.scope;
  4900. if (typeof A.method != "undefined") {
  4901. G = A.method
  4902. }
  4903. if (typeof A.nocache != "undefined") {
  4904. this.disableCaching = A.nocache
  4905. }
  4906. if (typeof A.text != "undefined") {
  4907. this.indicatorText = "<div class=\"loading-indicator\">"
  4908. + A.text + "</div>"
  4909. }
  4910. if (typeof A.scripts != "undefined") {
  4911. this.loadScripts = A.scripts
  4912. }
  4913. if (typeof A.timeout != "undefined") {
  4914. this.timeout = A.timeout
  4915. }
  4916. }
  4917. this.showLoading();
  4918. if (!D) {
  4919. this.defaultUrl = B
  4920. }
  4921. if (typeof B == "function") {
  4922. B = B.call(this)
  4923. }
  4924. G = G || (F ? "POST" : "GET");
  4925. if (G == "GET") {
  4926. B = this.prepareUrl(B)
  4927. }
  4928. var E = Ext.apply(A || {}, {
  4929. url : B,
  4930. params : (typeof F == "function" && C) ? F
  4931. .createDelegate(C) : F,
  4932. success : this.processSuccess,
  4933. failure : this.processFailure,
  4934. scope : this,
  4935. callback : undefined,
  4936. timeout : (this.timeout * 1000),
  4937. argument : {
  4938. "options" : A,
  4939. "url" : B,
  4940. "form" : null,
  4941. "callback" : H,
  4942. "scope" : C || window,
  4943. "params" : F
  4944. }
  4945. });
  4946. this.transaction = Ext.Ajax.request(E)
  4947. }
  4948. },
  4949. formUpdate : function(C, A, B, D) {
  4950. if (this.fireEvent("beforeupdate", this.el, C, A) !== false) {
  4951. if (typeof A == "function") {
  4952. A = A.call(this)
  4953. }
  4954. C = Ext.getDom(C);
  4955. this.transaction = Ext.Ajax.request({
  4956. form : C,
  4957. url : A,
  4958. success : this.processSuccess,
  4959. failure : this.processFailure,
  4960. scope : this,
  4961. timeout : (this.timeout * 1000),
  4962. argument : {
  4963. "url" : A,
  4964. "form" : C,
  4965. "callback" : D,
  4966. "reset" : B
  4967. }
  4968. });
  4969. this.showLoading.defer(1, this)
  4970. }
  4971. },
  4972. refresh : function(A) {
  4973. if (this.defaultUrl == null) {
  4974. return
  4975. }
  4976. this.update(this.defaultUrl, null, A, true)
  4977. },
  4978. startAutoRefresh : function(B, C, D, E, A) {
  4979. if (A) {
  4980. this.update(C || this.defaultUrl, D, E, true)
  4981. }
  4982. if (this.autoRefreshProcId) {
  4983. clearInterval(this.autoRefreshProcId)
  4984. }
  4985. this.autoRefreshProcId = setInterval(this.update
  4986. .createDelegate(this, [C || this.defaultUrl, D,
  4987. E, true]), B * 1000)
  4988. },
  4989. stopAutoRefresh : function() {
  4990. if (this.autoRefreshProcId) {
  4991. clearInterval(this.autoRefreshProcId);
  4992. delete this.autoRefreshProcId
  4993. }
  4994. },
  4995. isAutoRefreshing : function() {
  4996. return this.autoRefreshProcId ? true : false
  4997. },
  4998. showLoading : function() {
  4999. if (this.showLoadIndicator) {
  5000. this.el.update(this.indicatorText)
  5001. }
  5002. },
  5003. prepareUrl : function(B) {
  5004. if (this.disableCaching) {
  5005. var A = "_dc=" + (allGetServerTime().getTime());
  5006. if (B.indexOf("?") !== -1) {
  5007. B += "&" + A
  5008. } else {
  5009. B += "?" + A
  5010. }
  5011. }
  5012. return B
  5013. },
  5014. processSuccess : function(A) {
  5015. this.transaction = null;
  5016. if (A.argument.form && A.argument.reset) {
  5017. try {
  5018. A.argument.form.reset()
  5019. } catch (B) {
  5020. }
  5021. }
  5022. if (this.loadScripts) {
  5023. this.renderer.render(this.el, A, this, this.updateComplete
  5024. .createDelegate(this, [A]))
  5025. } else {
  5026. this.renderer.render(this.el, A, this);
  5027. this.updateComplete(A)
  5028. }
  5029. },
  5030. updateComplete : function(A) {
  5031. this.fireEvent("update", this.el, A);
  5032. if (typeof A.argument.callback == "function") {
  5033. A.argument.callback.call(A.argument.scope, this.el, true,
  5034. A, A.argument.options)
  5035. }
  5036. },
  5037. processFailure : function(A) {
  5038. this.transaction = null;
  5039. this.fireEvent("failure", this.el, A);
  5040. if (typeof A.argument.callback == "function") {
  5041. A.argument.callback.call(A.argument.scope, this.el, false,
  5042. A, A.argument.options)
  5043. }
  5044. },
  5045. setRenderer : function(A) {
  5046. this.renderer = A
  5047. },
  5048. getRenderer : function() {
  5049. return this.renderer
  5050. },
  5051. setDefaultUrl : function(A) {
  5052. this.defaultUrl = A
  5053. },
  5054. abort : function() {
  5055. if (this.transaction) {
  5056. Ext.Ajax.abort(this.transaction)
  5057. }
  5058. },
  5059. isUpdating : function() {
  5060. if (this.transaction) {
  5061. return Ext.Ajax.isLoading(this.transaction)
  5062. }
  5063. return false
  5064. }
  5065. });
  5066. Ext.Updater.defaults = {
  5067. timeout : 30,
  5068. loadScripts : false,
  5069. sslBlankUrl : (Ext.SSL_SECURE_URL || "javascript:false"),
  5070. disableCaching : false,
  5071. showLoadIndicator : true,
  5072. indicatorText : "<div class=\"loading-indicator\">Loading...</div>"
  5073. };
  5074. Ext.Updater.updateElement = function(D, C, E, B) {
  5075. var A = Ext.get(D).getUpdater();
  5076. Ext.apply(A, B);
  5077. A.update(C, E, B ? B.callback : null)
  5078. };
  5079. Ext.Updater.update = Ext.Updater.updateElement;
  5080. Ext.Updater.BasicRenderer = function() {
  5081. };
  5082. Ext.Updater.BasicRenderer.prototype = {
  5083. render : function(C, A, B, D) {
  5084. C.update(A.responseText, B.loadScripts, D)
  5085. }
  5086. };
  5087. Ext.UpdateManager = Ext.Updater;
  5088. Ext.util.DelayedTask = function(E, D, A) {
  5089. var G = null, F, B;
  5090. var C = function() {
  5091. var H = allGetServerTime().getTime();
  5092. if (H - B >= F) {
  5093. clearInterval(G);
  5094. G = null;
  5095. E.apply(D, A || [])
  5096. }
  5097. };
  5098. this.delay = function(I, K, J, H) {
  5099. if (G && I != F) {
  5100. this.cancel()
  5101. }
  5102. F = I;
  5103. B = allGetServerTime().getTime();
  5104. E = K || E;
  5105. D = J || D;
  5106. A = H || A;
  5107. if (!G) {
  5108. G = setInterval(C, F)
  5109. }
  5110. };
  5111. this.cancel = function() {
  5112. if (G) {
  5113. clearInterval(G);
  5114. G = null
  5115. }
  5116. }
  5117. };